<?php

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

include('includes/session.inc');
$Title = _('HRMS');
include('includes/header.inc');


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 '<div class="col-sm-9">';
		
    include('xcrud/xcrud.php');
    $rostering_timesheet = Xcrud::get_instance();
	$rostering_timesheet->table('cemrecon');
	
	$rostering_timesheet->order_by('cemid','desc');
	


	$rostering_timesheet->relation('employeeid','employeemaster','employeeid',array('first_name','last_name','employeeid','certifications'),array('department' => 'GF Aviation West'));

	
	//$rostering_timesheet->sum('mon_total,tues_total,wed_total,thurs_total,fri_total,sat_total,sun_total,mon2_total,total_hrs,normal_hours,time_half_hours,double_hours');
	//$rostering_timesheet->disabled('mon_date,rmon_in,rmon_out,rostered_mon,cmon_in,cmon_out,cem_mon,variance_mon,tues_date,rtues_in,rtues_out,rostered_tues,ctues_in,ctues_out,cem_tues,variance_tues,wed_date,rwed_in,rwed_out,rostered_wed,cwed_in,cwed_out,cem_wed,variance_wed,thurs_date, rthurs_in,rthurs_out,rostered_thurs,cthurs_in,cthurs_out,cem_thurs,variance_thurs,fri_date, rfri_in,rfri_out,rostered_fri,cfri_in,cfri_out,cem_fri,variance_fri,sat_date, rsat_in,rsat_out,rostered_sat,csat_in,csat_out,cem_sat,variance_sat,sun_date, rsun_in,rsun_out,rostered_sun,csun_in,csun_out,cem_sun,variance_sun,mon2_date, rmon2_in,rmon2_out,rostered_mon2,cmon2_in,cmon2_out,cem_mon2,variance_mon2,final_mon,final_tues,final_wed,final_thurs,final_fri,final_sat,final_sun,final_mon2,rostered_total,rnormal,rtime,rdouble,cem_total,cnormal,ctime,cdouble,final_total,fnormal,ftime,fdouble,employeeid');
	//$rostering_timesheet->disabled('m_hrs');
	

	$rostering_timesheet->label('employeeid','Employees');
	//$rostering_timesheet->label('debtorno','Customer');

$rostering_timesheet->before_insert('calculate_totalhoursperweek','functionsairportcem.php');
$rostering_timesheet->before_update('calculate_totalhoursperweek','functionsairportcem.php');

//$rostering_timesheet->field_callback('total_hrs','validate_maxhours');

//$rostering_timesheet->before_insert('validate_maxhours');
//$rostering_timesheet->before_update('validate_maxhours');

	//$rostering_timesheet->table_name('Employee Schedulling');
	
	//calculate total  hours per per each day
	
   
   
	$rostering_timesheet->table_name('CEM Reconciliation Timesheet for Nadi Airport');
	

	
	
		$rostering_timesheet->unset_print();
       // $rostering_timesheet->unset_csv();


	//$rostering_timesheet->highlight('mon_shift','=','{mon_shift}','{mon_color}');
	
	//1st level main table
	


	
	

	
	$rostering_timesheet->benchmark(true);
	
	//validate max hours for employees
	
//$rostering_timesheet->after_insert('after');
//$rostering_timesheet->after_update('after');
	
	//$xcrud->highlight('total_hrs','=',48,'#99FF66');
	//$rostering_timesheetcrud->highlight('total_hrs','>',48,'#F77F8A');
	//$xcrud->highlight('total_hrs','<',48,'#e6fff2');
	//$rostering_timesheet->highlight_row('total_hrs','=',48,'yellow');
	
	
   $rostering_timesheet->show_primary_ai_column(true);
    
 $rostering_timesheet->load_view('list','cemtimesheetaviationwestlist.php');
$rostering_timesheet->load_view('edit','cemtimesheetaviationwestedit.php');
$rostering_timesheet->load_view('create','cemtimesheetaviationwestedit.php');
$rostering_timesheet->load_view('view','cemtimesheetaviationwestedit.php');
//$userid = $_SESSION['UserID'];

//$xcrud->pass_var('last_modified_by',$userid );

$rostering_timesheet->duplicate_button();
$timenow = date('Y-m-d H:i:s');
//$rostering_timesheet->unset_add();

	
	echo $rostering_timesheet->render();
	

	

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

include('includes/footer.inc'); 

?>

