Current File : /home/inlingua/www/dwarka/icentex/conveyance/ingl_conveyance_bands.select.php |
<?php
// Copyright, Panalink Infotech Limited. Created on: 10-06-2012
session_start();
/*
$loggedUserNo = $_SESSION['loggedUserNo'];
if ($loggedUserNo == "")
{ echo "Please <a href='index.php'>login</a> first.";
exit(0);
}
*/
// Include header
include "header_conveyance.php";
?>
<h3><span class='pa-nor-navbar'><a href='admin_conveyance.php'>Home</a> >> <a href='ingl_conveyance_bands.select.php'>Rates Band</a></span></h3>
<div id="contentnew">
<?php
// Include the database connection details
require('../dbConnection.php');
// Include common functions
require('../commonFunc.php');
// Include common functions
require('../globalVars.php');
// Include the table handler class
require('../dbHandler.class.php');
// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
$band_query="select * from ingl_conveyance_designation where recNo='".$_SESSION['rates_designation']."'";
$resultband=mysqli_query($conn,$band_query);
$numband=mysqli_fetch_array($resultband);
// Records selection sql
$sqlQuery = "SELECT * FROM ingl_conveyance_bands order by band";
// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page
// Prepare add on URL
$addOnUrl = "";
if ($resultsPerPage > 0)
{ $prev_next_links = $dbObject->prev123Next($sqlQuery, $resultsPerPage,$addOnUrl);
$sqlQuery .= " limit " . $offset . "," . $resultsPerPage ;
}
// Print navigation bar
function printArray($element) { echo "$element"; }
// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
?>
<table border='0' class='pa-nor pa-table' width="100%">
<tr valign='top' class='rowH'>
<th>S.No</th>
<th>Band</th>
<th>KM</th>
<th>Travel Allowance</th>
<th>Outcenter Allowance</th>
</tr>
<?php
// If no records selected, print message
if (!$selectedRecords)
{ ?>
<tr><td colspan='5'>There are no entries</td></tr>
<?php
}
$i=1;
while($objectData=$dbObject->SelectNext())
{
if($i%2==0) $bgcolor='#F3F3F3';
else $bgcolor='#EBEBEB';
$numband['travelAllowance'];
$travelA=round((($objectData['travelAllowance']/100)/5)*$numband['travelAllowance'])*5;
$outCA=($objectData['outCenterAllowance']/100)*$numband['outCenterAllowance'];
?>
<tr valign='top' style='background:<?php echo $bgcolor ?>;height:25px;' onmouseover="this.className='pa-row-highlight'" onmouseout="this.className='pa-nor'">
<td align="center"><?php echo $i;?></td>
<td align="center"><?php echo $objectData['band'];?></td>
<td align="center"><?php echo $objectData['kmsfrom'];?>-<?php echo $objectData['kmsto'];?></td>
<td align="center"><?php echo $travelA;?></td>
<td align="center"><?php echo $outCA;?></td>
</tr>
<?php
$i++;
}
?>
</table>
</div>
<?php
$dbObject->CloseConnection();
// Include footer
include "footer_conveyance.php";
?>