PD CHANGES

This commit is contained in:
velz 2018-10-06 11:27:32 +05:30
parent 3e238f218d
commit 714f7ab021
2 changed files with 21 additions and 8 deletions

View File

@ -101,7 +101,7 @@ $db['dev'] = array(
$db['test'] = array( $db['test'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'sine-edge-dev.cya6cheplup2.ap-south-1.rds.amazonaws.com', 'hostname' => 'sine-edge-dev.cya6cheplup2.ap-south-1.rds.amazonaws.com',
'username' => 'asparqdev_mas001', 'username' => 'sparqdev_mas001',
'password' => 'sparqvenba', 'password' => 'sparqvenba',
'database' => 'sine_edge_test', 'database' => 'sine_edge_test',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',

View File

@ -181,12 +181,13 @@ class PD_Controller extends REST_Controller {
public function triggerNewPD_post() public function triggerNewPD_post()
{ {
$pd_details = json_decode($this->post('pd_details'),true); $pd_details = json_decode($this->post('pd_details'),true);
$pd_applicant_details = json_decode($this->post('pd_applicant_details'),true); $pd_applicant_details = json_decode($this->post('pd_applicant_details'),true);
$pd_document_titles = ""; $pd_document_titles = "";
if($this->post('pd_document_titles')){ json_decode($this->post('pd_document_titles'),true); } if($this->post('pd_document_titles')){ $pd_document_titles = json_decode($this->post('pd_document_titles'),true); }
$pd_documents = array(); $pd_documents = array();
$count = 0; $count = 0;
@ -208,7 +209,7 @@ class PD_Controller extends REST_Controller {
/***********************PD ALLOCATION TYPE PROCESS **********/ /***********************PD ALLOCATION TYPE PROCESS **********/
$pd_details['fk_pd_allocated_to'] = TRIGGERED; $pd_details['fk_pd_status'] = TRIGGERED;
$pd_details['fk_pd_allocated_to'] = null; $pd_details['fk_pd_allocated_to'] = null;
$where_condition_array = array('fk_city_id' => $pd_details['fk_city'],'fk_lender_id' => $pd_details['fk_lender_id']); $where_condition_array = array('fk_city_id' => $pd_details['fk_city'],'fk_lender_id' => $pd_details['fk_lender_id']);
$temp_city_id = $this->PD_Model->selectRecords(PDTEAMMAP,$where_condition_array,$limit=0,$offset=0); $temp_city_id = $this->PD_Model->selectRecords(PDTEAMMAP,$where_condition_array,$limit=0,$offset=0);
@ -219,7 +220,7 @@ class PD_Controller extends REST_Controller {
if($temp_city_id[0]['type'] == 0) // Allocate to Vendor if($temp_city_id[0]['type'] == 0) // Allocate to Vendor
{ {
$pd_details['pd_agency_id'] = $temp_city_id[0]['fk_team_id']; $pd_details['pd_agency_id'] = $temp_city_id[0]['fk_team_id'];
$pd_details['fk_pd_allocated_to'] = ALLOCATED_TO_PARTNER; $pd_details['fk_pd_status'] = ALLOCATED_TO_PARTNER;
} }
else //Allocate to SineEdge Team with allocation logics else //Allocate to SineEdge Team with allocation logics
{ {
@ -268,35 +269,42 @@ class PD_Controller extends REST_Controller {
/***********************END OF PD ALLOCATION TYPE AND PROCESS***********/ /***********************END OF PD ALLOCATION TYPE AND PROCESS***********/
$pd_details['pd_date_of_initiation'] = date("Y-m-d H:i:s"); $pd_details['pd_date_of_initiation'] = date("Y-m-d H:i:s");
if($pd_details['fk_pd_status'] == "" || $pd_details['fk_pd_status'] == null)
{
$pd_details['fk_pd_status'] = TRIGGERED;
}
$pd_id = $this->PD_Model->saveRecords($pd_details,PDTRIGGER); $pd_id = $this->PD_Model->saveRecords($pd_details,PDTRIGGER);
/***********************PD DOCUMENTS UPLOAD SECTION ***********/ /***********************PD DOCUMENTS UPLOAD SECTION ***********/
if($pd_id != null || $pd_id != '') if($pd_id != null || $pd_id != '')
{ {
if(!empty($_FILES['pddocuments']) && !empty($pd_document_titles)) if(!empty($_FILES['pddocuments']) && !empty($pd_document_titles))
{ {
foreach($pd_document_titles as $iter => $title) foreach($pd_document_titles as $iter => $title)
{ {
$tempdoc = $_FILES['pddocuments']['tmp_name'][$iter]; $tempdoc = $_FILES['pddocuments']['tmp_name'][$iter];
$tempdocname = $_FILES['pddocuments']['name'][$iter]; $tempdocname = $_FILES['pddocuments']['name'][$iter];
$bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details['fk_lender_id']; $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details['fk_lender_id'];
$key = 'pd'.$pd_id.'/'.$tempdocname ; $key = 'pd'.$pd_id.'/'.$tempdocname ;
$sourcefile = $tempdoc; $sourcefile = $tempdoc;
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile);
$s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{ {
$record_data = array('fk_pd_id' => $pd_id,'pd_document_title'=>$title[$pd_document_title],'pd_document_name'=>$tempdocname); $record_data = array('fk_pd_id' => $pd_id,'pd_document_title'=>$title,'pd_document_name'=>$tempdocname);
$this->saveRecords($record_data,PDDOCUMENTS); $this->PD_Model->saveRecords($record_data,PDDOCUMENTS);
} }
} }
} }
} }
/***********************END OF PD DOCUMENTS UPLOAD SECTION ***********/ /***********************END OF PD DOCUMENTS UPLOAD SECTION ***********/
if($pd_id != null || $pd_id != '') if($pd_id != null || $pd_id != '')
{ {
@ -414,6 +422,11 @@ class PD_Controller extends REST_Controller {
} }
public function updatePDDocs_post()
{
}
/* /*
* *
*Update PD Documents details from PD Trigger(Web application only) edit/view page *Update PD Documents details from PD Trigger(Web application only) edit/view page