Current File : /home/inlingua/public_html/icentex/inlingua_payment/admin.action.php
<?php
session_start();
ob_start(); 
// 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($conn);
//$dbObject->connect();

// Records selection sql
 $sqlQuery = "SELECT * FROM ingl_payment_gateway where login='".$conn->real_escape_string($_REQUEST['username'])."' and
password='".$conn->real_escape_string($_REQUEST['passwd'])."'
&& payment_status!='CAPTURED' &&  payment_status!='APPROVED' limit 0,1";

// Select records from table
$resultpW=$conn->query($sqlQuery);
$selectedRecords=$resultpW->num_rows;
$rdata=$resultpW->fetch_assoc();

//echo '<pre>'; print_r($rdata); exit;
//$selectedRecords = $dbObject->Select($sqlQuery);


// If no records selected, print message
if (!$selectedRecords)
{	
$_SESSION['wrongpass']="Username or Password Wrong";
header("Location: index.php");
//header(Location :)

}
if ($selectedRecords)
{
    

//$objectData=$dbObject->SelectNext();

$_SESSION['pid']=$rdata['recNo'];
$_SESSION['studentName']="".$rdata['Name']."";

$location="ingl_payment.php";

$queryW="select * from  ingl_payment_gateway where recNo='".$rdata['recNo']."' && status!=''";
$resultW=$conn->query($queryW);
$countW=$resultW->num_rows;
$numW=$resultW->fetch_assoc;

if($countW>0)
{
//$_SESSION['wrongpass']="Already Paid";
//header("Location: index.php");
header("Location:".$location."");   
}
else{
header("Location:".$location."");
}
}


// Print navigation bar
?>