diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index d52c02c5..6fefafc1 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2358,8 +2358,29 @@ class PD_Model extends SPARQ_Model { $this->db->WHERE('TEMPLATE_JSON_V2.map_id',$map_id); $this->db->ORDER_BY('PDFORMS.pd_form_order'); $template_forms = $this->db->GET()->result_array(); - - // print_r($template_forms);die(); + if(count($template_forms) > 0){ + array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '18','pd_form_order' => '2','pd_form_level_order' => '1','form_name' => 'General Information','is_form_disabled'=>0)); + array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '24','pd_form_order' => '21','pd_form_level_order' => '3','form_name' => 'Credit Manager Queries','is_form_disabled'=>0)); + array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '26','pd_form_order' => '24','pd_form_level_order' => '1','form_name' => 'Photograph','is_form_disabled'=>0)); + } + $buiness_related_form = array(22,14,1,2,11,16); + if(!strcasecmp($pd_master_detials[0]['lender_short_name'], 'CLIX')){ + array_push($buiness_related_form,21);//buiness banking form id pushed for filter. + } + if(!strcasecmp($pd_master_detials[0]['lender_short_name'], 'CLIX') || (!strcasecmp($pd_master_detials[0]['lender_short_name'], 'MWISE'))){ + array_push($buiness_related_form,23);//Future Plans & Business Environments form id pushed for filter. + } + if(!strcasecmp($pd_master_detials[0]['customer_segment_abbr'], 'SE-AI')){ + array_push($buiness_related_form,16);//Assessed Income form id pushed for filter. + } + for($j=0;$j $value) { - $this->db->SELECT('count(*) as count'); + $this->db->SELECT('count(*) as count,fk_form_id'); $this->db->FROM(PDFORMDETAILSJSON.' as PDFORMDETAILSJSON'); $this->db->WHERE('PDFORMDETAILSJSON.fk_pd_id',$pdid); $this->db->WHERE('PDFORMDETAILSJSON.fk_form_id',$value['form_id']); $this->db->WHERE('PDFORMDETAILSJSON.isactive',1); $template_forms_count = 0; $template_forms_count = $this->db->GET()->result_array(); + // print_r($template_forms_count);die(); //if($value['form_id'] == 4){print_r($template_forms_count);} if(count($template_forms_count) && $template_forms_count[0]['count'] != 0) @@ -2600,4 +2622,11 @@ class PD_Model extends SPARQ_Model { $query = $this->db->get(); return $query->result(); } + + public function filterArrayByKeyValue($array, $key, $keyValue) +{ + return array_filter($array, function($value) use ($key, $keyValue) { + return $value[$key] == $keyValue; + }); +} } \ No newline at end of file