<?  global $vis_language;
if(count($goto_assist->sessions)>0 && isset($goto_assist->sessions)){ ?> 
<table cellpadding="0" cellspacing="0" border="0" class="table table-hover b-t b-light m-b-none" id="datatable">
   <thead class="table_head">
	  <tr>
		 <th width="25%"><? echo $vis_language['TXTJOINURL']; ?></th>   
		 <th class="txt_nowrap"><? echo $vis_language['TXTMEETINGID'];?></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['TXTJOINDATE'];?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
		 <th></th>            
	  </tr>
   </thead>
   <tbody>
	  <?
		$goto_assist=$goto_assist->sessions;
		  for($i=0;$i<count($goto_assist);$i++) {
			  $endedAt=format_datetime(strtotime($goto_assist[$i]->endedAt));
			  if(trim($endedAt)=='01 Jan, 1970 00:00 am'){$endedAt='--';}
			  $customerJoinedAt=format_datetime(strtotime($goto_assist[$i]->customerJoinedAt));
			  if(trim($customerJoinedAt)=='01 Jan, 1970 00:00 am'){$customerJoinedAt='--';}
			  ?>
				<tr style="cursor:pointer;" onclick="vis_create_ticket('<?php echo $goto_assist[$i]->sessionId;?>');">
			<?php
			  echo '<td >'.$goto_assist[$i]->customerJoinUrl.'</td>';		
			  echo '<td class="txt_nowrap">'.$goto_assist[$i]->sessionId.'</a></td>';
			  echo '<td class="txt_nowrap">'.format_datetime(strtotime($goto_assist[$i]->startedAt)).'</td>';
			  echo '<td class="txt_nowrap">'.$endedAt.'</td>';
			  echo '<td class="txt_nowrap">'.$customerJoinedAt.'</td>';
			  if($goto_assist[$i]->status == 'complete') $meeting_status='<span class="label vh-green-bg">complete</span>';
			  else $meeting_status='<span class="label vh-danger-bg ">'.$goto_assist[$i]->status.'</span>';
			  echo '<td class="txt_nowrap">'.$meeting_status.'</td>';
			  echo '<td align="center"> <a class="text-muted" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=remoteaccess&vis_operation=get_meeting_delete&vis_meeting_id='.$goto_assist[$i]->sessionId.'&vis_domain='.$vis_domain.'&vis_static_area=vis_meeting_delete_form" title="'.$vis_language['TXTDELETE'].'"><i class="vh vh-delete-round"></a></td>';
			  echo '</tr>';
		  } ?>    
   </tbody>
</table>
<?
}
else
{
 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>
<script>
function vis_create_ticket(vis_session_id){
	$('#vis_workpanel_div').visExecution('load_module','<?php echo $vis_language["TXTSESSIONDETAILS"];?>',{'vis_module':'remoteaccess','vis_operation':'gotoassist_details','vis_assist_session_id':''+vis_session_id+'','vis_chk_domain':''+$('#vis_domain').val()+''});
}
</script>