Current File : /home/inlingua/public_html/sales/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 recNo,user_name,user_type FROM sales_login where user_id='".$_REQUEST['username']."' and password='".$_REQUEST['passwd']."' and user_type='Sales Admin' or user_type='Sales' and status='Enable' limit 0,1";
// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
// If no records selected, print message
if (!$selectedRecords)
{
$_SESSION['wrongpass']="User ID or Password Wrong";
header("Location: index.php");
//header(Location :)
}
if ($selectedRecords)
{
$objectData=$dbObject->SelectNext();
$_SESSION['id']=$objectData['recNo'];
$_SESSION['username']=$objectData['user_id'];
$_SESSION['user_type']=$objectData['user_type'];
$_SESSION['name1']=$objectData['user_name'];
if($objectData['user_type']=='Sales Admin' || $objectData['user_type']=='Sales')
header("Location: admin.php");
//header("Location: home.php");
}
// Print navigation bar
?>