echo '</table>'; if (isset($pagenav) && is_object($pagenav)) { echo "<div align='right'>" . $pagenav->renderNav() . "</div>"; } show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'add': // Ajout d'un fabricant // Ajout d'un fabricant case 'edit': // Edition d'un fabricant // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(4); if ($action == 'edit') { $title = _AM_OLEDRION_EDIT_MANUFACTURER; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } // Item exits ? $item = null; $item = $h_oledrion_manufacturer->get($id); if (!is_object($item)) { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); } $edit = true; $label_submit = _AM_OLEDRION_MODIFY; } else {
* Version : $Id: * **************************************************************************** */ /** * Actions relatives au Dashboard (affichage et suppression d'un vote) */ if (!defined("OLEDRION_ADMIN")) { exit; } switch ($action) { // **************************************************************************************************************** case 'default': // Affichage du dashboard // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(0); oledrion_utils::htitle(_MI_OLEDRION_ADMENU10, 4); $itemsCount = 5; // Nombre d'éléments à afficher if ($h_oledrion_products->getCount() > 0) { echo "<table border='0' width='100%' cellpadding='2' cellspacing='2'>"; echo "<tr>\n"; // Dernières commandes ************************************************ echo "<td valign='top' width='50%' align='center'><b>" . _AM_OLEDRION_LAST_ORDERS . "</b>"; $tblTmp = array(); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('cmd_id', 0, '<>')); $criteria->setSort('cmd_date'); $criteria->setOrder('DESC'); $criteria->setLimit($itemsCount); $criteria->setStart(0);
if ($add) { $plugins = oledrion_plugins::getInstance(); $plugins->fireAction(oledrion_plugins::EVENT_ON_CATEGORY_CREATE, new oledrion_parameters(array('category' => $item))); } oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2); } else { oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5); } break; // **************************************************************************************************************** // **************************************************************************************************************** case 'delete': // Suppression d'une catégorie // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(3); $id = isset($_POST['id']) ? intval($_POST['id']) : 0; if ($id == 0) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } $category = null; $category = $h_oledrion_cat->get($id); if (!is_object($category)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5); } $msg = sprintf(_AM_OLEDRION_CONF_DEL_CATEG, $category->getVar('cat_title')); xoops_confirm(array('op' => 'categories', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'confdelete':
if (isset($pagenav) && is_object($pagenav)) { echo "<div align='right'>" . $pagenav->renderNav() . "</div>"; } $oledrion_reductions = new oledrion_reductions(); show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'add': // Ajout d'une promotion // Ajout d'une promotion case 'edit': // Edition d'une promo // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(7); if ($action == 'edit') { $title = _AM_OLEDRION_EDIT_DISCOUNT; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } // Item exits ? $item = null; $item = $h_oledrion_discounts->get($id); if (!is_object($item)) { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); } $edit = true; $label_submit = _AM_OLEDRION_MODIFY; } else {
$form = oledrion_utils::formMarkRequiredFields($form); $form->display(); } else { oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR3, $baseurl . $opRedirect, 4); } } else { oledrion_utils::redirect(_AM_OLEDRION_GATEWAYS_ERROR1, $baseurl . $opRedirect, 4); } break; // **************************************************************************************************************** // **************************************************************************************************************** case 'saveparameters': // Enregistrement des paramètres de la passerelle de paiement // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(12); $opRedirect = '?op=gateways'; $gateway = isset($_POST['gateway']) ? strtolower($_POST['gateway']) : ''; $gateway = oledrion_gateways::purifyGatewayName($gateway); 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 ($res) { oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2); } else { oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5); } } else { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5); } break; // **************************************************************************************************************** // **************************************************************************************************************** case 'export': // Export des commandes au format CSV // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(6); oledrion_utils::htitle(_MI_OLEDRION_ADMENU5, 4); $orderType = intval($_POST['cmdtype']); $exportFilter = $_POST['exportfilter']; $exportFilename = OLEDRION_PATH . 'admin/exports/' . $exportFilter . '.php'; if (file_exists($exportFilename)) { require_once OLEDRION_PATH . 'admin/exports/export.php'; require_once $exportFilename; $className = 'oledrion_' . $exportFilter . '_export'; if (class_exists($className)) { $export = new $className(); $export->setOrderType($orderType); $result = $export->export(); if ($result === true) { echo "<a href='" . $export->getDownloadUrl() . "'>" . _AM_OLEDRION_EXPORT_READY . '</a>'; //echo "<a href='$baseurl?op=orders&action=deleteexport&file=".$export->getDownloadPath()."'>".
* Version : $Id: * **************************************************************************** */ /** * Gestion des stocks bas (dans l'administration) */ if (!defined("OLEDRION_ADMIN")) { exit; } switch ($action) { // **************************************************************************************************************** case 'default': // Stock bas // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(10); oledrion_utils::htitle(_MI_OLEDRION_ADMENU9, 4); $start = isset($_GET['start']) ? intval($_GET['start']) : 0; $criteria = new CriteriaCompo(); // Recherche des produits dont la quantité en stock est inférieure ou égale à la quantité d'alerte et ou la quantité d'alerte est supérieure à 0 $itemsCount = $h_oledrion_products->getLowStocksCount(); if ($itemsCount > $limit) { $pagenav = new XoopsPageNav($itemsCount, $limit, $start, 'start', 'op=lowstock'); } $products = $h_oledrion_products->getLowStocks($start, $limit); $class = $name = ''; $names = array(); echo "<form name='frmupdatequant' id='frmupdatequant' method='post' action='{$baseurl}'><input type='hidden' name='op' id='op' value='lowstock' /><input type='hidden' name='action' id='action' value='updatequantities' />"; echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; echo "<tr><th align='center'>" . _OLEDRION_TITLE . "</th><th align='center'>" . _OLEDRION_STOCK_QUANTITY . "</th><th align='center'>" . _OLEDRION_STOCK_ALERT . "</th><th align='center'>" . _AM_OLEDRION_NEW_QUANTITY . "</th></tr>"; foreach ($products as $item) {
echo '</table>'; if (isset($pagenav) && is_object($pagenav)) { echo "<div align='right'>" . $pagenav->renderNav() . "</div>"; } show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'add': // Ajout d'un fichier // Ajout d'un fichier case 'edit': // Edition d'un fichier // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(11); if ($action == 'edit') { $title = _AM_OLEDRION_EDIT_FILE; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } // Item exits ? $item = null; $item = $h_oledrion_files->get($id); if (!is_object($item)) { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); } $edit = true; $label_submit = _AM_OLEDRION_MODIFY; } else {
$item = null; $item = $h_oledrion_products->get($id); if (is_object($item)) { $res = $oledrion_shelf->deleteProduct($item, true); if ($res) { oledrion_utils::updateCache(); xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'new_product', $id); oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2); } else { oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5); } } else { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5); } } else { oledrion_adminMenu(5); oledrion_utils::htitle(_AM_OLEDRION_SORRY_NOREMOVE, 4); $tblTmp2 = array(); $tblTmp2 = $h_oledrion_commands->getObjects(new Criteria('cmd_id', '(' . implode(',', $tblTmp) . ')', 'IN'), true); echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; $class = ''; echo "<tr><th align='center'>" . _AM_OLEDRION_ID . "</th><th align='center'>" . _AM_OLEDRION_DATE . "</th><th align='center'>" . _AM_OLEDRION_CLIENT . "</th><th align='center'>" . _AM_OLEDRION_TOTAL_SHIPP . "</th></tr>"; foreach ($tblTmp2 as $item) { $class = $class == 'even' ? 'odd' : 'even'; $date = formatTimestamp(strtotime($item->getVar('cmd_date')), 's'); echo "<tr class='" . $class . "'>\n"; echo "<td align='right'>" . $item->getVar('cmd_id') . "</td><td align='center'>" . $date . "</td><td align='center'>" . $item->getVar('cmd_lastname') . ' ' . $item->getVar('cmd_firstname') . "</td><td align='center'>" . $item->getVar('cmd_total') . ' ' . oledrion_utils::getModuleOption('money_short') . ' / ' . $item->getVar('cmd_shipping') . ' ' . oledrion_utils::getModuleOption('money_short') . "</td>\n"; echo "<tr>\n"; } echo '</table>'; show_footer();
$sform->addElement(new XoopsFormTextArea(_AM_OLEDRION_NEWSLETTER_FOOTER, 'footer', '', 4, 70), 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(); show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'launch': // Création effective de la newsletter // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(8); oledrion_utils::htitle(_MI_OLEDRION_ADMENU7, 4); $newsletterTemplate = ''; if (file_exists(OLEDRION_PATH . 'language/' . $xoopsConfig['language'] . '/newsletter.php')) { require_once OLEDRION_PATH . 'language/' . $xoopsConfig['language'] . '/newsletter.php'; } else { require_once OLEDRION_PATH . 'language/english/newsletter.php'; } echo '<br />'; $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']);
echo "<tr class='" . $class . "'>\n"; echo "<td colspan='3' align='center'>" . $form . "</td>\n"; echo "</tr>\n"; echo '</table>'; show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'add': // Ajout d'une TVA // Ajout d'une TVA case 'edit': // Edition d'une TVA // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(2); if ($action == 'edit') { $title = _AM_OLEDRION_EDIT_VAT; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } // Item exits ? $item = null; $item = $h_oledrion_vat->get($id); if (!is_object($item)) { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); } $edit = true; $label_submit = _AM_OLEDRION_MODIFY; } else {
xoops_cp_header(); oledrion_adminMenu(14); if (oledrion_utils::isX23()) { $url = XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&selmod=-1&selvis=-1&selgrp=2&selgen=' . $xoopsModule->getVar('mid'); } else { $url = XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin'; } oledrion_utils::redirect(_MI_OLEDRION_ADMENU14, $url, 0); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'maintain': // Maintenance des tables // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(); require '../xoops_version.php'; $tables = array(); foreach ($modversion['tables'] as $table) { $tables[] = $xoopsDB->prefix($table); } if (count($tables) > 0) { $list = implode(',', $tables); $xoopsDB->queryF('CHECK TABLE ' . $list); $xoopsDB->queryF('ANALYZE TABLE ' . $list); $xoopsDB->queryF('OPTIMIZE TABLE ' . $list); } oledrion_utils::updateCache(); $h_oledrion_products->forceCacheClean(); oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl, 2); break;
* Version : $Id: * **************************************************************************** */ /** * Gestion des textes affichés sur certaines pages pour les utilisateurs */ if (!defined("OLEDRION_ADMIN")) { exit; } switch ($action) { // **************************************************************************************************************** case 'default': // Gestion des textes // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(9); require_once OLEDRION_PATH . 'class/registryfile.php'; $registry = new oledrion_registryfile(); $sform = new XoopsThemeForm(_MI_OLEDRION_ADMENU8, 'frmatxt', $baseurl); $sform->addElement(new XoopsFormHidden('op', 'texts')); $sform->addElement(new XoopsFormHidden('action', 'savetexts')); $editor1 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_INDEX_PAGE, 'welcome1', $registry->getfile(OLEDRION_TEXTFILE1), 5, 60, 'hometext1_hidden'); if ($editor1) { $sform->addElement($editor1, false); } $editor2 = oledrion_utils::getWysiwygForm(_OLEDRION_CGV, 'welcome2', $registry->getfile(OLEDRION_TEXTFILE2), 5, 60, 'hometext2_hidden'); if ($editor2) { $sform->addElement($editor2, false); } $editor3 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_RECOMM_TEXT, 'welcome3', $registry->getfile(OLEDRION_TEXTFILE3), 5, 60, 'hometext3_hidden'); if ($editor3) {
* * @since 2.3.2009.06.13 */ if (!defined("OLEDRION_ADMIN")) { exit; } global $baseurl; // Pour faire taire les warnings de Zend Studio $operation = 'lists'; switch ($action) { // **************************************************************************************************************** case 'default': // Liste des listes // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(15); global $xoopsConfig; $items = $usersList = array(); $class = ''; oledrion_utils::htitle(_MI_OLEDRION_ADMENU15, 4); $start = isset($_GET['start']) ? intval($_GET['start']) : 0; $itemsCount = $oledrion_handlers->h_oledrion_lists->getRecentListsCount(); if ($itemsCount > $limit) { $pagenav = new XoopsPageNav($itemsCount, $limit, $start, 'start', 'op=' . $operation); } $items = $oledrion_handlers->h_oledrion_lists->getRecentLists(new oledrion_parameters(array('start' => $start, 'limit' => $limit))); if (count($items) > 0) { $usersList = $oledrion_handlers->h_oledrion_lists->getUsersFromLists($items); } echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; if (isset($pagenav) && is_object($pagenav)) {
echo "<tr>\n"; } echo '</table>'; show_footer(); } break; // **************************************************************************************************************** // **************************************************************************************************************** case 'add': // Ajout d'un attribut // Ajout d'un attribut case 'edit': // Edition d'un attribut // **************************************************************************************************************** xoops_cp_header(); oledrion_adminMenu(13); removeAttributInSession(); if ($action == 'edit') { $title = _AM_OLEDRION_EDIT_ATTRIBUTE; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } // Item exits ? $item = null; $item = $oledrion_handlers->h_oledrion_attributes->get($id); if (!is_object($item)) { oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5); } $edit = true; $label_submit = _AM_OLEDRION_MODIFY;