
PK 
<?php
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=mysql_query($sqlu1) or die('error in fetch');
$rowu1=mysql_fetch_array($resultu1, MYSQL_ASSOC);
// echo "<pre>"; print_r($rowu1); echo "</pre>";
?>
<!DOCTYPE html>
<html>
<head>
<title>Fumigation Certificate</title>
<style>
@page {
size: A4;
margin: .5cm;
}
body {
font-family: Arial, sans-serif;
font-size: 12px;
line-height: 1;
margin: 0; padding: 5px 10px;
}
.certificate {
border: 0px solid #000;
padding: 4px;
position: relative;
}
.letterhead {
text-align: center;
padding-bottom: 1px;
margin-bottom: 1px;
min-height: 121px;
}
.letterhead img {
max-width: 100%;
}
.title {
font-size: 21px; font-weight: bold;
margin: 10px 0; color: #4d4d4d;
}
.ptitle {
font-weight: bold;
border-bottom: 1px solid #000;
padding: 4px 0;
}
.treatment-details {
width: 100%;
border-collapse: collapse;
margin: 10px 0;
}
.treatment-details th,
.treatment-details td {
border: 1px solid #000;
padding: 8px;
text-align: left;
}
.certificate-number {
font-weight: bold;
}
.issue_date {
font-weight: bold; float: right;
}
.cert_box{
background-color: #DFDFDF; padding-bottom: 2px;
border-top: 2px solid #000; font-size: 13px;
border-bottom: 2px solid #000; height: 30px;
}
.cert_box .certificate-number {
width: calc(50% - 7px);
float: left; padding-left: 6px;
text-align: left; padding-top: 3px;
}
.text-right{
text-align: right;
}
.border-left{
border-left: 1px solid #000;
}
.border-bottom{
border-bottom: 1px solid #000;
}
.border-top{
border-top: 1px solid #000;
}
.border-right{
border-right: 1px solid #000;
}
.pheading {
font-weight: 600; color: #888;
text-align: left; font-size: 16px;
}
.grey_bg{
background-color: #DFDFDF; padding: 5px;
font-size: 14px; line-height: 90%; font-weight: normal;
}
.disable_chk[checked] {
filter: invert(100%) hue-rotate(18deg) brightness(2);
}
.text-center{
text-align: center;
}
</style>
</head>
<body>
<div class="certificate">
<!--<div class="letterhead">
<img src="../img/letterhead.jpg" alt="">
</div>-->
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<br clear="both" />
<div class="title text-center"> Treatment Certificate - Methyl Bromide Fumigation </div>
<div class="cert_box">
<div class="certificate-number"style="border-right: thick #000000";>
Certificate number:
<?php
if($rowu1['parent_cert']){
$cert_id=$rowu1['parent_cert'];
$cert_id=getColumn("certificates","certificateno", $rowu1['parent_cert'],"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";
}
}else{
$cert_id=$rowu1['certno'];
}
//echo $_SESSION['city'];
$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 echo 'APM/'.$cert_id.$sub_certno;?> <?php echo '/'.$rowu['year'];?><br>
<div>
Date of Issue: <?php echo date("d-m-Y",strtotime($rowu1['issuedate']));?>
</div>
</div>
<div class="certificate-number border-left">
Treatment provider ID number: <br>
AEI No.:<?php echo $rowu['ppqs'];?>
</div>
</div>
<div class="ptitle text-center">Consignment Details</div>
<?php
$ar=explode(",",$rowu1['nameaddress']);
$exporter = $ar[0];
$sql="SELECT * FROM parties WHERE headid='$exporter' ";
$result=mysql_query($sql) or die('error in fetch');
if($client=mysql_fetch_array($result)){
}
$sql="SELECT * FROM parties WHERE headid='$rowu1[declarednameaddress]' ";
$result=mysql_query($sql) or die('error in fetch');
if($importer=mysql_fetch_array($result)){
}
?>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<th width="25%" class="text-right border-bottom">Consignment link (container numbers if applicable):</th>
<td width="75%" colspan="3" class="border-left border-bottom">
<?php echo ($rowu1['distmarks']?$rowu1['distmarks']:"")?> <br>
<?php echo $rowu1['conslinkno']; ?>
</td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Seal number(s) (if applicable):</th>
<td width="75%" colspan="3" class="border-left border-bottom"><?php echo ($rowu1['seal_no']?$rowu1['seal_no']:"N/A"); ?></td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Client Name & Address:</th>
<td width="75%" colspan="3" class="border-left border-bottom"><?php echo $client['headname'];?> <?php echo str_replace("<br>", " ", $client['headaddress']); ?></td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Importer Name & Address:</th>
<td width="75%" colspan="3" class="border-left border-bottom"><?php echo $importer['headname']; ?> <?php echo str_replace("<br>", " ", $importer['headaddress']); ?></td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Commodity Description:</th>
<td width="75%" colspan="3" class="border-left border-bottom"><?php echo $rowu1['commodity']; ?></td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Commodity Country of origin:</th>
<td width="25%" class="border-left border-bottom"><?php echo $rowu1['portcountry']; ?></td>
<th width="25%" class="text-right border-bottom border-left">Commodity quantity:</th>
<td width="25%" class="border-left border-bottom"><?php echo $rowu1['quantitydeclared']; ?></td>
</tr>
<tr>
<th width="25%" class="text-right border-bottom">Port of loading:</th>
<td width="25%" class="border-left border-bottom"><?php echo $rowu1['declentry']; ?></td>
<th width="25%" class="text-right border-bottom border-left">Destination country:</th>
<td width="25%" class="border-left border-bottom"><?php echo $rowu1['countrydes']; ?></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<th width="50%" colspan="3" class="text-right border-bottom pheading">Target of fumigation (pick all that apply):</th>
<th width="50%" colspan="3" class="border-left border-bottom pheading">Enclosure Type (pick one)</th>
</tr>
<tr>
<td width="16.6%" class="border-bottom">
<?php //echo $rowu1['desgood'];?>
<input type="checkbox" disabled class="disable_chk" <?php echo(strpos($rowu1['desgood'],"Commodity")!==false?"checked":"")?> /> Commodity
</td>
<td width="16.6%" class="border-left border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo(strpos($rowu1['desgood'],"Empty Container")!==false?"checked":"")?> /> Container
</td>
<td width="16.6%" class="border-left border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo(strpos($rowu1['desgood'],"Packing")!==false?"checked":"")?> /> Packing
</td>
<td width="16.6%" class="border-left border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['enclosure_type']=="Sheeted Enclosure"?"checked":"")?> /> Sheeted Enclosure
</td>
<td width="16.6%" class="border-left border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['enclosure_type']=="Fumigation Chamber"?"checked":"")?> /> Fumigation Chamber
</td>
<td width="16.6%" class="border-left border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['enclosure_type']=="Unsheeted Container"?"checked":"")?> /> Unsheeted Container
</td>
</tr>
<tr>
<td width="50%" colspan="3" class="border-bottom">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['desgood_others']?"checked":"")?> />
Other (Provide details): <?php echo $rowu1['desgood_others'];?>
</td>
<td width="50%" colspan="3" class="border-bottom border-left">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['enclosure_type_others']?"checked":"")?> />
Other (Provide details): <?php echo $rowu1['enclosure_type_others'];?>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<th colspan="3" class="text-center border-bottom pheading">Treatment Schedule (Prescribed/specified treatment schedule)</th>
</tr>
<tr class="grey_bg">
<td width="33%" class="border-bottom">
Dose rate: <?php echo $rowu1['namefumigant']; ?>
</td>
<td width="33%" class="border-left border-bottom">
Exposure period: <?php echo $rowu1['durationfumigantion']; ?>
</td>
<td width="33%" class="border-left border-bottom">
Temperature: 21 °C or above</td>
</tr>
<tr>
<th colspan="3" class="text-right border-bottom pheading">Fumigation details(treatment applied)</th>
</tr>
<tr class="grey_bg">
<td width="33%" class="border-bottom">
Appied Dose: <?php echo $rowu1['dosagefumigant_trmnt']; ?>
</td>
<td width="33%" class="border-left border-bottom">
Exposure period: <?php echo $rowu1['durationfumigantion_trmnt']; ?>
</td>
<td width="33%" class="border-left border-bottom">
Forecast Min.Temp: <?php echo $rowu1['airtemp_trmnt']; ?></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td width="50%" class="text-center border-bottom" rowspan="3">Place of fumigation (Full address)</td>
<td class="border-bottom border-left">
<b>Street Address</b></br></td>
<td class="border-bottom border-left"><?php echo $rowu1['streetaddress_trmnt']; ?></td>
</tr>
<tr>
<td class="border-bottom border-left"><b>Suburb/Town/City:</b></td>
<td class="border-bottom border-left"><?php echo $rowu1['city_trmnt']; ?></td>
</tr>
<tr>
<td class="border-bottom border-left"><b>Country</b>: <?php echo $rowu1['country_trmnt']; ?></td>
<td class="border-bottom border-left"><b>Postcode</b>: <?php echo $rowu1['postcode_trmnt']; ?></td>
</tr>
<tr>
<td width="50%" class="text-right border-bottom">Date and time Fumigation commenced</td>
<td class="border-bottom border-left">
<?php echo date('d/m/Y', strtotime($rowu1['datefumigantion_start'])); ?></td>
<td class="border-bottom border-left">Time: <?php echo date('H:i a', strtotime($rowu1['timefumigantion_start'])); ?></td>
</tr>
<tr>
<td width="50%" class="text-right border-bottom">Date and time Fumigation Completed</td>
<td class="border-bottom border-left">
<?php echo date('d/m/Y', strtotime($rowu1['datefumigantion_end'])); ?></td>
<td class="border-bottom border-left">Time: <?php echo date('H:i a', strtotime($rowu1['timefumigantion_end'])); ?></td>
</tr>
<tr>
<td width="50%" class="text-right border-bottom">FInal TLV reading (ppm)</td>
<td class="border-bottom border-left" colspan="2"> <?php echo $rowu1['perforated']; ?> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<th class="text-right border-bottom pheading" colspan="4">Declaration</th>
</tr>
<tr>
<td class="border-bottom" colspan="4">
I, the fumigator-in-charge declare:<br>
<ol style="margin: 4px 0;">
<li>The fumigation certified was conducted in accordance with the treatment schedule, import conditions and all the requirements in the Methyl Bromide Fumigation Methodology, and</li>
<li>The information I have provided is true and correct.</li>
</ol>
</td>
</tr>
<tr>
<td width="25%" class="border-bottom text-right"><p></p>Signature (sign your name)</p><br><br></td>
<td width="75%" class="border-bottom border-left" colspan="3"><?php //echo $rowu['name'];?></td>
</tr>
<tr>
<td width="25%" class="border-bottom text-right">Full Name</td>
<td width="75%" class="border-bottom border-left" colspan="3"><?php echo $rowu['name'];?></td>
</tr>
<tr>
<td width="25%" class="border-bottom text-right">Date</td>
<td width="25%" class="border-bottom border-left"><?php echo date("d-m-Y",strtotime($rowu1['issuedate']));?></td>
<!-- <td width="25%" class="border-bottom text-right">Accreditation Number</td>
<td width="25%" class="border-bottom border-left">91 TRPK 041PM</td> -->
<tr>
<td class="text-left border-bottom" colspan="4">
<span class="pheading">Additional Declaration:</span>
<?php echo $rowu1['decla'];?>
</td>
</tr>
</tr>
</table>
</div>
</body>
</html>


PK 99