Exemplo n.º 1
0
     $opRedirect = 'orders';
     $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>';
             }
Exemplo n.º 2
0
         myshop_utils::updateCache();
         if ($add) {
             $notification_handler =& xoops_gethandler('notification');
             $tags['CATEGORY_NAME'] = $item->getVar('cat_title');
             $tags['CATEGORY_URL'] = MYSHOP_URL . 'category.php?cat_cid=' . $item->getVar('cat_cid');
             $tags['X_MODULE_URL'] = MYSHOP_URL;
             $notification_handler->triggerEvent('global', 0, 'new_category', $tags);
         }
         myshop_utils::redirect(_AM_MYSHOP_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
     } else {
         myshop_utils::redirect(_AM_MYSHOP_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
     }
     break;
 case 'delete':
     xoops_cp_header();
     myshop_adminMenu(3);
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     if ($id == 0) {
         myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
     }
     $category = null;
     $category = $h_myshop_cat->get($id);
     if (!is_object($category)) {
         myshop_utils::redirect(_AM_MYSHOP_ERROR_10, $baseurl, 5);
     }
     $msg = sprintf(_AM_MYSHOP_CONF_DEL_CATEG, $category->getVar('cat_title'));
     xoops_confirm(array('op' => 'categories', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
     break;
 case 'confdelete':
     xoops_cp_header();
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
Exemplo n.º 3
0
         echo "<td>" . $item->getVar('file_description') . "</td><td align='center'>" . $product . "</td><td align='center'>" . implode(' ', $actions) . "</td>\n";
         echo "<tr>\n";
     }
     $class = $class == 'even' ? 'odd' : 'even';
     echo "<tr class='" . $class . "'>\n";
     echo "<td colspan='3' align='center'>" . $form . "</td>\n";
     echo "</tr>\n";
     echo '</table>';
     if (isset($pagenav) && is_object($pagenav)) {
         echo "<div align='right'>" . $pagenav->renderNav() . "</div>";
     }
     break;
 case 'add':
 case 'edit':
     xoops_cp_header();
     myshop_adminMenu(11);
     if ($op == 'edit') {
         $title = _AM_MYSHOP_EDIT_FILE;
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
         if (empty($id)) {
             myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
         }
         // Item exits ?
         $item = null;
         $item = $h_myshop_files->get($id);
         if (!is_object($item)) {
             myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl, 5);
         }
         $edit = true;
         $label_submit = _AM_MYSHOP_MODIFY;
     } else {
Exemplo n.º 4
0
 * @copyright       Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         myshop
 * @author 			Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 *
 * Version : $Id:
 * ****************************************************************************
 */
if (!defined("MYSHOP_ADMIN")) {
    exit;
}
switch ($action) {
    case 'default':
        // Stock
        xoops_cp_header();
        myshop_adminMenu(10);
        myshop_utils::htitle(_MI_MYSHOP_ADMENU9, 4);
        $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
        $criteria = new CriteriaCompo();
        $itemsCount = $h_myshop_products->getLowStocksCount();
        if ($itemsCount > $limit) {
            $pagenav = new XoopsPageNav($itemsCount, $limit, $start, 'start', 'op=lowstock');
        }
        $products = $h_myshop_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'>" . _MYSHOP_TITLE . "</th><th align='center'>" . _MYSHOP_STOCK_QUANTITY . "</th><th align='center'>" . _MYSHOP_STOCK_ALERT . "</th><th align='center'>" . _AM_MYSHOP_NEW_QUANTITY . "</th></tr>";
        foreach ($products as $item) {
            $id = $item->getVar('product_id');
Exemplo n.º 5
0
}
if (!is_dir(MYSHOP_CACHE_PATH)) {
    mkdir(MYSHOP_CACHE_PATH, 0777);
    file_put_contents(MYSHOP_CACHE_PATH . '/index.html', '<script>history.go(-1);</script>');
}
$destname = '';
define("MYSHOP_ADMIN", true);
$controler = MYSHOP_ADMIN_PATH . 'actions/' . $op . '.php';
if (file_exists($controler)) {
    require $controler;
}
// Main
switch ($op) {
    case 'maintain':
        xoops_cp_header();
        myshop_adminMenu();
        require_once '../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);
        }
        myshop_utils::updateCache();
        $h_myshop_products->forceCacheClean();
        myshop_utils::redirect(_AM_MYSHOP_SAVE_OK, $baseurl, 2);
        break;
Exemplo n.º 6
0
 *
 * @copyright       Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @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(0);
        myshop_utils::htitle(_MI_MYSHOP_ADMENU10, 4);
        $itemsCount = 5;
        $cssclass = '';
        if ($h_myshop_products->getCount() > 0) {
            echo "<hr /><br />";
            echo "<table>";
            echo "<tr>\n";
            echo "<td valign='top' width='50%' align='center'><b>" . _AM_MYSHOP_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);
Exemplo n.º 7
0
     $sform->addElement(new XoopsFormHidden('op', 'newsletter'), false);
     $sform->addElement(new XoopsFormHidden('action', 'launch'), false);
     $sform->addElement(new XoopsFormRadioYN(_AM_MYSHOP_REMOVE_BR, 'removebr', 1), false);
     $sform->addElement(new XoopsFormRadioYN(_AM_MYSHOP_NEWSLETTER_HTML_TAGS, 'removehtml', 0), false);
     $sform->addElement(new XoopsFormTextArea(_AM_MYSHOP_NEWSLETTER_HEADER, 'header', '', 4, 70), false);
     $sform->addElement(new XoopsFormTextArea(_AM_MYSHOP_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 = myshop_utils::formMarkRequiredFields($sform);
     $sform->display();
     break;
 case 'launch':
     xoops_cp_header();
     myshop_adminMenu(8);
     myshop_utils::htitle(_MI_MYSHOP_ADMENU7, 4);
     $newsletterTemplate = '';
     if (file_exists(MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/newsletter.php')) {
         require_once MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/newsletter.php';
     } else {
         require_once MYSHOP_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']);
Exemplo n.º 8
0
         echo "<td>" . $item->getVar('manu_name') . "</td><td align='left'>" . $item->getVar('manu_commercialname') . "</td><td align='center'>" . $item->getVar('manu_email') . "</td><td align='center'>" . implode(' ', $actions) . "</td>\n";
         echo "<tr>\n";
     }
     $class = $class == 'even' ? 'odd' : 'even';
     echo "<tr class='" . $class . "'>\n";
     echo "<td colspan='4' align='center' class='foot'>" . $form . "</td>\n";
     echo "</tr>\n";
     echo '</table>';
     if (isset($pagenav) && is_object($pagenav)) {
         echo "<div align='right'>" . $pagenav->renderNav() . "</div>";
     }
     break;
 case 'add':
 case 'edit':
     xoops_cp_header();
     myshop_adminMenu(4);
     if ($action == 'edit') {
         $title = _AM_MYSHOP_EDIT_MANUFACTURER;
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
         if (empty($id)) {
             myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
         }
         $item = null;
         $item = $h_myshop_manufacturer->get($id);
         if (!is_object($item)) {
             myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl, 5);
         }
         $edit = true;
         $label_submit = _AM_MYSHOP_MODIFY;
     } else {
         $title = _AM_MYSHOP_ADD_MANUFACTURER;
Exemplo n.º 9
0
         echo "<tr>\n";
     }
     $class = $class == 'even' ? 'odd' : 'even';
     echo "<tr class='" . $class . "'>\n";
     echo "<td colspan='3' align='center' class='foot'>" . $form . "</td>\n";
     echo "</tr>\n";
     echo '</table>';
     if (isset($pagenav) && is_object($pagenav)) {
         echo "<div align='right'>" . $pagenav->renderNav() . "</div>";
     }
     $myshop_reductions = new myshop_reductions();
     break;
 case 'add':
 case 'edit':
     xoops_cp_header();
     myshop_adminMenu(7);
     if ($action == 'edit') {
         $title = _AM_MYSHOP_EDIT_DISCOUNT;
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
         if (empty($id)) {
             myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
         }
         // Item exits ?
         $item = null;
         $item = $h_myshop_discounts->get($id);
         if (!is_object($item)) {
             myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl, 5);
         }
         $edit = true;
         $label_submit = _AM_MYSHOP_MODIFY;
     } else {
Exemplo n.º 10
0
 *
 * @copyright       Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @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(9);
        require_once MYSHOP_PATH . 'class/registryfile.php';
        $registry = new myshop_registryfile();
        $sform = new XoopsThemeForm(_MI_MYSHOP_ADMENU8, 'frmatxt', $baseurl);
        $sform->addElement(new XoopsFormHidden('op', 'texts'));
        $sform->addElement(new XoopsFormHidden('action', 'savetexts'));
        $editor1 = myshop_utils::getWysiwygForm(_AM_MYSHOP_INDEX_PAGE, 'welcome1', $registry->getfile(MYSHOP_TEXTFILE1), 5, 60, 'hometext1_hidden');
        if ($editor1) {
            $sform->addElement($editor1, false);
        }
        $editor2 = myshop_utils::getWysiwygForm(_MYSHOP_CGV, 'welcome2', $registry->getfile(MYSHOP_TEXTFILE2), 5, 60, 'hometext2_hidden');
        if ($editor2) {
            $sform->addElement($editor2, false);
        }
        $editor3 = myshop_utils::getWysiwygForm(_AM_MYSHOP_RECOMM_TEXT, 'welcome3', $registry->getfile(MYSHOP_TEXTFILE3), 5, 60, 'hometext3_hidden');
        if ($editor3) {
Exemplo n.º 11
0
Arquivo: vat.php Projeto: naao/myshop
         $actions[] = "<a href='{$baseurl}?op=vat&action=edit&id=" . $id . "' title='" . _MYSHOP_EDIT . "'>" . $icones['edit'] . '</a>';
         $actions[] = "<a href='{$baseurl}?op=vat&action=delete&id=" . $id . "' title='" . _MYSHOP_DELETE . "'" . $conf_msg . ">" . $icones['delete'] . '</a>';
         echo "<tr class='" . $class . "'>\n";
         echo "<td>" . $id . "</td><td align='right'>" . $myshop_Currency->amountInCurrency($item->getVar('vat_rate')) . "</td><td align='center'>" . implode(' ', $actions) . "</td>\n";
         echo "<tr>\n";
     }
     $class = $class == 'even' ? 'odd' : 'even';
     echo "<tr class='" . $class . "'>\n";
     echo "<td colspan='3' align='center' class='foot'>" . $form . "</td>\n";
     echo "</tr>\n";
     echo '</table>';
     break;
 case 'add':
 case 'edit':
     xoops_cp_header();
     myshop_adminMenu(2);
     if ($action == 'edit') {
         $title = _AM_MYSHOP_EDIT_VAT;
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
         if (empty($id)) {
             myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
         }
         // Item exits ?
         $item = null;
         $item = $h_myshop_vat->get($id);
         if (!is_object($item)) {
             myshop_utils::redirect(_AM_MYSHOP_NOT_FOUND, $baseurl, 5);
         }
         $edit = true;
         $label_submit = _AM_MYSHOP_MODIFY;
     } else {
Exemplo n.º 12
0
     $item = null;
     $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>';
 }