diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 01d73cf6..7686ca8c 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2780,7 +2780,7 @@ public function getPDFormDetailsJSON_post() $where_condition_array = array('fk_form_id'=>$pd_form_id,'fk_pd_id'=>$pd_id,'company_id' => $company_id,'isactive' => 1); } $rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON); - // print_r($rec); + //print_r($rec);die(); if(isset($rec[0]['json'])) { @@ -5704,6 +5704,7 @@ public function getPDFormDetailsJSON_post() //$this->load->helper('applicantname_grabber'); // print_r(APPLICANTNAME_GRABBER::getLatestApplicantsName(1390));die(); //satellite_image::getSatelliteImage(1442);die(); + set_time_limit(60); $records = $this->post('records'); $pdid = $records['pd_id']; @@ -5819,7 +5820,7 @@ public function getPDFormDetailsJSON_post() //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'] == 1) + if($data['pd_master_details'][0]['is_score_card_enabled'] == 1 && ($data['pd_master_details'][0]['customer_segment_abbr'] != '')) { $data['pd_score'] = $this->calculateScore($pdid); //print_r( $data['pd_score']);die(); diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index ffb20ee5..eda19e16 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -174,7 +174,9 @@ class Sales_PD_Controller extends REST_Controller { ini_set('max_execution_time', 0); $bucket_name = LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id']; $pdf_name = strtolower(trim($sales_pd_data[0]['applicant_name'])); - $pdf_name = str_replace(' ', '_', $pdf_name); + $pdf_name .= '-'.$sales_pd_data[0]['abbr']; + $pdf_name .= '-'.(date('dmY',strtotime($sales_pd_data[0]['completed_date']))); + //$pdf_name = str_replace(' ', '_', $pdf_name); $key = 'sales_pd/'.$sales_pd_id.'/'.$pdf_name.'.pdf'; @@ -198,7 +200,7 @@ class Sales_PD_Controller extends REST_Controller { //print_r($section);die(); $view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section); } - + //print_r($view_data['section1']);die(); $view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite'),SALEPD_DOCS); $view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite'),SALEPD_DOCS); $view_data['product_id'] = $sales_pd_data[0]['product_id']; @@ -207,7 +209,7 @@ class Sales_PD_Controller extends REST_Controller { //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr']; $view_name = $sales_pd_data[0]['short_name']; $html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); - echo $html_content;die(); + //echo $html_content;die(); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; @@ -294,10 +296,10 @@ class Sales_PD_Controller extends REST_Controller { // //print_r($section_array);die(); //echo '###'.$section_array['section_id'].'####'; - if($section_array['section_id'] == 2) + if($section_array['section_id'] == 6) { - //print_r(json_decode($section_array['section_data'],true)); - //die(); + // print_r(json_decode($section_array['section_data'],true)); + // die(); } if($section_array['section_id']) { @@ -362,7 +364,7 @@ class Sales_PD_Controller extends REST_Controller { //echo $group_key; $group_temp[ $q_value['question_key'] ] = $q_value['answer_value']; - if(isset($q_value['subfield_key'])){ $group_temp[ $q_value['question_key'] ] = $q_value['"subfield_value"']; } + if(isset($q_value['subfield_key'])){ $group_temp[ $q_value['question_key'] ] = $q_value['subfield_value']; } //print_r($group_temp); } //print_r($group_temp); @@ -500,6 +502,7 @@ class Sales_PD_Controller extends REST_Controller { else { $records['status'] = 'COMPLETED'; + $records['completed_date'] = date('Y-m-d h:i:s'); $id = $this->Sales_PD_Model->updateRecords($records,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id'])); satellite_image::getSatelliteImage($records['sales_pd_id'],2); } @@ -582,7 +585,7 @@ class Sales_PD_Controller extends REST_Controller { } else { - if($g_value['question_key'] == 'person_met_during_visit') + if($g_value['question_key'] == 'main_loan_applicant') { $applicant_name = $g_value['answer_value']; @@ -693,8 +696,8 @@ class Sales_PD_Controller extends REST_Controller { $question['is_repeatable'] = ""; $question['group_title'] = null; - //$question['answer_value'] = $value['img']; - $question['answer_value'] = "IMG"; + $question['answer_value'] = $value['img']; + //$question['answer_value'] = "IMG"; $question['question'] = $photo_names [ $value['img_name'] ]; $question['question_key'] = $value['img_name']; $question['type'] = 6; @@ -709,25 +712,21 @@ class Sales_PD_Controller extends REST_Controller { } else { - - // $temp['is_repeatable'] = ""; - // $temp['group_title'] = null; - // $temp['group_type'] = 6; $questions[ $photo_names [ $value['img_name'] ] ] ['is_repeatable'] = 1; $questions[ $photo_names [ $value['img_name'] ] ] ['group_title'] = $photo_names [ $value['img_name'] ]; $questions[ $photo_names [ $value['img_name'] ] ] ['group_type'] = 6; - $questions[ $photo_names [ $value['img_name'] ] ] ['question_group']['questions'][] = $question; + $questions[ $photo_names [ $value['img_name'] ] ] ['questions_group'][]['questions'][] = $question; } } - $temp['questions'] = $questions; + $temp['questions'] = array_values($questions); $temp['section_id'] = 9; $temp['section_name'] = 'Photography'; $temp['onsubmit'] = ''; $temp['sales_pd_id'] = $records['sales_pd_id']; - + //print_r($temp);die(); $temp2['section_data'] = json_encode($temp); $temp2['id'] = null; diff --git a/api/application/views/sale_pd_templates/MWISE.php b/api/application/views/sale_pd_templates/MWISE.php index 6b985ce1..e351bac5 100644 --- a/api/application/views/sale_pd_templates/MWISE.php +++ b/api/application/views/sale_pd_templates/MWISE.php @@ -116,6 +116,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| Satellite Image of PD Location |
|---|
GPS Coordinates of location where PD Visit was done :