<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['site']!='')
{
	
//$result=DB_query($sql,$db);
//$row=DB_fetch_array($result);
//$data=DB_query("SELECT * FROM salesorder WHERE id ='".$row['masterid']."'",$db);
//$data1=DB_fetch_array($data);
//$client="SELECT c_name FROM clientmaster where client_code='".$row['client']."'";
//$query=DB_query($client,$db);
//$clientdata=DB_fetch_array($query);
//$clientname=$clientdata['c_name'];
?>  
 <select name="sop_no" id="sop_no" style="width:100%;" onchange="gettotaldata(this.value)"> 
 	<option value="0">Select</option>                              
                       <?php
                        $item1=DB_query("Select distinct masterid from salesorder_details where ItemCode='".$_REQUEST['site']."'",$db);
					   while($rowdata=DB_fetch_array($item1))
					   {
					   
					    $item=DB_query("Select orderNo,id from salesorder WHERE id='".$rowdata['masterid']."'",$db);
						while($item_row=DB_fetch_array($item))
						{                      	
                       	?>
                       <option value="<?php echo $item_row['id'];?>"/><?php echo $item_row['orderNo'];?></option>	
                       	<?php } }?>
                         </select>
                 
               

<?php } ?>
