<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
global $db;
$sid=$_REQUEST['sid'];
$storid=$_REQUEST['storid'];?>
<select  name="grn_no" id="grn_no" onchange="get_grndetail(this.value)">
<option  value="0">Select GRN Number</option>
<?php 
echo $sql = "select A.id,A.grn_no from log_add_mrn AS A LEFT JOIN log_stn AS B ON A.id=B.grn_id where (A.vendor = '".$sid."' and A.store='".$storid."') OR (B.vendor = '".$sid."' and B.store='".$storid."') group by a.id";
$result=DB_query($sql,$db);
while($myrow=DB_fetch_array($result)){
echo '<option Value="'.$myrow['id'].'">'.$myrow['grn_no'].'</option>';
}
?>