
PK 
<?php
session_start();
require_once 'common/common.php';
require_once 'common/secure.php';
include("connexion.php");
include("head.php");
//$certno=getColumn("certificate", "certificateno", $_GET[certificate_id], "certno");
$certno=$_GET['certificate_id'];
$find = array('ALP','AQIS','PPQ','AUS');
$replace = array('','','','');
$certno = str_replace($find, $replace, $certno);
$sqlo="SELECT count(*) FROM certificate_sub where certificateno='".$_GET[certificate_id]."' ";
$resulto=mysql_fetch_array(mysql_query($sqlo));
$count=$resulto[0];
if($count==0)
{
$sub_c= $certno."/A";
}
else if($count==1)
{
$sub_c= $certno."/B";
}
else if($count==2)
{
$sub_c= $certno."/C";
}
else if($count==3)
{
$sub_c= $certno."/D";
}
else if($count==4)
{
$sub_c= $certno."/E";
}
else if($count==5)
{
$sub_c= $certno."/F";
}
else if($count==6)
{
$sub_c= $certno."/G";
}
else if($count==7)
{
$sub_c= $certno."/H";
}
else if($count==8)
{
$sub_c= $certno."/I";
}
else if($count==9)
{
$sub_c= $certno."/J";
}
else
{
$sub_c= $certno."/K";
}
// Invoice
?>
<?php
if($_GET[addition]=='on')
{
$deckl=".$_GET[deck]";
}
else
{
$deckl="";
}
// Certificate
$din=date('D, d M Y + H:i:s a');
$sql="INSERT INTO certificate_sub(issuedate,desgood,quantitydeclared,distmarks,conslinkno,portcountry,nameship,countrydes,declentry,nameaddress,declarednameaddress,namefumigant,datefumigantion,placefumigantion,dosagefumigant,durationfumigantion,airtemp,contype,presstest,airspace,discharge,enclosure,commodity,consignment,wrapping,perforated,height,cstatus,ctime,decla,clnid,ajtid,licetype,certypo,certificateno,sub_certificateno,consignment_link,container20feet,container40feet,container40HC,containerLCL)
VALUES('$_GET[issuedate]','$_GET[desgood]','$_GET[quantitydeclared]','$_GET[distmarks]','$_GET[conslinkno]','$_GET[portcountry]','$_GET[nameship]','$_GET[countrydes]','$_GET[declentry]','$_GET[nameaddress]','$_GET[declarednameaddress]','$_GET[namefumigant]','$_GET[datefumigantion]','$_GET[placefumigantion]','$_GET[dosagefumigant]','$_GET[durationfumigantion]','$_GET[airtemp]','$_GET[contype]','$_GET[presstest]','$_GET[airspace]','$_GET[discharge]','$_GET[enclosure]','$_GET[commodity]','$_GET[consignment]','$_GET[wrapping]','$_GET[perforated]','$_GET[height]','0','$din','$deckl','$_GET[clntid]','$_GET[ajtname]','$_GET[dtype]','$_GET[formno]','$_GET[certificate_id]','$sub_c','$_GET[consignment_link]','$_GET[container20feet]','$_GET[container40feet]','$_GET[container40HC]','$_GET[containerLCL]')";
$result=mysql_query($sql) or die('errin certificate ');
?>
<table align="center" width="100%" border="0">
<tr><td>
<form action="printcerts.php" method="get" target="_blank">
<input type="hidden" name="formno" value="<?php echo"$_GET[formno]";?>">
<input type="hidden" name="dtype" value="<?php echo"$_GET[dtype]";?>">
<input type="hidden" name="clntid" value="<?php echo"$_GET[clntid]";?>">
<input type="hidden" name="certificateno" value="0<?php echo"$certno";?>">
<input type="hidden" name="issuedate" value="<?php echo"$_GET[issuedate]";?>">
<input type="hidden" name="desgood" value="<?php echo"$_GET[desgood]";?>">
<input type="hidden" name="quantitydeclared" value="<?php echo"$_GET[quantitydeclared]";?>">
<input type="hidden" name="distmarks" value="<?php echo"$_GET[distmarks]";?>">
<input type="hidden" name="conslinkno" value="<?php echo"$_GET[conslinkno]";?>">
<input type="hidden" name="portcountry" value="<?php echo"$_GET[portcountry]";?>">
<input type="hidden" name="countrydes" value="<?php echo"$_GET[countrydes]";?>">
<input type="hidden" name="declentry" value="<?php echo"$_GET[declentry]";?>">
<input type="hidden" name="nameaddress" value="<?php echo"$_GET[nameaddress]";?>">
<input type="hidden" name="declarednameaddress" value="<?php echo"$_GET[declarednameaddress]";?>">
<input type="hidden" name="namefumigant" value="<?php echo"$_GET[namefumigant]";?>">
<input type="hidden" name="datefumigantion" value="<?php echo"$_GET[datefumigantion]";?>">
<input type="hidden" name="placefumigantion" value="<?php echo"$_GET[placefumigantion]";?>">
<input type="hidden" name="dosagefumigant" value="<?php echo"$_GET[dosagefumigant]";?>">
<input type="hidden" name="durationfumigantion" value="<?php echo"$_GET[durationfumigantion]";?>">
<input type="hidden" name="airtemp" value="<?php echo"$_GET[airtemp]";?>">
<input type="hidden" name="contype" value="<?php echo"$_GET[contype]";?>">
<input type="hidden" name="airspace" value="<?php echo"$_GET[airspace]";?>">
<input type="hidden" name="presstest" value="<?php echo"$_GET[presstest]";?>">
<input type="hidden" name="discharge" value="<?php echo"$_GET[discharge]";?>">
<input type="hidden" name="enclosure" value="<?php echo"$_GET[enclosure]";?>">
<input type="hidden" name="commodity" value="<?php echo"$_GET[commodity]";?>">
<input type="hidden" name="consignment" value="<?php echo"$_GET[consignment]";?>">
<input type="hidden" name="wrapping" value="<?php echo"$_GET[wrapping]";?>">
<input type="hidden" name="perforated" value="<?php echo"$_GET[perforated]";?>">
<input type="hidden" name="height" value="<?php echo"$_GET[height]";?>">
<input type="hidden" name="cmntz" value="<?php echo"$_GET[cmntz]";?>">
<input type="hidden" name="deck" value="<?php echo"$_GET[deck]";?>">
<input type="hidden" name="ajtname" value="<?php echo"$_GET[ajtname]";?>">
<input type="hidden" name="addition" value="<?php echo"$_GET[addition]";?>">
<input type="hidden" name="nameship" value="<?php echo"$_GET[nameship]";?>">
<input type="submit" value="Print Certificate"></form>
</td><td align=center><a href=certificate.php>Click here to Get Back Home</a></td>
<td align=right></td></tr></table>
<?php
include"foot.php";
?>
<br><br><br>


PK 99