Cet app Sales PD extra Log Added : ps
This commit is contained in:
parent
1b918102f6
commit
e8f90870fd
@ -335,12 +335,15 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$sales_pd_id = $details[$i]['sales_pd_id'];
|
||||
// echo $sales_pd_id;
|
||||
$result = $this->dataSynchronization($sales_pd_id);
|
||||
if($result == true){
|
||||
if($result->status == 200){
|
||||
$flag = $flag+1;
|
||||
//update here.
|
||||
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') status '.$result->status." Data Transfered");
|
||||
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||
$this->Sales_PD_Model->updateRecords($update_fields2,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||
array_push($ids, $sales_pd_id);
|
||||
}else{
|
||||
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') status '.$result->status);
|
||||
}
|
||||
// $flag = ($result == true) ? $flag+1 : $flag;
|
||||
}
|
||||
@ -413,8 +416,8 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = cet_salespd::pushwithcetsalespdapi($common_fields,$CETAPP_salesPD_data,1);
|
||||
if($result == true){
|
||||
$result = cet_salespd::pushwithcetsalespdapi($common_fields,$CETAPP_salesPD_data,1);
|
||||
if($result->status == 200){
|
||||
$photograph_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
$satellite_image = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') There are ' . count($photograph_data).' Images');
|
||||
@ -425,7 +428,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$img_split = explode( ',', $photograph_data[$i]['img']);
|
||||
$img_fields['img'] = $img_split[1];
|
||||
// $img_fields[0]['img'] = $photograph_data[$i]['img'];
|
||||
cet_salespd::pushwithcetphotographapi($img_fields,$i);
|
||||
$img_result = cet_salespd::pushwithcetphotographapi($img_fields,$i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -434,14 +437,14 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$stt_fields = $common_fields;
|
||||
$stt_fields['img_name'] = $satellite_image[0]['img_name'];
|
||||
$stt_fields['img'] = $satellite_image[0]['img'];
|
||||
cet_salespd::pushwithcetphotographapi($stt_fields,0);
|
||||
$stt_result = cet_salespd::pushwithcetphotographapi($stt_fields,0);
|
||||
}
|
||||
return $result;
|
||||
}else{
|
||||
log_message('ERROR', '#### Section Details pushed Images Details Not Pushed');
|
||||
log_message('ERROR',"###CET APP SALES PDID (".$sales_pd_id.") PullSalesPDData response :".json_encode($result));
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||
$data['msg'] = 'Section Details pushed Images Details Not Pushed ! Try Later';
|
||||
$data['msg'] = 'Sales pd details Not Pushed ! Try Later';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -54,7 +54,8 @@ class CET_SALESPD
|
||||
$headers = array('Content-Type: application/json');
|
||||
$ch = curl_init();
|
||||
$output_data = json_encode( $fields );
|
||||
// log_message('ERROR',"PullSalesPDData api Request Format : ".$output_data);
|
||||
// print_r($output_data);die();
|
||||
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 );
|
||||
@ -65,7 +66,7 @@ class CET_SALESPD
|
||||
$response = json_decode($result);
|
||||
log_message('ERROR',"CET APP SALES PDID (".$pdid.") "."PullSalesPDData api response :".json_encode($response));
|
||||
curl_close( $ch );
|
||||
return $response->status == 200 ? true : false;
|
||||
return $response;
|
||||
|
||||
}
|
||||
// multipart/form-data;
|
||||
@ -98,7 +99,7 @@ class CET_SALESPD
|
||||
log_message('ERROR',"###CET APP SALES PDID (".$pdid.") ".$log_msg."response :".json_encode($response));
|
||||
curl_close( $ch );
|
||||
unlink($file);
|
||||
return $response->status == 200 ? true : false;
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user