PK

ADDRLIN : /home/anibklip/aaravpest.in/2021-22/
FLL :
Current File : /home/anibklip/aaravpest.in/2021-22/create-certificate.php

<?php 
include "templatic/head.php"; 
include "templatic/header.php";
?>
<script>
	function subcert(v){
		if(v==true){
			document.getElementById("parent_cert").style.display="";
		}else{
			document.getElementById("parent_cert").style.display="none";
		}
	}
</script>

<div class="box">
	<h2>Create New Certificate</h2>
	<div style="padding:0px 1px;">
		<form action="certificate-form.php" method="post">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="150px" align="right">Form Type:
						<select name="formno">
							<option value="0">Select</option>
							<option value="c">PPQ</option>
							<option value="e">PPQ-BK</option>
								<option value="b">AUS</option>
							<!-- <option value="a">AQIS</option>
							
							<option value="d">AUS-BK</option> -->
						</select>
					</td>

					<td width="350px">Exporting Party:
						<select style="width:350px;" required name="clntid">
							<option value="">Select</option>
							<?php
							$rs = mysql_query('select headid, headname, headaddress from parties where status="active" && headname like "'. mysql_real_escape_string($_REQUEST['term']) .'%" order by headname ', $dblink);
							$data = array();
							if ( $rs && mysql_num_rows($rs) ){
								while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) ){
									$headid = strip_tags($row['headid']);
									$headname = strip_tags($row['headname']);
									$headaddress = $row['headaddress'];
									if($_POST['clntid']==$headid){
										$sel="selected";
									}else{
										$sel="";
									}
									?>
									<option <?php echo $sel?> value="<?php echo $headid?>"><?php echo $headname?> <?php echo $headaddress?></option>
									<?php
								}
							}
							?>
						</select>
						<!-- <input type="text" size="75" name="clntid" id="exporterslist" /> -->
					</td>
				</tr>
				<input type="hidden" name="dtype" value="import/export">
				<!--  
				<tr>
				   <td width="50%">Cert. Type: <select name="dtype"><option value="import">Importer</option><option value="export">Exporter</option></select></td>
				</tr>
				-->
				<tr>
					<td width="150px" align="right">
						<!--<input type="checkbox" name="sub_c" value="yes" /> SubCertificate-->
					</td>
					<td width="350px">Importing Party:
						<select style="width:350px;" name="clntid2">
							<option value="">Select</option>
							<?php
							$rs = mysql_query('select headid, headname, headaddress from parties where status="active" && headname like "'. mysql_real_escape_string($_REQUEST['term']) .'%" order by headname ', $dblink);
							$data = array();
							if ( $rs && mysql_num_rows($rs) ){
								while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) ){
									$headid = strip_tags($row['headid']);
									$headname = strip_tags($row['headname']);
									$headaddress = $row['headaddress'];
									if($_POST['clntid2']==$headid){
										$sel="selected";
									}else{
										$sel="";
									}
									?>
									<option <?php echo $sel?> value="<?php echo $headid?>"><?php echo $headname?> <?php echo $headaddress?></option>
									<?php
								}
							}
							?>
						</select>
						<!-- <input type="text" size="75" name="clntid2" id="importerslist" /> -->
					</td>
				</tr>
				<!-- <tr>
					<td align="right">Sub Certificate:</td>
					<td align="left"><input type="checkbox" name="sub_c" value="1" onclick="subcert(this.checked)" /></td>
				</tr> -->
				<tr style="display:none;" id="parent_cert">
					<td align="right">Select Parent Certificate:</td>
					<td align="left">
						<select name="parent_cert">
							<option value="">Select Parent Certificate</option>
							<?php
							$sql="SELECT * from certificates where  parent_cert=0 order by certificateno DESC limit 40";
							$result=mysql_query($sql) or die('Error in getting Certificates');
							while($row=mysql_fetch_array($result)){
								//$sel="selected";
								if($row[certypo]=="a"){
									$certypo="AQIS";
								}elseif($row[certypo]=="b"){
									$certypo="AUS";
								}elseif($row[certypo]=="c"){
									$certypo="PPQ";
								}
								?>
								<option value="<?php echo $row[certificateno]?>" ><?php echo $row[certno]?> - <?php echo $certypo?></option>
								<?php
							}
							?>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<center>
							<?php echo "<input type=submit value='&raquo; Start Certification &raquo'; class=amo-submit>";?>
						</center>
					</td>
				</tr>
			</table>
		</form>
		<p align="center">Please select data above carefully and correctly.</p>
	</div>
</div>
<?php
include "templatic/footer.php";
?>


PK 99