
PK 
<?php
include"connexion.php";
include"head.php";
?>
<head>
<title>ANIBS BUSSINESS SOLUTIONS</title>
<SCRIPT language=JavaScript>
function reload(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='sub_certificate.php?cat=' + val ;
}
</script>
<body>
<?
@$cat=$_GET['cat']; // Use this line or below line if register_global is off
//@$cat=$HTTP_GET_VARS['cat']; // Use this line or above line if register_global is off
///////// Getting the data from Mysql table for first list box//////////
$quer2=mysql_query("SELECT DISTINCT * FROM head WHERE parhead='0'");
///////////// End of query for first list box////////////
/////// for second drop down list we will check if category is selected else we will display all the subcategory/////
if(isset($cat) and strlen($cat) > 0)
{
$quer=mysql_query("SELECT DISTINCT * FROM head WHERE parhead='$cat' order by headname");
}
else
{
$quer=mysql_query("SELECT DISTINCT * FROM head order by headname");
}
////////// end of query for second subcategory drop down list box ///////////////////////////
?>
<div id="content">
<div class="error-notice">
Select the Followings:
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<form action="sub_form.php" method="get">
<tr>
<td align="center" width="50%"> <div id="loading"></div>
Client Type :
<?php
echo "<select name='cat' onchange=\"reload(this.form)\">
<option value=''>Select one</option>";
while($noticia2 = mysql_fetch_array($quer2))
{
if($noticia2['headid']==$cat)
{
echo "<option selected value='$noticia2[headid]'>$noticia2[headname]</option>"."<BR>";
}
else
{
echo "<option value='$noticia2[headid]'>$noticia2[headname]</option>";
}
}
echo "</select>";?>
</ td>
<td align="center" width="50%">Client Name:
<?php
echo "<select name='clntid'><option value=''>Select one</option>";
while
(
$noticia = mysql_fetch_array($quer))
{
echo "<option value='$noticia[headid]'>$noticia[headname]</option>";
}
echo "</select>"; ?>
</td>
</tr>
<tr><td width="50%">Form Type: <select name="formno"><option value="a">ALP</option><option value="b">AQIS</option><option value="c">PPQ</option><option value="d">NSPM</option></select></td>
<td width="50%">Cert. Type: <select name="dtype"><option value="import">Importer</option><option value="export">Exporter</option></select></td>
</tr>
<tr>
<td width="50%">Sub Certificate ID:<select name="clnt"> <?php
$sql="SELECT max(certificateno) as certificateno FROM certificate ";
$result=mysql_query($sql) or die('error in fetch');
$row=mysql_fetch_array($result);
$sql_sub="SELECT * FROM certificate WHERE certificateno='".$row[certificateno]."'";
$result_sub=mysql_query($sql_sub);
$row_sub=mysql_fetch_array($result_sub);
$sub_cer=$row_sub[certificateno];
$sub_cer1=$row_sub[sub_c];
if($sub_cer1 == "")
{
echo "<option value=0>Please Enter Parent Certificate</option>";
}
else
{
echo "<option value='".$sub_cer."'>$sub_cer</option>";
}
?></select></td>
</tr>
<tr>
<td colspan="2" align="center"><center>
<?php
if($sub_cer1 == "yes")
{ echo "<input type=submit value='» Start Certification »'; class=amo-submit>";
}
// echo "<input type=submit value='» Start Certification »'; class=amo-submit>";
?>
</center></td>
</tr>
</form>
</table>
<p align="center"> Choose the above data carefully and correctly.</p>
</div>
</div>
<hr class="hide" />
<?php
include"foot.php";
?>


PK 99