diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index d99e171c..c61f1bc0 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -2200,7 +2200,7 @@ class Flyhi_Controller extends REST_Controller { }else{ $view_data['list'] = json_decode($response_data['records'], true); $view_data['token']= $response_data['token']; - $view_data['pd_id']=$response_data['pd_id']; + $view_data['dtls']=$response_data['dtls']; log_message('ERROR',"### 1st : Inside Controller GetDigilockerDocs reponse :".json_encode($response_data)); log_message('ERROR',"### 1st : Inside Controller GetDigilockerDocs viewdata :".json_encode($view_data)); $this->load->view("digital_locker",$view_data); @@ -2216,23 +2216,28 @@ class Flyhi_Controller extends REST_Controller { $form_data = $this->post(); $token = $form_data['token']; $pd_id = $form_data['pd_id']; + $applicant_name = $form_data['applicant_name']; log_message('ERROR','### 5th User Choosen Files token key'.$form_data['token']); unset($form_data['token']); + unset($form_data['pd_id']); + unset($form_data['applicant_name']); $reindexed_array = array_values($form_data); if(count($reindexed_array)>0){ for($i=0;$i $folder_to_check,'overwrite' => TRUE,'allowed_types' => '*','file_name' => $reindexed_array[$i]); - // $this->load->library('upload', $config); + $folder_to_check = XLPATH.'/tmp'; + $bytes = file_put_contents($folder_to_check, json_decode($reponse, true)); + $config = array('upload_path' => $folder_to_check,'overwrite' => TRUE,'allowed_types' => '*','file_name' => $reindexed_array[$i]); + $this->load->library('upload', $config); $fields = array('pd_id','fk_lender_id'); $where_condition_array = array('pd_id' => $pd_id); $dtls = $this->Flyhi_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); $pd_id = (count($dtls)>0) ? $dtls[0]['pd_id'] : null; $fk_lender_id = (count($dtls)>0) ? $dtls[0]['fk_lender_id'] : null; - - $tempdocname = "IDPROOF - ".$i+1; + $tempdocname = $applicant_name."-id_proof-".$i+1; $bucketname = LENDER_BUCKET_NAME_PREFIX.$fk_lender_id; $key = 'pd'.$pd_id.'/'.$tempdocname ; $sourcefile = json_decode($reponse, true); @@ -2241,7 +2246,7 @@ class Flyhi_Controller extends REST_Controller { if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { - $record_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>"DigiLocker Files (".$tempdocname.")",'pd_document_name'=>$tempdocname); + $record_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>$tempdocname,'pd_document_name'=>$digilocker_doc_name); $this->Flyhi_Model->saveRecords($record_data,PDDOCUMENTS); } log_message('ERROR',"### 7 : Choosen Files reponse :".json_encode($reponse)); diff --git a/api/application/helpers/digital_locker_helper.php b/api/application/helpers/digital_locker_helper.php index ec12869c..9fcf9078 100644 --- a/api/application/helpers/digital_locker_helper.php +++ b/api/application/helpers/digital_locker_helper.php @@ -28,21 +28,20 @@ class DIGITAL_LOCKER return array('dataStatus'=>false,'msg'=>$response->error_description); }else{ log_message('ERROR',"### 3 : getAccessToken URI :".$response->access_token); - $CI->db->SELECT("fk_pd_id"); + $CI->db->SELECT("fk_pd_id,pd_co_applicant_id,applicant_name"); $CI->db->FROM(PDAPPLICANTSDETAILS." as PDAPPLICANTSDETAILS"); $CI->db->WHERE("PDAPPLICANTSDETAILS.pd_co_applicant_id",$applicant); $CI->db->WHERE("PDAPPLICANTSDETAILS.isactive",1); $dtls = $CI->db->GET()->result_array(); - $pd_id = (count($dtls)>0) ? $dtls[0]['fk_pd_id'] : null; $CI->db->where('pd_co_applicant_id =',$applicant); $CI->db->update(PDAPPLICANTSDETAILS, array('digi_locker_token' => $response)); - return self::getFileIssuedList($response->access_token,$pd_id); + return self::getFileIssuedList($response->access_token,$dtls); } } - - public static function getFileIssuedList($access_token,$pd_id) + + public static function getFileIssuedList($access_token,$dtls) { log_message('ERROR',"### 4 : Inside Helper getFileIssuedList Token :".$access_token); $CI =&get_instance(); @@ -54,7 +53,7 @@ class DIGITAL_LOCKER $result=curl_exec($ch); log_message('ERROR',"### 4th : getFileIssuedList Filelist Reponse :".json_encode($result)); curl_close( $ch ); - return array('dataStatus'=>true,'records'=>$result,'token'=>$access_token,'pd_id'=>$pd_id); + return array('dataStatus'=>true,'records'=>$result,'token'=>$access_token,'dtls'=>$dtls); } public static function downloadFiles($uri,$access_token) diff --git a/api/application/views/digital_locker.php b/api/application/views/digital_locker.php index 7290e7f0..fa46e9b0 100644 --- a/api/application/views/digital_locker.php +++ b/api/application/views/digital_locker.php @@ -3,7 +3,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $uparrow = ''; $downarrow = ''; $dash = ' '; - + if(count($dtls)>0){ + $pd_id = isset($dtls[0]['fk_pd_id']) ? $dtls[0]['fk_pd_id'] : null; + $applicant_name = isset($dtls[0]['applicant_name']) ? $dtls[0]['applicant_name'] : null; + } + ?> @@ -101,9 +105,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ''.$list['items'][$i]['name'].''; echo ''.$list['items'][$i]['description'].''; echo ''.$list['items'][$i]['issuer'].''; + echo ''; } echo ''; echo ''; + echo ''; + echo '