branch access
This commit is contained in:
parent
541e146eb8
commit
3bb2ab7f66
@ -276,6 +276,8 @@ class Employee_model extends CI_Model
|
|||||||
// get branch details based on login user
|
// get branch details based on login user
|
||||||
public function get_req_master_branch_detail($reqRoleId, $reqUserID,$branchId)
|
public function get_req_master_branch_detail($reqRoleId, $reqUserID,$branchId)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$listcode="R003";
|
||||||
if ($reqRoleId == SUPER_ADMIN) {
|
if ($reqRoleId == SUPER_ADMIN) {
|
||||||
// res for SuperAdmin
|
// res for SuperAdmin
|
||||||
$this->db->select('BranchCode, BranchName');
|
$this->db->select('BranchCode, BranchName');
|
||||||
@ -290,10 +292,11 @@ class Employee_model extends CI_Model
|
|||||||
$subQuery = "SELECT t1.BranchCode, t1.BranchName
|
$subQuery = "SELECT t1.BranchCode, t1.BranchName
|
||||||
FROM T_BranchMaster as t1
|
FROM T_BranchMaster as t1
|
||||||
LEFT JOIN T_Staff_BranchAccess as t2 ON t2.StaffID = '$staffId'
|
LEFT JOIN T_Staff_BranchAccess as t2 ON t2.StaffID = '$staffId'
|
||||||
WHERE t1.BranchCode='$branchId' and t2.ListCode='$listcode'
|
WHERE t1.BranchCode='$branchId' and t2.ListCode='$listcode'
|
||||||
WHERE t2.BranchCode = t1.BranchCode
|
|
||||||
AND t1.IsActive = 1
|
AND t1.IsActive = 1
|
||||||
AND t2.IsActive = 1";
|
AND t2.IsActive = 1
|
||||||
|
group by t1.BranchCode";
|
||||||
$mBranchDetails = $this->db->query($subQuery);
|
$mBranchDetails = $this->db->query($subQuery);
|
||||||
$results['MeasterBranchDetailStatus'] = true;
|
$results['MeasterBranchDetailStatus'] = true;
|
||||||
$results['branch_details'] = $mBranchDetails->result();
|
$results['branch_details'] = $mBranchDetails->result();
|
||||||
|
|||||||
@ -25,13 +25,17 @@ class Login_model extends CI_Model
|
|||||||
$this->db->select('t1.MobileNumber, t1.Password,t1.ListCode');
|
$this->db->select('t1.MobileNumber, t1.Password,t1.ListCode');
|
||||||
$this->db->from('' . LOGIN . ' as t1');
|
$this->db->from('' . LOGIN . ' as t1');
|
||||||
$this->db->where('t1.MobileNumber', $mobile);
|
$this->db->where('t1.MobileNumber', $mobile);
|
||||||
|
$this->db->or_where('t1.StaffID', $mobile);
|
||||||
// $this->db->join('' . STAFF . ' as t2', 't1.StaffID = t2.StaffID', 'LEFT');
|
// $this->db->join('' . STAFF . ' as t2', 't1.StaffID = t2.StaffID', 'LEFT');
|
||||||
$this->db->where('t1.IsActive', 1);
|
$this->db->where('t1.IsActive', 1);
|
||||||
//$this->db->where('t2.IsActive', 1);
|
//$this->db->where('t2.IsActive', 1);
|
||||||
$loginDetails = $this->db->get(LOGIN)->first_row();
|
$loginDetails = $this->db->get(LOGIN)->first_row();
|
||||||
// print_r($loginDetails);exit();
|
$mobileno= $loginDetails->MobileNumber;
|
||||||
if ($loginDetails) {
|
|
||||||
if ($mobile == $loginDetails->MobileNumber) {
|
// print_r($loginDetails);
|
||||||
|
|
||||||
|
if($loginDetails) {
|
||||||
|
if ($mobile == $loginDetails->MobileNumber || $mobile == $loginDetails->StaffID) {
|
||||||
|
|
||||||
if ($password == $loginDetails->Password) {
|
if ($password == $loginDetails->Password) {
|
||||||
if($loginDetails->ListCode == SUPER_ADMIN){
|
if($loginDetails->ListCode == SUPER_ADMIN){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user