SAVE CO IMG DELETE IMG INVESMENT
This commit is contained in:
parent
ede9f95637
commit
434e9bcd04
@ -8775,7 +8775,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
|
||||
$records = $this->post('records');
|
||||
$pd_details = $this->PD_Model->getPDMasterDetails($records['fk_pd_id']);
|
||||
|
||||
//print_r($records);
|
||||
// if(isset($records['isactive']) && ($records['isactive'] == 0 || $records['isactive'] == 1))//de activate the image
|
||||
// {
|
||||
// unset($records['image']);
|
||||
@ -8798,8 +8798,9 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
// }
|
||||
// }
|
||||
|
||||
if(isset($records['image']) && ($records['image'] != ''))
|
||||
if(isset($records['image']) && ($records['image'] != '' && !substr_count($records['image'],'https')))
|
||||
{
|
||||
|
||||
$output_file = APPPATH."/docs/temp_base64_image.jpeg";
|
||||
$temp_file_name = $records['pd_document_name'];
|
||||
|
||||
@ -8821,6 +8822,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
$record_data = array('fk_updatedby' => $records['fk_updatedby']);
|
||||
if(isset($records['is_show_report'])){ $record_data['is_show_report'] = $records['is_show_report']; }
|
||||
if(isset($records['pd_document_title'])){ $record_data['pd_document_title'] = $records['pd_document_title']; }
|
||||
if(isset($records['isactive'])){ $record_data['isactive'] = $records['isactive']; }
|
||||
|
||||
$where_condition_array = array('pd_document_id' => $records['pd_document_id']);
|
||||
$id = $this->PD_Model->updateRecords($record_data,PDDOCUMENTS,$where_condition_array);
|
||||
@ -9031,7 +9033,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
$applicant_type = $records['is_applicant'] ? 0 : ($records['is_person_met'] ? 3 : '');
|
||||
$applicant_details = array('fk_pd_id' => $records['fk_pd_id'],'applicant_name' => $records['applicant_name'],'applicant_title_name' => $records['applicant_title_name'],'applicant_type' => $applicant_type );
|
||||
//print_r($applicant_details);
|
||||
if($records['pd_co_applicant_id'] == " " || $records['pd_co_applicant_id'] == null)
|
||||
if($records['pd_co_applicant_id'] == "" || $records['pd_co_applicant_id'] == null)
|
||||
{
|
||||
$applicant_id = $this->PD_Model->saveRecords($applicant_details,PDAPPLICANTSDETAILS);
|
||||
$current_operation = 1;// 1 means INSERT
|
||||
@ -9061,16 +9063,19 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 2);
|
||||
}
|
||||
}
|
||||
//print_r( $img_data );
|
||||
if($current_operation == 2) // Make inactive old entries with same data
|
||||
///print_r( $img_data );
|
||||
if($current_operation == 2)
|
||||
{
|
||||
$sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'].' WHERE co_applicant_id = '.$records['pd_co_applicant_id'];
|
||||
$where1 = '';
|
||||
$where2 = '';
|
||||
|
||||
|
||||
if($records['is_person_met_pic'] != "" && !substr_count($records['is_person_met_pic'],'https'))
|
||||
{
|
||||
$img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link']);
|
||||
$where1 = $records['applicant_name'];
|
||||
$img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1);
|
||||
|
||||
// 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'] .' and img_type = 1';
|
||||
|
||||
$this->db->query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -9079,26 +9084,25 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
|
||||
if($records['is_person_met_id_proof'] != "" && !substr_count($records['is_person_met_id_proof'],'https'))
|
||||
{
|
||||
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link']);
|
||||
$where2 = ($records['applicant_name'].'-id_proof');
|
||||
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2);
|
||||
|
||||
|
||||
// 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';
|
||||
|
||||
$this->db->query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->PD_Model->updateRecords(array('pd_document_title' => ($records['applicant_name'].'-id_proof')),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2,'isactive' => 1));// 2- person met ID proof img
|
||||
}
|
||||
|
||||
if($where1 != '' || $where2 != '')
|
||||
{
|
||||
$sql .= ' and (pd_document_title = ? or pd_document_title = ?)';
|
||||
$this->db->query($sql, array($where1, $where2));
|
||||
//print_r($this->db->last_query());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(count($img_data))
|
||||
{
|
||||
$this->saveBase64Images($records['fk_pd_id'],18,null,null,$img_data);
|
||||
$d = $this->saveBase64Images($records['fk_pd_id'],18,null,null,$img_data);
|
||||
//print_r($d);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9107,14 +9111,16 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
$lender_id = $this->PD_Model->selectCustomRecords(array('fk_lender_id'),array('pd_id' => $records['fk_pd_id']),PDTRIGGER);
|
||||
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id[0]['fk_lender_id'];
|
||||
|
||||
$applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name']),'isactive' => 1),PDDOCUMENTS);
|
||||
$applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name']),'isactive' => 1,'co_applicant_id is not null' => null,'img_type' => 1),PDDOCUMENTS);
|
||||
//print_r($this->db->last_query());
|
||||
if(count($applicant_name))
|
||||
{
|
||||
$profilepics3path = 'pd'.$records['fk_pd_id'].'/'.($applicant_name[0]['pd_document_name']);
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'30 minutes');
|
||||
$is_person_met_pic = $singed_uri;
|
||||
}
|
||||
$applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'].'-id_proof'),'isactive' => 1),PDDOCUMENTS);
|
||||
$applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'].'-id_proof'),'isactive' => 1,'co_applicant_id is not null' =>null,'img_type' => 2),PDDOCUMENTS);
|
||||
//print_r($this->db->last_query());
|
||||
if(count($applicant_name_id))
|
||||
{
|
||||
$profilepics3path = 'pd'.$records['fk_pd_id'].'/'.($applicant_name_id[0]['pd_document_name']);
|
||||
|
||||
@ -37,27 +37,27 @@ public static function getOthersAssetsDetails($values){
|
||||
// this is for investments type
|
||||
if($fetchVal['assets_mode']==7){
|
||||
$storeValue['approximate_market_value'] = $fetchVal['details'][0]['amount_of_invest'];
|
||||
switch($fetchVal['details'][0]['investments_type_master']) {
|
||||
switch($fetchVal['details'][0]['investments_type']) {
|
||||
case 1:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['other_investments_type'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['other_investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
case 2:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
case 3:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
case 4:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
case 5:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
case 6:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
break;
|
||||
default:
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
|
||||
$storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ class AWS_COGNITO
|
||||
$result = $this->client->adminSetUserPassword([
|
||||
'Password' => 'temp1234', // REQUIRED
|
||||
'Permanent' => false,
|
||||
'UserPoolId' => $this->CI->config->item('sine_egde_pool_id'), // REQUIRED
|
||||
'UserPoolId' => $this->CI->config->item('lender_pool_id'), // REQUIRED
|
||||
'Username' => $user_name, // REQUIRED
|
||||
]);
|
||||
print_r($result);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user