Current File : /home/inlingua/public_html/dwarka/icentex/admin_calendar/ingl_calendar_participate.select.php
<?php
//  Created on: 25-12-2014
session_start();
/*
$loggedUserNo = $_SESSION['loggedUserNo'];
if ($loggedUserNo == "")
{	echo "Please <a href='index.php'>login</a> first.";
	exit(0);
}
*/

// Include header
include "header_calendar.php";
?>
<div style='text-align:left;'><h3>&nbsp;&nbsp;&nbsp;View Participants List</h3></div>

<?php if ($_SESSION['dispMesg'][1] != "" && (date("U") - $_SESSION['dispMesg'][0] < 7)) 
{ 	?>
	<span id='mesgSpan'><font color='#da0000'><?php echo $_SESSION['dispMesg'][1];?></font></span>
	<script>
	setTimeout(function() {   $('#mesgSpan').fadeOut('slow'); }, 4000); // <-- time in milliseconds 
	</script>
	<br>
	<?php
}
unset($_SESSION['dispMesg']);
?>

<?php
// Include the database connection details
require('../pdo_conn/dbConnection.php');

// Include common functions
require('../pdo_conn/commonFunc.php');

// Include common functions
require('../pdo_conn/globalVars.php');

// Include the table handler class
require('../pdo_conn/dbHandler.class.php');

// Init and connect to database
$dbObject = new dbHandler($conn);
//$dbObject->connect();

// Records selection sql
$sqlQuery = "SELECT a.*,b.name FROM ingl_calendar_participate a left join timesheet_user b on a.user_id=b.recNo where event_id='".$_REQUEST['kV']."'";

// Prepare page navigation
$resultsPerPage = 1000; // 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 && count($prev_next_links) > 1)
{	echo "Page: ";
	array_walk($prev_next_links, 'printArray'); 
}

// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
?>
<div id="contentnew">
<table border='0' class='pa-nor pa-table' width="100%">
<tr valign='top' class='rowH'>
<td>id</td>
<td>Name</td>
<td>Date</td>
<td>Want to join?</td>
<td>Comments</td>
</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())
{	?>
	<tr valign='top' onmouseover="this.className='pa-row-highlight'" onmouseout="this.className='pa-nor'">
	<td><?php echo $i;?></td>
	<td><?php echo $objectData['name'];?></td>
	
	<td><?php echo $objectData['createDate'];?></td>
	<td><?php echo $objectData['status'];?></td>
	<td><?php echo nl2br($objectData['comments']);?></td>
	
	</tr>
	<?php
	$i++;
}
?>
</table>

<?php
// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links  && count($prev_next_links) > 1)
{	echo "Page: ";
	array_walk($prev_next_links, 'printArray'); 
	echo "<br>";
}
?>
</div>
<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
include "footer_calendar.php";
?>