本文整理汇总了PHP中Frontend::redirection方法的典型用法代码示例。如果您正苦于以下问题:PHP Frontend::redirection方法的具体用法?PHP Frontend::redirection怎么用?PHP Frontend::redirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frontend
的用法示例。
在下文中一共展示了Frontend::redirection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: microtime_string
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">';
示例2: RandomString
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();
示例3: foreach
$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']) {