<?  global $vis_language;?>  
<?php if(count($response->Chats)>0){?>
       <table class="table table-hover b-t b-light m-b-none" id="datatables">
		   <thead class="table_head">
			  <tr>
				 <th width="25%"><? echo $vis_language['TXTMESSAGE']; ?></th>   
				 <th class="txt_nowrap"><? echo $vis_language['TXTIPADDRESS'];?></th>
				 <th class="txt_nowrap"><? echo $vis_language['TXTVISITORNAME'];?></th>
				 <th class="txt_nowrap"><? echo $vis_language['TXTVISITOREMAIL']; ?></th>             
				 <th class="txt_nowrap"><? echo $vis_language['TXTDATE']; ?></th>              
				 <th class="txt_nowrap"><? echo $vis_language['TXTSTAFF'];?></th>
			  </tr>
		   </thead>
		   <tbody>
			  <?
				 for($c=0;$c<count($response->Chats);$c++){
					 if($response->Chats[$c]->Chat->Email!=''){
						 $visitor_email = $response->Chats[$c]->Chat->Email;
					  }else{
						 $visitor_email= $vis_language['TXTNOTSPECIFIED'];
					  }
					  $chat = explode('|',$response->Chats[$c]->Chat->PlainText);
						  ?>
					     <tr style="cursor:pointer;" onclick="$('#vis_workpanel_div').visExecution('load_module','<?php echo $vis_language["TXTCHATTRANSCRIPT"];?>',{'vis_module':'chat','vis_operation':'livezilla_detail','vis_chat_id':'<?php echo $response->Chats[$c]->Chat->ChatId;?>','vis_fz_domain':'<?php echo $vis_domain;?>'});">
						<?php
						  echo '<td width="25%">'.$chat[2].'</td>';
						  echo '<td class="txt_nowrap">'.$response->Chats[$c]->Chat->IP.'</a></td>';
						  echo '<td class="txt_nowrap">'.ucfirst($response->Chats[$c]->Chat->Fullname).'</td>';
						  echo '<td class="txt_nowrap">'.$visitor_email.'</td>';
						  echo '<td>'.$start_time =format_datetime($response->Chats[$c]->Chat->TimeStart).'</td>';
						  echo '<td class="txt_nowrap">'.ucfirst($response->Chats[$c]->Chat->OperatorId).'</td>';
						  echo '</tr>';
				  }
				 ?>    
		   </tbody>
		</table>
	<script type="text/javascript" src="<?= VIS_PATH_SCRIPT; ?>datatables/data-tables/DT_bootstrap.js"></script>
	<script>
		$(document).ready(function() {	
		$('#datatables').dataTable({		
			   "bPaginate" : true,	
				"iDisplayLength": 25,
				"sDom": 'ltipr',
				  "bLengthChange": false,
					"bInfo": false,
				"aoColumns": [null,	null, null, null, null, null]
			});
		});
		</script>
  <? 
}else
{
 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>