diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index bbc4d122..f43068ef 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -453,7 +453,7 @@ class Sales_PD_Controller extends REST_Controller { //disable previous selfie img $update_fields2 = array('isactive' => 0); - $this->Sales_PD_Model->updateRecords($update_fields2,SALEPD_DOCS,array('img_name' => 'selfie_with_person_met')); + $this->Sales_PD_Model->updateRecords($update_fields2,SALEPD_DOCS,array('img_name' => 'selfie_with_person_met','fk_sales_pd_id' => $records['fk_sales_pd_id'])); } $id = $this->Sales_PD_Model->saveRecords($records,SALEPD_DOCS); @@ -522,13 +522,21 @@ class Sales_PD_Controller extends REST_Controller { unset($dup_of_section_names[9]);//unset photograph always if($product_short_name[0]['abbr'] == "WCTL"){ unset($dup_of_section_names[6]);} - // print_r($dup_of_section_names); - $data['dataStatus'] = true; - $data['records'] = array_values($dup_of_section_names); + //print_r($dup_of_section_names);die(); + if(count($dup_of_section_names)) + { + $res_data = array(); + foreach ($dup_of_section_names as $key => $value) + { + $res_data[] = array('section_id' => $key,'sectin_name' => $section_names[$key]); + } + $data['dataStatus'] = true; + $data['records'] = $res_data; $data['pd_status'] = 'DRAFT'; $data['status'] = REST_Controller::HTTP_OK; $this->response($data,REST_Controller::HTTP_OK); - + } + //die(); if(count($drafted_sections)) { diff --git a/api/application/helpers/custom_pdalerts_helper.php b/api/application/helpers/custom_pdalerts_helper.php index 1a2dfcba..88a101a9 100644 --- a/api/application/helpers/custom_pdalerts_helper.php +++ b/api/application/helpers/custom_pdalerts_helper.php @@ -37,6 +37,7 @@ class CUSTOM_PDALERTS if(ENVIRONMENT == 'production') { PDALERTS::sendMail($CI,'sinepd@sinemanagement.com',$msg,$core_details); + PDALERTS::sendMail($CI,'ssa@venbainfotech.com',$msg,$core_details); log_message('ERROR','###CUSTOM MAIL TRIGGERED to sinepd@sinemanagement.com'); } else if(ENVIRONMENT == 'testing') diff --git a/api/application/models/User_Management_Model.php b/api/application/models/User_Management_Model.php index a320c89c..2543304a 100644 --- a/api/application/models/User_Management_Model.php +++ b/api/application/models/User_Management_Model.php @@ -15,7 +15,7 @@ class User_Management_Model extends SPARQ_Model { $result_data = array(); - $this->db->select('USERPROFILE.userid, USERPROFILE.aws_name, USERPROFILE.first_name as user_first_name, USERPROFILE.last_name as user_last_name, USERPROFILE.email, USERPROFILE.mobile_no, USERPROFILE.profilepic, USERPROFILE.createdon, USERPROFILE.fk_createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as created_full_name, USERPROFILE.updatedon, USERPROFILE.fk_updatedby,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name)as update_full_name, USERPROFILE.fk_entity_id,ENTITY.full_name, USERPROFILE.isactive, USERPROFILE.fk_city,CITY.name as city_name, USERPROFILE.fk_state,STATE.name as state_name, PDOFFICIERSDETAILS.fk_pd_type_id,PDOFFICIERSDETAILS.fk_team_id,USERPROFILEROLES.user_role,USERPROFILE.fk_entity_type_id,ENTITYTYPE.name as entitytypename,ROLES.role_name'); + $this->db->select('USERPROFILE.userid, USERPROFILE.aws_name, USERPROFILE.first_name as user_first_name, USERPROFILE.last_name as user_last_name, USERPROFILE.email, USERPROFILE.mobile_no, USERPROFILE.profilepic, USERPROFILE.createdon, USERPROFILE.fk_createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as created_full_name, USERPROFILE.updatedon, USERPROFILE.fk_updatedby,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name)as update_full_name, USERPROFILE.fk_entity_id,ENTITY.full_name, USERPROFILE.isactive, USERPROFILE.fk_city,CITY.name as city_name, USERPROFILE.fk_state,STATE.name as state_name, PDOFFICIERSDETAILS.fk_pd_type_id,PDOFFICIERSDETAILS.fk_team_id,USERPROFILEROLES.user_role,USERPROFILE.fk_entity_type_id,ENTITYTYPE.name as entitytypename,ROLES.role_name,DESIGNATION.designation as designation_name,USERPROFILE.designation'); $this->db->from(USERPROFILE.' as USERPROFILE'); $this->db->join(ENTITY.' as ENTITY','USERPROFILE.fk_entity_id = ENTITY.entity_id and ENTITY.isactive = 1','LEFT'); $this->db->join(STATE.' as STATE','USERPROFILE.fk_state = STATE.state_id and STATE.isactive = 1','LEFT'); @@ -25,6 +25,7 @@ class User_Management_Model extends SPARQ_Model { $this->db->join(USERPROFILEROLES. ' as USERPROFILEROLES','USERPROFILEROLES.fk_userid = USERPROFILE.userid and USERPROFILEROLES.isactive =1'); $this->db->join(ENTITYTYPE.' as ENTITYTYPE','USERPROFILE.fk_entity_type_id = ENTITYTYPE.entity_type_id and ENTITYTYPE.isactive = 1','LEFT'); $this->db->join(PDOFFICIERSDETAILS.' as PDOFFICIERSDETAILS','PDOFFICIERSDETAILS.fk_user_id = USERPROFILE.userid and PDOFFICIERSDETAILS.isactive = 1','LEFT'); + $this->db->join(DESIGNATION.' as DESIGNATION','USERPROFILE.designation = DESIGNATION.designation_id','LEFT'); $this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role');