From 45148746f97174af88eca2662b0edfddb2e65571 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Wed, 28 Aug 2019 12:56:03 +0530 Subject: [PATCH] LOG ENABLED FOR SAVE AND GET JSON --- .../config/api_user_auth_config.php | 2 +- api/application/controllers/PD_Controller.php | 59 ++++++++++++++----- api/application/libraries/AWS_S3.php | 9 ++- api/application/models/PD_Model.php | 5 +- 4 files changed, 54 insertions(+), 21 deletions(-) diff --git a/api/application/config/api_user_auth_config.php b/api/application/config/api_user_auth_config.php index 97511e38..c55e172c 100644 --- a/api/application/config/api_user_auth_config.php +++ b/api/application/config/api_user_auth_config.php @@ -30,7 +30,7 @@ $config['api_user_auth_info'] = array( 'saveNewUser' => array(10), -'updateExistUser' => array(10,4,5), +//'updateExistUser' => array(10,4,5), //'getUsersDetails' => array(), //'triggerNewPD' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20), //'updatePDMaster' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20), diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index b194808f..15348b93 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1695,11 +1695,11 @@ public function assignPDTempalate($data) - //Find General Team ID + //echo 'Find General Team ID'; $fields = array('pdteam_id'); $where_condition_array = array('team_name' => "General"); $general_team_id = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTEAM); - + if(count($general_team_id)) { @@ -2373,6 +2373,11 @@ public function assignPDTempalate($data) $parent_forms = $this->config->item('parent_forms'); $additional_pd_id = $pdid; + $logger = MYLOG::logFunction(null,$pdid); + $log_info_array['pdid'] = $pdid; + $log_info_array['formid'] = $formid; + $logger->info("SAVE FORM JSON FUNCTION CALLED - ENV (".ENVIRONMENT.")",$log_info_array); + $inline_forms_photo_status_check = $this->PD_Model->selectCustomRecords(array('*'),array('fk_pd_id' => $pdid),T_PD_INLINE_PHOTO_FORM_STATUS); // print_r($inline_forms_photo_status_check); // echo count($inline_forms_photo_status_check); @@ -2557,6 +2562,8 @@ public function assignPDTempalate($data) $temp_array = array('fk_form_id'=>$formid,'company_id' => $company_id,'fk_pd_id'=>$pdid,'fk_createdby'=>$createdby,'json'=>$records,'processed_json' => $processed_json,'rental_count_id' => $rental_count_id); $id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON); + + $logger->info("SAVE FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); if($id != "" || $id != null) { // Update form dummy entry against Additional PD common form ID to avoid every time fetch data from additional PD forms - scenarios like exist loan obligations, other family details @@ -2602,7 +2609,10 @@ public function getPDFormDetailsJSON_post() $pd_id = $parent_form_index != null ? $parent_pd_id : $pd_id; } - //echo $pd_id;echo $pd_form_id; + $logger = MYLOG::logFunction(null,$pd_id); + $log_info_array['pdid'] = $pdid; + $log_info_array['formid'] = $pd_form_id; + $logger->info("GET FORM JSON FUNCTION CALLED - ENV (".ENVIRONMENT.")",$log_info_array); if($pd_form_id == 18) { @@ -2620,7 +2630,8 @@ public function getPDFormDetailsJSON_post() if(count($rec)) { - $temp_json = $this->renewGeneralFormForAddtionalPD($rec[0]['json']); + $temp_json = $this->renewGeneralFormForAddtionalPD($rec[0]['json']); + $logger->info("GET FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $temp_json; @@ -2641,7 +2652,7 @@ public function getPDFormDetailsJSON_post() if(count($form_count)) { - + $logger->info("GET FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = json_decode($form_count[0]['json']); @@ -2662,7 +2673,8 @@ public function getPDFormDetailsJSON_post() $address[] = array('address' => $temp_address['addressline1'],'address_type' => "",'address_type_others' => '','state'=>$temp_address['fk_state'],'city'=>$temp_address['fk_city'],'citySearch' =>'','stateSearch'=>'','citySearch'=>'','pinSearch' => '','pincode'=>$temp_address['pincode'],'pincode_others' => '','locality' => '','locality_others'=>'','pd_location' => '','comment_locality' => '','estimated_area' => '','uom' => '','uom_others'=>''); $records['addresses'] = $address; - $records['address_form_remark'] = ''; + $records['address_form_remark'] = ''; + $logger->info("GET FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $records; @@ -2724,7 +2736,7 @@ public function getPDFormDetailsJSON_post() { $json = json_decode($rec[0]['json']); } - + $logger->info("GET FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $json; @@ -2732,6 +2744,7 @@ public function getPDFormDetailsJSON_post() } else { + $logger->info("GET FORM JSON FUNCTION RESPONSE - ENV (".ENVIRONMENT.")",$log_info_array); $data['dataStatus'] = false; $data['status'] = REST_Controller::HTTP_NO_CONTENT; $data['msg'] = 'No Data Available'; @@ -7480,31 +7493,49 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() if($records) { $report_data = $records; + + //attach outer HTML tags $start_pos = strpos($report_data,''); $end_pos = $start_pos + 10; $report_data = substr_replace($report_data,'',$end_pos,0); $report_data = substr_replace($report_data,'',0,0); $report_data = substr_replace($report_data,'',-1,0); - - $total_replaces = substr_count($t,''); + //replace tooltip and span tags + $total_replaces = substr_count($report_data,''); for($i = 0 ;$i < $total_replaces;$i++) { - $start_pos = strpos($t,''); + $start_pos = strpos($report_data,''); - $end_pos = strpos($t, '', strpos($t,'')); + $end_pos = strpos($report_data, '', strpos($report_data,'')); $end_pos = $end_pos + 14; //echo $start_pos.'-';echo $end_pos.'-';echo ($end_pos - $start_pos).'-'; - $t = substr_replace($t,'',$start_pos,($end_pos - $start_pos)); + $report_data = substr_replace($report_data,'',$start_pos,($end_pos - $start_pos)); - $t = substr_replace($t,'',strpos($t,''),(strlen(''))); + $report_data = substr_replace($report_data,'',strpos($report_data,''),(strlen(''))); } } else { $report_data = $this->getLatestPDReportHTMLFile($pdid,$random_string,true); + + //replace tooltip and span tags + $total_replaces = substr_count($report_data,''); + for($i = 0 ;$i < $total_replaces;$i++) + { + $start_pos = strpos($report_data,''); + + $end_pos = strpos($report_data, '', strpos($report_data,'')); + $end_pos = $end_pos + 14; + //echo $start_pos.'-';echo $end_pos.'-';echo ($end_pos - $start_pos).'-'; + + $report_data = substr_replace($report_data,'',$start_pos,($end_pos - $start_pos)); + + $report_data = substr_replace($report_data,'',strpos($report_data,''),(strlen(''))); + + } } @@ -8463,7 +8494,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() { $data['dataStatus'] = false; $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; - $data['msg'] = 'No Lender Profile was found under selected branch. Create Lender profile in this branch'; + $data['msg'] = 'Credit Person Lender Profile was not found?. Create Credit Person Lender profile'; $this->response($data,REST_Controller::HTTP_OK); } diff --git a/api/application/libraries/AWS_S3.php b/api/application/libraries/AWS_S3.php index bf4fd106..61b86076 100644 --- a/api/application/libraries/AWS_S3.php +++ b/api/application/libraries/AWS_S3.php @@ -203,14 +203,13 @@ class AWS_S3 return $result; } - - + public function getCORES($BUCKETNAME) { - $result = $this->S3->getBucketCors([ - 'Bucket' => $BUCKETNAME]); - //////print_r($result); + $result = $this->S3->getBucketCors([ + 'Bucket' => $BUCKETNAME]); + //////print_r($result); } } diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 21a6c459..5e5fa23e 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -41,7 +41,10 @@ class PD_Model extends SPARQ_Model { if($pdofficerid != "" || $pdofficerid != null) { - $this->db->WHERE('PDTRIGGER.fk_pd_allocated_to',$pdofficerid); + if($pdofficerid != 52) //support pd officer user id + { + $this->db->WHERE('PDTRIGGER.fk_pd_allocated_to',$pdofficerid); + } } if($lenderid != "" || $lenderid != null)