<?php
include("../config/database.php");
$conct  = new connectionCreat();
$conct->connectToDB();
$conct->selectDB();
$month     = $_POST['month'];			     
$year      = $_POST['year'];
$driverId  = $_POST['driverId'];
$sqlOrder  = mysql_query("SELECT A.id,A.date,AT.symbol,AT.details FROM `tbl_attendence_driver_team` A JOIN `tbl_attend_type` AT ON AT.id=A.mark where A.emp_id='".$driverId."' and A.date LIKE '$year-$month%' order by A.date");
$count     = mysql_num_rows($sqlOrder);
if($count > 0)
{	
    $attendanceList = array();	
    while($data = mysql_fetch_array($sqlOrder))
    {	
		$attendanceList[]    = array('date'=>date('d-m-Y', strtotime($data['date'])), 'mark'=>$data['details']." ( ".$data['symbol']." )");
	}
    $arr  = array("status"=>true, "attendanceList"=>$attendanceList);	
}
else
{
    $arr = array("status"=>false, 'msg'=>"Attendance List Not Found.");
}
echo json_encode($arr);		    	
mysql_close();
?>