本文整理汇总了PHP中oledrion_utils::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP oledrion_utils::redirect方法的具体用法?PHP oledrion_utils::redirect怎么用?PHP oledrion_utils::redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oledrion_utils
的用法示例。
在下文中一共展示了oledrion_utils::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CriteriaCompo
$configHandler->insertConfig($config);
}
}
if (isset($_POST['product_property10'])) {
if (oledrion_utils::getModuleOption('product_property10') != $_POST['product_property10']) {
$criteria = new CriteriaCompo();
$criteria->add($moduleIdCriteria);
$criteria->add(new Criteria('conf_name', 'product_property10'));
$config = $configHandler->getConfigs($criteria);
$config = $config[0];
$configValue = array('conf_modid' => $xoopsModule->getVar('mid'), 'conf_catid' => 0, 'conf_name' => 'product_property10', 'conf_value' => $_POST['product_property10'], 'conf_formtype' => 'hidden', 'conf_valuetype' => 'text');
$config->setVars($configValue);
$configHandler->insertConfig($config);
}
}
if (isset($_POST['product_property10_title'])) {
if (oledrion_utils::getModuleOption('product_property10_title') != $_POST['product_property10_title']) {
$criteria = new CriteriaCompo();
$criteria->add($moduleIdCriteria);
$criteria->add(new Criteria('conf_name', 'product_property10_title'));
$config = $configHandler->getConfigs($criteria);
$config = $config[0];
$configValue = array('conf_modid' => $xoopsModule->getVar('mid'), 'conf_catid' => 0, 'conf_name' => 'product_property10_title', 'conf_value' => $_POST['product_property10_title'], 'conf_formtype' => 'hidden', 'conf_valuetype' => 'text');
$config->setVars($configValue);
$configHandler->insertConfig($config);
}
}
oledrion_utils::updateCache();
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=property', 2);
break;
}
示例2: array
}
}
// Vérification de la validité de la facture (si pas admin)
if (!oledrion_utils::isAdmin()) {
if ($order->getVar('cmd_state') != OLEDRION_STATE_VALIDATED) {
// Commande non validée
oledrion_utils::redirect(_OLEDRION_ERROR12, 'index.php', 6);
}
}
$caddy = $tmp = $products = $vats = $manufacturers = $tmp2 = $manufacturers = $productsManufacturers = array();
// Récupération des TVA
$vats = $h_oledrion_vat->getAllVats(new oledrion_parameters());
// Récupération des caddy associés
$caddy = $h_oledrion_caddy->getCaddyFromCommand($cmdId);
if (count($caddy) == 0) {
oledrion_utils::redirect(_OLEDRION_ERROR11, 'index.php', 6);
}
// Récupération de la liste des produits associés
foreach ($caddy as $item) {
$tmp[] = $item->getVar('caddy_product_id');
}
// Recherche des produits ***********************************************************************************************
$products = $h_oledrion_products->getProductsFromIDs($tmp, true);
// Recherche des fabricants **********************************************************************************************
$tmp2 = $h_oledrion_productsmanu->getFromProductsIds($tmp);
$tmp = array();
foreach ($tmp2 as $item) {
$tmp[] = $item->getVar('pm_manu_id');
$productsManufacturers[$item->getVar('pm_product_id')][] = $item;
}
$manufacturers = $h_oledrion_manufacturer->getManufacturersFromIds($tmp);
示例3: array
*/
/**
* oledrion
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Hossein Azizabadi (azizabadi@faragostaresh.com)
* @version $Id$
*/
require 'header.php';
$xoopsOption['template_main'] = 'oledrion_user.tpl';
require_once XOOPS_ROOT_PATH . '/header.php';
// Check is user
$uid = oledrion_utils::getCurrentUserID();
if ($uid == 0) {
oledrion_utils::redirect(_OLEDRION_ERROR23, XOOPS_URL . '/register.php', 4);
}
// Load header
$handlers = oledrion_handler::getInstance();
// Get list of this user order
$orders = $list = array();
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('cmd_uid', $uid));
$criteria->setSort('cmd_id');
$criteria->setOrder('DESC');
$orders = $handlers->h_oledrion_commands->getObjects($criteria, false);
if (!empty($orders)) {
foreach ($orders as $item) {
$command = $item->toArray();
/* $caddy = $h_oledrion_caddy->getCaddyFromCommand($command['cmd_id']);
foreach ($caddy as $item) {
示例4: XoopsFormHidden
$sform->addElement(new XoopsFormHidden('product_id', $item->getVar('product_id')));
foreach ($productRelated_d as $value) {
$sform->addElement(new XoopsFormText($value['title'], $value['id'], 5, 5, $value['percent']), false);
}
$button_tray = new XoopsFormElementTray('', '');
$submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
$button_tray->addElement($submit_btn);
$sform->addElement($button_tray);
$sform = oledrion_utils::formMarkRequiredFields($sform);
$sform->display();
include_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
break;
// **********************************************************************************************
// **********************************************************************************************
case 'relatedsave':
// ******************************************************************************************
xoops_cp_header();
$id = isset($_POST['product_id']) ? intval($_POST['product_id']) : 0;
$item = $h_oledrion_products->get($id);
if (!is_object($item)) {
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5);
}
foreach ($_POST as $related => $percent) {
if (is_numeric($related)) {
$h_oledrion_related->updatePercent($id, $related, $percent);
}
}
$opRedirect = 'products';
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $opRedirect, 5);
break;
}
示例5: intval
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* oledrion
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Hervé Thouzard (http://www.herve-thouzard.com/)
* @version $Id: rate-product.php 12290 2014-02-07 11:05:17Z beckmi $
*/
/**
* Notation d'un produit
*/
require 'header.php';
oledrion_utils::redirect(_OLEDRION_NORATE, 'index.php', 5);
/*
$product_id = 0;
// Les tests **************************************************************************************
// Peut on voter ?
if (oledrion_utils::getModuleOption('rateproducts') == 0 ) {
oledrion_utils::redirect(_OLEDRION_NORATE, 'index.php', 5);
}
// Recherche du n° du produit
if (isset($_GET['product_id'])) {
$product_id = intval($_GET['product_id']);
} elseif (isset($_POST['product_id'])) {
$product_id = intval($_POST['product_id']);
} else {
oledrion_utils::redirect(_OLEDRION_ERROR1, 'index.php', 5);
}
示例6: basename
oledrion_utils::redirect(_OLEDRION_ERROR15, OLEDRION_URL, 5);
}
// On vérifie que la commande associée est payée
$order = null;
$order = $h_oledrion_commands->get($caddy->getVar('caddy_cmd_id'));
if ($order == null) {
oledrion_utils::redirect(_OLEDRION_ERROR16, OLEDRION_URL, 5);
}
// Tout est bon, on peut envoyer le fichier au navigateur, s'il y a un fichier à télécharger, et s'il existe
$file = '';
$file = $product->getVar('product_download_url');
if (xoops_trim($file) == '') {
oledrion_utils::redirect(_OLEDRION_ERROR17, OLEDRION_URL, 5);
}
if (!file_exists($file)) {
oledrion_utils::redirect(_OLEDRION_ERROR18, OLEDRION_URL, 5);
}
// Mise à jour, le fichier n'est plus disponible au téléchargement
$h_oledrion_caddy->markCaddyAsNotDownloadableAnyMore($caddy);
$fileContent = file_get_contents($file);
// Plugins ************************************************
$plugins = oledrion_plugins::getInstance();
$parameters = new oledrion_parameters(array('fileContent' => $fileContent, 'product' => $product, 'order' => $order, 'fullFilename' => $file));
$parameters = $plugins->fireFilter(oledrion_plugins::EVENT_ON_PRODUCT_DOWNLOAD, $parameters);
if (trim($parameters['fileContent']) != '') {
$fileContent = $parameters['fileContent'];
}
// *********************************************************
// Et affichage du fichier avec le type mime qui va bien
header("Content-Type: " . oledrion_utils::getMimeType($file));
header('Content-disposition: inline; filename="' . basename($file) . '"');
示例7: XoopsFormElementTray
$sform->addElement($editor6, false);
}
$editor7 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_CHECKOUT_TEXT2, 'welcome7', $registry->getfile(OLEDRION_TEXTFILE7), 5, 60, 'hometext7_hidden');
if ($editor7) {
$sform->addElement($editor7, false);
}
$button_tray = new XoopsFormElementTray('', '');
$submit_btn = new XoopsFormButton('', 'post', _AM_OLEDRION_MODIFY, 'submit');
$button_tray->addElement($submit_btn);
$sform->addElement($button_tray);
$sform = oledrion_utils::formMarkRequiredFields($sform);
$sform->display();
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'savetexts':
// Sauvegarde des textes d'accueil ********************************************************
// ****************************************************************************************************************
require_once OLEDRION_PATH . 'class/registryfile.php';
$registry = new oledrion_registryfile();
$registry->savefile($myts->stripSlashesGPC($_POST['welcome1']), OLEDRION_TEXTFILE1);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome2']), OLEDRION_TEXTFILE2);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome3']), OLEDRION_TEXTFILE3);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome4']), OLEDRION_TEXTFILE4);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome5']), OLEDRION_TEXTFILE5);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome6']), OLEDRION_TEXTFILE6);
$registry->savefile($myts->stripSlashesGPC($_POST['welcome7']), OLEDRION_TEXTFILE7);
oledrion_utils::updateCache();
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=texts', 2);
break;
}
示例8:
if (empty($gateway)) {
oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl . $opRedirect, 5);
}
if (!oledrion_gateways::isInstalledGatewayName($gateway)) {
oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR5, $baseurl . $opRedirect, 4);
}
if (oledrion_gateways::gatewayClassFileExists($gateway)) {
if (!oledrion_gateways::loadGatewaysLanguageDefines($gateway)) {
// Le chargement des traductions a échoué
oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR2, $baseurl . $opRedirect, 4);
}
oledrion_gateways::includeGatewayClass($gateway);
if (oledrion_gateways::gatewayClassExists($gateway)) {
$gatewayClassName = oledrion_gateways::gatewayClassName($gateway);
$temporaryGateway = new $gatewayClassName();
if (!oledrion_gateways::asGoodAncestor($temporaryGateway)) {
oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR4, $baseurl . $opRedirect, 4);
}
if ($temporaryGateway->saveParametersForm($_POST)) {
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . $opRedirect, 2);
} else {
oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . $opRedirect, 4);
}
} else {
oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR3, $baseurl . $opRedirect, 4);
}
} else {
oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR1, $baseurl . $opRedirect, 4);
}
break;
}
示例9: header
// On va chercher sa valeur par défaut
if ($attribute->hasDefaultValue()) {
$userAttributes[$attribute->attribute_id] = $attribute->getAttributeDefaultValue();
}
}
}
}
$h_oledrion_caddy->addProduct($productId, 1, $userAttributes);
$url = OLEDRION_URL . 'caddy.php';
if (!OLEDRION_CART_BUG) {
header("Location: {$url}");
} else {
listCart();
}
} else {
oledrion_utils::redirect(_OLEDRION_PROBLEM_QTY, 'index.php', 5);
// Plus de stock !
}
listCart();
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'empty':
// Suppression du contenu du caddy
// ****************************************************************************************************************
$h_oledrion_caddy->emptyCart();
listCart();
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'default':
示例10: intval
$GLOBALS['current_category'] = -1;
$xoopsOption['template_main'] = 'oledrion_manufacturer.tpl';
require_once XOOPS_ROOT_PATH . '/header.php';
require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
// Les tests **************************************************************************************
if (isset($_GET['manu_id'])) {
$manu_id = intval($_GET['manu_id']);
} else {
oledrion_utils::redirect(_OLEDRION_ERROR7, 'index.php', 5);
}
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
// Le fabricant existe ?
$manufacturer = null;
$manufacturer = $h_oledrion_manufacturer->get($manu_id);
if (!is_object($manufacturer)) {
oledrion_utils::redirect(_OLEDRION_ERROR7, 'index.php', 5);
}
$xoopsTpl->assign('mod_pref', $mod_pref);
// Préférences du module
$xoopsTpl->assign('columnsCount', oledrion_utils::getModuleOption('catagory_colums'));
$xoopsTpl->assign('manufacturer', $manufacturer->toArray());
$limit = oledrion_utils::getModuleOption('perpage');
// Lecture des TVA ********************************************************************************
$vatArray = array();
$vatArray = $h_oledrion_vat->getAllVats(new oledrion_parameters());
// Recherche des produits de ce fabricant *********************************************************
// On commence par chercher le nombre total de ses produits
$itemsCount = $h_oledrion_manufacturer->getManufacturerProductsCount($manu_id);
if ($itemsCount > $limit) {
$pagenav = new XoopsPageNav($itemsCount, $limit, $start, 'start', 'manu_id=' . $manu_id);
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
示例11: md5
$passwordCancel = md5(xoops_makepass());
$commande = $h_oledrion_commands->create(true);
$commande->setVars($_POST);
$commande->setVar('cmd_uid', $uid);
$commande->setVar('cmd_date', date("Y-m-d"));
$commande->setVar('cmd_state', OLEDRION_STATE_NOINFORMATION);
$commande->setVar('cmd_ip', oledrion_utils::IP());
$commande->setVar('cmd_articles_count', count($cartForTemplate));
$commande->setVar('cmd_total', oledrion_utils::formatFloatForDB($commandAmountTTC));
$commande->setVar('cmd_shipping', oledrion_utils::formatFloatForDB($shippingAmount));
$commande->setVar('cmd_password', $password);
$commande->setVar('cmd_cancel', $passwordCancel);
$commande->setVar('cmd_text', implode("\n", $discountsDescription));
$res = $h_oledrion_commands->insert($commande, true);
if (!$res) {
oledrion_utils::redirect(_OLEDRION_ERROR10, OLEDRION_URL, 6);
}
// Enregistrement du panier
$msgCommande = '';
$handlers = oledrion_handler::getInstance();
foreach ($cartForTemplate as $line) {
$panier = $h_oledrion_caddy->create(true);
$panier->setVar('caddy_product_id', $line['product_id']);
$panier->setVar('caddy_qte', $line['product_qty']);
$panier->setVar('caddy_price', oledrion_utils::formatFloatForDB($line['totalPrice']));
// Attention, prix TTC avec frais de port
$panier->setVar('caddy_cmd_id', $commande->getVar('cmd_id'));
$panier->setVar('caddy_shipping', oledrion_utils::formatFloatForDB($line['discountedShipping']));
$panier->setVar('caddy_pass', md5(xoops_makepass()));
// Pour le téléchargement
$msgCommande .= str_pad(wordwrap($line['product_title'], 60), 60, ' ') . ' ' . str_pad($line['product_qty'], 8, ' ', STR_PAD_LEFT) . ' ' . str_pad($line['totalPriceFormated'], 10, ' ', STR_PAD_LEFT) . ' ' . str_pad($line['discountedShipping'], 10, ' ', STR_PAD_LEFT) . "\n";
示例12: xoops_cp_header
xoops_cp_header();
$categories = $h_oledrion_cat->getCategoriesCount();
if ($categories == 0) {
$cat_array = array('cat_cid' => 1, 'cat_pid' => 0, 'cat_title' => 'Test category');
$cat = $h_oledrion_cat->create();
$cat->setVars($cat_array);
$res = $h_oledrion_cat->insert($cat);
$manufacturer_array = array('manu_id' => 1, 'manu_name' => 'Test manufacturer');
$manufacturer = $h_oledrion_manufacturer->create(true);
$manufacturer->setVars($manufacturer_array);
$res = $h_oledrion_manufacturer->insert($manufacturer);
$product_array = array('product_id' => 1, 'product_cid' => 1, 'product_title' => 'Test product', 'product_vendor_id' => 1, 'product_submitter' => 1, 'product_online' => 1, 'product_submitted' => time(), 'product_price' => '100', 'product_summary' => 'Test test test test test test test test test test test test test test test test test', 'product_vat_id' => 1, 'product_stock' => 100);
$product = $h_oledrion_products->create(true);
$product->setVars($product_array);
$res = $h_oledrion_products->insert($product);
$productsmanu_array = array('pm_id' => 1, 'pm_id' => 1, 'pm_manu_id' => 1);
$productsmanu = $h_oledrion_productsmanu->create(true);
$productsmanu->setVars($productsmanu_array);
$res = $h_oledrion_products->insert($productsmanu);
$vat_array = array('vat_id' => 1, 'vat_rate' => '0.00', 'vat_country' => 'us');
$vat = $h_oledrion_vat->create(true);
$vat->setVars($vat_array);
$res = $h_oledrion_vat->insert($vat);
$vendor_array = array('vendor_id' => 1, 'vendor_name' => 'Test vendor');
$vendor = $h_oledrion_vendors->create(true);
$vendor->setVars($vendor_array);
$res = $h_oledrion_vendors->insert($vendor);
}
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl, 2);
break;
}
示例13: isset
$removeBr = $removeHtml = false;
$removeBr = isset($_POST['removebr']) ? intval($_POST['removebr']) : 0;
$removeHtml = isset($_POST['removehtml']) ? intval($_POST['removehtml']) : 0;
$header = isset($_POST['header']) ? $_POST['header'] : '';
$footer = isset($_POST['footer']) ? $_POST['footer'] : '';
$date1 = strtotime($_POST['date1']);
$date2 = strtotime($_POST['date2']);
$cat_id = intval($_POST['cat_cid']);
$products = $categories = array();
$products = $h_oledrion_products->getProductsForNewsletter(new oledrion_parameters(array('startingDate' => $date1, 'endingDate' => $date2, 'category' => $cat_id)));
$newsfile = OLEDRION_NEWSLETTER_PATH;
$categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters(array('start' => 0, 'limit' => 0, 'sort' => 'cat_title', 'order' => 'ASC', 'idaskey' => true)));
$vats = $h_oledrion_vat->getAllVats(new oledrion_parameters());
$fp = fopen($newsfile, 'w');
if (!$fp) {
oledrion_utils::redirect(_AM_OLEDRION_ERROR_7, $baseurl . '?op=newsletter', 5);
}
if (xoops_trim($header) != '') {
fwrite($fp, $header);
}
foreach ($products as $item) {
$content = $newsletterTemplate;
$tblTmp = $tblTmp2 = array();
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('pm_product_id', $item->getVar('product_id'), '='));
$tblTmp = $h_oledrion_productsmanu->getObjects($criteria);
foreach ($tblTmp as $productManufacturer) {
$tblTmp2[] = $productManufacturer->getVar('pm_manu_id');
}
$manufacturers = $h_oledrion_manufacturer->getObjects(new Criteria('manu_id', '(' . implode(',', $tblTmp2) . ')', 'IN'), true);
$tblTmp = array();
示例14: show_footer
}
echo '</table></form>';
if (isset($pagenav) && is_object($pagenav)) {
echo "<div align='right'>" . $pagenav->renderNav() . '</div>';
}
show_footer();
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'updatequantities':
// Mise à jour des quantités des produits
// ****************************************************************************************************************
$names = array();
if (isset($_POST['names'])) {
$names = explode('|', $_POST['names']);
foreach ($names as $item) {
$name = 'qty_' . $item;
if (isset($_POST[$name]) && xoops_trim($_POST[$name]) != '') {
$quantity = intval($_POST[$name]);
$product_id = intval($item);
$product = null;
$product = $h_oledrion_products->get($product_id);
if (is_object($product)) {
$h_oledrion_products->updateAll('product_stock', $quantity, new Criteria('product_id', $product_id, '='), true);
}
}
}
}
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=lowstock', 2);
break;
}
示例15: xoops_cp_header
echo "<tr>\n";
}
echo '</table>';
if (isset($pagenav) && is_object($pagenav)) {
echo "<div align='right'>" . $pagenav->renderNav() . "</div>";
}
include_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'delete':
// Suppression d'une liste
// ****************************************************************************************************************
xoops_cp_header();
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if (empty($id)) {
oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl . '?op=' . $operation, 5);
}
$list = null;
$list = $oledrion_handlers->h_oledrion_lists->get($id);
if (!is_object($list)) {
oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . '?op=' . $operation, 5);
}
if ($oledrion_handlers->h_oledrion_lists->deleteList($list)) {
oledrion_utils::updateCache();
oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $operation, 2);
} else {
oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $operation, 5);
}
break;
}