Beispiel #1
0
 * @package         myshop
 * @author 			Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 *
 * Version : $Id:
 * ****************************************************************************
 */
if (!defined("MYSHOP_ADMIN")) {
    exit;
}
switch ($action) {
    case 'default':
        xoops_cp_header();
        myshop_adminMenu(3);
        // Display categories
        $categories = array();
        myshop_utils::htitle(_AM_MYSHOP_CATEGORIES, 4);
        $categories = $h_myshop_cat->getAllCategories();
        $mytree = new XoopsObjectTree($categories, 'cat_cid', 'cat_pid');
        $categoriesSelect = $mytree->makeSelBox('id', 'cat_title');
        echo "<div class='even'><form method='post' name='quickaccess' id='quickaccess' action='{$baseurl}' >" . _AM_MYSHOP_LIST . " {$categoriesSelect}<input type='hidden' name='op' id='op' value='categories' /><input type='radio' name='action' id='action' value='edit' />" . _EDIT . " <input type='radio' name='action' id='action' value='delete' />" . _DELETE . " <input type='submit' name='btnquick' id='btnquick' value='" . _GO . "' /></form></div>\n";
        echo "<div class='odd' align='center'><form method='post' name='frmadd' id='frmadd' action='{$baseurl}' ><input type='hidden' name='op' id='op' value='categories' /><input type='hidden' name='action' id='action' value='add' /><input type='submit' name='btnadd' id='btnadd' value='" . _AM_MYSHOP_ADD_CATEG . "' /></form></div>\n";
        echo "<br /><br />\n";
        // Categories preferences
        $chunk1 = myshop_utils::getModuleOption('chunk1');
        $chunk2 = myshop_utils::getModuleOption('chunk2');
        $chunk3 = myshop_utils::getModuleOption('chunk3');
        $chunk4 = myshop_utils::getModuleOption('chunk4');
        $positions = array(0 => _AM_MYSHOP_INVISIBLE, 1 => "1", 2 => "2", 3 => "3", 4 => "4");
        $sform = new XoopsThemeForm(_AM_MYSHOP_CATEG_CONFIG, 'frmchunk', $baseurl);
        $sform->addElement(new XoopsFormHidden('op', 'categories'));
        $sform->addElement(new XoopsFormHidden('action', 'savechunks'));
Beispiel #2
0
     $item = $h_myshop_commands->get($id);
     if (is_object($item)) {
         $res = $h_myshop_commands->validateOrder($item);
         if ($res) {
             myshop_utils::redirect(_AM_MYSHOP_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
         } else {
             myshop_utils::redirect(_AM_MYSHOP_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
         }
     } else {
         myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
     }
     break;
 case 'export':
     xoops_cp_header();
     myshop_adminMenu(6);
     myshop_utils::htitle(_MI_MYSHOP_ADMENU5, 4);
     $orderType = intval($_POST['cmdtype']);
     $exportFilter = $_POST['exportfilter'];
     $exportFilename = MYSHOP_PATH . 'admin/exports/' . $exportFilter . '.php';
     if (file_exists($exportFilename)) {
         require_once MYSHOP_PATH . 'admin/exports/export.php';
         require_once $exportFilename;
         $className = 'myshop_' . $exportFilter . '_export';
         if (class_exists($className)) {
             $export = new $className();
             $export->setOrderType($orderType);
             $result = $export->export();
             if ($result === true) {
                 echo "<a href='" . $export->getDownloadUrl() . "'>" . _AM_MYSHOP_EXPORT_READY . '</a>';
             }
         }
Beispiel #3
0
     $item = $h_myshop_products->get($id);
     if (is_object($item)) {
         $res = $myshop_shelf->deleteProduct($item, true);
         if ($res) {
             myshop_utils::updateCache();
             xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'new_product', $id);
             myshop_utils::redirect(_AM_MYSHOP_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
         } else {
             myshop_utils::redirect(_AM_MYSHOP_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
         }
     } else {
         myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
     }
 } else {
     myshop_adminMenu(5);
     myshop_utils::htitle(_AM_MYSHOP_SORRY_NOREMOVE, 4);
     $tblTmp2 = array();
     $tblTmp2 = $h_myshop_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_MYSHOP_ID . "</th><th align='center'>" . _AM_MYSHOP_DATE . "</th><th align='center'>" . _AM_MYSHOP_CLIENT . "</th><th align='center'>" . _AM_MYSHOP_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') . ' ' . myshop_utils::getModuleOption('money_short') . ' / ' . $item->getVar('cmd_shipping') . ' ' . myshop_utils::getModuleOption('money_short') . "</td>\n";
         echo "<tr>\n";
     }
     echo '</table>';
 }
 break;