diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index c42899b7..0adf66d6 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1570,6 +1570,21 @@ 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)){ + 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']; + $img_split = explode( ',', $view_data['smc_images'][$i]['img']); + $img_fields['img'] = $img_split[1]; + // $img_fields[0]['img'] = $view_data['section9'][$i]['img']; + cet_creditpd::pushwithcetphotographapi($img_fields,$i); + }} + if(!empty($view_data['satellite'])){ + $stt_fields = $common_fields; + $stt_fields['img_name'] = $view_data['satellite'][0]['img_name']; + $stt_fields['img'] = $view_data['satellite'][0]['img']; + cet_creditpd::pushwithcetphotographapi($stt_fields,0); + } // print_r($view_data['smc_images']);die(); //print_r(count($view_data['smc_images']));die(); diff --git a/api/application/helpers/cet_creditpd_helper.php b/api/application/helpers/cet_creditpd_helper.php index bb85a2c2..2dc1579a 100644 --- a/api/application/helpers/cet_creditpd_helper.php +++ b/api/application/helpers/cet_creditpd_helper.php @@ -8,16 +8,23 @@ class CET_CREDITPD public static function pushwithcetcreditpdapi($fields,$data) { log_message('ERROR','#### Inside cet creditpd helper fns'); - // if(array_key_exists("Photograph's",$data)){ - // unlink($data["Photograph's"]); - // } + if (array_key_exists("Photograph's", $data)) { + unset($data["Photograph's"]); + } + $key_check = array("Supplier details","Clients details","Stock details", "Neighbourhood Details", "Existing Loan Obligations","Business Assets"); + for($i=0;$i