From 2c306055beb5b61538d8f62fa13cda05a2f11243 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 12 Jun 2020 00:01:11 +0530 Subject: [PATCH] VIDEO API TELE SALES PD,SALES PD CUS LINK --- api/application/config/constants.php | 7 +- api/application/config/routes.php | 1 + api/application/controllers/PD_Controller.php | 134 +++++++++++------- .../controllers/Sales_PD_Controller.php | 82 ++++++++++- .../helpers/authorization_helper.php | 2 +- api/application/models/Sales_PD_Model.php | 2 +- .../JSONTOREPORT_DI_AI_TELE_PD.php | 2 +- 7 files changed, 174 insertions(+), 56 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index dd2f7100..e9c9dce1 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -89,6 +89,8 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getPDOfficerCurrentLocation'); // no errors defined('ROUTE_LOGIN_X') OR define('ROUTE_LOGIN_X', '(getPDReportHTML/:any/:any)'); // no errors defined('ROUTE_LOGIN_Y') OR define('ROUTE_LOGIN_Y', '(getPDReportPDFpreview/:any/:any)'); // no errors +defined('ROUTE_LOGIN_Z') OR define('ROUTE_LOGIN_Z', 'getSalesPDImgDataCusLink'); // no errors +defined('ROUTE_LOGIN_W') OR define('ROUTE_LOGIN_W', 'saveSalesPDImage'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors /*********************AWS resources Constants*************************************************/ @@ -104,6 +106,7 @@ defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIza defined('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY') OR define('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY','AAAA0yTIWHY:APA91bGuBHAEn1NcX95Uudm847Ez2AIbqqmi5698trFPx0cIs0OTXWUNu7c5DKDJlbxPBILytBGC5cEHqEy08AQZGu_rpCE4hyvoHyCDkOjuwhA3DFNMQDpMU6XxDDJXCI1zjhHRuEQr'); defined('OFFICER_TRACKING_URL') OR define('OFFICER_TRACKING_URL','https://demo.pdgenie.com/otnew/#/'); defined('CUSTOMER_IMG_URL') OR define('CUSTOMER_IMG_URL','https://demo.pdgenie.com/customer/#/pd-images/'); +defined('SALESPD_CUSTOMER_IMG_URL') OR define('SALESPD_CUSTOMER_IMG_URL','https://demo.pdgenie.com/customer/#/sales-pd-images/'); } else if(ENVIRONMENT == 'testing') { @@ -115,7 +118,7 @@ else if(ENVIRONMENT == 'testing') defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0'); defined('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY') OR define('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY','AAAA0yTIWHY:APA91bGuBHAEn1NcX95Uudm847Ez2AIbqqmi5698trFPx0cIs0OTXWUNu7c5DKDJlbxPBILytBGC5cEHqEy08AQZGu_rpCE4hyvoHyCDkOjuwhA3DFNMQDpMU6XxDDJXCI1zjhHRuEQr'); defined('OFFICER_TRACKING_URL') OR define('OFFICER_TRACKING_URL','https://demo.pdgenie.com/otnew/#/'); - defined('CUSTOMER_IMG_URL') OR define('CUSTOMER_IMG_URL','https://demo.pdgenie.com/customer/#/pd-images/'); + defined('SALESPD_CUSTOMER_IMG_URL') OR define('SALESPD_CUSTOMER_IMG_URL','https://demo.pdgenie.com/customer/#/sales-pd-images/'); } else if(ENVIRONMENT == 'production') { @@ -127,7 +130,7 @@ else if(ENVIRONMENT == 'production') defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0'); defined('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY') OR define('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY','AAAA0yTIWHY:APA91bGuBHAEn1NcX95Uudm847Ez2AIbqqmi5698trFPx0cIs0OTXWUNu7c5DKDJlbxPBILytBGC5cEHqEy08AQZGu_rpCE4hyvoHyCDkOjuwhA3DFNMQDpMU6XxDDJXCI1zjhHRuEQr'); defined('OFFICER_TRACKING_URL') OR define('OFFICER_TRACKING_URL','https://pdgenie.com/track/#/'); - defined('CUSTOMER_IMG_URL') OR define('CUSTOMER_IMG_URL','https://pdgenie.com/customer/#/pd-images/'); + defined('SALESPD_CUSTOMER_IMG_URL') OR define('SALESPD_CUSTOMER_IMG_URL','https://pdgenie.com/customer/#/sales-pd-images/'); } /*********************END of AWS resources Constants*************************************************/ diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 00f815fb..554e4963 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -277,4 +277,5 @@ $route['testAPISalesPD'] = 'Sales_PD_Controller/testAPISalesPD'; $route['salesPDMisReport'] = 'Sales_PD_Controller/salesPDMisReport'; $route['filterSalesPDList']='Sales_PD_Controller/filterSalesPDList'; $route['generateSatelliteImg']='Sales_PD_Controller/generateSatelliteImg'; +$route['getSalesPDImgDataCusLink']='Sales_PD_Controller/getSalesPDImgDataCusLink'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 31039738..8ba04b76 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -9225,6 +9225,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $response = false; $msg = "Dear Applicant, Please click the link to upload the photographs. " . CUSTOMER_IMG_URL .$random_string; + //SALESPD_CUSTOMER_IMG_URL $res = SMS_GUPSHUP::sendSMS($msg,$mobile_no,array('pd_id' => $pd_id,'status' => 'STARTED','msg' => 'Cus Link from PD controlller'),true); //print_r($res); $res = explode('|', $res); @@ -9269,12 +9270,28 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $pd_master_details = $this->PD_Model->getPDMasterDetails($records['pd_id']); $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; $key = 'pd'.$records['pd_id'].'/video/'.$records['filename']; - /// print_r($pd_master_details);die(); - - //$temp_file = XLPATH.'/pd_reports/'.$records['pd_id'].'/temp.txt'; - $sourcefile = $_FILES['video_file']['tmp_name']; - // $current_file = fopen($temp_file,'w'); - // fwrite($current_file, $records['video_blob']); + $file_name_wo_extension = explode('.', ($records['filename']))[0]; + $file_type = explode('/', ($_FILES['video_file']['type']))[1]; + $folder_to_check = XLPATH.'/pd_reports/'.$records['pd_id'].'/videos'; + if(!file_exists($folder_to_check)) { mkdir($folder_to_check,0777); } + + $config = array('upload_path' => $folder_to_check,'overwrite' => TRUE,'allowed_types' => '*','file_name' => $file_name_wo_extension.'.'.$file_type); + $this->load->library('upload', $config); + if($this->upload->do_upload('video_file')) + { + $upload_data = $this->upload->data(); + //$this->load->view('upload_success',$data); + //print_r($upload_data); + + $command_to_execute = FFMPEG_PATH.' -i '.$folder_to_check.'/'.$file_name_wo_extension.'.'.$file_type.' '.$folder_to_check.'/'.$file_name_wo_extension.'.mp4'.' 2>&1' ; + //print_r($command_to_execute);die(); + exec($command_to_execute,$o,$v); + // print_r($o); + // echo $command_to_execute;die(); + if($o) + { + $sourcefile = $folder_to_check.'/'.$file_name_wo_extension.'.mp4'; + $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); // print_r($s3result); @@ -9283,6 +9300,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() log_message('ERROR','###PDVIDEO stored in S3'.$records['pd_id']); $record_data = array('fk_pd_id' => $records['pd_id'],'video_part_name'=>$records['filename']); $id = $this->PD_Model->saveRecords($record_data,CUS_VIDEO); + unlink($folder_to_check.'/'.$file_name_wo_extension.'webm'); + unlink($folder_to_check.'/'.$file_name_wo_extension.'.mp4'); } @@ -9300,7 +9319,25 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $data['msg'] = 'Something Wrong. Try Later!'; $this->response($data,REST_Controller::HTTP_OK); } - + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_FOUND; + $data['msg'] = 'Something Wrong. Try Later!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_FOUND; + $data['msg'] = 'Something Wrong. Try Later!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } else { @@ -9319,23 +9356,20 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $pd_id = $this->post('pd_id'); $random_string = $this->post('random_string'); $final_video_name = $pd_id.'-'.$random_string; + //echo $final_video_name;die(); //Get PD master DEtails $pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string); //$is_video_merged = $this->PD_Model->selectCustomRecords(array('*'),array('fk_pd_id' => $pd_id,'video_part_name' => $final_video_name),CUS_VIDEO); - //print_r($pd_master_details);die(); + //prit_r($pd_master_details);die(); if(count($pd_master_details) && isset($pd_master_details[0]['pd_id'])) { $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; - $key = 'pd'.$pd_id.'/video/'.$final_video_name; + $final_key = 'pd'.$pd_id.'/video/'.$final_video_name.'.webm'; if($pd_master_details[0]['is_video_merged']) { - //get full video from S3 - //$key = 'pd'.$pd_id.'/video/salt&kidny.mp4'; - - $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'+3 hrs'); - //echo $singed_uri; + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+3 hrs'); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['url'] = $singed_uri; @@ -9345,15 +9379,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() { //Get all video info $video_info = $this->PD_Model->selectCustomRecords(array('*'),array('fk_pd_id' => $pd_id,'is_active' => 1),CUS_VIDEO); - //print_r($video_info); - //echo XLPATH.'/pd_reports/'.$pd_id.'/videos'; - $folder_to_check = XLPATH.'/pd_reports/'.$pd_id.'/videos'; - if(!file_exists($folder_to_check)) { mkdir(file_to_check,0777); } + $folder_to_check = XLPATH.'/pd_reports/'.$pd_id.'/videos'; + $file_list = $folder_to_check.'/filelist.txt'; + //Get All video and temp store it in xlpath - $all_input_files_names_with_path = '"concat:'; + $file_pointer = fopen($file_list, 'w+'); + $all_input_files_names_with_path = ''; foreach ($video_info as $video_info_key => $video_info_value) { - //echo $file_name_wo_extension = explode('.', ($video_info_value['video_part_name']))[0];die(); $key = 'pd'.$pd_id.'/video/'.$video_info_value['video_part_name']; $temp_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'+10 minutes'); $file_to_create = $folder_to_check.'/'.$video_info_value['video_part_name']; @@ -9362,37 +9395,50 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() { $file_name_wo_extension = explode('.', ($video_info_value['video_part_name']))[0]; - $all_input_files_names_with_path .= $folder_to_check.'/'.$file_name_wo_extension.'.ts|'; - $command_to_execute = FFMPEG_PATH.' -i '.$file_to_create.' -c copy -bsf:v h264_mp4toannexb -f mpegts '.$folder_to_check.'/'.$file_name_wo_extension.'.ts 2>&1'; - echo $command_to_execute.'-****'; - - exec($command_to_execute,$ou,$v); - // print_r('video'); - //ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts + + fwrite($file_pointer,"file "."'".$file_name_wo_extension.".mp4"."'\n"); } } - - //remove last pipr symbal - $all_input_files_names_with_path = substr_replace($all_input_files_names_with_path,'',-1,1); - $all_input_files_names_with_path .= '"' ; - //echo $all_input_files_names_with_path;die(); - //final command to merge all videos - $merge_cmd = FFMPEG_PATH.' -i '.$all_input_files_names_with_path.' -c copy -bsf:a aac_adtstoasc '.$folder_to_check.'/'.$final_video_name.'.mp4 2>&1'; - //echo $merge_cmd; + fclose($file_pointer); + // echo '***************************************';//die(); + + $merge_cmd = FFMPEG_PATH.' -f concat -safe 0 -i '.$folder_to_check.'/'.'filelist.txt -c copy '.$folder_to_check.'/'.$final_video_name.'.mp4 2>&1'; + //echo '#########################################'; + //echo $merge_cmd;//die(); exec($merge_cmd,$ou,$v); - //print_r($ou); + //print_r($ou);//die(); if($ou && file_exists($folder_to_check.'/'.$final_video_name.'.mp4')) { - //upload to s3 - $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>($folder_to_check.'/'.$final_video_name.'.mp4')); + //echo 'upload to s3'; + $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$final_key,'sourcefile'=>($folder_to_check.'/'.$final_video_name.'.mp4')); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { log_message('ERROR','###PDVIDEO final video tored in S3'.$pd_id); $record_data = array('is_video_merged' => 1); $id = $this->PD_Model->updateRecords($record_data,PDTRIGGER,array('pd_id' => $pd_id)); - //unlink($folder_to_check.'/'.$final_video_name.'.mp4'); + unlink($folder_to_check.'/'.$final_video_name.'.mp4'); } + + foreach($video_info as $video_info_key => $video_info_value) + { + $file_name_wo_extension = explode('.', ($video_info_value['video_part_name']))[0]; + //unlink($folder_to_check.'/'.$file_name_wo_extension.'.ts'); + unlink($folder_to_check.'/'.$file_name_wo_extension.'.mp4'); + } + + + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+3 hrs'); + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['url'] = $singed_uri; + $this->response($data,REST_Controller::HTTP_OK); + + + } + else + { + echo 'Not DOne'; } @@ -9406,15 +9452,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $data['msg'] = 'No PD Found...!'; $this->response($data,REST_Controller::HTTP_OK); } - //ffmeg test code snippet ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4 - //$str = 'C:\ffmpeg\bin\ffmpeg -i C:\ffmpeg\bin\mango.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts C:\ffmpeg\bin\intermediate1.ts 2>&1'; - // die(); - // $str = 'C:\ffmpeg\bin\ffmpeg -i "concat:C:\ffmpeg\bin\intermediate1.ts|C:\ffmpeg\bin\intermediate2.ts" -c copy -bsf:a aac_adtstoasc C:\ffmpeg\bin\output.mp4 2>&1'; - // exec($str,$o,$v); - // print_r($v); - // print_r($o); - // die(); - //ffmeg test code snippet + } } diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index e8a33915..ee633511 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -32,8 +32,9 @@ class Sales_PD_Controller extends REST_Controller { $records = $this->post('records'); $lender_id = $records['lender_id']; $product = $records['product_id']; + $sales_pd_type = $records['sales_pd_type']; - $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'product_id' => $product,'isactive' => 1),SALESPDTEMPLATE); + $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'product_id' => $product,'sales_pd_type' => $sales_pd_type,'isactive' => 1),SALESPDTEMPLATE); if(is_array($template) && count($template)) { $data['dataStatus'] = true; @@ -257,7 +258,7 @@ class Sales_PD_Controller extends REST_Controller { { $lender_id = $this->uri->segment(2); $user_id = $this->uri->segment(3); - $columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status' + $columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type' // ,"DATE_FORMAT(SALES_PD_DATA.createdon,'%Y-%m-%d') as modify","DATE_ADD(CURDATE(),INTERVAL '-10' DAY) as currd", // "(CURDATE()) as daye10" ); @@ -863,7 +864,7 @@ class Sales_PD_Controller extends REST_Controller { $to_date = $this->post('to_date'); - $columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status','SALES_PD_DATA.mail_status'); + $columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status','SALES_PD_DATA.mail_status','SALES_PD_DATA.sales_pd_type','IF(SALES_PD_DATA.sales_pd_type = 1 ,"physical pd","tele pd") as sales_pd_type_name'); $table = SALES_PD_DATA.' as SALES_PD_DATA'; $joins = array( array('table' => ENTITY. ' as ENTITY', @@ -957,6 +958,81 @@ public function filterSalesPDList_post() { } + + + public function getSalesPDImgDataCusLink_post() + { + $sales_pd_id = $this->post('sales_pd_id'); + + $sales_pd_master_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $sales_pd_id),SALES_PD_DATA); + + $sales_pd_img_data = $this->Sales_PD_Model->selectCustomRecords(array('doc_id', 'fk_sales_pd_id','img','img_name','isactive'),array('fk_sales_pd_id' => $sales_pd_id,'isactive' => 1,'img_name!=' => 'satellite'),SALEPD_DOCS); + + //print_r($sales_pd_img_data); + //sales tele pd img structure array + $imgs = array('selfie_with_person_met' => array('is_multiple' => 0,'img_name' => 'Selfie With Person Met'),'name_board_seen' => array('is_multiple' => 0,'img_name' => 'Business Name Board'),'stock_image' => array('is_multiple' => 1,'img_name' => 'Stock Images'),'workplace_interior_image' => array('is_multiple' => 1,'img_name' => 'Work Place Interior')); + + $img_data = array(); + if(count($sales_pd_img_data)) + { + + foreach ($imgs as $key => $value) + { + foreach ($sales_pd_img_data as $sales_pd_img_data_key => $sales_pd_img_data_value) + { + if($key == $sales_pd_img_data_value['img_name']) + { + if($value['is_multiple']) + { + if(!array_key_exists($key,$img_data)) + { + $img_data[$key] = array('img_key' => $key,'img_name' => $value['img_name'],'img_data' => [array('img_url' => $sales_pd_img_data_value['img'])],'is_multiple' => 1,'section_heading' => $value['img_name']); + } + else + { + $img_data[$key]['img_data'][] = array('img_url' => $sales_pd_img_data_value['img']); + } + + } + else + { + $img_data[$key] = array('img_key' => $key,'img_name' => $value['img_name'],'img_url' => $sales_pd_img_data_value['img'],'is_multiple' => 0,'section_heading' => $value['img_name']);//$sales_pd_img_data_value['img'] + } + + unset($sales_pd_img_data[$sales_pd_img_data_key]); + } + else + { + $img_data[$key] = array('img_key' => $key,'img_name' => $value['img_name'],'img_url' => $value['is_multiple'] == 0 ? '' : array(),'is_multiple' => $value['is_multiple'],'section_heading' => $value['img_name']); + } + } + } + $img_data = array_values($img_data); + + } + else + { + + foreach ($imgs as $key => $value) + { + if($value['is_multiple']) + { + $img_data[] = array('img_key' => $key,'img_name' => $value['img_name'],'img_data' => array(),'is_multiple' => 1,'section_heading' => $value['img_name']); + + } + else + { + $img_data[] = array('img_key' => $key,'img_name' => $value['img_name'],'img_url' => '','is_multiple' => 0,'section_heading' => $value['img_name']); + } + } + } + + //print_r($img_data); + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = array('img_data' => $img_data,'is_cus_link_disabled' => '0'); + $this->response($data,REST_Controller::HTTP_OK); + } } \ No newline at end of file diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index 096d596a..d4bf1c0e 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -72,7 +72,7 @@ class AUTHORIZATION } - if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y) + if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W) { return true; } diff --git a/api/application/models/Sales_PD_Model.php b/api/application/models/Sales_PD_Model.php index e8e3cb30..f9fdb991 100644 --- a/api/application/models/Sales_PD_Model.php +++ b/api/application/models/Sales_PD_Model.php @@ -11,7 +11,7 @@ class Sales_PD_Model extends SPARQ_Model { public function getSalesPDListwithFilters($pd_status = '',$pd_from_date = '',$pd_to_date = '',$pd_products = '',$pd_lender = '',$pd_applicant_name = '',$pd_officer_name = '',$sales_pd_officer_id) { // SALES_PD_DATA.sales_pd_sno, SALES_PD_DATA.sales_pd_id, SALES_PD_DATA.applicant_name,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name,SALES_PD_DATA.applicant_id,SALES_PD_DATA.lender_id,SALES_PD_DATA.product_id,SALES_PD_DATA.is_pdf,SALES_PD_DATA.is_edited,ENTITY.short_name,PRODUCTS.abbr,DATE_FORMAT(SALES_PD_DATA.createdon, "%d/%m/%Y") as pd_createdon,SALES_PD_DATA.status $this->db->SELECT(' SALES_PD_DATA.sales_pd_sno, SALES_PD_DATA.sales_pd_id, SALES_PD_DATA.applicant_name,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name,SALES_PD_DATA.applicant_id,SALES_PD_DATA.lender_id,SALES_PD_DATA.product_id,SALES_PD_DATA.is_pdf,SALES_PD_DATA.is_edited,ENTITY.short_name,PRODUCTS.abbr,SALES_PD_DATA.createdon, - DATE_FORMAT(SALES_PD_DATA.createdon, "%Y-%m-%d") as pd_createdon, SALES_PD_DATA.status'); + DATE_FORMAT(SALES_PD_DATA.createdon, "%Y-%m-%d") as pd_createdon, SALES_PD_DATA.status,SALES_PD_DATA.sales_pd_type'); $this->db->from(SALES_PD_DATA.' as SALES_PD_DATA'); $this->db->join(ENTITY.' as ENTITY','ENTITY.entity_id = SALES_PD_DATA.lender_id','INNER'); $this->db->join(PRODUCTS.' as PRODUCTS', 'PRODUCTS.product_id = SALES_PD_DATA.product_id','INNER'); diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php index 24117e20..bb223b3b 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php @@ -1119,7 +1119,7 @@ if ( isset($pdf) ) { if($business_assets_details['business_assets_for_address'][0]['business_month'] != ""){ $yrs_being_run.= ' and '.$business_assets_details['business_assets_for_address'][0]['business_month'].' Months';} echo '

'; - echo 'the PD was telephonically done with the loan applicant(s) at '. $address_type. 'Address Form - Type of Address . '; + echo 'The PD was telephonically done with the loan applicant(s) at '. $address_type. 'Address Form - Type of Address . '; echo 'The '.$address_type.'Address Form - Type of Address is '.$property_owner_type.'Business Assest Form - Owner of the Property and the business has been in operation from here for the last '.$yrs_being_run.'Business Assest Form - Business running Yrs in this premise .'; echo '

The '.$address_type.'Address Form - Type of Address is located in '.$locality.'Address Form - Locality of Address '.($estimated_area != 0? 'and the estimated area of the '.$address_type.'Address Form - Type of Address is '.$estimated_area.'Address Form - Estimated Area .' : ''); // echo '

The PD location was '. $pd_address['pd_location_master'].'Address Form - Approach to PD location . ' . 'As Per PD Officer, the '.$address_type .'Address Form - Type of Address is situated in '.$comment_locality_master .'Address Form - Comment on locality Locality.';