<?php

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

$order_no = $_REQUEST['orderNo'];    
$users = $db->salesOrderItems($order_no);     
$a = array();     
$b = array(); 
 
 if ($users != false){ 
   while($row = mysqli_fetch_array($users)) {
	   
	$b["po_no"] = $row["po_no"];
  	$b["partcode"] = $row["partcode"];
	//// retailer name
	
	$b["partname"] = $db->getAnyDetails($row["partcode"],"part_name","partcode","partcode_master");
	$b["brand"] = $db->getAnyDetails($row["brand_id"],"brand","brand_id","brand_master");
  	$b["qty"] = $row["qty"];
  	$b["po_price"] = $row["po_price"];
	$b["po_value"] = $row["po_value"];	
	array_push($a,$b);
   }	
	echo json_encode($a);
 }

?>