Current File : /home/inlingua/public_html/icentex/pg/ingl_course_payment.select.php
<?php
//  Created on: 16-05-2013
session_start();
/*
$loggedUserNo = $_SESSION['loggedUserNo'];
if ($loggedUserNo == "")
{	echo "Please <a href='index.php'>login</a> first.";
	exit(0);
}
*/

// Include header
include "header_in.php";
?>

<aside class="contentbox-head"> <span class="title">Online Frontend Course Payment</span>
          </aside>
<div id="contentnew">
<?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('../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();
//print_r($_SESSION);
// Records selection sql
$sqlQuery = "SELECT * FROM ingl_payment_online order by recNo desc";

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

// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
?>

<table border='0' class='pa-nor pa-table listing-table' width="100%">
<tr valign='top' class='rowH'>
<th>recNo</th>
<th>Name</th>
<th>Mobile</th>
<th>Email</th>
<th>Amount</th>
<th>Course Details</th>
<th>Address</th>
<th>Status</th>

</tr>
<?php
// If no records selected, print message
if (!$selectedRecords)
{	?>
	<tr><td colspan='5'>There are no entries</td></tr> 
	<?php
}
	
while($objectData=$dbObject->SelectNext())
{
	if($objectData['payment_status']=="")
	{
		$objectData['payment_status']="Ready To Pay";
	}
	?>
	<tr valign='top' onmouseover="this.className='pa-row-highlight'" onmouseout="this.className='pa-nor'">
	<td><?php echo $objectData['recNo'];?></td>
	
	<td><?php echo $objectData['Name'];?></td>
	<td><?php echo $objectData['mobile'];?></td>
	<td><?php echo $objectData['email'];?></td>
	<td><?php echo $objectData['amount_to_pay'];?></td>
	<td><?php echo $objectData['payment_details'];?></td>
        <td><?php echo $objectData['address'];?></td>
        <td><?php  if($objectData['payment_status']=="CAPTURED" || $objectData['payment_status']=="APPROVED")
	{
		
		
echo '<div style="font-weight:bold;color: green;">'.$objectData['payment_status'].'</div>';
	}else {
		
		echo $objectData['payment_status'];
		
	}

?></td>
	
	</tr>
	<?php
}
?>
</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>";
}
?>
<br>

<br>

<script type="text/javascript">
function confDel()
{	var agree = confirm("Click OK to delete permanently or cancel");
	if (agree)
		return true;
	else
		return false;
}
</script>
</div>
<?php 
$dbObject->CloseConnection();

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