$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.'; } } } else { $msg = 'Please select a watchlist to use.'; } } $watchlists = array(); if (DOBA_API_ENABLED !== true) { $msg = 'You must set up your Doba API authentication before you can use this tool. Find out more by sending an email to support@doba.com.'; } else { // load up the watchlists set up under the current api auth $action = DOBA_API_ACTION_GETWATCHLISTS;