diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index d34f53fd..20bb4802 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -1988,8 +1988,8 @@ public function filterSalesPDList_post() { $photograph_data[$k]['rand_name'] = $rand_name;$k++; } $CET_response = cet_salespd::repushwithcetphotographapi($section_fields); - foreach ($photograph_data as $key => $value){ - if(isset($CET_response->status) && $CET_response->status == 200){ + if(isset($CET_response->status) && $CET_response->status == 200){ + foreach ($photograph_data as $key => $value){ $rand_name = $value['rand_name']; $source=$value['img_name'] == 'satellite' ? 'data:image/png;base64,'.$value['img'] : $value['img']; //Google Library - GCP @@ -2014,12 +2014,13 @@ public function filterSalesPDList_post() { $update_fields2 = array('rand_name' => $rand_name); $this->Sales_PD_Model->updateRecords($update_fields2,SALEPD_DOCS,array('doc_id'=>$value['doc_id'])); } - log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') - CET response - '.json_encode($CET_response,true)); - } - else{ - log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') - CET response - '.json_encode($CET_response,true)); } + log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') - CET response - '.json_encode($CET_response,true)); } + else{ + log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') - CET response - '.json_encode($CET_response,true)); + } + }else{ log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') - No Images'); }