JezK
Edit File: loginapp.php
<?php include_once("adminObj.php"); include_once("checkSession.php"); if(isset($_REQUEST['loginRequest'])) { $res=$customerObj->userLogin($_POST,$type=1); //$res=$customerObj->userLogin($_POST); // print_r($res);exit; if(isset($res['status']) && $res['status']==1) { $_SESSION['user_id']=$res['details']['user_id']; $_SESSION['email']=$res['details']['email']; $_SESSION['name']=$res['details']['first_name']; $_SESSION['role']=$res['details']['role_id']; $_SESSION['picture']=$res['details']['upload_pic']; $_SESSION['created_by'] = $res['details']['created_by']; $_SESSION['token'] = $res['details']['token']; $_SESSION['company_id'] = $res['details']['company_id']; $_SESSION['languageStatus']=1; $customerObj->redirect('../warehouse_admin/dashboard.php'); } else if(isset($res['status']) && $res['status']==2) { $customerObj->setFlashMessage('Please enter Correct password to proceed further','danger'); $customerObj->redirect('../owner_login.php'); } else if(isset($res['status']) && $res['status']==3) { $customerObj->setFlashMessage('Your account is awaiting confirmation, please check your email box for activation link.','danger'); $customerObj->redirect('../owner_login.php'); } else if(isset($res['status']) && $res['status']==4) { $customerObj->setFlashMessage('Please check your email box to generate password.','danger'); $customerObj->redirect('../owner_login.php'); } else if(isset($res['status']) && $res['status']==6){ $customerObj->setFlashMessage('Your account is Inactivated ','danger'); $customerObj->redirect('../owner_login.php'); } else { $customerObj->setFlashMessage(' Login failed your username Or password does not match','danger'); $customerObj->redirect('../owner_login.php'); } } else if(isset($_REQUEST['loginBussinessRequest'])) { $res=$customerObj->userLogin($_POST,$type=4); if($res['status']==1) { $_SESSION['customer_user_id']=$res['details']['user_id']; $_SESSION['customer_email']=$res['details']['email']; $_SESSION['customer_name']=$res['details']['first_name'].' '.$res['details']['last_name']; $_SESSION['customer_role']=$res['details']['role_id']; $_SESSION['customer_image']=$res['details']['upload_pic']; $_SESSION['customer_token']=$res['details']['token']; $_SESSION['customer_languageStatus']=1; $customerObj->redirect('../warehouse.php'); } else if($res['status']==2) { $customerObj->setFlashMessage('Entered password was wrong','danger'); $customerObj->redirect('../login.php'); } else if($res['status']==3) { $customerObj->setFlashMessage('Your account is awaiting confirmation, please check your email box for activation link.','danger'); $customerObj->redirect('../login.php'); } else { $customerObj->setFlashMessage('Login details are wrong','danger'); $customerObj->redirect('../login.php'); } } else if(isset($_REQUEST['customerLoginRequest'])) { $res=$customerObj->userLogin($_POST,$type=3); if($res['status']==1) { $_SESSION['customer_user_id']=$res['details']['user_id']; $_SESSION['customer_email']=$res['details']['email']; $_SESSION['customer_name']=$res['details']['first_name'].' '.$res['details']['last_name']; $_SESSION['customer_role']=$res['details']['role_id']; $_SESSION['customer_image']=$res['details']['upload_pic']; $_SESSION['customer_token']=$res['details']['token']; $_SESSION['customer_languageStatus']=1; // print_r($_SESSION); // exit; $customerObj->redirect('../warehouse.php'); } else if($res['status']==2) { $customerObj->setFlashMessage('Entered password was wrong','danger'); $customerObj->redirect('../login.php?id=2'); } else if($res['status']==3) { $customerObj->setFlashMessage('Your account is awaiting confirmation, please check your email box for activation link.','danger'); $customerObj->redirect('../login.php?id=2'); } else { $customerObj->setFlashMessage('Login details are wrong','danger'); $customerObj->redirect('../login.php?id=2'); } } ?>