Current File : /home/inlingua/www/noida/icentex/iNDEED/ingl_designation.select.php |
<?php
// Copyright, Panalink Infotech Limited. Created on: 01-02-2012
// Include header
include "header_indeed.php";
echo"<h3>Designation</h3>";
echo'<div id="contentnew">';
?>
<a href="ingl_designation.main.php">Add new record</a>
<br>
<?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();
// Records selection sql
$sqlQuery = "SELECT * FROM ingl_designation order by designation";
// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page
// Prepare add on URL
$addOnUrl = "";
$offset=$_REQUEST['offset'];
if ($resultsPerPage > 0)
{ $prev_next_links = $dbObject->prev123Next($sqlQuery, $resultsPerPage,$addOnUrl);
$sqlQuery .= " limit " . $offset . "," . $resultsPerPage ;
}
// Print navigation bar
function printArray($element) { echo "$element"; }
if ($resultsPerPage > 0 && $prev_next_links)
{ //echo "Page: ";
//array_walk($prev_next_links, 'printArray');
}
// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
echo "<table border='0' class='pa-nor' cellspacing='0' width='100%'>";
echo "<tr valign='top' class='rowH'>";
echo "<th><b>S.No.</b></th>";
echo "<th><b>Designation</b></th>";
echo "<th>Action</th>";
echo "</tr>";
// If no records selected, print message
if (!$selectedRecords)
{ echo "<tr><td colspan='5'>There are no selected records</td></tr>"; }
$i=1;
while($objectData=$dbObject->SelectNext())
{
if($i%2==0) $bgcolor='#F3F3F3';
else $bgcolor='#EBEBEB';
echo "<tr valign='top' style='background:$bgcolor' onmouseover=\"this.className='pa-row-highlight'\" onmouseout=\"this.className='pa-nor'\">";
echo "<td>$i</td>";
echo "<td>$objectData[designation]</td>";
echo "<td>";
if($_SESSION['branch'] !='Noida')
{
echo "<a href='ingl_designation.main.php?aC=sM&kV=". $objectData['recNo'] ."'>Modify</a> |";
echo "<a href='ingl_designation.main.php?aC=sV&kV=". $objectData['recNo'] ."'>View</a> |";
echo " <a href='ingl_designation.main.php?aC=sD&kV=". $objectData['recNo'] ."'>Delete</a>";
}
echo "</td></tr>";
$i++;
}
print "</table>";
// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links)
{ echo "Page: ";
array_walk($prev_next_links, 'printArray');
}
?>
</div>
<?php
$dbObject->CloseConnection();
// Include footer
include "footer_indeed.php";
?>