Auto Trigger GSHEET : ps
This commit is contained in:
parent
da6f0b8be3
commit
b9f41c853a
@ -185,14 +185,31 @@ class Data_Dump_Controller extends REST_Controller {
|
||||
// log_message('ERROR',"G-Sheet For PD Step 2.4 (Fourth Cell mobilenumber) GSheet data : ".$GSdata['ContactNumber']);
|
||||
// }
|
||||
$applicatantParts ="";
|
||||
$Totalapplicatantcount = 0;
|
||||
if(isset($GSdata["ApplicantName"]) && $GSdata["ApplicantName"] != ""){
|
||||
$applicatantParts = explode(',',$GSdata["ApplicantName"]);
|
||||
if(count($applicatantParts)>1){
|
||||
$Totalapplicatantcount = count($applicatantParts);
|
||||
for($j=0;$j<count($applicatantParts);$j++){
|
||||
$pd_applicant_details[$j]['applicant_name'] = $applicatantParts[$j];
|
||||
$applicant_title_name = explode('.',$applicatantParts[$j]);
|
||||
if(count($applicant_title_name)>1){
|
||||
$pd_applicant_details[$j]['applicant_name'] = $applicant_title_name[1];
|
||||
$pd_applicant_details[$j]['applicant_title_name'] = $this->Data_Dump_Model->getId(10,$applicant_title_name[0]);
|
||||
$this->Data_Dump_Model->getId(10,$GSdata["LenderCreditName"]);
|
||||
|
||||
}else{
|
||||
$pd_applicant_details[$j]['applicant_name'] = $applicatantParts[$j];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$pd_applicant_details[0]['applicant_name'] = $applicatantParts[0];
|
||||
$applicant_title_name = explode('.',$applicatantParts[0]);
|
||||
if(count($applicant_title_name)>1){
|
||||
$pd_applicant_details[0]['applicant_name'] = $applicant_title_name[1];
|
||||
$pd_applicant_details[0]['applicant_title_name'] = $this->Data_Dump_Model->getId(10,$applicant_title_name[0]);
|
||||
|
||||
}else{
|
||||
$pd_applicant_details[0]['applicant_name'] = $applicatantParts[0];
|
||||
}
|
||||
|
||||
}
|
||||
$pd_applicant_details[0]['company_name'] = (isset($GSdata["CompanyName"]) && $GSdata["CompanyName"] != "") ? $GSdata["CompanyName"] : null ;
|
||||
@ -201,10 +218,25 @@ class Data_Dump_Controller extends REST_Controller {
|
||||
log_message('ERROR',"G-Sheet For PD Step 2.4 (company) GSheet data : ".$GSdata["CompanyName"]);
|
||||
}
|
||||
if(isset($GSdata["ContactNumber"]) && $GSdata["ContactNumber"] != ""){
|
||||
$ContactNumber = explode(',',$GSdata["ContactNumber"]);
|
||||
$ContactNumber = explode(',',trim($GSdata["ContactNumber"]));
|
||||
// Contact number as below Format
|
||||
// mentioned (9999999999, 8888888888, 7777777777) in Gsheet, then:
|
||||
// 1st number mentioned as primary number in PD genie,
|
||||
// 2nd number as additional number, (if applicant has no additional number they mentioned as Single 0 only)
|
||||
// 3rd number as co-applicant number.
|
||||
if(count($ContactNumber)>1){
|
||||
for($j=0;$j<count($ContactNumber);$j++){
|
||||
$pd_applicant_details[$j]['mobile_no'] = $ContactNumber[$j];
|
||||
if($j==0 || $j==1){
|
||||
if($j==0 && !empty($ContactNumber[$j]) && $ContactNumber[$j] != 0){
|
||||
$pd_applicant_details[0]['mobile_no'] = $ContactNumber[$j];
|
||||
}
|
||||
if($j==1 && !empty($ContactNumber[$j]) && $ContactNumber[$j] != 0){
|
||||
$pd_applicant_details[0]['additional_mobile_no'] = $ContactNumber[$j];
|
||||
}
|
||||
}else if($j>1 && $Totalapplicatantcount > ($j-1)) {
|
||||
// here if condition $J inx should greater than 1 and total applicant count is also greater then index .
|
||||
$pd_applicant_details[$j-1]['mobile_no'] = $ContactNumber[$j];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$pd_applicant_details[0]['mobile_no'] = $ContactNumber[0];
|
||||
@ -323,8 +355,6 @@ class Data_Dump_Controller extends REST_Controller {
|
||||
log_message('ERROR',"G-Sheet For PD Step 2.15 (Lender Credit Person) GSheet data : ".$GSdata["LenderCreditName"]);
|
||||
}
|
||||
|
||||
// print_r($pd_applicant_details);
|
||||
// die();
|
||||
## Default Status section;
|
||||
$pd_details['pd_status'] = TRIGGERED;
|
||||
$pd_details['pd_date_of_initiation'] = date('Y-m-d H-i-s');
|
||||
|
||||
@ -141,6 +141,8 @@ class Data_Dump_Model extends SPARQ_Model {
|
||||
$select = "userid";$where = "concat(m_user_profile.first_name, ' ', m_user_profile.last_name)";$table = "m_user_profile";}
|
||||
if($flag == 9){ $value = trim($keyword);$value = strtolower($value);
|
||||
$select = "userid";$where = "first_name";$table = "m_user_profile";}
|
||||
if($flag == 10){ $value = trim($keyword);$value = strtolower($value);
|
||||
$select = "title_id";$where = "name";$table = "m_titles";}
|
||||
|
||||
$this->db->select($select);
|
||||
$this->db->from($table);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user