Current File : /home/inlingua/public_html/icentex/admin_conveyance/ingl_conveyance_kms.form.php
<?php
// Copyright, Panalink Infotech Limited. Created on: 09-06-2012

// Include header
include "header_conveyance.php";
?>

<h3><span class='pa-nor-navbar'><a href='admin_conveyance.php'>Home</a> >> <a href='ingl_conveyance_kms.select.php'>Kms Chart</a></span></h3>

<?php
echo $succFailMesg; 

// Show result of a form submission?
if ($showResult == "Y")
{	echo "<br><a href='ingl_conveyance_rates.select.php'>Back</a><br>";
	// Include footer
	include "footer.php";
	return; 
}

?>

<script type="text/javascript" src="js/jquery.validate.min.js"></script>

<script language="javascript">
<!--
function validate1(form) 
{	if (form.recNo.value=="")
	{	alert("recNo cannot be blank. Please enter it.");
		form.recNo.focus(); return false;
	}
	return true;
}
-->
</script>

<form id='aForm' method='post' action='ingl_conveyance_kms.main.php' onsubmit="return validate(this)">
<input type='hidden' name='recNo' class='required' value="<?php echo $dbObject->getDbField('recNo');?>">
<input type='hidden' name='kV' value="<?php echo $_REQUEST['kV'];?>">
<table border='0' class='pa-nor' width="100%">
<tr valign='top'><td>CENTERS</td>
<?php
$queryS1="Select * from timesheet_location where show_conveyance=1 order by order_rates";
$resultS1=mysqli_query($conn,$queryS1);
while($numS1=mysqli_fetch_array($resultS1))
{

?>
<td style="background-color:#FFFF00;"><?php echo $numS1['location']; ?></td>
<?php
}
?>
</tr>

<?php
$queryS="Select * from timesheet_location where show_conveyance=1 order by order_rates";
$resultS=mysqli_query($conn,$queryS);



while($numS=mysqli_fetch_array($resultS))
{
?>
<tr valign='top'><td style="background-color:#FFFF00;"><?php echo $numS['location']; ?><input type='hidden' name='center_from[]' value="<?php echo $numS['recNo'];?>" size='11' maxlength='11'></td>
<?php
$queryS1="Select * from timesheet_location where show_conveyance=1 order by order_rates";
$resultS1=mysqli_query($conn,$queryS1);
while($numS1=mysqli_fetch_array($resultS1))
{
if($numS['recNo']!=$numS1['recNo'])
{
$queryKms="Select * from  ingl_conveyance_kms where center_from='".$numS['recNo']."' && center_to='".$numS1['recNo']."'";
$resultKms=mysqli_query($conn,$queryKms);
$numKms=mysqli_fetch_array($resultKms);
$countKms=mysqli_num_rows($resultKms);
if($countKms>0)
{
$kms=$numKms['kms'];
}
else
{
$kms=$dbObject->getDbField('kms');
}
?>
<td><input type='text' name='<?php echo"". $numS['recNo']."_". $numS1['recNo'].""; ?>'  value="<?php echo $kms;?>" size='11' maxlength='11'></td>
<?php
}
else
{
?>
<td><input type='text' name='<?php echo"".$numS['recNo']."_".$numS1['recNo'].""; ?>' style="background-color:#FFFF00;"  value="<?php echo $dbObject->getDbField('kms');?>" size='11' maxlength='11' disabled></td>
<?php
}

}
?>

</tr>
<?php
}

?>

<!--<tr valign='top'><td>main_center</td><td><input type='text' name='main_center' value="<?php echo $dbObject->getDbField('main_center');?>" size='11' maxlength='11'></td><td></td></tr>
<tr valign='top'><td>South Extension</td><td><input type='text' name='South Extension' value="<?php echo $dbObject->getDbField('South Extension');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Gurgaon</td><td><input type='text' name='Gurgaon' value="<?php echo $dbObject->getDbField('Gurgaon');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Pitampura</td><td><input type='text' name='Pitampura' value="<?php echo $dbObject->getDbField('Pitampura');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Kamla Nagar</td><td><input type='text' name='Kamla Nagar' value="<?php echo $dbObject->getDbField('Kamla Nagar');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Noida</td><td><input type='text' name='Noida' value="<?php echo $dbObject->getDbField('Noida');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>East Delhi</td><td><input type='text' name='East Delhi' value="<?php echo $dbObject->getDbField('East Delhi');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Yamuna Vihar</td><td><input type='text' name='Yamuna Vihar' value="<?php echo $dbObject->getDbField('Yamuna Vihar');?>" size='10' maxlength='10'></td><td></td></tr>
<tr valign='top'><td>Vikapuri</td><td><input type='text' name='Vikapuri' value="<?php echo $dbObject->getDbField('Vikapuri');?>" size='10' maxlength='10'></td><td></td></tr>-->
<tr><td colspan='3'><input type='submit' name='aC' value='<?php echo $currentMode;?>'></td></tr>
</table>
</form>




<script>
$(function() {
	$('#aForm').validate({
		errorPlacement: function(error, element) 
		{   error.appendTo( element.parent("td").next("td") );
		} 
	});
});
</script>

<?php
// Include footer
include "footer_conveyance.php";
?>