
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

include './../api.php';


//print_r($_POST);

$auth = auth($_POST['email_address'],$_POST['password']);


$_SESSION['auth'] = $auth['auth'];
$_SESSION['role_id'] = $auth['role_id'];
$_SESSION['username'] = $auth['username'];
$_SESSION['email_address'] = $auth['email_address'];
$_SESSION['user_id'] = $auth['user_id'];
$_SESSION['branch_code'] = $auth['branch_code'];
$_SESSION['language'] = $_POST['language'];
$_SESSION['report_source'] = $auth['report_source'];

if($_POST['redirect'] == ''){

if($auth['auth'] == 1){

header('Location: https://tajeercrm.core3.agency/admin/app/');


}else{


header('Location: https://tajeercrm.core3.agency/admin/app/login.php?reason=1');


}    
    
    
}else{
    
if($auth['auth'] == 1){

header('Location: '.$_POST['redirect']);


}else{


header('Location: https://tajeercrm.core3.agency/admin/app/login.php?reason=1');


}     
    
    
}



//print_r($auth);

?>