Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: srvrorder_dhrufusion.php
<?php $arrCustomFields = array(); //echo '<pre>'; //print_r($row); die; if($row->APIType == '2' || $row->APIType == '6') { require_once(APPPATH . 'libraries/cron/dhrufusionapi.class.php'); $objFusion = new DhruFusion(); } else if($row->APIType == '7') { require_once(APPPATH . 'libraries/cron/gsmhubapi.class.php'); $objFusion = new GSMHUB(); } if($row->ExternalNetworkId != '') $para['ID'] = $row->ExternalNetworkId; if(!empty($row->CustomFields) && $row->APIType == 2 || $row->APIType == '6') { $CustomFieldsArray = array(); $para['SERVER'] = "true"; foreach($row->CustomFields as $CustomField) { if($CustomField->UseAsQuantity) { $para['QNT'] = $CustomField->FieldValue; // $para['QUANTITY'] = $CustomField->FieldValue; }else{ if($CustomField->CustomField) { $CustomFieldsArray[$CustomField->FieldName] = $CustomField->FieldValue; }else{ $para[$CustomField->FieldName] = $CustomField->FieldValue; } } } echo 'custom fields array<pre>'; print_r($CustomFieldsArray); echo '</pre>'; if(!empty($CustomFieldsArray)) $para['customfield'] = base64_encode(json_encode($CustomFieldsArray)); } //if($row->APIType == '7' && $row->OrderServiceTypeId != '0') if($row->APIType == '7') { $strReqParams = ''; if($row->OrderServiceTypeId != '0') $strReqParams = '"service_type_id":"'.$row->OrderServiceTypeId.'"'; $CustomFieldsArray = array(); foreach($row->CustomFields as $CustomField) { if($CustomField->UseAsQuantity) { $para['QUANTITY'] = $CustomField->FieldValue; }else{ if($strReqParams != '') $strReqParams .= ','; $strReqParams .= '"' . $CustomField->FieldName . '":"'.$CustomField->FieldValue.'"'; } } $para['REQUIRED'] = '{'.$strReqParams.'}'; } echo 'Para: <pre>'; print_r($para); echo '</pre>'; if($row->APIType == '2') { $RESPONSE_FU = $objFusion->action('placeimeiorder', $MY_API_KEY, $row->AccountId, $row->ServerURL, $para); echo 'Response is <pre>'; print_r($RESPONSE_FU); echo '</pre>'; } else if($row->APIType == '7' || $row->APIType == '6') { //echo ''here''; die; $RESPONSE_FU = $objFusion->action('placeserverorder', $MY_API_KEY, $row->AccountId, $row->ServerURL, $para); echo 'Response is <pre>'; print_r($RESPONSE_FU); echo '</pre>'; } if(isset($RESPONSE_FU['ERROR'])) { if(is_array($RESPONSE_FU['ERROR'][0])) { $ifCodeSentToServer = 0; $msgFromServer = 'Error while sending request to server!'; if(isset($RESPONSE_FU['ERROR'][0]['MESSAGE']) && $RESPONSE_FU['ERROR'][0]['MESSAGE'] != '') $msgFromServer = strip_tags($RESPONSE_FU['ERROR'][0]['MESSAGE']); if(isset($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'])) { if($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'] != '') $msgFromServer = strip_tags($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION']); else if($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][0] != '' || $RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][1] != '') { if(isset($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][0]) && $RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][0] != '') $msgFromServer = strip_tags($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][0]); if(isset($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][1]) && $RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][1] != '') $msgFromServer = strip_tags($RESPONSE_FU['ERROR'][0]['FULL_DESCRIPTION'][1]); } } if(isset($RESPONSE_FU['ERROR'][0]['MESSAGE']['error']) && $RESPONSE_FU['ERROR'][0]['MESSAGE']['error'] != '') $msgFromServer = strip_tags($RESPONSE_FU['ERROR'][0]['MESSAGE']['error']); } } else if(isset($RESPONSE_FU['SUCCESS'])) { $ifCodeSentToServer = 1; if(is_array($RESPONSE_FU['SUCCESS'][0])) { if(isset($RESPONSE_FU['SUCCESS'][0]['REFERENCEID'])) $orderIdFromServer = $RESPONSE_FU['SUCCESS'][0]['REFERENCEID']; } } ?>