<?
    global $vis_language;
    $paging_list='';
    for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($event_page==$i)?'selected="selected"':'').'>'.($i+1).'</option>';  ?>
 <div class="row wrapper clr" id="view_action" >
              <div class="col-sm-9 tkt_left_menu"></div>
            <div  class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
               <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$('#vis_gcal_events').visExecution('load_area',{'vis_module':'home', 'vis_operation':'get_gcal_event_list', 'vis_page':this.value,'vis_action':'#/home/get_gcal_event_list/<?  echo $vis_language['TXTEVENTS'];?>'})">
               <? echo $paging_list;?>
               </select>
               <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
            </div>
         </div>
 <div class="table-responsive scroll-x">
	  <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['TXTTITLE'];?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTDESCRIPTION'];?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTLOCATION']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTCREATEDBY']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTCREATIONDATE']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTGUESTEMAIL']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTSTARTDATE']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTENDDATE']; ?></th>
      </tr>
   </thead>
   <tbody>
   	<? for($i=0;$i<count($event_list);$i++){?>
		<tr style="cursor:pointer;" onclick="$('#vis_workpanel_div').visExecution('load_module','<?php echo $vis_language["TXTEVENTS"];?>',{'vis_module':'home','vis_operation':'get_gcal_details','vis_cal_id':'<?php echo $event_list[$i]['calId'];?>','vis_event_id':'<?php echo $event_list[$i]['id'];?>','vis_domain':'<?php echo $vis_domain;?>'});">
		<?echo '<td>'.((!empty($event_list[$i]['name']))?$event_list[$i]['name']:'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['description']))?$event_list[$i]['description']:'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['location']))?$event_list[$i]['location']:'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['creator']))?$event_list[$i]['creator']:'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['created']))?format_datetime(strtotime($event_list[$i]['created'])):'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['guest_email']))?$event_list[$i]['guest_email']:'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['start']))?format_datetime(strtotime($event_list[$i]['start'])):'-').'</td>';
			echo '<td>'.((!empty($event_list[$i]['end']))?format_datetime(strtotime($event_list[$i]['end'])):'-').'</td></tr>'; 
	  }?>    
   </tbody>
</table></div>
<footer class="wrapper panel-footer bg-white">
       <div class="row">
	   <div class="col-sm-9 tkt_left_menu"> </div>
	   <div class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
		  <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$('#vis_gcal_events').visExecution('load_area',{'vis_module':'home', 'vis_operation':'get_gcal_event_list', 'vis_page':this.value,'vis_action':'#/home/get_gcal_event_list/<?  echo $vis_language['TXTEVENTS'];?>'})">
		  <? echo $paging_list;?>
		  </select>
		  <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
	   </div></div>
	   </footer>
<script type="text/javascript">
	$(".selectpicker").selectpicker();
   $(document).ready(function() {
   $('[data-ride="datatables"]').dataTable({
   	 "bPaginate" : false,
          "paginate": false,
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,
			null,
			null,					
   		]
   	});
   });
</script>
