<?php

/* $Id: SelectCustomer.php 7133 2015-02-07 03:23:51Z daintree $*/

include('includes/session.inc');
 echo '<link href="' . $RootPath . '/css/print.css" rel="stylesheet" type="text/css" media="print" />';
	echo '<link href="' . $RootPath . '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" media="screen"/>';
	echo '<script type="text/javascript" src = "'.$RootPath.'/javascripts/MiscFunctions.js"></script>';
	
	echo' <link rel="stylesheet" href="css/awesome/css/font-awesome.min.css" />';
	 
?>
  <link rel="stylesheet" href="bootstrap-3.3.7/js/bootstrap.min.js" />
<link rel="stylesheet" href="bootstrap-3.3.7/css/bootstrap.min.css" />



<script src="js/jquery.min.js"></script>
  

<script type="text/javascript" src="lib/jquery.ntm/js/jquery.ntm.js"></script>
<link rel="stylesheet" href="jquerysctipttop.css" />



  <link rel="stylesheet" href="lib/jquery.ntm/themes/default/css/theme.css" />
  
  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js">
  </script>
 
   <meta http-equiv="refresh" content="3">

<?php


include('includes/SQL_CommonFunctions.inc');
echo '<link href="' . $RootPath . '/css/evergreen2'.'/default.css" rel="stylesheet" type="text/css" media="screen"/>';


//echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png"> </p>';
    //  echo '<meta http-equiv="refresh" content="5">';
	echo '<div class="col-sm-12" row align-items-center>';
		
    include('xcrud/xcrud.php');
    $xcrud = Xcrud::get_instance();
	$xcrud->table('rosteringtimesheet');
	
	$xcrud->order_by('employeeid,rstimeid','desc');
	
$xcrud->table_name('Realtime Tallies on Guards Rostered','Rostering','icon-leaf');
$xcrud->join('rosterid','rostering','rosterid');

$xcrud->relation('rostering.sectors','sectors','id','name');

 $xcrud->relation('rostering.patrol_location','guardforceclient','clientid',array('customername','patrollocation'),'','','','','','rostering.sectors','sectors');     
	$xcrud->relation('employeeid','employeemaster','employeeid',array('first_name','last_name','employeeid'),array('department' => 'GFS'));
//$xcrud->columns('rostering.start_date,rostering.end_date,rostering.account_number,rostering.department', true);
  $xcrud->columns('rosterid,employeeid,rostering.sectors,rostering.patrol_location,mon_date,montime_in,montime_out,mon_hrs,montime_in1,montime_out1,mon_hrs2,mon_total,tues_date,tuestime_in,tuestime_out,tues_hrs,tuestime_in1,tuestime_out1,tues_hrs2,tues_total,wed_date,wedtime_in,wedtime_out,wed_hrs,wedtime_in1,wedtime_out1,wed_hrs2,wed_total,thurs_date, thurstime_in,thurstime_out,thurs_hrs,thurstime_in1,thurstime_out1,thurs_hrs2,thurs_total,fri_date, fritime_in,fritime_out,fri_hrs,fritime_in1,fritime_out1,fri_hrs2,fri_total,sat_date,sattime_in,sattime_out,sat_hrs,sattime_in1,sattime_out2,sat_hrs2,sat_total,sun_date,sunttime_in,sunttime_out,sun_hrs,suntime_in1,suntime_out1,sun_hrs2,sun_total,mon2_date,mon2time_in,mon2time_out,mon2_total,total_hrs,normal_hours,time_half_hours,double_hours,rostering.status,rostering.last_modified_by,rostering.lastupdate,rostering.management_approval');
  $xcrud->fields('rosterid,employeeid,rostering.sectors,rostering.patrol_location,mon_date,montime_in,montime_out,mon_hrs,montime_in1,montime_out1,mon_hrs2,mon_total,tues_date,tuestime_in,tuestime_out,tues_hrs,tuestime_in1,tuestime_out1,tues_hrs2,tues_total,wed_date,wedtime_in,wedtime_out,wed_hrs,wedtime_in1,wedtime_out1,wed_hrs2,wed_total,thurs_date, thurstime_in,thurstime_out,thurs_hrs,thurstime_in1,thurstime_out1,thurs_hrs2,thurs_total,fri_date, fritime_in,fritime_out,fri_hrs,fritime_in1,fritime_out1,fri_hrs2,fri_total,sat_date,sattime_in,sattime_out,sat_hrs,sattime_in1,sattime_out2,sat_hrs2,sat_total,sun_date,sunttime_in,sunttime_out,sun_hrs,suntime_in1,suntime_out1,sun_hrs2,sun_total,mon2_date,mon2time_in,mon2time_out,mon2_total,total_hrs,normal_hours,time_half_hours,double_hours,rostering.status,rostering.last_modified_by,rostering.lastupdate,rostering.management_approval');
$xcrud->column_pattern('rosterid', '<a href="#" class="xcrud-action" data-task="view" data-primary="{rosterid}">{value}</a>');
$xcrud->button('javascript:window.open("http://www.ebusinessfiji.com");','Xymon','glyphicon glyphicon-eye-open');
 $xcrud->modal('employeeid');
$xcrud->unset_remove();
$xcrud->unset_edit();
$xcrud->unset_add();
	echo $xcrud->render();



	

echo '</div>';
echo '</div>';

include('includes/footer.inc'); 

?>

