<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
global $db;
$sid=$_REQUEST['sid'];
$data1='';
$data2='';
$data3='';
$data4='';

$sql = "select * from locations_to where id = '".$sid."' ";
$result=DB_query($sql,$db);
$myrow=DB_fetch_array($result);

$data1.=$myrow['address'];
$data2.=$myrow['contact_per'];
$data3.=$myrow['contact_no'];

if($_REQUEST['cc']==1){
	$data4.="<select name='dis_id' id='dis_id'  style='width:150px;' onchange='getdisitem(this.value)'>";
	$data4.="<option value='0' >---Select---</option>";
	$sql1="select id, dis_no from log_dispatch where party_id='".$_REQUEST['pid']."' AND to_site='".$sid."' AND store='".$_REQUEST['warehou']."'";
	$result1 = DB_query($sql1, $db);
	while($myrow1 = DB_fetch_array($result1))
	{
		$data4.="<option value=".$myrow1['id'].">".$myrow1['dis_no']."</option>";
	}
	$data4.="</select>";
}

if($_REQUEST['cc']==1){
	echo $data=$data1."__".$data2."__".$data3."__".$data4;
}else{
	echo $data=$data1."__".$data2."__".$data3;
}	

?>
