<?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);
	$bus=array();$root="";
	$aryForm=$db->getRow("select * from student where school_id='".$school_id."' and session='".$session."' and idno='".$idno."' and status=1 and issue_TC=0");
	$root=$db->getVal("select root from bus where school_id='".$school_id."' and id='".$aryForm['bus']."'");
	$busDetail=$db->getRow("select * from bus_detail where id='".$aryForm['old_school']."'");
	//echo $root."<pre>";print_r($busDetail);
	$bus["pickup_root"]=$root;
	$bus["bus_name"]=$busDetail["name"];
	$bus["bus_root"]=$busDetail["root"];
	$bus["bus_no"]=$busDetail["vehicle_no"];
	$bus["driver_name"]=$busDetail["driver_name"];
	$bus["driver_no"]=$busDetail["driver_no"];
	$bus["conductor_name"]=$busDetail["conductor_name"];
	$bus["conductor_no"]=$busDetail["conductor_no"];
	$bus["incharge_name"]=$busDetail["category"];
	$bus["incharge_no"]=$busDetail["vehicle_sch_no"];
	//echo "<pre>";print_r($bus);
   if(is_array($busDetail) || $root!="")
	{
		file_put_contents($file, $output); 
		echo json_encode(array('status' => 1, 'msg'=>'Data found Successfully..!', "data"=>$bus));    
			
	}else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'Data not found..! NO transport assigned to the student..!'));
	}
?>