diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index e003b0d5..687c6e14 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5886,7 +5886,7 @@ public function getPDFormDetailsJSON_post() { //print_r($this->aws_s3->createNewBucket('xmldatatest007'));die(); - //satellite_image::getSatelliteImage(1213);die(); + //satellite_image::getSatelliteImage(1704);die(); //echo $this->assignPDTempalate(1325);die(); //$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com // PDALERTS::sendSalesPDMail($this,2);die(); @@ -5896,14 +5896,14 @@ public function getPDFormDetailsJSON_post() // $this->load->helper('push_notification'); // PUSH_NOTIFICATION::notifyWeb("fJJeUjCWSSs:APA91bHJIHVBJ4KuBbz5sEQSTXG171KpUyraekuejPedkCVrFrULvh8R8JmIHZlovA3QJogr007Yv6IN0Bhja_oBScMBFS2MAWAyPOWLDwsY-OeoPbOx8vzNalvJ7yt0jcB_atJcTbAD","The New PD 255 has been triggered...",array());die(); // print_r($this->db->error());die(); - //$s3result= $this->aws_s3->uploadFileToS3Bucket(array('bucket_name' =>'xmldatatest007' ,'key' => 'packages/tourone.xml','sourcefile' => 'C:\xampp\htdocs\XMLTOARRAY\mydata.xml',));die(); + //$s3result= $this->aws_s3->uploadFileToS3Bucket(array('bucket_name' =>'xmldatatest007' ,'key' => 'packages/tourone.xml','sourcefile' => 'C:\xampp\htdocs\XMLTOARRAY\mydata.xml',));die(); //$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI('xmldatatest007','packages/tourone.xml','+1 minutes'); //echo $singed_uri; // $new = simplexml_load_string(file_get_contents($singed_uri)); // $con = json_decode(json_encode($new),true); // print_r($con) ; // die(); - set_time_limit(60); + //set_time_limit(60); $records = $this->post('records'); $pdid = $records['pd_id']; @@ -6027,14 +6027,14 @@ public function getPDFormDetailsJSON_post() $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); $data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly(); - //print_r($data['pd_score']); - //die(); + // print_r($data['pd_score']); + // die(); $data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid); //print_r($data['pd_master_details'][0]['is_score_card_enabled']);die(); // echo "**************************"; //$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] ); - if($data['pd_master_details'][0]['is_score_card_enabled'] == 0 && ($data['pd_master_details'][0]['customer_segment_abbr'] != "SAL"))// && $data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CHQ")) //&& ($data['pd_master_details'][0]['customer_segment_abbr'] != '')) + if($data['pd_master_details'][0]['is_score_card_enabled'] == 1 && ($data['pd_master_details'][0]['customer_segment_abbr'] != "SAL"))// && $data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CHQ")) //&& ($data['pd_master_details'][0]['customer_segment_abbr'] != '')) { //echo $data['pd_master_details'][0]['is_score_card_enabled'].'-'.$data['pd_master_details'][0]['customer_segment_abbr'];die(); $data['pd_score'] = $this->calculateScore($pdid); @@ -7437,7 +7437,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $loan_amt_from_loam_form = $loan_amt_from_loam_form['loan_amount']; //echo $loan_amt_from_loam_form; //seperate PD Scorable quesitons from JSON - $score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details[0]['is_otp_done']); + $score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details); //print_r($score_questions);die(); // echo "###################################"; //Get Pesrsonal Assets Grid Masters Details @@ -7504,10 +7504,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() //Get All Score able Question from various PD Forms - 3 Questions Pending - public function seperateScoreQuestions($form_data,$OTP) + public function seperateScoreQuestions($form_data,$pd_master_details) { $score_questions = array(); - + $OTP = $pd_master_details[0]['is_otp_done']; + $is_this_tele_pd = $pd_master_details[0]['fk_pd_type'] == 3 ? true : null; #####General Form Questions######## $general_form = (json_decode($form_data[18][0]['processed_json'],true)); // echo "seperateScoreQuestions"; @@ -7530,6 +7531,9 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $score_questions['general']['person_met_is_applicant'] = 'yes'; } } + + //if tele pd remove person_met_is_applicant + if($is_this_tele_pd){ unset($score_questions['general']['person_met_is_applicant']);} //print_r($qualification_temp_array); $qualification_temp_array = array_map(function($item){ return $item != "" || $item != null ? $item : 6; @@ -7558,10 +7562,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() if(isset($address_form['is_pd_done_on_initiated_address']) && $address_form['is_pd_done_on_initiated_address'] != 1) { - // 4 - QNO(1.2) - Comment on locality - $score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master']; - // 5 - QNO(1.3) - pd location approach - $score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master']; + + if(!$is_this_tele_pd) + { + // 4 - QNO(1.2) - Comment on locality + $score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master']; + // 5 - QNO(1.3) - pd location approach + $score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master']; + } } else //get it from alternative address @@ -7583,23 +7591,32 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() // 6 - QNO(1.4) - customer behaviour - $score_questions['general']['customer_behaviour'] = $final_remarks_form['final_custormer_remark_type_master']; + + $score_questions['general']['customer_behaviour'] = $final_remarks_form['final_custormer_remark_type_master']; + // 7 - QNO(3.1) - pd_officer_recommadations $score_questions['final_remarks']['pd_officer_recommandations'] = $final_remarks_form['pd_officers_recommendation_master']; // 8 - QNO(2.11) - pd location approach - $score_questions['business']['location_suited_for_busienss'] = $final_remarks_form['is_service_provided']; + if(!$is_this_tele_pd) + { + $score_questions['business']['location_suited_for_busienss'] = $final_remarks_form['is_service_provided']; + } #####End of Final Remarks Form Questions######## #####Neighbourhood Form Questions######## - $neighbourhood_form = (json_decode($form_data[19][0]['processed_json'],true)); - //print_r($neighbourhood_form); - - // 9 - QNO(1.5) - neibourhood_check_as_per_pd_officer - $score_questions['general']['neibourhood_check_as_per_pd_officer'] = isset($neighbourhood_form['neighbourhood_status']) ? $neighbourhood_form['neighbourhood_status'] : 'Negative'; + if(!$is_this_tele_pd) + { + $neighbourhood_form = (json_decode($form_data[19][0]['processed_json'],true)); + //print_r($neighbourhood_form); + + + // 9 - QNO(1.5) - neibourhood_check_as_per_pd_officer + $score_questions['general']['neibourhood_check_as_per_pd_officer'] = isset($neighbourhood_form['neighbourhood_status']) ? $neighbourhood_form['neighbourhood_status'] : 'Negative'; + } #####End of Neighbourhood Form Questions######## @@ -7614,7 +7631,10 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $score_questions['business']['business_seasonality'] = $business_form['seasonality']; // 12 - QNO(2.3) - employees_total - $score_questions['business']['employees_total'] = $business_form['employees_total']; + if(!$is_this_tele_pd) + { + $score_questions['business']['employees_total'] = $business_form['employees_total']; + } // 13 - QNO(2.4) - all business certificate @@ -7663,8 +7683,12 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $score_questions['business']['owned_property'] = $property_count ? 'yes':'no'; // 15 - QNO(2.6) - owned_vechile $score_questions['business']['owned_vechile'] = $vechile_count ? 'yes':'no'; + // - QNO (2.12) - business_activity seen - $score_questions['business']['business_activity_has_seen'] = isset($business_assest_form['business_assets_for_address'][0]['business_is_pd_visited'])? $business_assest_form['business_assets_for_address'][0]['business_is_pd_visited']: 'no'; + if(!$is_this_tele_pd) + { + $score_questions['business']['business_activity_has_seen'] = isset($business_assest_form['business_assets_for_address'][0]['business_is_pd_visited'])? $business_assest_form['business_assets_for_address'][0]['business_is_pd_visited']: 'no'; + } } #####End of Business Assets Form Questions######## @@ -8876,6 +8900,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() //update geo location to pd master table $this->PD_Model->updateRecords(array('start_location' => $records['link']),PDTRIGGER,array('pd_id' => $records['fk_pd_id'])); + satellite_image::getSatelliteImage($records['fk_pd_id']); } else if(strpos($records['image_key'], 'common_image') !== false) { diff --git a/api/application/helpers/satellite_image_helper.php b/api/application/helpers/satellite_image_helper.php index c6506198..9273a2c8 100644 --- a/api/application/helpers/satellite_image_helper.php +++ b/api/application/helpers/satellite_image_helper.php @@ -56,12 +56,12 @@ class satellite_image } - + $geo_location = preg_replace('/\s+/', '', $geo_location); $url = "https://maps.googleapis.com/maps/api/staticmap?center=".$geo_location."&zoom=14&markers=color:red|".$geo_location."&size=800x300&maptype=roadmap&key=".$google_map_static_api_key; //echo $url; $ou = file_put_contents($path_to_check.'/satellite.png', file_get_contents($url)); $satellite_script = $url; - + //echo $url; // //convert as base 64 image. diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php index d2a82741..19e38af5 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php @@ -542,10 +542,11 @@ if ( isset($pdf) ) { PD Initiated Date : '.$pd_master_details[0]['createdon'].''; - echo 'PD Type : Telephonic '; + echo 'Tele PD Date : '.$pd_master_details[0]['pd_visit_date'].''; echo 'PD Report Date : '.$pd_master_details[0]['pd_report_generated_date'].''; echo 'PD Initiated by : '.$pd_master_details[0]['branch_name'].' Branch'; + echo 'PD Type : Telephonic '; echo 'Loan Application ID : '.$pd_master_details[0]['lender_applicant_id'].''; echo 'Product : '.$pd_master_details[0]['product_name'].''; echo 'Customer Segment : '.(explode('-',$pd_master_details[0]['customer_segment_name'])[0]).''; @@ -1089,7 +1090,7 @@ if ( isset($pdf) ) {  Satellite Image of location of Where PD was Done


- +
@@ -2288,7 +2289,7 @@ if($total_no_of_business > 0) { } - else{ echo "

Financial statements not provided by Loan Applicants to PD officer.

";} + //else{ echo "

Financial statements not provided by Loan Applicants to PD officer.

";} ?> @@ -2434,7 +2435,7 @@ if($total_no_of_business > 0) { if($financial_kuccha_info['kuccha_records_shown'] == 'yes') { - echo '

Photograph of Kuchha Bills Allowed (Yes/No) : '. ($financial_kuccha_info['kuccha_bill_allowed'] == 'yes' ? 'Yes, enclosed with report': 'No'); + echo '

Photograph of Kuchha Bills Shared (Yes/No) : '. ($financial_kuccha_info['kuccha_bill_allowed'] == 'yes' ? 'Yes, enclosed with report': 'No'); // echo '

Number of Kuccha Bills and Values therein, justifies the customer declared turnover (Yes / No): '. ( $financial_kuccha_info['customer_declared_turnover'] == 'yes' ? 'Yes': 'No'); } @@ -2557,7 +2558,7 @@ if($total_no_of_business > 0) { As per person met, Applicant does not have any business account.

'; + echo '

As per loan applicant(s), Applicant does not have any business account.

'; } if($business_banking_common_remarks != ""){ echo '

'.$business_banking_common_remarks.'

'; } @@ -4281,7 +4282,7 @@ if($total_no_of_business > 0) {
-

PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS

+

PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR & OVERALL PD STATUS

Name Board of Business/Entrance