<? global $vis_language;
if($total_twilio_call<=0){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
 } else {
  ?>
<script> $("#view_action").show(); $("#total_cnt").html("(<?php echo count($twilio_call_list->calls); ?>)"); $("#vis_<?php echo $operation['vis_operation']; ?>_form .panel-footer").show(); $("#vis_domain_list").show(); </script>
<?php
	if($twilio_call_list->previous_page_uri!=''){
		echo '<input  type="hidden" name="vis_prev_page_no" id="vis_prev_page_no" value="'.($twilio_call_list->page - 1).'" />';
	}
	if($twilio_call_list->next_page_uri!=''){
		echo '<input  type="hidden" name="vis_next_page_no" id="vis_next_page_no" value="'.($twilio_call_list->page + 1).'" />';
	}?>
<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>
      <? //echo "<pre>";print_r($twilio_call_list);echo count($twilio_call_list->calls);echo "</pre>";
        foreach($twilio_call_list->calls as $call_list){
			if($call_list->to=='')$call_list->to='--';
			 ?>
				<tr style="cursor:pointer;" onclick="$('#vis_workpanel_div').visExecution('load_module','<?php echo $vis_language["TXTCALLDETAILS"];?>',{'vis_module':'voip','vis_operation':'twilio_call_details','vis_call_id':'<?php echo $call_list->sid;?>','vis_chk_domain':'<?php echo $vis_domain;?>'});">
			<?php
			 echo '<td>'.$call_list->from.'</td>';
             echo '<td>'.$call_list->to.'</td>';
             echo '<td>'.format_datetime(strtotime($call_list->start_time)).'</td>';
             echo '<td>'.format_datetime(strtotime($call_list->end_time)).'</td>';
             echo '<td>'.$call_list->duration.' '.$vis_language['TXTSECONDS'].'</td>';
             echo '<td>'.$call_list->status.'</td>';
            echo "</tr>";
        } ?>
   </tbody>
</table>
<script>
<? if($twilio_call_list->previous_page_uri==''){?>$(".btn_prev_page").css("display", "none");<? }else {?>$(".btn_prev_page").css("display", "block");<? }?>
<? if($twilio_call_list->next_page_uri==''){?>$(".btn_next_page").css("display", "none");<? }else {?>$(".btn_next_page").css("display", "block");<? }?>
</script>
<? } ?>

