for ($i = 0; $i < 10; $i++) { $randstring = $characters[rand(0, strlen($characters) - 1)]; } return $randstring; } function microtime_string() { list($usec, $sec) = explode(" ", microtime()); return str_ireplace('.', '', (double) $usec + (double) $sec); } $db = new Database(); $api = new Api(); $html = new Frontend(); $settings = $db->select('settings', null, '*', 1); if (!$settings['shipping_api'] or !$settings['ship_ready']) { $html->redirection('../../royalmail.php'); } if (!isset($_SESSION['force'])) { $_SESSION['force'] = microtime_string(); echo "<script>document.location.reload(true)</script>"; } else { $errorCount = 0; $orders = $api->getOrders('label_request'); foreach ($orders as $order) { $_order = new Mage_Sales_Model_Order(); $_order->loadByIncrementId($order['reference']); if (!$db->select('royal_mail', '`reference` = ' . $order['reference'])) { $api->addGiftMessageToComments($_order); } $xml = $api->createOrderXML($order, $settings, $order['postage']); echo '<div class="col-md-6">';
echo "<pre>"; print_r($data); echo "</pre>"; ?> </div> </div> <?php } function RandomString() { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randstring = ''; for ($i = 0; $i < 10; $i++) { $randstring = $characters[rand(0, strlen($characters) - 1)]; } return $randstring; } $html = new Frontend(); $db = new Session(); if (isset($_SESSION['userid'])) { $db->update("users", "last_seen", "CURRENT_TIMESTAMP", $_SESSION['userid']); } if (is_file("update.lock") or is_file("install.lock")) { if ($current_page != "lock.php" and $current_page != "update.php") { $html->redirection("lock.php"); } } if (basename($_SERVER['PHP_SELF']) != "logon.php" and basename($_SERVER['PHP_SELF']) != "upload.php") { $html->navbar(); } $alerts = new Alerts();
$ai = $mage_db->select("m2epro_amazon_listing_product", null, "listing_product_id,sku"); if ($mp and $ai) { if ($_SESSION['display']) { $report->start("Comparing Amazon Item Sku's to Products", 3); } foreach ($ai as $si) { $result = $mage_db->select("m2epro_listing_product", $si['listing_product_id'], "product_id", 1); $si['product_id'] = $result['product_id']; if ($mp[$si['product_id']] !== $si['sku']) { if ($_SESSION['display']) { $entry = $mp[$si['product_id']] . "||" . $si['sku']; $report->entry("warning", $si['product_id'], $entry); } else { $mage_db->delete("m2epro_amazon_listing_product", "`listing_product_id` = " . $si['listing_product_id']); $mage_db->delete("m2epro_listing_product", $si['listing_product_id']); $html->redirection("../scripts.php"); } } // else if($_SESSION['display']) { // $entry = $mp[$si['product_id']]."||".$si['sku']; // $report->entry("info", "skipping", $entry); // } } if ($_SESSION['display']) { $report->end(); } } //////////////// // End Script // //////////////// if ($_SESSION['display']) {