diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 292d7e9f..dcfab8cf 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2013,17 +2013,19 @@ class PD_Controller extends REST_Controller $this->load->model('User_Management_Model'); $user_details = $this->User_Management_Model->getUserDetails($createdby); - if($user_details['data'][0]['user_role'] == 26)//Credit Manager - { - $pdofficerid = $createdby; + // if($user_details['data'][0]['user_role'] == 26)//Credit Manager + // { + // $pdofficerid = $createdby; + // } + // else if($user_details['data'][0]['user_role'] == 27)//Reg Credit Manager + // { + // $lender_details = array('city' => $user_details['data'][0]['fk_city']); + // } - } - else if($user_details['data'][0]['user_role'] == 27)//Reg Credit Manager - { - $lender_details = array('city' => $user_details['data'][0]['fk_city']); - - } + ### if Cond role 29 = SMC Vendor officer. Data filtering this officer Only. if($user_details['data'][0]['user_role'] == 29) $pdofficerid = $createdby; + ### if Cond role 28 = SMC Vendor Manager. Data filtering using logged-in-id to find agency-id based on . + if($user_details['data'][0]['user_role'] == 28) $pdagencyid = $user_details['data'][0]['smc_agency_id']; $createdby = ''; } @@ -2143,15 +2145,19 @@ class PD_Controller extends REST_Controller if ($pd_lender == $smc_lender_id) { $this->load->model('User_Management_Model'); $user_details = $this->User_Management_Model->getUserDetails($createdby); - if($user_details['data'][0]['user_role'] == 26)//Credit Manager - { - $pd_officer_id = $createdby; - } - else if($user_details['data'][0]['user_role'] == 27)//Reg Credit Manager - { - $pd_city = array( $user_details['data'][0]['fk_city'] ); - } + // if($user_details['data'][0]['user_role'] == 26)//Credit Manager + // { + // $pd_officer_id = $createdby; + // } + // else if($user_details['data'][0]['user_role'] == 27)//Reg Credit Manager + // { + // $pd_city = array( $user_details['data'][0]['fk_city'] ); + // } + + ### if Cond role 29 = SMC Vendor officer. Data filtering this officer Only. if($user_details['data'][0]['user_role'] == 29) $pd_officer_id = $createdby; + ### if Cond role 28 = SMC Vendor Manager. Data filtering Agency ID. + if($user_details['data'][0]['user_role'] == 28) $pd_agency_id = $user_details['data'][0]['smc_agency_id']; $createdby = ''; }