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


	  $session=$_REQUEST['session'];
	  $school_id=$_REQUEST['school_id'];
      $Added_by = $_REQUEST['Added_by'];
      $date=$_REQUEST['date'];
          
          
// 	 $session=mysql_real_escape_string($session);
// 	 $school_id=mysql_real_escape_string($school_id);
// 	 $Added_by =mysql_real_escape_string($Added_by);
// 	 $date=mysql_real_escape_string($date);
	 
	
	 
        // $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 = $db->getRows("select * from assignment where added_by='".$Added_by."'  and session='$session' and school_id= '$school_id' and status='1'");

       
// 	$result = mysql_query($sql);
//   while ($row = mysql_fetch_assoc($result)) 	
foreach($sql as $row)
	{

        $home_detail = $row['detail']; //utf8_encode($row['detail']);

    	$jsonn[]=array("id" =>$row['id'],"class" =>$row['class'],"section" =>$row['section'],"subject" =>$row['subject'],"detail" =>$home_detail,
            "file" =>"uploads/assignment/".$row['upload_assignment'],"date" =>$row['date'],"Added_by" =>$row['Added_by']);
 	    $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'=>'Profile not found..!'));
	}
