<?php 

include_once 'db_functions.php';
include_once './db_connect.php';    
$db = new DB_Functions();  

$ei = $_REQUEST['entry_by'];    
$users = $db->streceiveList($ei);    
$a = array();     
$b = array();  
 //$link1=db->connect();
   
 if ($users != false){ 
   while($row = mysqli_fetch_array($users)) {
	   
	$b["st_no"] = $row["challan_no"];
  	$b["po_from"] = $row["from_location"];


	$b["po_to"] = $row["to_location"];
$b["to_name"] = $db->getAnyDetails( $row["to_location"],"locationname","location_code","location_master");
	//$b["retailerState"] = $db->getAnyDetails($row["from_state"],"state","stateid","state_master");
  	$b["entry_date"] = $row["sale_date"];
  
	$b["status"] =$db->getdispatchstatus($row['status']);
		
	array_push($a,$b);
   }	
	echo json_encode($a);
 }

?>