EXIST CHECK ENHANCED
This commit is contained in:
parent
434e9bcd04
commit
085ed0e31a
@ -1985,6 +1985,9 @@ public function assignPDTempalate($data)
|
|||||||
$random_string = $this->post('random_string');
|
$random_string = $this->post('random_string');
|
||||||
// Get All PD Masters Details
|
// Get All PD Masters Details
|
||||||
$result_data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid,$random_string);
|
$result_data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid,$random_string);
|
||||||
|
|
||||||
|
//Get All existing PD details of same applicants
|
||||||
|
$result_data['exist_pd_details'] = $this->PD_Model->getExistPDdetails($pdid);
|
||||||
|
|
||||||
// Get All Applicant's Details
|
// Get All Applicant's Details
|
||||||
$result_data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
|
$result_data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
|
||||||
@ -2804,7 +2807,6 @@ public function getPDFormDetailsJSON_post()
|
|||||||
log_message('ERROR',$custom_log_info);
|
log_message('ERROR',$custom_log_info);
|
||||||
|
|
||||||
$result_data = $this->PD_Model->getSignedPDDocsURL($pd_id,13,$company_id,null,null,null,'report');
|
$result_data = $this->PD_Model->getSignedPDDocsURL($pd_id,13,$company_id,null,null,null,'report');
|
||||||
|
|
||||||
foreach($result_data as $b_key => $b_value)
|
foreach($result_data as $b_key => $b_value)
|
||||||
{
|
{
|
||||||
if($b_value['pd_document_title'] == 'shop_eat_act_cert_pic')
|
if($b_value['pd_document_title'] == 'shop_eat_act_cert_pic')
|
||||||
@ -2839,6 +2841,10 @@ public function getPDFormDetailsJSON_post()
|
|||||||
{
|
{
|
||||||
$temp_rec['fire_noc_pic'] = $b_value['doc_url'];
|
$temp_rec['fire_noc_pic'] = $b_value['doc_url'];
|
||||||
}
|
}
|
||||||
|
if($b_value['pd_document_title'] == 'eb_bill_pic')
|
||||||
|
{
|
||||||
|
$temp_rec['eb_bill_pic'] = $b_value['doc_url'];
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($temp_rec['documents']) && count($temp_rec['documents']))
|
if(isset($temp_rec['documents']) && count($temp_rec['documents']))
|
||||||
{
|
{
|
||||||
@ -2847,6 +2853,10 @@ public function getPDFormDetailsJSON_post()
|
|||||||
if($value['document'] == $b_value['pd_document_title'])
|
if($value['document'] == $b_value['pd_document_title'])
|
||||||
{
|
{
|
||||||
$temp_rec['documents'][$key]['document_pic'] = $b_value['doc_url'];
|
$temp_rec['documents'][$key]['document_pic'] = $b_value['doc_url'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$temp_rec['documents'][$key]['document_pic'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -9088,7 +9098,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
|
|
||||||
|
|
||||||
// Make inactive old entries with same data
|
// Make inactive old entries with same data
|
||||||
$sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'].' and co_applicant_id = '.$records['pd_co_applicant_id'] .' img_type = 2';
|
$sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'].' and co_applicant_id = '.$records['pd_co_applicant_id'] .' and img_type = 2';
|
||||||
|
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
}
|
}
|
||||||
@ -9156,13 +9166,29 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
$records = $this->post('records');
|
$records = $this->post('records');
|
||||||
//print_r($records);die();
|
//print_r($records);die();
|
||||||
$lender_applicant_id = isset($records['lender_applicant_id']) ? $records['lender_applicant_id'] : null;
|
$lender_applicant_id = isset($records['lender_applicant_id']) ? $records['lender_applicant_id'] : null;
|
||||||
|
$applicant_name = isset($records['applicant_name']) ? $records['applicant_name'] : null;
|
||||||
|
$mobile_no = isset($records['mobile_no']) ? $records['mobile_no'] : null;
|
||||||
$params = array();
|
$params = array();
|
||||||
|
$table = null;
|
||||||
if($lender_applicant_id)
|
if($lender_applicant_id)
|
||||||
{
|
{
|
||||||
$params['lender_applicant_id'] = $lender_applicant_id;
|
$params['lender_applicant_id'] = $lender_applicant_id;
|
||||||
|
$table = PDTRIGGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result_data = $this->PD_Model->checkExistPDDetails($params);
|
if($applicant_name)
|
||||||
|
{
|
||||||
|
$params['applicant_name'] = $applicant_name;
|
||||||
|
$table = PDAPPLICANTSDETAILS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($mobile_no)
|
||||||
|
{
|
||||||
|
$params['mobile_no'] = $mobile_no;
|
||||||
|
$table = PDAPPLICANTSDETAILS;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result_data = $this->PD_Model->checkExistPDDetails($params,$table);
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
$data['records'] = $result_data;
|
$data['records'] = $result_data;
|
||||||
|
|||||||
@ -335,11 +335,26 @@ class PD_Model extends SPARQ_Model {
|
|||||||
return $document_lists;
|
return $document_lists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getExistPDdetails($pdid)
|
||||||
|
{
|
||||||
|
$applicants_data = $this->getApplicantsDetails($pdid,$type = 1);
|
||||||
|
//print_r($applicants_data);die();
|
||||||
|
if(count($applicants_data))
|
||||||
|
{
|
||||||
|
$fields = array('pd_id','pd_sno','random_string');
|
||||||
|
$table = PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS';
|
||||||
|
$where_condition_array = array('mobile_no' => $applicants_data[0]['mobile_no'],'applicant_name' => $applicants_data[0]['applicant_name']);
|
||||||
|
$joins = array(
|
||||||
|
array('table'=>PDTRIGGER.' as PDTRIGGER','condition'=>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id','jointype'=>'LEFT'),
|
||||||
|
);
|
||||||
|
return $this->getJoinRecords($fields,$table,$joins,$where_condition_array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*Get all Applicants details by pdid
|
*Get all Applicants details by pdid
|
||||||
*/
|
*/
|
||||||
public function getApplicantsDetails($pdid)
|
public function getApplicantsDetails($pdid,$type = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$pdmaster_details = $this->getPDMasterDetails($pdid);
|
$pdmaster_details = $this->getPDMasterDetails($pdid);
|
||||||
@ -364,13 +379,18 @@ class PD_Model extends SPARQ_Model {
|
|||||||
$this->db->JOIN(TITLES.' as TITLES','PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id','LEFT');
|
$this->db->JOIN(TITLES.' as TITLES','PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id','LEFT');
|
||||||
|
|
||||||
$this->db->WHERE('PDAPPLICANTSDETAILS.fk_pd_id ',$pdid);
|
$this->db->WHERE('PDAPPLICANTSDETAILS.fk_pd_id ',$pdid);
|
||||||
if(count($addtional_pd_ids_string))
|
if($type)
|
||||||
|
{
|
||||||
|
//echo 'DOIDNO';
|
||||||
|
$this->db->WHERE('PDAPPLICANTSDETAILS.applicant_type',1);
|
||||||
|
}
|
||||||
|
if(count($addtional_pd_ids_string) && !$type)
|
||||||
{
|
{
|
||||||
$this->db->OR_WHERE_IN('PDAPPLICANTSDETAILS.fk_pd_id',$addtional_pd_ids_string);
|
$this->db->OR_WHERE_IN('PDAPPLICANTSDETAILS.fk_pd_id',$addtional_pd_ids_string);
|
||||||
}
|
}
|
||||||
$this->db->ORDER_BY('PDAPPLICANTSDETAILS.pd_co_applicant_id');
|
$this->db->ORDER_BY('PDAPPLICANTSDETAILS.pd_co_applicant_id');
|
||||||
$result_child_array = $this->db->GET()->result_array();
|
$result_child_array = $this->db->GET()->result_array();
|
||||||
|
//print_r($this->db->last_query());die();
|
||||||
if(count($result_child_array) != 0)
|
if(count($result_child_array) != 0)
|
||||||
{
|
{
|
||||||
return $result_child_array;
|
return $result_child_array;
|
||||||
@ -1847,13 +1867,37 @@ class PD_Model extends SPARQ_Model {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkExistPDDetails($params)
|
function checkExistPDDetails($params,$table)
|
||||||
{
|
{
|
||||||
if(count($params))
|
if(count($params) && $table)
|
||||||
{
|
{
|
||||||
$fields = array('pd_id','pd_sno');
|
if($table == PDTRIGGER)
|
||||||
$where_condition_array = array('lender_applicant_id' => $params['lender_applicant_id']);
|
{
|
||||||
return $this->selectCustomRecords($fields,$where_condition_array,PDTRIGGER);
|
$fields = array('pd_id','pd_sno');
|
||||||
|
$where_condition_array = array('lender_applicant_id' => $params['lender_applicant_id']);
|
||||||
|
return $this->selectCustomRecords($fields,$where_condition_array,$table);
|
||||||
|
}
|
||||||
|
else if($table == PDAPPLICANTSDETAILS)
|
||||||
|
{
|
||||||
|
$fields = array('pd_id','pd_sno','random_string');
|
||||||
|
$table = PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS';
|
||||||
|
$where_condition_array = array();
|
||||||
|
if(isset($params['mobile_no']) && $params['mobile_no'])
|
||||||
|
{
|
||||||
|
$where_condition_array['mobile_no'] = $params['mobile_no'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($params['applicant_name']) && $params['applicant_name'])
|
||||||
|
{
|
||||||
|
$where_condition_array['applicant_name'] = $params['applicant_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$joins = array(
|
||||||
|
array('table'=>PDTRIGGER.' as PDTRIGGER','condition'=>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id','jointype'=>'LEFT'),
|
||||||
|
);
|
||||||
|
return $this->getJoinRecords($fields,$table,$joins,$where_condition_array);
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user