OFAMILY TITLE IN APPNAME GRABBER CHANGED

This commit is contained in:
Velz2020 2019-11-07 16:13:52 +05:30
parent ce557ba184
commit b35c0a6a1d
5 changed files with 22 additions and 7 deletions

View File

@ -5807,6 +5807,9 @@ public function getPDFormDetailsJSON_post()
//echo $this->assignPDTempalate(1325);die();
//$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com
//PDALERTS::sendMail($this,'vitvelz@gmail.com','PDGENIE TEST',array());die();
//$this->load->helper('applicantname_grabber');
// print_r(APPLICANTNAME_GRABBER::getLatestApplicantsName(1390));die();
$records = $this->post('records');
$pdid = $records['pd_id'];
//$external_path = $this->config->item('external_data_path');
@ -6027,7 +6030,7 @@ public function getPDFormDetailsJSON_post()
//$t = $this->load->view('temp_html.html',null,true);
echo $t;
die();
//die();
$total_replaces = substr_count($t,'<span class="tooltip">');
for($i = 0 ;$i < $total_replaces;$i++)

View File

@ -7,16 +7,26 @@ class applicantname_grabber
{
$CI =&get_instance();
$CI->load->model('PD_Model');
return ( $CI->PD_Model->selectCustomRecords(array('pd_co_applicant_id','applicant_name'),array('fk_pd_id' => $pd_id),PDAPPLICANTSDETAILS));
//return ( $CI->PD_Model->selectCustomRecords(array('pd_co_applicant_id','applicant_name'),array('fk_pd_id' => $pd_id),PDAPPLICANTSDETAILS));
$columns = array('pd_co_applicant_id','applicant_name','TITLES.name as title');
$table = array(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS');
$joins = array(
array('table' => TITLES. ' as TITLES',
'condition' =>"PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id AND PDAPPLICANTSDETAILS.fk_pd_id = $pd_id",
'jointype' => 'INNER')
);
return ( $CI->PD_Model->getJoinRecords($columns,$table,$joins));
}
public static function getApplicantsNameById($id,$latest_applicants_names)
public static function getApplicantsNameById($id,$latest_applicants_names,$type = 1) //$type i for return name only, 2 for return title only, and 3 for return both
{
foreach ($latest_applicants_names as $key => $value) {
if($id == $value['pd_co_applicant_id'])
{
return $value['applicant_name'];
return $type == 1 ? $value['applicant_name'] : ($type == 2 ? $value['title'] : ($value['title'].' '.$value['applicant_name']));
}
}
}

View File

@ -826,7 +826,7 @@ class GETPROCESSEDJSON
if(array_key_exists('selected_person',$family_details))
{
$CI->db->SELECT( 'PDAPPLICANTSDETAILS.applicant_name,TITLES.name' );
$CI->db->SELECT( 'PDAPPLICANTSDETAILS.applicant_name,TITLES.name,TITLES.title_id' );
$CI->db->FROM(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS');
$CI->db->JOIN(TITLES.' as TITLES','PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id','LEFT');
$CI->db->WHERE( $master_tables_pkid['PDAPPLICANTSDETAILS'] ,$family_details['selected_person']);
@ -839,6 +839,7 @@ class GETPROCESSEDJSON
$selected_person_title_master = $owner[0]['name'];
$raw_json['family_details'][$family_details_key]['selected_person_master'] = $selected_person_master;
$raw_json['family_details'][$family_details_key]['selected_person_title_master'] = $selected_person_title_master;
$raw_json['family_details'][$family_details_key]['selected_person_title_id'] = $$owner[0]['title_id'];
}
}

View File

@ -4,13 +4,14 @@ class Otherfamilyform
{
public static function getFamilyDetails($values,$pdid){
$mergeResult=array();
// print_r($values);die();
$latest_applicants_names = APPLICANTNAME_GRABBER::getLatestApplicantsName($pdid);
$male_gender_array = array('1','2','4','5','11','12','14','16','17','19','21','24');
// $gender = 'DEFAULT';
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
foreach($values as $fetchVal){
$storeValue=array();
$storeValue['selected_person_title']= isset($fetchVal['selected_person_title_master']) ? $fetchVal['selected_person_title_master'] : '';
$storeValue['selected_person_title']= isset($fetchVal['selected_person_title_id']) ? APPLICANTNAME_GRABBER::getApplicantsNameById($fetchVal['selected_person_title_id'],$latest_applicants_names,2) : $fetchVal['selected_person_title_master'];
$storeValue['selected_person']= APPLICANTNAME_GRABBER::getApplicantsNameById($fetchVal['selected_person'],$latest_applicants_names);
$storeValue['residency_address']=$fetchVal['residence_place'].', '.$fetchVal['residence_city_master'].', '.$fetchVal['residence_state_master'].'-';

View File

@ -1337,7 +1337,7 @@ if($total_no_of_business > 0) {
// if($temp_show == null)
// {
?>
<div id='page_break'></div>
<!-- <div id='page_break'></div> -->
<?php
$businessResult=array();
if(isset($pd_processed_forms[13][$business_count]))