 <? global $vis_language;  
if($aircall_count<=0){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_'.$operation['vis_operation'].'_form .panel-footer").hide(); $("#vis_domain_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { 
 
 
 //echo '-*-*-*<pre>'; print_r($call_details[0]->calls);echo'</pre>';
 
 ?>
<script> $("#view_action").show(); $("#vis_<?php echo $operation['vis_operation']; ?>_form .panel-footer").show(); $("#vis_domain_list").show(); </script>
<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
	<thead class="table_head">
		<tr>
			
		<th class="txt_nowrap"><? echo $vis_language['TXTFROM']; ?></th>
        <th class="txt_nowrap"><? echo $vis_language['TXTTO']; ?></th>
        <th class="txt_nowrap"><? echo $vis_language['TXTSTARTDATE']; ?></th>
        <th class="txt_nowrap"><? echo $vis_language['TXTENDDATE']; ?></th>
        <th class="txt_nowrap"><? echo $vis_language['TXTDURATION']; ?></th>
        <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
		</tr>
	</thead>
	<tbody>			  
		<?  $calls_array = $call_details[0]->calls;

		for($c=0;$c<$aircall_count;$c++){ 
		
			if($calls_array[$c]->direction == 'outbound'){
				$to = $calls_array[$c]->raw_digits;
				$from = $calls_array[$c]->number->digits;
			}else if($calls_array[$c]->direction == 'inbound'){
				 $from = $calls_array[$c]->raw_digits;
				 $to = $calls_array[$c]->number->digits;
			}
	
				?><tr style="cursor:pointer;" onclick="$('#vis_workpanel_div').visExecution('load_module','<?php echo $vis_language["TXTCALLDETAILS"];?>',{'vis_module':'voip','vis_operation':'aircall_call_details','vis_domain_id':'<?php echo $dom_id; ?>','vis_action':'#/voip/aircall_call_details/call details/<?php echo $calls_array[$c]->id ;?>'});" >
			 <? $icon = ($calls_array[$c]->direction == 'outbound')?'<i class="vh vh-2x vh-outward-call" title="'.$vis_language['TXTOUTWARDCALL'].'"></i>&nbsp;&nbsp;':'<i class="vh vh-2x vh-inward-call" title="'.$vis_language['TXTINWARDCALL'].'"></i>&nbsp;&nbsp;';
			 
			 echo '<td>'.$icon.$from.'</td>';
             echo '<td>'.$to.'</td>';
             echo '<td>'.format_datetime($calls_array[$c]->started_at).'</td>';
             echo '<td>'.format_datetime($calls_array[$c]->ended_at).'</td>';
             echo '<td>'.$calls_array[$c]->duration.' '.$vis_language['TXTSECONDS'].'</td>';
             echo '<td>'.$calls_array[$c]->status.'</td>';
            echo "</tr>";
        }
    ?>
	</tbody>
</table><? } ?>
<script type="text/javascript">
$(".selectpicker").selectpicker();

</script>


