Current File : /home/inlingua/www/icentex/admin/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();
$dbObject->connect();
// Records selection sql
$sqlQuery = "SELECT * FROM timesheet_user where username='".$_REQUEST['username']."' and password='".$_REQUEST['passwd']."' and (usertype='timesheet_admin' OR usertype='super_admin') ";
// Select records from table
$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['id']=$objectData['recNo'];
$_SESSION['username']=$objectData['username'];
$_SESSION['usertype']=$objectData['usertype'];
if($objectData['usertype']=='timesheet_admin') header("Location: admin.php");
if($objectData['usertype']=='certificate_admin') header("Location: admin_cert/admin_cert.php");
if($objectData['usertype']=='super_admin') header("Location: admin_super/admin_super.php");
}
// Print navigation bar
?>