
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.1;
margin: 0;
padding: 5px 10px;
}
.certificate {
border: 0px solid #000;
padding: 4px;
position: relative;
}
.certificate .tbl{
border: 1px solid #000; border-collapse: collapse;
}
.certificate .tbl td, .certificate .tbl th{
border: 1px solid #000; border-collapse: collapse;
}
.letterhead {
text-align: center;
padding-bottom: 1px;
margin-bottom: 1px;
min-height: 131px;
}
.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: 4px;
border-top: 2px solid #000;
font-size: 13px;
border-bottom: 2px solid #000;
height: 40px;
}
.cert_box .certificate-number {
width: 50%;
float: left;
text-align: left;
}
.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: #4a4a4a;
font-size: 15px;
}
.grey_bg {
background-color: #DFDFDF;
padding: 5px;
font-size: 14px;
line-height: 140%;
font-weight: 600;
}
.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>
<div class="title text-center ">TREATMENT CERTIFICATE – METHYL BROMIDE FUMIGATION</div>
<table width="100%" class="tbl" cellpadding="6" cellspacing="0">
<tbody>
<tr>
<td colspan="3" width="50%">
<?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";
$resultu=mysql_query($sqlu) or die('error in fetch');
$rowu=mysql_fetch_array($resultu);
?>
Certificate Number:
<strong>AFPMS/<?php echo $cert_id . $sub_certno . '/' . $rowu['year']; ?></strong><br/>
Date of Issue: <strong><?php echo date("d/m/Y", strtotime($rowu1['issuedate'])); ?></strong>
</td>
<td colspan="3" width="50%">
<strong>Treatment provider ID number</strong><br/>
<strong>AEI NO.: IN-0584-MB</strong>
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center"> CONSIGNMENT DETAILS </td>
</tr>
<tr>
<td colspan="6" >
<?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)){
}
?>
<strong>Consignment link (container numbers if applicable):</strong><br/>
<?php echo ($rowu1['conslink'] ? $rowu1['conslink'] : ""); ?><br/>
Container No(s): <?php echo $rowu1['conslinkno']; ?>
</td>
</tr>
<tr>
<td colspan="6" >
<strong>Seal numbers(s) (if applicable):</strong> <?php echo ($rowu1['seal_no'] ? $rowu1['seal_no'] : "N/A"); ?><br/>
</td>
</tr>
<tr>
<td colspan="6" >
<strong>Client name & Address:</strong>
<?php echo $client['headname']; ?> <?php echo $client['headaddress']; ?>
</td>
</tr>
<tr>
<td colspan="6" >
<strong>Commodity description:</strong> <?php echo $rowu1['commodity']; ?>
</td>
</tr>
<tr>
<td colspan="6" >
<strong>Commodity quantity:</strong> <?php echo $rowu1['quantitydeclared']; ?>
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<strong>Commodity Country of origin:</strong><br/>
<?php echo $rowu1['portcountry']; ?><br/>
</td>
<td colspan="2" class="text-center">
<strong>Port of loading:</strong><br/>
<?php echo $rowu1['declentry']; ?><br/>
</td>
<td colspan="2" class="text-center">
<strong>Destination Country:</strong><br/>
<?php echo $rowu1['countrydes']; ?><br/>
</td>
</tr>
<tr>
<td colspan="3" class="pheading text-center">
<strong>TARGET OF FUMIGATION</strong><br/>
</td>
<td colspan="3" class="pheading text-center">
<strong>ENCLOSURE TYPE</strong><br/>
</td>
</tr>
<tr>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo (strpos($rowu1['desgood'], "Commodity") !== false ? "checked" : "") ?>/> Commodity
</td>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo (strpos($rowu1['desgood'], "Empty Container") !== false ? "checked" : "") ?>/> Container
</td>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo (strpos($rowu1['desgood'], "Packing") !== false ? "checked" : "") ?>/> Packing
</td>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo ($rowu1['enclosure_type'] == "Sheeted Enclosure" ? "checked" : "") ?>/> Sheeted Enclosure
</td>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo ($rowu1['enclosure_type'] == "Fumigation Chamber" ? "checked" : "") ?>/> Fumigation Chamber
</td>
<td>
<input type="checkbox" disabled class="disable_chk" <?php echo ($rowu1['enclosure_type'] == "Unsheeted Container" ? "checked" : "") ?>/> Unsheeted Container
</td>
</tr>
<tr>
<td colspan="3">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['desgood_others']?"checked":"")?> />
Other (provide details): <?php echo $rowu1['desgood_others']; ?><br/>
</td>
<td colspan="3">
<input type="checkbox" disabled class="disable_chk" <?php echo($rowu1['enclosure_type_others']?"checked":"")?> />
Other (provide details): <?php echo $rowu1['enclosure_type_others']; ?><br/>
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center">
<strong>TREATMENT SCHEDULE (PRESCRIBED/SPECIFIED TREATMENT SCHEDULE)</strong><br/>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Dose Rate: </strong><?php echo $rowu1['namefumigant']; ?><br/>
</td>
<td colspan="2">
<strong>Exposure period: </strong><?php echo $rowu1['durationfumigantion']; ?><br/>
</td>
<td colspan="2">
<strong>Temperature: </strong><?php echo $rowu1['airtemp']; ?>°C<br/>
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center">
<strong>FUMIGATION DETAILS (TREATMENT APPLIED)</strong><br/>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Applied dose: </strong><?php echo $rowu1['dosagefumigant_trmnt']; ?><br/>
</td>
<td colspan="2">
<strong>Exposure period: </strong><?php echo $rowu1['durationfumigantion_trmnt']; ?><br/>
</td>
<td colspan="2">
<strong>Forecast minimum temp (°C): </strong><?php echo $rowu1['airtemp_trmnt']; ?>°C<br/>
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center">
<strong>PLACE OF FUMIGATION (FULL ADDRESS)</strong><br/>
</td>
</tr>
<tr>
<td colspan="6" >
<strong>Street Address: </strong><?php echo $rowu1['streetaddress_trmnt']; ?><br/>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Suburb/Town/City: </strong><?php echo $rowu1['city_trmnt']; ?><br/>
</td>
<td colspan="2">
<strong>Country: </strong><?php echo $rowu1['country_trmnt']; ?><br/>
</td>
<td colspan="2">
<strong>Postcode: </strong><?php echo $rowu1['postcode_trmnt']; ?><br/>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Date and time fumigation commenced:</strong>
</td>
<td colspan="2">
<strong>Date: </strong><?php echo date('d/m/Y', strtotime($rowu1['datefumigantion_start'])); ?><br/>
</td>
<td colspan="2">
<strong>Time: </strong><?php echo date('H:i a', strtotime($rowu1['timefumigantion_start'])); ?><br/>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Date and time fumigation completed:</strong>
</td>
<td colspan="2">
<strong>Date: </strong><?php echo date('d/m/Y', strtotime($rowu1['datefumigantion_end'])); ?>
</td>
<td colspan="2">
<strong>Time: </strong><?php echo date('H:i a', strtotime($rowu1['timefumigantion_end'])); ?>
</td>
</tr>
<tr>
<td colspan="6" >
Final TLV reading (ppm): <?php echo $rowu1['perforated']; ?> ppm<br/>
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center">
<strong>DECLARATION</strong>
</td>
</tr>
<tr>
<td colspan="6">
I, the fumigator-in-charge declare:<br/>
1. The fumigation certified was conducted in accordance with the treatment schedule, import conditions, and all the requirements in the Methyl Bromide Fumigation Methodology, and<br/>
2. The information I have provided is true and correct.
</td>
</tr>
<tr>
<td colspan="6" class="pheading text-center">
<strong>ADDITIONAL DECLARATIONS: </strong><?php echo $rowu1['decla']; ?>
</td>
</tr>
<tr>
<td colspan="6" class="text-right" style="line-height: 23px;">
NAME OF AFO: <?php echo $rowu['name']; ?><br/>
Accreditation Number: 91 TRPK 041PM
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>


PK 99