PK

ADDRLIN : /home/anibklip/aaravpest.in/2019-20/
FLL :
Current File : /home/anibklip/aaravpest.in/2019-20/view_cert_noinv.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">
	<form method="post" action="create_invoice.php">
		<table>
			<thead>
				<tr>
					<th>Select</th>
					<th>Certificate#</th>
					<!--th>Has Sub</th-->
					<th>Name</th>
					<th>Date of Issue</th>
					<th>Department of Goods</th>
					<th>Qty</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 where parent_cert=0 and inv_done=0 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, MYSQL_ASSOC)){
					//echo "<pre>";print_r($row);echo "</pre>";
					$qq="SELECT * from certificates where parent_cert='$row[certificateno]' ";
					$qq=mysql_query($qq) or die('Error in getting Certificates');
					if($r1=mysql_fetch_array($qq, MYSQL_ASSOC)){
						$has_sub="Yes";
					}else{
						$has_sub="No";
					}

					if($row['certypo']=="a"){
						$ctype="AQIS";
					}elseif($row['certypo']=="b"){
						$ctype="AUS";
					}elseif($row['certypo']=="c"){
						$ctype="PPQ";
					}elseif($row['certypo']=="d"){
						$ctype="AUS-BK";
					}elseif($row['certypo']=="e"){
						$ctype="PPQ-BK";
					}


					if($_GET[typ]=="sub"){
						$certificateno=getColumn("certificates","certificateno", $row['parent_cert'],"certno");
					}else{
						$certificateno=$row['certno'];
					}

					if($row['sub_certno']==1){
						$sub_certno="/A";
					}elseif($row['sub_certno']==2){
						$sub_certno="/B";
					}elseif($row['sub_certno']==3){
						$sub_certno="/C";
					}elseif($row['sub_certno']==4){
						$sub_certno="/D";
					}elseif($row['sub_certno']==5){
						$sub_certno="/E";
					}elseif($row['sub_certno']==6){
						$sub_certno="/F";
					}elseif($row['sub_certno']==7){
						$sub_certno="/G";
					}elseif($row['sub_certno']==8){
						$sub_certno="/H";
					}

					echo"
					<tr>
					<td><input type='checkbox' id='chk' name='chk[]' value='{$row['certificateno']}' /></td> 
					<td>{$ctype}-{$certificateno}{$sub_certno}</td> 
					<!--td>{$has_sub}</td-->";
					?>
					<td>
						<?php
						$qc="select headid, headname, headaddress from parties where headid='$row[nameaddress]' ";
						$rsp = mysql_query($qc) or die(mysql_erorr());
						if( $rp = mysql_fetch_array($rsp, MYSQL_ASSOC) ){
							echo "<b>$rp[headname]</b><br>$rp[headaddresszzzzz]";
						}
						?>
					</td>
					<?php
					echo "<td>".date("d-m-Y",strtotime($row['issuedate']))."</td>
					<td>{$row['desgood']}</td> 
					<td>{$row['quantitydeclared']}</td>  
					<td>{$row['countrydes']}</td> 

					<td>{$row['placefumigantion']}</td> 
					
					<!-- <td>{$row['dosagefumigant']}</td><td><a href='create_invoice.php?cert_id={$row['certificateno']}'>Create Invoice</a></td> -->
					</tr>
					";
				}
				?>
			</tbody>
		</table>
		<input type="submit" value="Create Invoice"/>
	</form>
</div>

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


PK 99