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

header('Content-Type: application/json');

$module_name = "Timetable PDF";
$module_name2 = "Timetable Daywise";


          $session=$_REQUEST['session'];
	      $class=$_REQUEST['class'];
	      $section=$_REQUEST['section'];
   	  
	   //   $session=mysql_real_escape_string($session);
	   //   $class=mysql_real_escape_string($class);
	     
	 
	 
	 
	  if(isset($_REQUEST['section']) && trim($_REQUEST['section'])!=""){
		
			$conwhere.=" and section='".$_REQUEST['section']."' ";
		}

	 
	 
	      $result=$db->getRows("select * from app_timetable where session='$session' and class='$class' $conwhere ");
     
	if($result)
	{
	    foreach ($result as $rowc) 
	{
    	$jsonc[]="uploads/notice/".$rowc['timetable_file'];
	  
        $json['status']=1;
		$json['msg']="Data found Successfully..!";
		$json['data']=$jsonc;

        $json['module_name'] = $module_name;
        $json['module_name2'] = $module_name2;
	}
	echo json_encode($json);
	}
	else
	{
	   	echo json_encode(array('status' => 0, 'msg'=>'detail not found..!', 'module_name' => $module_name, 'module_name2' => $module_name2));
	}
	
	
	

?>