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

	/*$idno=$_REQUEST['idno'];
	$session=$_REQUEST['session'];
	$school_id=$_REQUEST['school_id'];
	$idno=mysql_real_escape_string($idno);
	$session=mysql_real_escape_string($session);
	$school_id=mysql_real_escape_string($school_id);*/
	
 // $class=$db->getVal("Select class FROM student where idno='".$idno."'");
$aryList=$db->getRows("SELECT * FROM content where type='photo_gallery' order by id desc");
//print_r($aryList);exit;

$i=0;$data=array();
	
	foreach($aryList as $list){$i++;
		
		$data[$i]["order"]=$i;
		$data[$i]["id"]=$list["id"];
		$data[$i]["name"]=$list["Name"];
		
		$data[$i]["content"]=$list["content"];
						
		if($list["image"]!='')	$data[$i]["image"]=URL_ROOT."/".$list['image'];
		else 
			$data[$i]["image"]=NULL;
	}
	
	
	
	
	if(is_array($aryList) && count($aryList)>0)
	{  
		echo json_encode(array('status' => 1, 'msg'=>'Data found Successfully..!', "data"=>$data));    
			
	}else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'No Images Found..!'));
	}
