SALES PD 2ND MAIL CHANGES

This commit is contained in:
Velz2020 2019-12-21 11:24:40 +05:30
parent 8679010a6e
commit 074b2e350e
3 changed files with 41 additions and 56 deletions

View File

@ -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();

View File

@ -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;

View File

@ -116,6 +116,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="3"> Application ID</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['application_id']?> </td>
</tr>
<tr>
<tr>
<td colspan="3"> Main Applicat Name</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['main_loan_applicant']?> </td>
</tr>
<tr>
<td colspan="3"> Name of the Company/Firm</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['company_name']?></td>
@ -377,32 +382,40 @@ if(isset($section6))
<tr>
<th class="thlargefont" colspan="10"> Property Information</th>
</tr>
<?php foreach($section6 as $property_key => $property_value) {
echo '<br><br><tr><th colspan="10"> Property '.($property_key + 1).'</th></tr>';
//echo 'Property '. ($property_key + 1).'<br>';
?>
<tr>
<td colspan="1" >Property Address (With Landmark &amp; PIN)</td>
<td class="tdcenteralign" colspan="9" ><?php echo $section6['property_address']?></td>
<td class="tdcenteralign" colspan="9" ><?php echo $property_value['property_address']?></td>
</tr>
<tr>
<td colspan="1" >Property Type</td>
<td class="tdcenteralign" colspan="4" ><?php echo $section6['property_type']?></td>
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['property_type']?></td>
<td colspan="1" >Occupancy Status</td>
<td class="tdcenteralign" colspan="4" ><?php echo $section6['occupancy_status']?></td>
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['occupancy_status']?></td>
</tr>
<tr>
<td colspan="1" >Permitted Property Usage</td>
<td class="tdcenteralign" colspan="4" ><?php echo $section6['permitted_property_usage']?></td>
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['permitted_property_usage']?></td>
<td colspan="1" >Actual Property Usage</td>
<td class="tdcenteralign" colspan="4" ><?php echo $section6['actual_property_usage']?></td>
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['actual_property_usage']?></td>
</tr>
<tr>
<td colspan="1" >Built-Up Area (Sq. Ft.)</td>
<td class="tdcenteralign" colspan="4" ><?php echo $section6['built_up_area']?></td>
<td colspan="1" >Built-Up Area</td>
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['built_up_area'] .' '.$property_value['built_up_area_uom']; ?></td>
<td colspan="1" >Approx Mkt. Val (Rs)</td>
<td class="tdcenteralign" colspan="4" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($section6['approx_mkt_val'])?></td>
<td class="tdcenteralign" colspan="4" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($property_value['approx_mkt_val'])?></td>
</tr>
<tr>
<td colspan="1" >Property Ownership Status (Enter the names of the Property Owner(s) and their relationships)</td>
<td class="tdcenteralign" colspan="9"><?php echo $section6['Property_Ownership_Status']?></td>
<td class="tdcenteralign" colspan="9"><?php echo $property_value['Property_Ownership_Status']?></td>
</tr>
<?php
echo '<br>';
}?>
</tbody>
</table>
<?php }
@ -433,34 +446,6 @@ if(isset($section6))
</table>
<br><br>
<?php
// $photos = array();
// if(isset($section9) && count($section9))
// {
// foreach ($section9 as $img_key => $img_value)
// {
// if(!is_array($img_value))
// {
// array_push($photos, array('name' => $img_key, 'img' => $img_value)) ;
// }
// else
// {
// foreach ($img_value as $key => $value)
// {
// if($value)
// {
// array_push($photos, array('name' => $img_key, 'img' => $value)) ;
// }
// }
// }
// }
// }
//print_r($photos);die();satellite_image
?>
<br><table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Satellite Image of PD Location</th></tr></table><br>
<p><b>GPS Coordinates of location where PD Visit was done : <?php echo $geo_location ?></b></p>
<img style="border:3px solid #0191ed;" src = "<?php echo 'data:image/gif;base64,'.$satellite_image[0]['img']; ?>" alt = "PD Visted Location Satellite Image " height="300px" width="630px">