diff --git a/api/application/config/constants.php b/api/application/config/constants.php index c965fff3..16396452 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -124,9 +124,10 @@ defined('PDF_ATTACHEMENT_URL') OR define('PDF_ATTACHEMENT_URL','https://apitest. defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); -defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); +defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); +defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); -defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); +defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'testing') { @@ -145,9 +146,10 @@ else if(ENVIRONMENT == 'testing') defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); - defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); + defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); - defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); + defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'production') { @@ -166,8 +168,10 @@ else if(ENVIRONMENT == 'production') defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-live'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://4u9t03hvfb.execute-api.ap-south-1.amazonaws.com/live'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://l.pdgenie.com/'); - defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); - defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); + defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); + defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } /*********************END of AWS resources Constants*************************************************/ diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 0adf66d6..8a44da51 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1570,7 +1570,7 @@ public function filterSalesPDList_post() { // print_r($view_data['pd_section_data'][15]);die(); $view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS); $view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS); - if(count($view_data['smc_images']>0)){ + if(count($view_data['smc_images'])>0){ for ($i = 0; $i < count($view_data['smc_images']); $i++){ $img_fields = $common_fields; $img_fields['img_name'] = $view_data['smc_images'][$i]['img_name']; diff --git a/api/application/helpers/cet_creditpd_helper.php b/api/application/helpers/cet_creditpd_helper.php index 2dc1579a..c4e07112 100644 --- a/api/application/helpers/cet_creditpd_helper.php +++ b/api/application/helpers/cet_creditpd_helper.php @@ -55,7 +55,7 @@ class CET_CREDITPD $ch = curl_init(); $log_msg = " PullcreditPdPhotographsData api (".$fields['img_name'].")"; $fields['img'] = $curlFile; - curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_IMG_INTEGRATION_URL); + curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_INTEGRATION_IMG_URL); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); diff --git a/api/application/helpers/cet_salespd_helper.php b/api/application/helpers/cet_salespd_helper.php index 2c7367d7..d6a2b51d 100644 --- a/api/application/helpers/cet_salespd_helper.php +++ b/api/application/helpers/cet_salespd_helper.php @@ -2,7 +2,7 @@ class CET_SALESPD { - public static function pushwithcetsalespdapi($fields,$data,$flag) + public static function pushwithcetsalespdapi_bkup($fields,$data,$flag) { log_message('ERROR','#### pushwithcetsalespdapi Helper FNS'); $fields['data'] = $data; @@ -44,12 +44,33 @@ class CET_SALESPD // log_message('ERROR',"result : ".json_encode($result)); curl_close( $ch ); - } + } + public static function pushwithcetsalespdapi($fields,$data,$flag) + { + log_message('ERROR','#### pushwithcetsalespdapi Helper FNS'); + $fields['data'] = $data; + $pdid = $fields['pdid']; + $headers = array('Content-Type: application/json'); + $ch = curl_init(); + $output_data = json_encode( $fields ); + // log_message('ERROR',"PullSalesPDData api Request Format : ".$output_data); + curl_setopt( $ch,CURLOPT_URL, CET_SALESPD_INTEGRATION_URL); + curl_setopt( $ch,CURLOPT_POST, true ); + curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); + curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); + curl_setopt( $ch,CURLOPT_POSTFIELDS, $output_data); + $result = curl_exec($ch ); + $response = json_decode($result); + log_message('ERROR',"CET APP SALES PDID (".$pdid.") ".$log_msg."PullSalesPDData api response :".json_encode($response)); + curl_close( $ch ); + + } // multipart/form-data; public static function pushwithcetphotographapi($fields,$index) { - // log_message('ERROR','#### pushwithcetphotographapi Helper FNS'); + log_message('ERROR','#### pushwithcetphotographapi Helper FNS'); $CI =&get_instance(); $img = $fields['img']; $pdid = $fields['pdid']; @@ -63,10 +84,9 @@ class CET_SALESPD // $headers = array('Content-Type: application/json'); $ch = curl_init(); // $url = 'https://apitest.pdgenie.com/file_receive.php'; - $url = 'https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'; $log_msg = " PullSalesPdPhotographsData api (".$fields['img_name'].")"; $fields['img'] = $curlFile; - curl_setopt( $ch,CURLOPT_URL, $url); + curl_setopt( $ch,CURLOPT_URL, CET_SALESPD_INTEGRATION_IMG_URL); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); @@ -74,11 +94,9 @@ class CET_SALESPD curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $result=curl_exec($ch); $response = json_decode($result); - log_message('ERROR',"###CET APP PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); + log_message('ERROR',"###CET APP SALES PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); curl_close( $ch ); unlink($file); - // unlink($file_name_with_full_path); - } }