<?php
 $PageSecurity = 11;//echo $_SERVER['QUERY_STRING'];exit;
include('includes/DefineSuppTransClass.php');
include('includes/DefinePOClass.php');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
include('includes/session.inc');

$sql="Select MRNDate,PO_WO_MTO,grn_type,DocumentType,billno,MRNVoucherDate from addmrn where id='".$_GET['mrnno']."'";
$result=DB_query($sql,$db);
$mrnrow=DB_fetch_array($result);
$data1='';
$data1.=ConvertSQLDate($mrnrow['MRNDate']);

$data2='';
$data2.=$s->getField('direct_po','id',$mrnrow['PO_WO_MTO'],'pr_no');


$data3='';
$data3.=ConvertSQLDate($s->getField('direct_po','id',$mrnrow['PO_WO_MTO'],'pr_date'));



if($mrnrow['grn_type']=='1') { $displayData='Import Order'; } 
elseif($mrnrow['grn_type']=='2') { $displayData='Domestic Order'; }
elseif($mrnrow['grn_type']=='3') { $displayData='Service Order'; }
elseif($mrnrow['grn_type']=='4') { $displayData='Asset Order'; }

$data4="";
$data4.="<option Value=".$mrnrow['grn_type'].">".$displayData."</option>";
$data4.="</select>";

$data5="";
$data5='<input type="text" name="doc_type" id="doc_type" class="datepicker" style="width:200px;" value="'.$mrnrow['DocumentType'].'"/>';

if($mrnrow['DocumentType']=="BOL" || $mrnrow['DocumentType']=="Bill")
{
$data6="";
$data6.='<tr class="row1">';

	$data6.='<td class="tabledata1"><strong>Bill No<font color="#FF0000">*</font></strong></td>';
	$data6.='<td><input type="text" name="bill_no" id="bill_no" class="datepicker" style="width:200px;" value="'.$mrnrow['billno'].'"/></td>';
	$data6.='<td class="tabledata1"><strong>Bill Date<font color="#FF0000">*</font></strong></td>';
	$data6.='<td><input type="text" readonly name="bill_date" id="bill_date" class="datepicker" style="width:200px;" value="'.ConvertSQLDate($mrnrow['MRNVoucherDate']).'"/></td>';
$data6.='</tr>';
	
$data6.='<tr class="row1">';
	$data6.='<td class="tabledata1"><strong>Challan No</strong></td>';
	$data6.='<td><input type="text" name="challan_no" id="challan_no" class="datepicker" style="width:200px;"/></td>';
	$data6.='<td class="tabledata1"><strong>Challan Date</strong></td>';
	$data6.='<td><input type="text" name="challan_date" id="challan_date" class="datepicker" style="width:200px;"/></td>';
	$data6.='<td class="tabledata1">&nbsp;</td>';
	$data6.='<td>&nbsp;</td>';
$data6.='</tr>';


}
elseif($mrnrow['DocumentType']=="Challan")
{
$data6="";
$data6.='<tr class="row1">';
	$data6.='<td class="tabledata1"><strong>Challan No </strong></td>';
	$data6.='<td><input type="text" readonly name="challan_no" id="challan_no" class="datepicker" style="width:200px;" value="'.$mrnrow['billno'].'"/></td>';
	$data6.='<td class="tabledata1"><strong>Challan Date </strong></td>';
	$data6.='<td><input type="text" name="challan_date" readonly id="Challan_date" class="datepicker" style="width:200px;" value="'.ConvertSQLDate($mrnrow['MRNVoucherDate']).'"/></td>';
$data6.='</tr>';
	
$data6.='<tr class="row1">';
	$data6.='<td class="tabledata1"><strong>Bill No<font color="#FF0000">*</font></strong></td>';
	$data6.='<td><input type="text" name="bill_no" id="bill_no" class="datepicker" style="width:200px;"/></td>';
	$data6.='<td class="tabledata1"><strong>Bill Date<font color="#FF0000">*</font></strong></td>';
	$data6.='<td><input type="text" name="bill_date" id="bill_date" class="datepicker" style="width:200px;"/></td>';
	$data6.='<td></td>';
	$data6.='<td></td>';
$data6.='</tr>';

}

echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6;


?>
