<?php 

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

$ei = $_REQUEST['entry_by'];    
$users = $db->salesOrderList($ei);    
$a = array();     
$b = array();  
 //$link1=db->connect();
   
 if ($users != false){ 
   while($row = mysqli_fetch_array($users)) {
	   
	$b["po_no"] = $row["po_no"];
  	$b["po_from"] = $row["po_from"];
	//// retailer name

	$b["retailercode"] = $row["from_code"];
$b["retailername"] = $db->getAnyDetails($row["from_code"],"locationname","location_code","location_master");
	$b["retailerState"] = $db->getAnyDetails($row["from_state"],"state","stateid","state_master");
  	$b["entry_date"] = $row["update_date"];
  
	$b["status"] ="pending";
	$b["po_value"] = $row["po_value"];	
	array_push($a,$b);
   }	
	echo json_encode($a);
 }

?>