<td colspan="3" valign="top" class="print_text" style="border-bottom:#000000 solid thin;">Buyer (if other than consignee)</td>
  </tr>
  <tr>
    <td colspan="2" valign="top" class="print_text" style="border-right:#000000 solid thin;">Country of Origin of Goods<br/>
    <b>INDIA</b>
    </td>
    <td class="print_text" valign="top">Country of final Destination :<br/><b><?php 
echo $buyercountry;
?>
</b></td>
  </tr>
  <tr>
    <td colspan="2" class="print_text" style="border-bottom:#000000 solid thin;border-right:#000000 solid thin;" valign="top">Pre. Carriage by :</td>
    <td width="148" valign="top" class="print_text" style="border-bottom:#000000 solid thin;">Place of Receipt by</td>
    <td colspan="3" rowspan="3" class="print_text" valign="top" style="border-top:#000000 solid thin;border-bottom:#000000 solid thin;border-left:#000000 solid thin;">Terms of Delivery of Payment<br/><?php 
echo nl2br(getPINumber('TermsAndCondition', 'rec_id', getDispatchDetail('PiId', 'DispatchNumberId', $rec_id)));
?>
</td>
  </tr>
  <tr>
    <td colspan="2" class="print_text" style="border-bottom:#000000 solid thin;border-right:#000000 solid thin;" valign="top">Vessel/Flight No.:</td>
    <td class="print_text" style="border-bottom:#000000 solid thin;" valign="top">Port of Loading :</td>
  </tr>
  <tr>
    <td colspan="2" class="print_text" style="border-bottom:#000000 solid thin;border-right:#000000 solid thin;" valign="top">Port of Discharge : <b><?php 
echo $port;
?>
</b></td>
    <td class="print_text" style="border-bottom:#000000 solid thin;" valign="top">Final Destination :</td>
  </tr>
  <tr>
Esempio n. 2
0
                $_SESSION['no_refresh'] = $_POST['no_refresh'];
            } else {
                $sql_up = "update " . $mysql_adm_table_prefix . "despatch_doclist set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDispatchMasterId = '{$dispatch_id}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDocId = '{$doc_id}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDocStatus = '{$chk_flag}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDocDate = '{$doc_date}' where rec_id = '{$update_id}'";
                $result_up = mysql_query($sql_up) or die("Error in Query :" . $sql_up . "<br/>" . mysql_error() . "<br/>" . mysql_errno());
                $_SESSION['no_refresh'] = $_POST['no_refresh'];
            }
        }
    }
}
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $sql_sel = "select * from " . $mysql_adm_table_prefix . "dispatch_number where rec_id = '{$id}'";
    $result_sel = mysql_query($sql_sel) or die("Error in Query :" . $sql_sel . "<br>" . mysql_error() . ":" . mysql_errno());
    $row_sel = mysql_fetch_array($result_sel);
    $buyerid = $row_sel['BuyerId'];
    $dispatchid = getDispatchDetail('rec_id', 'DispatchNumberId', $row_sel['rec_id']);
    $sql_type = "select * from " . $mysql_adm_table_prefix . "buyer_master where rec_id = '{$buyerid}'";
    $result_type = mysql_query($sql_type) or die("Error in Query :" . $sql_type . "<br/>" . mysql_error() . "<br/>" . mysql_errno());
    $row_type = mysql_fetch_array($result_type);
    $buyer_type = $row_type['BuyerType'];
}
?>
	
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
    	<td>
        	<table width="80%" cellpadding="0" cellspacing="0" align="center" border="0">
                <tr>
                    <td height="500px" align="center" valign="top" class="tableborder">
                        <table align="center" width="90%" cellpadding="0" cellspacing="0" border="0">
                        	<tr>
    <b><?=$buyername?></b><br/>
    <?=$buyeraddress?><br/>
    <b><?=$buyercountry?></b>
    </td>
   <td colspan="3" valign="top" class="print_text" style="border-bottom:#000000 solid 1px;">Buyer (if other than consignee)</td>
 </tr>
 <tr>
   <td colspan="2" valign="top" class="print_text" style="border-right:#000000 solid 1px;">Country of Origin of Goods<br/>
   <b>INDIA</b>
   </td>
   <td class="print_text" valign="top">Country of final Destination :<br/><b><?=$buyercountry?></b></td>
 </tr>
 <tr>
   <td colspan="2" class="print_text" style="border-bottom:#000000 solid 1px;border-right:#000000 solid 1px;" valign="top">Pre. Carriage by :</td>
   <td width="148" valign="top" class="print_text" style="border-bottom:#000000 solid 1px;">Place of Receipt by</td>
   <td colspan="3" rowspan="3" class="print_text" valign="top" style="border-top:#000000 solid 1px;border-bottom:#000000 solid 1px;border-left:#000000 solid 1px;">Terms of Delivery of Payment<br/><?=nl2br(getPINumber('TermsAndCondition','rec_id',getDispatchDetail('PiId','DispatchNumberId',$rec_id)))?></td>
 </tr>
 <tr>
   <td colspan="2" class="print_text" style="border-bottom:#000000 solid 1px;border-right:#000000 solid 1px;" valign="top">Vessel/Flight No.:</td>
   <td class="print_text" style="border-bottom:#000000 solid 1px;" valign="top">Port of Loading :</td>
 </tr>
 <tr>
   <td colspan="2" class="print_text" style="border-bottom:#000000 solid 1px;border-right:#000000 solid 1px;" valign="top">Port of Discharge :</td>
   <td class="print_text" style="border-bottom:#000000 solid 1px;" valign="top">Final Destination :</td>
 </tr>
 <tr>
   <td width="96" valign="top" class="print_text" style="border-bottom:#000000 solid 1px;"><b>Marks &amp; Nos./</b></td>
   <td width="117" valign="top" class="print_text" style="border-bottom:#000000 solid 1px;"><b>No. &amp; Kind of Pkgs.</b></td>
   <td valign="top" class="print_text" style="border-bottom:#000000 solid 1px;border-right:#000000 solid 1px;"><b>Description of Goods</b></td>
   <td width="94" align="center" valign="top" style="border-bottom:#000000 solid 1px;border-right:#000000 solid 1px;"><span class="print_text"><b>Quantity</b><br/>
   <b>Kgs</b></span></td>
     </td>
 </tr>            
 <tr>
     <td align="center" colspan="4">
         <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
             <tr>
             <?
             $sql_1 = "select bm.rec_id , bm.BuyerName , docm.rec_id , docm.DocumentName , docm.DocumentFor , dn.rec_id , dn.DispatchNumber from mo_adm_buyer_master as bm , mo_adm_dispatch_number as dn , mo_adm_document_master as docm where bm.BuyerType = docm.DocumentFor and dn.BuyerId = bm.rec_id and dn.rec_id = '".$row_dn["rec_id"]."' order by dn.rec_id ";
             $result_1 = mysql_query($sql_1)or die("Error in Query: ".$sql_1."<br/>".mysql_error()."<br/>".mysql_errno());
             if(mysql_num_rows($result_1)>0)
             {
                 while($row_1 = mysql_fetch_array($result_1))
                 //$row_1 = mysql_fetch_array($result_1);
                 {
                     $DocStatus = 0;
                     $DispatchMasterId = getDispatchDetail('rec_id','DispatchNumberId',$row_1["rec_id"]);
                     
                     $sql_2 = "select * from mo_adm_despatch_doclist  where DispatchMasterId = '$DispatchMasterId'";
                     
                     $result_2 = mysql_query($sql_2)or die("Error in Query: ".$sql_2."<br/>".mysql_error()."<br/>".mysql_errno());
                     
                     if(mysql_num_rows($result_2) == 0)
                     {
                     ?>
                 <td class="tableText"><?=$row_1['DocumentName']?></td>
                     <?
                     }
                 }
             }
             ?>
             </tr>
    $result = mysql_query($sql) or die("Error in Query : " . $sql . "<br/>" . mysql_error() . "<br/>" . mysql_errno());
    $row = mysql_fetch_array($result);
    $rec_id = $row['rec_id'];
    $buyername = getBuyer('BuyerName', 'rec_id', $row['BuyerId']);
    $buyercountry = getCountry(getBuyer('CountryId', 'rec_id', $row['BuyerId']));
    $buyeraddress = getBuyer('Address', 'rec_id', $row['BuyerId']);
    $buyertinno = getBuyer('TinNumber', 'rec_id', $row['BuyerId']);
    $invoiceno = $row['DispatchNumber'];
    $invoicedate = getDateFormate($row['DespatchDate'], 1);
    $transport = $row['TransportNo'];
    $vechileno = $row['VechileNo'];
    $lr_no = $row['LrNo'];
    $lr_date = $row['LrDate'];
    $Other_ref = $row['OtherRef'];
    $FreightCharges = $row['FreightCharges'];
    $pi_id = getDispatchDetail('PiId', 'DispatchNumberId', $rec_id);
    $report_type = getPINumber('ReportType', 'rec_id', $pi_id);
    $FinalNetAmount = $row['FinalNetAmount'];
}
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=domestic_dispatch_excel.xls");
?>
<style type="text/css">
.headingSmallPrint
{
 	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:15px;
	color:#000000;
	text-align:center;
	line-height:15px;
	vertical-align:top;