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

	$idno=$_REQUEST['id'];
	$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);
	
	
		$location_id=$db->getVal("select location from student where idno='$idno'");
		//echo $ss="select location from student where idno='$idno'";
		$location_name=$db->getVal("select name from location where id='$location_id'" );

		
		
		
		$bus_id=$db->getVal("select old_school from student where idno='$idno'");

// echo $bus_id;
$rowc = $db->getRow("select * from bus_detail where id='$bus_id' ");

$driver_idno = $rowc['driver_name'];
$dr_name = $db->getVal("select name from staff where idno='$driver_idno' ");

// $result = mysql_query($bus);
	
//  while ($rowc = mysql_fetch_assoc($result)) 	
// 	{
	 $driver_name= $dr_name;  //$rowc['driver_name'];
	 $driver_no=$rowc['driver_no'];
	 $conductor_name=$rowc['conductor_name'];
	 $conductor_no=$rowc['conductor_no'];
	  $vehicle_no=$rowc['vehicle_no'];
	   $vehicle_type=$rowc['vehicle_type'];
	    $vehicle_sch_no=$rowc['vehicle_sch_no'];
	     $adharphoto=$rowc['adharphoto'];
	      $photo=$rowc['photo'];
	       $driving_license=$rowc['driving_license'];
	        $root=$rowc['root'];
	          $category=$rowc['category'];
// 	}
	
        $json['status']=1;
		$json['msg']="successful";
		$json['data']=array("location" =>"$location_name","driver_name" =>"$driver_name","driver_no" =>"$driver_no","conductor_name"=>"$conductor_name","conductor_no"=>"$conductor_no","conductor_name"=>"$conductor_name","vehicle_no"=>"$vehicle_no","vehicle_type"=>"$vehicle_type","vehicle_sch_no"=>"$vehicle_sch_no","adharphoto"=>"$adharphoto","photo"=>"$photo","driving_license"=>"$driving_license","root"=>"$root","category"=>"$category");

	    

echo json_encode($json);		
	    
	?>