// $gBitSmarty->assign( 'loadAjax', 'mochikit' ); // $gBitSmarty->assign( 'mochikitLibs', array( 'DOM.js', 'Iter.js', 'Style.js', 'Signal.js', 'Color.js', 'Position.js', 'Visual.js', 'DragAndDrop.js', 'Sortable.js' ) ); $productManager = new CommerceProductManager(); if ($gCommerceSystem->getConfig('ATTRIBUTES_ENABLED_IMAGES') == 'true') { $dir = @dir(DIR_FS_CATALOG_IMAGES); $dir_info[] = array('id' => '', 'text' => "Main Directory"); while ($file = $dir->read()) { if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { $dir_info[] = array('id' => $file . '/', 'text' => $file); } } sort($dir_info); $default_directory = 'options/'; } if ($gBitProduct->isValid()) { $gBitSmarty->assign('optionsList', $productManager->getOptionsList()); $editTpl = 'bitpackage:bitcommerce/admin_products_options_map_inc.tpl'; } elseif (empty($_REQUEST['cancel']) && !empty($_REQUEST['products_options_id'])) { if (BitBase::verifyId($_REQUEST['products_options_id']) && ($editOption = current($productManager->getOptionsList(array('products_options_id' => $_REQUEST['products_options_id']))))) { $gBitSmarty->assign_by_ref('editOption', $editOption); } $gBitSmarty->assign_by_ref('optionsTypes', $productManager->getOptionsTypes()); $editTpl = 'bitpackage:bitcommerce/admin_products_options_edit_inc.tpl'; } elseif (empty($_REQUEST['cancel']) && !empty($_REQUEST['products_options_values_id'])) { if (BitBase::verifyId($_REQUEST['products_options_values_id']) && ($editOptionsValue = current($productManager->getOptionsList(array('products_options_values_id' => $_REQUEST['products_options_values_id']))))) { $gBitSmarty->assign_by_ref('editValue', $editOptionsValue); } $gBitSmarty->assign('optionsList', $productManager->getOptionsList()); $editTpl = 'bitpackage:bitcommerce/admin_products_options_values_edit_inc.tpl'; } else { $gBitSmarty->assign('optionsList', $productManager->getOptionsList());
bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId); break; case 'Add': $gCoupon->storeRestriction($_REQUEST); bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId); break; case 'remove': if (!empty($_GET['info'])) { $gBitDb->query("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = ?", array($_GET['info'])); } bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId); break; } } if (isset($_POST['cPath_prod'])) { $current_category_id = $_POST['cPath_prod']; } else { $_POST['cPath_prod'] = NULL; } $productsList = $gBitDb->getAssoc("select p.`products_id`, pd.`products_name` from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.`products_id` = pd.`products_id` and pd.`language_id` = ? and p.`products_id` = p2c.`products_id` and p2c.`categories_id` = ? order by pd.`products_name`", array($_SESSION['languages_id'], $_POST['cPath_prod'])); $gBitSmarty->assign_by_ref('productsList', $productsList); $gBitSmarty->assign_by_ref('gCoupon', $gCoupon); require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceProductManager.php'; $productManager = new CommerceProductManager(); $gBitSmarty->assign('optionsList', $productManager->getOptionsList()); $categoryTree = zen_get_category_tree(); $gBitSmarty->assign('categorySelect', zen_draw_pull_down_menu('category_id', $categoryTree, $current_category_id)); $gBitSmarty->assign('productCategorySelect', zen_draw_pull_down_menu('cPath_prod', $categoryTree, $current_category_id, 'onChange="this.form.submit();"')); $gBitSmarty->assign('productTypes', $productManager->getProductTypes()); $gBitSmarty->assign_by_ref('feedback', $feedback); $gBitSystem->display('bitpackage:bitcommerce/admin_coupon_restrict.tpl', HEADING_TITLE, array('display_mode' => 'admin'));
// | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: orders.php,v 1.61 2010/07/14 15:19:58 spiderr Exp $ // require 'includes/application_top.php'; $gBitThemes->loadAjax('jquery', array(UTIL_PKG_PATH . 'javascript/jquery/plugins/colorbox/jquery.colorbox-min.js')); $gBitThemes->loadCss(UTIL_PKG_PATH . 'javascript/jquery/plugins/colorbox/colorbox.css', FALSE, 300, FALSE); $currencies = new currencies(); if ($gBitThemes->isAjaxRequest()) { require BITCOMMERCE_PKG_PATH . 'classes/CommerceProductManager.php'; $productManager = new CommerceProductManager(); if (!empty($_REQUEST['new_option_id'])) { if ($optionValues = $productManager->getOptionsList(array('products_options_id' => $_REQUEST['new_option_id']))) { if (!empty($optionValues[$_REQUEST['new_option_id']]['values'])) { foreach ($optionValues[$_REQUEST['new_option_id']]['values'] as $optValId => $optVal) { $optionValuesList[$optValId] = $optVal['products_options_values_name']; } } else { $optionValuesList[$optionValues[$_REQUEST['new_option_id']]['products_options_values_id']] = $optionValues[$_REQUEST['new_option_id']]['products_options_values_name']; } $gBitSmarty->loadPlugin('smarty_function_html_options'); print smarty_function_html_options(array('options' => $optionValuesList, 'name' => 'newOrderOptionValue', 'class' => 'form-control', 'print_result' => FALSE), $gBitSmarty); print '<input class="btn btn-sm btn-primary" type="submit" value="save" name="save_new_option">'; } else { print "<span class='alert alert-danger'>Unkown Option</span>"; } } elseif (!empty($_REQUEST['address_type'])) { $addressType = $_REQUEST['address_type'];