Released under the GNU General Public License */ require 'includes/application_top.php'; require_once 'doba/DobaProducts.php'; include_once 'doba/DobaApi.php'; include_once 'doba/DobaProductAPI.php'; $msg = ''; $api = new DobaApi(); if (isset($_POST['submit'])) { require_once 'doba/DobaInteraction.php'; $watchlist_id = isset($_POST['watchlist_id']) ? intval($_POST['watchlist_id']) : 0; if ($watchlist_id > 0) { $action = DOBA_API_ACTION_GETPRODUCTDETAIL; $data = array('watchlist_id' => $watchlist_id); if ($api->compileRequestXml($action, $data) && $api->sendRequest()) { $objDobaProducts = DobaProductAPI::parseProductDetails($api->getResponseXml()); if (is_a($objDobaProducts, 'DobaProducts') && DobaInteraction::loadDobaProductsIntoDB($objDobaProducts)) { require_once 'doba/DobaLog.php'; DobaLog::logProductApiLoad($objDobaProducts, 'success'); header('Location: ' . FILENAME_DOBA_PRODUCTS . '?api=success'); exit; } else { $msg = 'Your request could not be completed at this time. Please try again later.'; } } else { if ($api->hasErrors()) { $msg = 'Your request could not be completed due to the following errors:<br>- ' . implode('<br>- ', $api->getErrors()); } else { $msg = 'Your request could not be completed at this time. Please try again later.'; }