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

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

    $sqlsec = "select  type,total from examtype group by type order by id ";
	$result_term = mysql_query($sqlsec);
   while ($rowt = mysql_fetch_assoc($result_term)) 	
	{
	    
//$total=$db->getVal("select total from examtype where type='".$rowt['type']."' and class='".$_GET["class"]."' and  subject='".$sub["subject"]."' and type='".$_GET["type"]."'");

	
    	$jsond[]=array("exam_name"=>$rowt['type'],"max_mark"=>$rowt['total']);
 	    
	    
	}

	
	
$sqlsec = "select name from section";
       
	$result1 = mysql_query($sqlsec);
   while ($rowc = mysql_fetch_assoc($result1)) 	
	{
	    
	
	
    	$jsonc[]=$rowc['name'];
 	    
	    
	}
	
 $sql = "select class from class";
       
	$result = mysql_query($sql);
   while ($row = mysql_fetch_assoc($result)) 	
	{
	    
	
	
    	$jsonn[]=$row['class'];
 	    $json['status']=1;
		$json['msg']="successful";
		$json['data']=array("class" =>$jsonn,"section"=>$jsonc,"exam_term"=>$jsond);
	//	$json['section']=$jsonc;
	    
	}
echo json_encode($json);	
    
/*	if(is_array($arr) && count($arr)>0)
	{  
		echo json_encode(array('status' => 1, 'msg'=>'Profile found Successfully..!', "data"=>$arr,"section"=>$arr_sec));    
			
	}else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'Profile not found..!'));
	}
	
	*/
//echo $arr["name"];	

?>