<?php 
$PageSecurity = 4;
include('includes/session.inc');
include('includes/DefineSuppTransClass.php');
$result=DB_query("Select locationname from locations where loccode ='".$_GET['site']."'",$db);
$myrow=DB_fetch_array($result);


$data2='';
$data2.="<select name='ReceivedFrom' onchange='showsitename160(this.value)' id='ReceivedFrom' style='width:100%'>";
      $data2.="<option value='000'>---Select---</option>";
    if($_REQUEST['site']!=''){ 
	 //  echo $_SESSION['AssignedSites'];
	  $result1=DB_query("Select loccode,locationname from locations where loccode !='".$_GET['site']."' and CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
	}
	else
	{
		$result1=DB_query("SELECT loccode, locationname FROM locations where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
}
   
   
    while($myrow1=DB_fetch_array($result1))
	{
	$p='';
				if($myrow1['loccode'] == $_POST['ReceivedFrom'])
				$p="selected";
	
	
      $data2.="<option value=".$myrow1['loccode']." ".$p.">".$myrow1['locationname']."</option>";
        }	
    $data2.="</select>";
	
	
	
	 $store_sql = "SELECT id, StoreName,storecode FROM storetype where Store_Site = '".$_GET['site']."'";
	
	$data1='';
		$data1.="<select name='store'  id='store' onChange='' style='width:100%;'>";
								
 			$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>";
	
	
	
	
	
	
	
	
	
	echo $data=$data1."__".$data2;


?>
