
PK 
<?php
session_start();
/*
session_start();
require_once '../common/common.php';
require_once '../common/secure.php';
include("../connexion.php");
*/
$printype = $_GET['printype'];
$ccid = $_GET['id'];
$id = $_GET['id'];
if(is_numeric($id)){
$certype = "main";
$id = "/$id";
$sqlu1="SELECT * FROM certificates WHERE certificateno='$ccid'";
}else{
$certype = "subb";
$pid = $_GET['pid'];
$sqlu1="SELECT * FROM certificate_sub WHERE sub_certificateno='$_GET[id]' AND certificateno = '$pid' AND certypo='d'";
$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=mysqli_query($conn,$sqlu1) or die('error in fetch');
$rowu1=mysqli_fetch_array($resultu1);
//print_r($rowu1);
$sqlu="SELECT * FROM users where user_id='$_SESSION[user_id]' ";
$resultu=mysqli_query($conn,$sqlu) or die('error in fetch');
$rowu=mysqli_fetch_array($resultu, MYSQLI_ASSOC);
?><head>
<style type="text/css">
.printo--{
font-style: normal;
color: #000000;
letter-spacing: 0;
display1: block;
padding-top: 1px;
font-size: 12px;
line-height:1.1em;
}
.printo {
color: #000000; font-family:arial;
font-style: normal; letter-spacing: 0;
display1: block; padding-top: 1px;
font-size:11px; border: thin;
text-transform: uppercase;
}
.crtName{
float: left;
margin: 5px 5px 0 0;
}
.crtNoBox{
float: left;
padding:5px;
border:solid #000 1px;
}
.crtNameRight{
float: right;
margin: 5px 5px 0 0;
}
.crtNoBoxRight{
float: right;
padding:5px;
border:solid #000 1px;
}
.hr{
border: solid; border-width: thin;
border-color:#000000;
}
h4{
margin-bottom: 0px;
}
input[type="checkbox"] {
-moz-appearance1: none;
height: 18px;
width: 18px;
margin-left: 50px;
vertical-align: middle;
}
.cross {
font-size: 18px;
border: 1px solid #000000;
margin-left: 50px;
padding: 3px 4px;
margin-bottom: 3px;
display: inline-block;
}
</style>
<script type="text/javascript">
window.onload = function() { window.print(); }
</script>
</head>
<p> </p><p> </p><p> </p>
<table align="center" width="100%" border="0" class="printo" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="center"><strong><h4><!-- FUMIGATION CERTIFICATE --></h4></strong> <hr /></td>
</tr>
<tr>
<td colspan="3" align="center"> AFAS - METHYL BROMIDE FUMIGATION CERTIFICATE </td>
</tr>
<tr>
<td colspan="3" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" width="33%"><span class="crtName">Certificate number:</span><span class="crtNoBox">
<?php
//echo $_SESSION['city'];
/*if($_SESSION['city']=="ludhiana"){
echo "LDH";
}else if($_SESSION['city']=="amritser"){
echo "ASR";
}*/
/*if($rowu1[parent_cert]){
$certno=getColumn("certificates", "certificateno", $rowu1[parent_cert], "certno");
}else{
}*/
$certno=$rowu1['certno'];
if($rowu1['sub_certno']==1){
$sub_certno="/A";
}elseif($rowu1['sub_certno']==2){
$sub_certno="/B";
}elseif($rowu1['sub_certno']==3){
$sub_certno="/C";
}elseif($rowu1['sub_certno']==4){
$sub_certno="/D";
}elseif($rowu1['sub_certno']==5){
$sub_certno="/E";
}elseif($rowu1['sub_certno']==6){
$sub_certno="/F";
}elseif($rowu1['sub_certno']==7){
$sub_certno="/G";
}elseif($rowu1['sub_certno']==8){
$sub_certno="/H";
}
if($rowu1['certypo']=="b"){
echo "AFAS/";
}else{
echo "AFA/";
}
// $sqlu="SELECT * FROM signature where user_id='$_SESSION[user_id]' ";
// $resultu=mysqli_query($conn,$sqlu) or die('error in fetch');
// $rowu=mysqli_fetch_array($resultu);
?><?php echo $certno.$sub_certno;?>/<? echo $rowu['yr'];?></strong></font>
</td>
<td align="right" width="33%">Date of Issue: <?php echo date("d-m-Y",strtotime($rowu1[issuedate]));?></td>
<td align="right" width="33%"><span class="crtNoBoxRight"><?php echo $rowu['AFAS'];?></span><span class="crtNameRight">AEI No.:</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" align="center"><hr>TARGET OF FUMIGATION DETAILS<hr /></td>
</tr>
<tr>
<td colspan="3" align="left"><br />Target of fumigation:
<?php
if($rowu1['desgood']=="Commodity"){
echo '<span class="cross">✔</span> Commodity
<span class="cross">✘</span> Packing
<span class="cross">✘</span> Both Commodity and Packing
<span class="cross">✘</span> Empty Container ';
}elseif($rowu1['desgood']=="Packing"){
echo '<span class="cross">✘</span> Commodity
<span class="cross">✔</span> Packing
<span class="cross">✘</span> Both Commodity and Packing
<span class="cross">✘</span> Empty Container ';
}elseif($rowu1['desgood']=="Both Commodity and Packing"){
echo '<span class="cross">✘</span> Commodity
<span class="cross">✘</span> Packing
<span class="cross">✔</span> Both Commodity and Packing
<span class="cross">✘</span> Empty Container ';
}elseif($rowu1['desgood']=="Empty Container"){
echo '<span class="cross">✘</span> Commodity
<span class="cross">✘</span> Packing
<span class="cross">✘</span> Both Commodity and Packing
<span class="cross">✔</span> Empty Container ';
}
?>
</td>
</tr>
<tr>
<td colspan="" align="left">Commodity: <?php echo"$rowu1[commodity]";?></td>
<!--<td colspan="" align="left">Quantity <?php echo $rowu1[quantitydeclared];?></td>-->
</tr>
<tr>
<td colspan="" align="left">Consignment link: <?php echo $rowu1[distmarks]?></td>
<td align="left">Country of origin: <?php echo"$rowu1[portcountry]";?> </td>
</tr>
<tr>
<td align="left">Port of loading: <?php echo"$rowu1[declentry]";?></td>
<td align="left">Country of Destination: <?php echo"$rowu1[countrydes]";?></td>
</tr>
<tr>
<td colspan="3" align="center"> <hr />
<?php
$sqlg="SELECT * FROM certificates WHERE certificateno='$ccid'";
$resultg=mysqli_query($conn,$sqlg) or die('error in fetch');
$rowg=mysqli_fetch_array($resultg);
if($rowu1[licetype]=='import'){
?>
<table width="100%" class="printo" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" width="50%" style="border-right: solid #000 1px;"> Name and address of exporter: <br/>
<?php
$ar=explode(",",$rowu1['nameaddress']);
$exporter = $ar[0];
echo $sql="SELECT * FROM parties WHERE headid='$exporter' ";
$result=mysqli_query($conn,$sql) or die('error in fetch');
while($row=mysqli_fetch_array($result)){
echo"{$row['headname']}<br>{$row['headaddress']}";
}
?>
</td>
<td align="left" width="50%"> <span style="margin-left:10px; float:left; width:100%;">Name and address of importer: <br />
<?php
$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=mysqli_query($conn,$sql) or die('error in fetch');
while($row=mysqli_fetch_array($result))
{
echo"{$row['headname']}<br>{$row['headaddress']}";
}
?>
</span>
</td>
</tr>
</table>
<?php
}else{ // case EXPORT
?>
<table width="100%" class="printo" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" width="50%" style="border-right: solid #000 1px;"> Name and address of exporter: <br/>
<?php
//echo $exporter = $rowu1['nameaddress'];
$ar=explode(",",$rowu1['nameaddress']);
$exporter = $ar[0];
$sql="SELECT * FROM parties WHERE headid='$exporter' ";
$result=mysqli_query($conn,$sql) or die('error in fetch');
while($row=mysqli_fetch_array($result)){
echo"<strong>{$row['headname']}</strong><br>{$row['headaddress']}";
}
/*//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=mysqli_query($conn,$sql) or die(mysqli_error($conn));
while($row=mysqli_fetch_array($result)){
echo"{$row['headname']}<br>{$row['headaddress']}";
}*/
?>
</td>
<td align="left" width="50%">
<span style="margin-left:10px; float:left; width:100%;">Name and address of importer:<br />
<?php
$ar=explode(",",$rowu1['declarednameaddress']);
$importer = $ar[0]; //$rowu1['declarednameaddress'];
//print "<h1>IMPORTER: $importer</h1>";
$sql="SELECT * FROM parties WHERE headid='$importer'";
//echo $sql;
$result=mysqli_query($conn,$sql) or die('error in fetch for database');
while($row=mysqli_fetch_array($result)){
echo"<strong>{$row['headname']}</strong><br>{$row['headaddress']}";
}
?></span></td>
</tr>
</table>
<?php
}
?>
<hr />
</td>
</tr>
<tr>
<td colspan="3" align="center"> <h4>TREATMENT DETAILS </h4> <hr /></td>
</tr>
<tr>
<td colspan="5" align="center">
<table border="0" width="100%" class="printo" cellpadding="5" cellspacing="0">
<tr>
<td align="left" width="50%">
<?php if($rowu1[issuedate]){?>Date of Fumigation started: <?php echo date("d-m-Y", strtotime($rowu1[date_start]));?><br><?php }?>
</td>
<td align="left">Date of fumigation completed: <?php echo date("d-m-Y", strtotime($rowu1[datefumigantion]));?></td>
</tr>
<tr>
<td align="left">Place of fumigation: <?php echo"$rowu1[placefumigantion]";?></td>
</tr>
<tr>
<td align="left" width="50%">AQIS prescribed dose rate (g/m³): <?php echo"$rowu1[namefumigant]";?></td>
<td align="left" width="50%">Exposure period (hrs): <?php echo"$rowu1[durationfumigantion]";?></td>
</tr>
<tr>
<td align="left" width="50%">Forecast minimum temp (°C): <?php echo"$rowu1[airtemp]";?></td>
<td align="left" width="50%">Applied dose rate(g/m³): <?php echo"$rowu1[dosagefumigant]";?></td>
</tr>
<!-- <tr>
<td align="left" width="50%"> </td>
</tr> -->
</table>
<hr />
</td>
</tr>
<tr>
<td colspan="3" align="left">
<table width="100%" class="printo" cellpadding="0">
<tr>
<td width="25%">How was the fumigation conducted?: </td>
<td width="75%">
<?php
if($rowu1['contype']=='Yes') {
$checkedStackSheet = ' checked ';
}else{
$checkedStackSheet = "";
}
echo '<input type="checkbox" name="contype" '.$checkedStackSheet.' value="'.$rowu1[contype].'"> Stack under sheet';
?>
<?php
//echo $rowu1[presstest]." - sssssssssss";
if($rowu1[presstest]=='Yes') {
$checkedPresstest = " checked ";
}else{
$checkedPresstest = "";
}
//echo $checkedPresstest;
echo '<input type="checkbox" name="presstest" '.$checkedPresstest.' value="'.$rowu1[presstest].'"> Container/s under sheet';
?>
</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="75%">
<?php
if($rowu1[airspace]=='Yes') {
$checkedAirspace = "checked='checked'";
}else{
$checkedAirspace = "";
}
echo '<input type="checkbox" name="airspace" '.$checkedAirspace.' value="'.$checkedAirspace.'"> Permanent Chamber ';
?>
<?php
if($rowu1[discharge]=='Yes') {
$checkedPresstest = "checked='checked'";
}else{
$checkedPresstest = "";
}
echo '<input type="checkbox" name="discharge" '.$checkedPresstest.' value="'.$rowu1[discharge].'"> Pressure Tested Container/s';
?>
</td>
</tr>
</table>
Container number/s (where applicable) : <?php echo $rowu1['conslinkno']; ?>
<hr />
</td>
</tr>
<tr>
<td colspan="4" align="left">
Dose the target of fumigation conform to the AQIS plastic wrapping, impervious surface and timber thickness requirements at the time of fumigation?
<?php
//echo $rowu1[consignment];
if($rowu1[consignment]=='Yes'){
echo '<span class="cross">✔</span> Yes';
echo '<span class="cross">✘</span> No';
}else{
echo '<span class="cross">✘</span> Yes';
echo '<span class="cross">✔</span> No';
}
?>
<hr />
Ventilation Final TLV reading(ppm): <?php echo $rowu1['perforated']; ?>
<span style="float1:left;">(nor required for Stack or Permanent Chamber fumigations)</span>
<hr />
</td>
</tr>
<tr>
<td colspan="3" align="center"> <h4>DECLARATION </h4> <hr />
By signing below, I, the AQIS accredited fumigator responsible, declare that these details are true and correct and the fumigation <br /> has been carried out in accordance with all the requirements in the AQIS Methyl Bromide Fumigation Standard. <hr />
</td>
</tr>
<tr>
<td colspan="3" align="center"> <h4>ADDITIONAL DECLARATIONS </h4> <hr /> </td>
</tr>
<tr>
<td colspan="3" align="left"> <?php
// if($rowu1['addition']=="on")
// {
echo $rowu1[decla];
// }
?></td>
</tr>
<tr>
<td colspan="3">
<table border="0" class="printo" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" align="center">
<!-- Signature<br/> -->
<img src="../img/<?php echo $rowu['signature'];?>" width="120" border="0" alt=""><br/>
Name of Acceredited Fumigator<br/><?php echo $rowu['name'];?> <?php echo $rowu['acc_no'];?>
</td>
<td width="30%" align="center">
Date: <?php echo date("d-m-Y",strtotime($rowu1['issuedate']));?><br><br/><br/><br/><br/>
AFAS Accreditation Number<br />
AFAS
<?php echo $rowu['AFAS'];?>
<!-- DPCF Accreditation Number<br /> -->
</td>
<td width="40%" align="center">
<br/><br/><br/><br/><br/>
<!-- DPPQ Accreditation Number : <br /> -->
<?php// echo $rowu['acc_no'];?> <!-- 456010514 -->
</td>
</tr>
</table>
</td>
</tr>
<!-- <tr>
<td colspan="3" align="left"> N.B. : No Liability attached to the certifying company or its representatives with respect to this certificate, <br>Consignment details as declared by shipper or his shipping agent </td>
</tr> -->
<!--
<tr><td>Place and Date: <?
//echo $_SESSION['city'];
/*if($_SESSION['city']=="ludhiana")
{
echo "LUDHIANA";
}
else if($_SESSION['city']=="amritser")
{
echo "AMRITSAR";
};*/?> <?php echo"$rowu1[issuedate]";?></td></tr>
<tr>
<td>
<br><br>Signature<br>
Name of Accredited Fumigation Operator: <br>
DPPQS Accreditation No.:<strong></strong><br>
</td>
</tr>
<tr>
<td align="center">
P.S. : No liability attaches to the certifying company or it proprietors or representatives with respect to this certificate.<br>
Recognised by: GOVERNMENT OF INDIA</td>
</tr>
-->
<tr>
<td colspan="6">
<hr />
P.S.: No Liability attached to the certifying company or its representatives with respect to this certificate, Consignment details as declared by shipper or his shipping agent
</td></tr> <tr>
<td colspan="6" align="center">
Recognised by: GOVERNMENT OF INDIA
</td></tr>
</table>


PK 99