<?php $PageSecurity = 2;
include('includes/DefineSuppTransClass.php');
include('includes/DefinePOClass.php');
include('includes/SQL_CommonFunctions.inc');
include('includes/session.inc');

//echo "SELECT id, StoreName,storecode FROM storetype where Store_Site = '".$_GET['site']."'";
  $store_sql = "SELECT id, StoreName,StoreCode FROM storetype where Store_Site = '".$_GET['site']."'";
	
	$data1='';
		$data1.="<select name='store'  sstyle='width:150px;' id='store'    >";
								
 			$store_result = DB_query($store_sql,$db);
			while($store_row = DB_fetch_array($store_result))
			{
				
				$p='';
				if($store_row['id'] == $_POST['store'])
				$p="selected";
			
			
		$data1.="<option value=".$store_row['id']." ".$p.">".$store_row['StoreName']."</option>";
			 }
			
			$data1.="</select>";
			
			
		$data2='';	
		
		
		$data2.="<select name='work_order_no' style='width:150px;' id='work_order_no' onchange='Get_oderdata(this.value)' >'";
	    $data2.="<option value='0'>Select</option>";
	  $sql_wo=DB_query("Select fpr_flag from fin_Product where company_id='".$_SESSION['ACGCompanyId']."' order by id ASC",$db);
                   $result_wo=DB_fetch_array($sql_wo);
                   if($result_wo['fpr_flag']=='0'){
	$floor_sql=DB_query("Select * from salesorder where branch = '".$_GET['site']."' order by orderNo ASC   ",$db);
                   }
                   else
                   {
                     $floor_sql=DB_query("Select id,wo_no as orderNo from prd_wo where site = '".$_GET['site']."' and CompanyId='".$_SESSION['ACGCompanyId']."' order by wo_no ASC",$db);
                   }
	while($floor_row=DB_fetch_array($floor_sql))
	{
			     
	
	
	$data2.="<option value=".$floor_row['id']." >".$floor_row['orderNo']."</option>";
		
	}
	
    $data2.="</select>";	
			
			
			
			
echo $data=$data1."__".$data2;			
	?>