Sales_PD_Controller section CETAPI : ps
This commit is contained in:
parent
b21e8a0e26
commit
8b4415e1ba
@ -8,7 +8,8 @@
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
|
||||
require_once APPPATH . '/libraries/REST_Controller.php';
|
||||
|
||||
require_once APPPATH . '/libraries/REST_Controller.php';
|
||||
include_once APPPATH.'/vendor/autoload.php';
|
||||
|
||||
|
||||
@ -214,15 +215,29 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);//die();
|
||||
$section_fields['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);
|
||||
}
|
||||
salespd_cetapp::pushwithcetsalespdapi($common_fields,$section_fields,1);
|
||||
// print_r($view_data['section3']);die();
|
||||
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
if(count($view_data['section9'])>0){
|
||||
for ($i = 0; $i < count($view_data['section9']); $i++){
|
||||
$img_fields[0]['img_name'] = $view_data['section9'][$i]['img_name'];
|
||||
$img_fields[0]['img'] = $view_data['section9'][$i]['img'];
|
||||
salespd_cetapp::pushwithcetsalespdapi($common_fields,$img_fields,2);
|
||||
}}
|
||||
//for ($i = 0; $i < count($view_data['section9']); $i++){
|
||||
// $img_fields[0]['img_name'] = $view_data['section9'][$i]['img_name'];
|
||||
// $img_fields[0]['img'] = $view_data['section9'][$i]['img'];
|
||||
// salespd_cetapp::pushwithcetsalespdapi($common_fields,$img_fields,2);
|
||||
//}
|
||||
// "section9":{"selfie_with_person_met":"SAVED","approach_to_pd_location":["SAVED",""],"name_board_seen":["SAVED",""],"stock_image":["SAVED","SAVED","SAVED","SAVED",""],"workplace_interior_image":["SAVED","SAVED",""]}}
|
||||
$arr1 =array();$arr2 =array();
|
||||
for ($i = 0; $i < count($view_data['section9']); $i++){
|
||||
$img_name = $view_data['section9'][$i]['img_name'];
|
||||
if(!in_array($img_name, $arr1)){
|
||||
array_push($arr1,$img_name);
|
||||
}
|
||||
$k = array_search($img_name, $arr1); //$k = 1;
|
||||
$arr2[$k][] = $view_data['section9'][$i]['img'];
|
||||
for ($j = 0; $j < count($arr1); $j++) {
|
||||
$section_fields['section9'][$arr1[$j]] = $arr2[$j];
|
||||
}
|
||||
}
|
||||
}
|
||||
salespd_cetapp::pushwithcetsalespdapi($common_fields,$section_fields,1);
|
||||
$view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
if(!empty($view_data['satellite_image'])){
|
||||
$stt_fields[0]['img_name'] = $view_data['satellite_image'][0]['img_name'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user