Current File : /home/inlingua/public_html/faridabad/icentex/admin/timesheet_location.select.php
<?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 timesheet_location order by location";

// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page
$offset=$_REQUEST[offset];
// Prepare add on URL
$addOnUrl = "";

if ($resultsPerPage > 0)
{	$prev_next_links = $dbObject->prev123Next($sqlQuery, $resultsPerPage,$addOnUrl);
	$sqlQuery .= " limit " . $offset . "," . $resultsPerPage ;
}

?>
<?php include("header.php"); ?>
<div class="clear"></div>
<?php include("left.php"); ?>
<div id="content-wrap" style="padding-top:20px;" >
  <div id="content-box" >
		<div id="toolbar-title" >
			<h3>
Location Manager

</h3>
			
			<div class="clear"></div>
		</div>
		<div id="toolbar-box">
		  <div class="toolbar" id="toolbar"></div>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
		
		<div id="element-box">
			<div class="m">
				<table class="adminform">
					<tbody><tr>
												<td valign="top" width="55%">
												
<a href="timesheet_location.main.php">Add new Location</a>
<br>
												<?php
// 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='1' class='pa-nor' cellspacing='0'>";
echo "<tr valign='top' class='pa-sel-header'>";
//echo "<th><b>recNo</b></th>";
echo "<th><b>Location</b></th>";
echo "<th><b>Status</b></th>";
//echo "<th><b>zipcode</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>"; }
	
while($objectData=$dbObject->SelectNext())
{
	if($objectData['status']=="1")
{
	$status="Open";
	}
	else{
	$status="Closed";	
	}
	echo "<tr valign='top' onmouseover=\"this.className='pa-row-highlight'\" onmouseout=\"this.className='pa-nor'\">";
	//echo "<td>$objectData[recNo]</td>";
	if($objectData[location]=="S.Extn")
	{
	$location="South Extension";
	}
	else
	{
	$location=$objectData[location];
	}
echo "<td>$location</td>";

echo "<td>$status</td>";

	echo "<td><a href='timesheet_location.main.php?aC=sM&kV=". $objectData['recNo'] ."'>Modify</a> |";
	//echo "<a href='timesheet_location.main.php?aC=sV&kV=". $objectData['recNo'] ."'>View</a> |";
	echo " <a href='timesheet_location.main.php?aC=sD&kV=". $objectData['recNo'] ."'>Delete</a></td>";	
	echo "</tr>";
}
print "</table>";

// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links)
{	echo "Page: ";
	array_walk($prev_next_links, 'printArray'); 
}
?>


<?php 
$dbObject->CloseConnection();

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


												
												<div id="cpanel">
				<div style="float: left;">
			<div class="icon"></div>
		</div>
				<div style="float: left;">
			<div class="icon"></div>
		</div>
				
				<div style="float: left;"></div>
			</div>
	</td>
												<td valign="top" width="45%">&nbsp;</td>
					</tr>
				</tbody></table>
			</div>
		</div>
		<div class="clear"></div>
		<p class="copyright">&nbsp;</p>
  </div>
</div>
</body></html>