Current File : /home/inlingua/public_html/icentex/admin/timesheet_block.select.php |
<?php include("header.php");
// Include header
//error_reporting(1);
// 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_block order by recNo desc";
// 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 ;
}
?>
<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>
Block Timesheet
</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="100%">
<a href="timesheet_block.php">Block Timesheet</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 width='100%' border='1' class='pa-nor' cellspacing='0'>";
echo "<tr valign='top' class='pa-sel-header'>";
echo "<th><b>From Date</b></th>";
//echo "<th><b>Email</b></th>";
//echo "<th><b>Contact Number</b></th>";
//echo "<th><b>Pay Type</b></th>";
echo "<th><b>To Date</b></th>";
echo "<th><b>Status</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>$objectData[name]</td>";
//echo "<td>$objectData[email]</td>";
//echo "<td>$objectData[contact_no]</td>";
//echo "<td>$objectData[pay_type]</td>";
echo "<td>$objectData[fromDate]</td>";
echo "<td>$objectData[toDate]</td>";
echo "<td>$objectData[status]</td>";
echo"<td>";
//echo "<td><a href='timesheet_user.main.php?aC=sM&kV=". $objectData['recNo'] ."&offset=".$_REQUEST[offset]."'>Modify</a> |";
//echo " <a href='timesheet_user.main.php?aC=sV&kV=". $objectData['recNo'] ."'>View</a> |";
echo " <a onclick='return confDel();' href='timesheet_block_delete.php?aC=sD&kV=". $objectData['recNo'] ."&offset=".$_REQUEST[offset]."' >Delete</a> ";
//echo " <a href='reset.php?kV=". $objectData['recNo'] ."'>Reset</a></td>";
echo"</td>";
echo "</tr>";
$i++;
}
print "</table>";
// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links)
{ echo "Page: ";
array_walk($prev_next_links, 'printArray');
}
?>
<script type="text/javascript">
function confDel()
{ var agree = confirm("Click OK to delete permanently or cancel");
if (agree)
return true;
else
return false;
}
</script>
<?php
$dbObject->CloseConnection();
// Include footer
?>
<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%"> </td>
</tr>
</tbody></table>
</div>
</div>
<div class="clear"></div>
<p class="copyright"> </p>
</div>
</div>
</body></html>