<?php
include_once 'db_functions.php';     
$db = new DB_Functions();  

$ei = $_REQUEST['eid'];    
$users = $db->salesOrderList($ei);     
$a = array();     
$b = array(); 
 
   
 if ($users != false){ 
   while($row = mysql_fetch_array($users)) {
	   
	$b["po_no"] = $row["po_no"];
  	$b["po_from"] = $row["po_from"];
	//// retailer name
	$res_loc = $db->getLocationDetail($row["po_from"]);
    $row_loc = mysql_fetch_array($res_loc);
	$b["retailerName"] = $row_loc["name"];
	$b["retailerCity"] = $row_loc["city"];
	$b["retailerState"] = $row_loc["state"];
  	$b["entry_date"] = $row["entry_date"];
  	$b["entry_time"] = $row["entry_time"];
	$b["status"] = $row["status"];
	$b["po_value"] = $row["po_value"];	
	array_push($a,$b);
   }	
	echo json_encode($a);
 }

?>