PK

ADDRLIN : /home/anibklip/vpgldh.com/vpg18/webmanager/
FLL :
Current File : /home/anibklip/vpgldh.com/vpg18/webmanager/certificates.php

<?php 
include "templatic/head.php"; 
include "templatic/header.php";

if($_GET[id] && ($_GET[sts]=="0" || $_GET[sts]=="1")){
	$sql="update certificates set cancel='$_GET[sts]' where certificateno='$_GET[id]'";
	mysql_query($sql) or die(mysql_error());
	$sql="update invoices set cancel='$_GET[sts]' where certid='$_GET[id]'";
	mysql_query($sql) or die(mysql_error());
}
?>

<div class="dataGrid">
<table>
	<thead>
		<tr>
			<th>#</th>
			<th>Date of Issue</th>
			<th>Certificate Type</th>
			<th>Department of Goods</th>
			<th>Quantity Declared</th>
			<th style="width:20px;">Name of Country</th>
			<th>Place of Fumigant</th>
			<th>Dosage Rate of Fumigant</th>
			<th>&nbsp;</th>
		</tr>
	</thead>
	<tbody>
<?php

$sql="SELECT * from certificates  order by certificateno DESC ";
$result=mysql_query($sql) or die('Error in getting Certificates');
if
(mysql_num_rows($result) == 0) {
echo "<tr><td colspan='9' align=center colour=black><br>No Result found in Certificates, try again later.<br></td></tr>";
}
while($row=mysql_fetch_array($result)){
	if($row[cancel]){
		$sts=0;
		$can="Active";
	}else{
		$sts=1;
		$can="Cancel";
	}

	if(trim($row['certypo'])=="a"){
		$ctype="ALP";
	}elseif(trim($row['certypo'])=="b"){
		$ctype="AFAS";
	}elseif(trim($row['certypo'])=="c"){
		$ctype="NSPM";
	}

	echo"
	<tr>
	<td><b>{$row['certificateno']}</b></td> 
	<td>{$row['issuedate']}</td>
	<td>{$ctype}</td>
	<td>{$row['desgood']}</td> 
	<td>{$row['quantitydeclared']}</td>  
	<td>{$row['countrydes']}</td> 

	<td>{$row['placefumigantion']}</td> 
	<td>{$row['dosagefumigant']}</td>  
	<td><a target='_blank' href=./print/form_print.php?id={$row['certificateno']}><img src='./img/printer.png' alt='Print' /></a></td>
	<td><a target='_blank' href=./print/cretid_report.php?id={$row['certificateno']}>Print Report</a></td>
	<td>
		<a href=?id={$row['certificateno']}&sts=$sts>$can</a>
	</td>
	</tr>
	";
}

?>

	</tbody>

</table>


</div>

<?php include "templatic/footer.php"; ?>


PK 99