
PK 
<?
session_start();
include('../connexion.php');
$id = $_GET['id'];
$printype = $_GET['printype'];
if(is_numeric($id)){
$sqlu1="SELECT * FROM cert_alp WHERE certificateno='$_GET[id]'";
$id = "/AP/$id";
}
else{
$pid = $_GET['pid'];
$sqlu1="SELECT * FROM certificate_sub WHERE sub_certificateno='$_GET[id]' AND certificateno = '$pid'";
$id = explode('/',$id);
$id = $id[1];
$find = array('ALP','AQIS','PPQ','AUS');
$replace = array('AP/','AS/','PQ/','AU/');
$ppid = str_replace($find,$replace,$pid);
$id = "/$ppid/$id";
}
$resultu1=mysql_query($sqlu1) or die('error in fetch 1');
$rowu1=mysql_fetch_array($resultu1);
?><head>
<style type="text/css">
.printo {
font-style: normal;
color: #000000;
letter-spacing: 0;
display: block;
padding-top: 1px;
font-size: 90%;
border-bottom:solid;
border:thin;
}
</style>
</head>
<body onLoad="window.print(); window.close();">
<body>
<br /><br />
<table cellspacing="3" align="center" width="100%" border="0" cellpadding="3" class="printo">
<tr>
<td valign="top" colspan="3"> <center><h4> <font face="Arial, Helvetica, sans-serif"> CERTIFICATE OF FUMIGATION</font> </h4> </center>
</td>
</tr>
<tr>
<td valign="top" colspan="3"><font face="Arial, Helvetica, sans-serif"><strong>Dte PPQS Regd. No.:136/ALP</strong></font></td>
</tr>
<td valign="top" colspan="3"><font face="Arial, Helvetica, sans-serif"><strong>Treatment Certificate No.<?
//echo $_SESSION['city'];
if($_SESSION['city']=="ludhiana")
{
echo "ASR";
}
else if($_SESSION['city']=="amritser")
{
echo "ASR";
}
$sqlu="SELECT * FROM signature WHERE user_id='$_SESSION[user_id]'";
$resultu=mysql_query($sqlu) or die('error in fetch');
$rowu=mysql_fetch_array($resultu);
?>
<?php
if($printype=='reco'){
echo '/AP/';
echo $rowu1['reco'];
}
else{
echo "$id";
}
?>/<? echo $rowu['year'];?></strong></font></td>
<td width="55%" colspan="3" align="center" valign="top"><strong>Date of Issue: <?php echo "$rowu1[issuedate]"; ?></strong></td>
</tr>
<tr><td colspan="6"> This is to certify that this consignment has been treated as per details listed below and that subject consignment
is believed to be substantially free from any injurious pests.</td></tr>
<?php
$find = array('ALP','AQIS','PPQ','AUS');
$replace = array('','','','');
$ccid = str_replace($find, $replace, $rowu1[certificateno]);
$sqlg="SELECT * FROM cert_alp WHERE certificateno='$ccid'";
$resultg=mysql_query($sqlg) or die('error in fetch');
$rowg=mysql_fetch_array($resultg);
if($rowu1[licetype]=='import')
{
$exporter = $rowu1['nameaddress'];
if($exporter!=""){
echo"<tr>
<td align=left colspan=3><b>Name and address of consignor/exporter</b>:</td>
<td colspan=3>";
?>
<?php
$exporter = $rowu1['nameaddress'];
//print "<h1>EXPORTER: $exporter</h1>";
if($certype=="main"){
$sql="SELECT subname,subaddress FROM clients WHERE subid='$rowg[nameaddress]'";
}else{
$sql="SELECT subname,subaddress FROM clients WHERE subid='$exporter'";
}
$result=mysql_query($sql) or die('error in fetch');
while($row=mysql_fetch_array($result))
{
echo"{$row['subname']}<br>{$row['subaddress']}";
}
echo"
</td>
</tr>";
}
echo "<tr>
<td colspan=3><b>Name & address of consignee</b>:</td>
<td colspan=3>";
$importer = $rowu1['declarednameaddress'];
//print "<h1>IMPORTER: $importer</h1>";
if($certype=="main"){
$sql="SELECT headname,headaddress FROM head WHERE headid='$rowg[declarednameaddress]'";
}else{
$sql="SELECT headname,headaddress FROM head WHERE headid='$importer'";
}
$result=mysql_query($sql) or die('error in fetch');
while($row=mysql_fetch_array($result))
{
echo"{$row['headname']}<br>{$row['headaddress']}";
}
echo"</td>
</tr>";
}
else
{
echo"<tr>
<td colspan=3><b>Name and address of consignor/exporter</b>:</td>
<td colspan=3>";
$exporter = $rowu1['declarednameaddress'];
//print "<h1>EXPORTER: $exporter</h1>";
if($certype=="main"){
$sql="SELECT headname,headaddress FROM head WHERE headid='$rowg[clnid]'";
}else{
$sql="SELECT headname,headaddress FROM head WHERE headid='$exporter'";
}
$result=mysql_query($sql) or die('error in fetch');
while($row=mysql_fetch_array($result))
{
echo"{$row['headname']}<br>{$row['headaddress']}";
}
echo"</td>
</tr>";
$importer = $rowu1['nameaddress'];
if($importer!=""){
echo"<tr>
<td align=left colspan=3><b>Name & address of consignee</b>:</td>
<td colspan=3>";
?>
<?php
$importer = $rowu1['nameaddress'];
//print "<h1>IMPORTER: $importer</h1>";
if($certype=="main"){
$sql="SELECT subname,subaddress FROM clients WHERE subid='$rowg[declarednameaddress]'";
}else{
$sql="SELECT subname,subaddress FROM clients WHERE subid='$importer'";
}
$result=mysql_query($sql) or die('error in fetch for database');
while($row=mysql_fetch_array($result))
{
echo"{$row['subname']}<br>{$row['subaddress']}";
}
echo"
</td>
</tr>";
}
}
?>
<!--tr>
<td valign="top" colspan="3"><strong>Name of Importer/Exporter:</strong></td>
<td colspan="3">
<?php
$sql="SELECT headname,headaddress,headphone FROM head WHERE headid='$rowu1[clnid]'";
$result=mysql_query($sql) or die('error in fetch');
while($row=mysql_fetch_array($result))
{
echo "{$row['headname']}<br>{$row['headaddress']}";
}
?>
</td>
</tr-->
<td valign="top" colspan="3"><strong>Invoice No.</strong>:</td><td colspan="3"><?php echo "$rowu1[distmarks]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Description of consignment:</strong></td><td colspan="3"><?php echo "$rowu1[desgood]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Type and No. of Packges:</strong></td><td colspan="3"><?php echo "$rowu1[quantitydeclared]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Container no. or Vessel:</strong></td><td colspan="3"><?php echo "$rowu1[conslinkno]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Means of conveyance:</strong></td><td colspan="3"><?php echo "$rowu1[nameship]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Destination Port:</strong></td><td colspan="3"><?php echo "$rowu1[countrydes]";?></td>
</tr>
<tr><td valign="top" colspan="6"> <center><h4> SCHEDULE OF TREATMENT </h4> </center> </td></tr>
<tr>
<td valign="top" colspan="3"><strong>Chemical (Fumigant):</strong></td><td colspan="3"><?php echo "$rowu1[namefumigant]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Dosage:</strong></td><td colspan="3"><?php echo "$rowu1[dosagefumigant]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Temperature:</strong></td><td colspan="3"><?php echo "$rowu1[airtemp]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"><strong>Duration of Exposure:</strong></td><td colspan="3"><?php echo "$rowu1[durationfumigantion]";?></td>
</tr>
<tr>
<td valign="top" colspan="3"> <strong>Date of Fumigation:</strong></td><td colspan="3"><?php echo "$rowu1[datefumigantion]";?></td>
</tr>
<tr>
<td colspan="3"><strong>Remark:</strong></td>
<td colspan="3"><?php echo "$rowu1[decla]";?></td>
</tr>
<tr>
<td colspan="3"></td>
<td colspan="3"><br /><br /><strong>For PEST CONTROL & FUMIGATION COMPANY</strong><br /><br /><br /><br />
<strong>Authorised Signatory</strong></td>
<tr><td colspan="6">P.S. : No liability attaches to the certifying company or it proprietors or representatives with respect to this certificate</td></tr>
<tr><td colspan="6"><center>Recognised by: GOVERNMENT OF INDIA</center></td></tr>
</table>
</body>


PK 99