<?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");


	      $session=$_REQUEST['session'];

          
          
	 $session=mysql_real_escape_string($session);
	
	
	 
        // $arr=$db->getRows("select * from assignment where added_by='".$Added_by."' and date='$date' and session='$session' and school_id= '$school_id' and status='1'");
         
        $sql = "select * from teacher_leave where  session='$session' ";
       
	$result = mysql_query($sql);
   while ($row = mysql_fetch_assoc($result)) 	
	{
	    
	
	
    	$jsonn[]=array("id" =>$row['id'],"teacher_id" =>$row['teacher_id'],"subject" =>$row['subject'],"details" =>$row['details'],"date" =>$row['date'],"image" =>"uploads/assignment/".$row['image'],"leave_status" =>$row['leave_status'],"remarks" =>$row['remarks']);
 	    $json['status']=1;
		$json['msg']="successful";
		$json['data']=$jsonn;

	    
	}
	

	if(is_array($jsonn) && count($jsonn)>0)
	{  
		echo json_encode($json);    
			
	}else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'data not found..!'));
	}
