<?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"/>';

      

//check.php  

$connect = mysqli_connect("localhost", "sooggoo", "4Compassion*", "evergreenint"); 
if(isset($_POST["monin"]))
	

{
	
	
	

 $monin =  $_POST["monin"];
	
 $rosterid =  $_POST["rosterid"];
	

	
	//quickly get calendar ID since calendar ID is only available for already in rostering timehsheet records. What if new person is added to the timesheet. Therefore its better to get this using rosterid.
	$query = "SELECT id FROM timesheetsuva  WHERE  timesuvaid ='".$rosterid."' ";
	$result = mysqli_query($connect, $query);
	$myrow = mysqli_fetch_assoc($result);
	$calendar_id = $myrow['id'];

	
;
	//get mon shift 1 range
	$query1 = "SELECT start_date,end_date FROM calendar_management  WHERE  id = '".$calendar_id."'  ";
	$result1 = mysqli_query($connect, $query1);
	
   $row = mysqli_fetch_assoc($result1);
	  
	  $startdate = $row['start_date'];
	$enddate = $row['end_date'];
	$monday =  date('Y-m-d ',strtotime($startdate));
	
	$mondate =  date('Y-m-d ',strtotime($monin));
	
		$data = array($rosterid);
		
		echo json_encode($data);

	
}

mysqli_close($connect);

?>

