diff --git a/api/application/config/autoload.php b/api/application/config/autoload.php index 0286af49..10e276c3 100644 --- a/api/application/config/autoload.php +++ b/api/application/config/autoload.php @@ -89,7 +89,7 @@ $autoload['drivers'] = array(); | | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption'); +$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption','readexceldata'); /* | ------------------------------------------------------------------- diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 3b01aa13..2eb2ad76 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -654,6 +654,7 @@ defined('SMC_CREDIT_PD_DOCS') OR define('SMC_CREDIT_PD_DOCS','t_smc_credit_pd_do defined('SMC_CREDIT_PD_SECTION_DATA') OR define('SMC_CREDIT_PD_SECTION_DATA','t_smc_credit_pd_section_data'); defined('VIDEO_ROOM_INFO') OR define('VIDEO_ROOM_INFO','t_video_room_info'); defined('SMC_EXCEL_FILELIST') OR define('SMC_EXCEL_FILELIST','t_smc_excel_filelist'); +defined('EXCEL_COLUMN_REF_NAME') OR define('EXCEL_COLUMN_REF_NAME','t_excel_column_ref_name'); diff --git a/api/application/controllers/Common_Masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php index 3dd530a4..9cf10f50 100644 --- a/api/application/controllers/Common_Masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -1302,7 +1302,15 @@ class Common_Masters_Controller extends REST_Controller { if(!empty($_FILES['pd_excel_data'])) { $folder_to_check = XLPATH.'/tmp'; - $modified_fname = $records['rand_key'].'~'.str_replace(' ','_',($_FILES['pd_excel_data']['name'])); + // $modified_fname = $records['rand_key'].'~'.str_replace(' ','_',($_FILES['pd_excel_data']['name'])); + $modified_fname = str_replace(' ','_',($_FILES['pd_excel_data']['name'])); + + ###TEMP + // $sourcefile = $folder_to_check.'/'.$modified_fname; + // $result_data = readexceldata::getExcelSectionData($sourcefile); + // print_r($result_data); + ###TEMP + // die(); // var_dump($_FILES['pd_excel_data']);die(); $config = array('upload_path' => $folder_to_check,'overwrite' => TRUE,'allowed_types' => '*','file_name' => $modified_fname); $this->load->library('upload', $config); @@ -1312,9 +1320,10 @@ class Common_Masters_Controller extends REST_Controller { // die(); $lender_id = ENVIRONMENT == 'production' ? 7 : 35; + // $sourcefile = $folder_to_check.'/'.$modified_fname; $sourcefile = $folder_to_check.'/'.$modified_fname; // echo $sourcefile; - $key = 'tmp/'.$sourcefile; + $key = 'tmp/'.$modified_fname; $bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id; //echo $modified_fname;die(); @@ -1326,7 +1335,11 @@ class Common_Masters_Controller extends REST_Controller { { $is_bucket_upload_sucess = 1; $id = $this->Common_Masters_Model->saveRecords(array('rand_key' =>$records['rand_key'],'file_name' => $_FILES['pd_excel_data']['name'],'modified_fname' => $modified_fname),SMC_EXCEL_FILELIST); - unlink($sourcefile); + + + //read excel file get trigger data + $result_data = readexceldata::getExcelSectionData($sourcefile); + // unlink($sourcefile); } } @@ -1336,7 +1349,8 @@ class Common_Masters_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['msg'] = 'File Uploaded Successfully'; - $data['records'] = $id; + $data['excel_file_id'] = $id; + $data['records'] = $result_data; $this->response($data,REST_Controller::HTTP_OK); } else