<?php
$PageSecurity = 4;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');

if($_REQUEST['type']=='PO')
{
$sql=DB_query("select orderno,PO_Orderno from purchorders where Po_recive_status='Pending' and site='".$_GET['site']."' and supplierno='".$_GET['vendor']."' ",$db);
?>
<div id="order"><select name="PO" id="PurchaseOrder" onchange="FiendPurchasenumber(this.value)"  style="width:210px">
<option value="000">---Select---</option>
<?php
 while($myrow=DB_Fetch_array($sql))
 {
?>
<option value="<?php echo $myrow['orderno']; ?>"><?php echo $myrow['PO_Orderno']; ?> </option>
<?php }?> 
</select></div>
<?php } 

if($_REQUEST['type']=='IMPO')
{
	$sitecode=$s->getField('locations','locationname',$_GET['site'],'loccode');
	$sql=DB_query("select id,orderNo from import_purchaseorder where site='".$sitecode."' and vendor='".$_GET['vendor']."' and status='pending' ",$db);
?>
<div id="order"><select name="PO" id="PurchaseOrder" onchange="FiendPurchasenumber(this.value)"  style="width:120px">
<option value="000">---Select---</option>
<?php
 while($myrow=DB_Fetch_array($sql))
 {
?>
<option value="<?php echo $myrow['id']; ?>"><?php echo $myrow['orderNo']; ?> </option>
<?php }?> 
</select></div>
<?php 
}
?>
