
PK 
<?php
include("../connexion.php");
include("../head.php");
?>
<?php
// Certificate
$din=date('D, d M Y + H:i:s a');
$q="select * from certificate where certypo='a' order by certno desc";
$sql="INSERT INTO cert_alp(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, sub_c, cancel_reason, 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', '$_GET[deck]', '$_GET[clntid]', '$_GET[ajtname]', '$_GET[dtype]', '$_GET[formno]', '$_GET[sub_c]', '0', '$_GET[consignment_link]', '$_GET[container20feet]', '$_GET[container40feet]', '$_GET[container40HC]', '$_GET[containerLCL]') ";
//echo $sql; die();
$result=mysql_query($sql) or die(mysql_error().' - error in certificate');
$certificateno=mysql_insert_id();
$certino="ALP$certificateno";
$sqlo="SELECT count(*) FROM certificate ";
$resulto=mysql_fetch_array(mysql_query($sqlo));
$count=$resulto[0];
//$certificateno="$count";
// Invoice
if($_GET[stax]=='yes'){
$srtax=$_GET[srtax];
}else{
$srtax=0;
}
/*
if($_SESSION['city']=="ludhiana"){
include("connexion.php");
$dat=date("Y-m-d");
$sql="INSERT INTO invoices(clnid,ajtid,certid,dtd,famount,tamount,mamount,amount,discount,servicetax,grandtotal,invstatus,cmntz,branch)
VALUES('$_GET[clntid]','$_GET[ajtname]','$certificateno','$dat','$_GET[famount]','$_GET[tamount]','$_GET[mamount]','$_GET[amount]','$_GET[discount]','$srtax','$_GET[finalone]','pending','$_GET[cmntz]','$_SESSION[city]')";
$result=mysql_query($sql) or die('error in inserting ');
$invoiceid=mysql_insert_id();
}else{
$dat=date("Y-m-d");
$sql="INSERT INTO invoices(clnid,ajtid,certid,dtd,famount,tamount,mamount,amount,discount,servicetax,grandtotal,invstatus,cmntz,branch)
VALUES('$_GET[clntid]','$_GET[ajtname]','$certificateno','$dat','$_GET[famount]','$_GET[tamount]','$_GET[mamount]','$_GET[amount]','$_GET[discount]','$srtax','$_GET[finalone]','pending','$_GET[cmntz]','$_SESSION[city]')";
$result=mysql_query($sql) or die('error in inserting ');
$invoiceid=mysql_insert_id();
}
*/
/* Inserting details in Invoices Table*/
if($_GET[famount]>0){
$dat=date("Y-m-d");
$sql="INSERT INTO invoices(clnid, ajtid, certid, dtd, famount, tamount, mamount, amount, discount, servicetax, grandtotal, invstatus, cmntz, branch, hsn, uom, gst_combine, qty, product) VALUES('$_GET[clntid]', '$_GET[ajtname]', '$certino', '$dat', '$_GET[famount]', '$_GET[tamount]', '$_GET[mamount]', '$_GET[amount]', '$_GET[discount]', '$srtax', '$_GET[finalone]', 'pending', '$_GET[particular]', '$_SESSION[city]', '$_GET[hsn]', '$_GET[uom]', '$_GET[gst_combine]', '$_GET[qty]', '$_GET[product]')";
$result=mysql_query($sql) or die('error in inserting ');
$invoiceid=mysql_insert_id();
}
?>
<table width=100% align=center>
<tr>
<td>New ALP Certificate Sucessfully Entered </td>
<td>Certificate # <?php print $certificateno; ?> </td>
<td>Invoice ID# <?php print $invoiceid; ?> </td>
</tr>
<tr>
<td>
<form action="../print/alp.php" method="get" target="_blank">
<input type="hidden" name="id" value="<?php echo"$certificateno";?>">
<!--input type="hidden" name="clntid" value="<?php echo"$_GET[clntid]";?>">
<input type="hidden" name="dtype" value="<?php echo"$_GET[dtype]";?>">
<input type="hidden" name="dat" value="<?php echo"$_GET[dat]";?>">
<input type="hidden" name="invoice" value="<?php echo"$_GET[invoice]";?>">
<input type="hidden" name="desc" value="<?php echo"$_GET[desc]";?>">
<input type="hidden" name="pack" value="<?php echo"$_GET[pack]";?>">
<input type="hidden" name="vessel" value="<?php echo"$_GET[vessel]";?>">
<input type="hidden" name="convey" value="<?php echo"$_GET[convey]";?>">
<input type="hidden" name="destinat" value="<?php echo"$_GET[destinat]";?>">
<input type="hidden" name="chem" value="<?php echo"$_GET[chem]";?>">
<input type="hidden" name="dosage" value="<?php echo"$_GET[dosage]";?>">
<input type="hidden" name="temp" value="<?php echo"$_GET[temp]";?>">
<input type="hidden" name="durat" value="<?php echo"$_GET[durat]";?>">
<input type="hidden" name="Dfumigation" value="<?php echo"$_GET[Dfumigation]";?>">
<input type="hidden" name="remark" value="<?php echo"$_GET[remark]";?>">
<input type="hidden" name="ajtname" value="<?php echo"$_GET[ajtname]";?>">
<input type="hidden" name="cmntz" value="<?php echo"$_GET[cmntz]";?>">
<input type="hidden" name="stax" value="<?php echo"$_GET[stax]";?>"-->
<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>
<form action="../print/printinvc.php" method="get" target="_blank">
<input type="hidden" name="iid" value="<?php echo"$invoiceid";?>">
<input type="hidden" name="cype" value="alp">
<!--input type="hidden" name="clntid" value="<?php echo"$_GET[clntid]";?>">
<input type="hidden" name="dtype" value="<?php echo"$_GET[dtype]";?>">
<input type="hidden" name="invoiceid" value="<?php echo"$invoiceid";?>">
<input type="hidden" name="dat" value="<?php echo"$_GET[dat]";?>">
<input type="hidden" name="invoice" value="<?php echo"$_GET[invoice]";?>">
<input type="hidden" name="desc" value="<?php echo"$_GET[desc]";?>">
<input type="hidden" name="pack" value="<?php echo"$_GET[pack]";?>">
<input type="hidden" name="vessel" value="<?php echo"$_GET[vessel]";?>">
<input type="hidden" name="convey" value="<?php echo"$_GET[convey]";?>">
<input type="hidden" name="destinat" value="<?php echo"$_GET[destinat]";?>">
<input type="hidden" name="chem" value="<?php echo"$_GET[chem]";?>">
<input type="hidden" name="dosage" value="<?php echo"$_GET[dosage]";?>">
<input type="hidden" name="temp" value="<?php echo"$_GET[temp]";?>">
<input type="hidden" name="durat" value="<?php echo"$durat]";?>">
<input type="hidden" name="Dfumigation" value="<?php echo"$_GET[Dfumigation]";?>">
<input type="hidden" name="remark" value="<?php echo"$_GET[remark]";?>">
<input type="hidden" name="ajtname" value="<?php echo"$_GET[ajtname]";?>">
<input type="hidden" name="cmntz" value="<?php echo"$_GET[cmntz]";?>">
<input type="hidden" name="particular" value="<?php echo"$_GET[particular]";?>">
<input type="hidden" name="finalone" value="<?php echo"$_GET[finalone]";?>">
<input type="hidden" name="amount" value="<?php echo"$_GET[amount]";?>">
<input type="hidden" name="discount" value="<?php echo"$_GET[discount]";?>">
<input type="hidden" name="srtax" value="<?php echo"$_GET[srtax]";?>">
<input type="hidden" name="stax" value="<?php echo"$_GET[stax]";?>"-->
<?php
if($_GET['amount']!="")
{
?>
<input type="submit" value="Print Invoice"></form>
<? }?></td></tr></table>
<?php
include"../foot.php";
?>
<br><br><br>


PK 99