public static function save($id, $data) { global $lC_DateTime; $update = array('date_available' => strstr($data['products_date_available'], '/') ? lC_DateTime::toDateTime($data['products_date_available']) : $data['products_date_available']); if (lC_Products_Admin::setDateAvailable($id, $update)) { return true; } else { return false; } }
protected function _setData() { global $lC_Database, $lC_Language, $lC_Currencies, $lC_Vqmod; if (!$this->enabled) { $this->_data = ''; } else { $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile clear-both">' . ' <h2 class="relative thin">' . $this->_title . '</h2>' . ' <ul class="list spaced">'; if (!isset($lC_Currencies)) { if (!class_exists('lC_Currencies')) { include $lC_Vqmod->modCheck('../includes/classes/currencies.php'); } $lC_Currencies = new lC_Currencies(); } $Qproducts = $lC_Database->query('select p.products_id, greatest(p.products_date_added, p.products_last_modified) as date_last_modified, pd.products_name from :table_products p, :table_products_description pd where parent_id = 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by date_last_modified desc limit 6'); $Qproducts->bindTable(':table_products', TABLE_PRODUCTS); $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qproducts->bindInt(':language_id', $lC_Language->getID()); $Qproducts->execute(); while ($Qproducts->next()) { $data = lC_Products_Admin::get($Qproducts->valueInt('products_id')); $products_icon = lc_icon_admin('products.png'); $products_price = $data['products_price']; if (!empty($data['variants'])) { $products_icon = lc_icon_admin('attach.png'); $products_price = null; foreach ($data['variants'] as $variant) { if ($products_price === null || $variant['data']['price'] < $products_price) { $products_price = $variant['data']['price']; } } if ($products_price === null) { $products_price = 0; } } $this->_data .= ' <li>' . ' <span class="list-link icon-bag icon-blue" title="' . $lC_Language->get('edit') . '">' . ' <strong>' . (!empty($data['variants']) ? $lC_Language->get('text_from') . ' ' : '') . $lC_Currencies->format($products_price) . '</strong> <span class="anthracite">' . lc_output_string_protected($data['products_name']) . '</span>' . ' </span>' . ' <div class="absolute-right compact show-on-parent-hover">' . ' <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'products=' . $Qproducts->valueInt('products_id') . '&cID=' . $category_id . '&action=save')) . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '">' . $lC_Language->get('icon_edit') . '</a>' . ' <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : 'javascript://" onclick="copyProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-pages with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_copy') . '"></a>' . ' <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? '#' : 'javascript://" onclick="deleteProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>' . ' </div>' . ' </li>'; } $this->_data .= ' </ul>' . '</div>'; $Qproducts->freeResult(); $this->_data .= $this->loadModal(); } }
} echo lc_draw_input_field('products_price_gross', $products_price_gross, 'style="width:94%;" class="input-unstyled strong products-price-gross" id="products_price0_gross" READONLY'); ?> </div> </div> </div> </div> </fieldset> <fieldset class="fieldset"> <legend class="legend"><?php echo $lC_Language->get('text_management_settings'); ?> </legend> <div class="columns no-margin-bottom"> <?php echo lC_Products_Admin::getProductAttributeModules('dataManagementSettings'); ?> <div class="new-row-mobile six-columns six-columns-tablet twelve-columns-mobile no-margin-bottom"> <?php if (utility::isPro() === false) { ?> <div class="twelve-columns strong mid-margin-bottom upsellwrapper"> <span class="upsellinfo" upselltitle="<?php echo $lC_Language->get('text_product_class_upsell_title'); ?> " upselldesc="<?php echo $lC_Language->get('text_product_class_upsell_desc'); ?> "><?php echo $lC_Language->get('text_product_class') . lc_go_pro(); ?>
/** @package catalog::admin::applications @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @copyright Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: edit.php v1.0 2013-08-08 datazen $ */ global $lC_Vqmod; if (is_numeric($_GET[$lC_Template->getModule()])) { $pInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$lC_Template->getModule()])); } if (is_numeric($_GET[$lC_Template->getModule()])) { $lC_ObjectInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$lC_Template->getModule()])); $attributes = $lC_ObjectInfo->get('attributes'); $Qpd = $lC_Database->query('select products_name, products_blurb, products_description, products_keyword, products_tags, products_url, language_id from :table_products_description where products_id = :products_id'); $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qpd->bindInt(':products_id', $lC_ObjectInfo->getInt('products_id')); $Qpd->execute(); $products_name = array(); $products_blurb = array(); $products_description = array(); $products_keyword = array(); $products_tags = array(); $products_url = array(); while ($Qpd->next()) { $products_name[$Qpd->valueInt('language_id')] = $Qpd->value('products_name'); $products_blurb[$Qpd->valueInt('language_id')] = $Qpd->value('products_blurb'); $products_description[$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
?> /><?php echo lc_show_info_bubble($lC_Language->get('info_bubble_pricing_specials'), null, 'info-spot on-left grey margin-left margin-right'); ?> <div onclick="togglePricingSection(this, 'specials_pricing_container');" style="cursor:pointer;" class="field-block-chevron-container float-right"><span id="specials_pricing_container_span" class="icon-chevron-thin-down icon-size2"></span></div> </div> <div id="specials_pricing_container" class="field-drop button-height black-inputs no-margin-bottom"<?php echo isset($pInfo) && $pInfo->get('products_special_price') != null ? ' style="display:block;"' : ' style="display:none;"'; ?> > <?php echo lC_Products_Admin::getSpecialPricingContent(); ?> </div> <?php } ?> </fieldset> <fieldset class="fieldset large-margin-top"> <legend class="legend"><?php echo $lC_Language->get('text_options_pricing'); ?> </legend> <dl id="simple-options-pricing-tab" class="accordion"> <?php echo lC_Products_Admin::getOptionsPricingContent(); ?> </dl> </fieldset> </div>
<?php /** @package catalog::admin::applications @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @copyright Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: edit.php v1.0 2013-08-08 datazen $ */ $lC_ObjectInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET['pID'])); $Qdata = $lC_Database->query('select str_to_date(pa.value, "%Y-%m-%d") as products_date_available from :table_product_attributes pa, :table_templates_boxes tb where tb.code = :code and tb.modules_group = :modules_group and tb.id = pa.id'); $Qdata->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES); $Qdata->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES); $Qdata->bindValue(':code', 'date_available'); $Qdata->bindValue(':modules_group', 'product_attributes'); $Qdata->execute(); $lC_ObjectInfo->set('products_date_available', $Qdata->value('products_date_available')); ?> <h1><?php echo lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule()), $lC_Template->getPageTitle()); ?> </h1> <?php if ($lC_MessageStack->exists($lC_Template->getModule())) { echo $lC_MessageStack->get($lC_Template->getModule()); } ?> <div class="infoBoxHeading"><?php echo lc_icon_admin('edit.png') . ' ' . $lC_ObjectInfo->getProtected('products_name');
public static function delete($id) { global $lC_Database; $lC_CategoryTree = new lC_CategoryTree_Admin(); if (is_numeric($id)) { $lC_CategoryTree->setBreadcrumbUsage(false); $categories = array_merge(array(array('id' => $id, 'text' => '')), $lC_CategoryTree->getArray($id)); $products = array(); $products_delete = array(); foreach ($categories as $category) { $Qproducts = $lC_Database->query('select products_id from :table_products_to_categories where categories_id = :categories_id'); $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); $Qproducts->bindInt(':categories_id', $category['id']); $Qproducts->execute(); while ($Qproducts->next()) { $products[$Qproducts->valueInt('products_id')]['categories'][] = $category['id']; } } foreach ($products as $key => $value) { $Qcheck = $lC_Database->query('select categories_id from :table_products_to_categories where products_id = :products_id and categories_id not in :categories_id limit 1'); $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); $Qcheck->bindInt(':products_id', $key); $Qcheck->bindRaw(':categories_id', '("' . implode('", "', $value['categories']) . '")'); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 0) { $products_delete[$key] = $key; } } lc_set_time_limit(0); foreach ($categories as $category) { $lC_Database->startTransaction(); $Qimage = $lC_Database->query('select categories_image from :table_categories where categories_id = :categories_id'); $Qimage->bindTable(':table_categories', TABLE_CATEGORIES); $Qimage->bindInt(':categories_id', $category['id']); $Qimage->execute(); $Qc = $lC_Database->query('delete from :table_categories where categories_id = :categories_id'); $Qc->bindTable(':table_categories', TABLE_CATEGORIES); $Qc->bindInt(':categories_id', $category['id']); $Qc->setLogging($_SESSION['module'], $id); $Qc->execute(); if (!$lC_Database->isError()) { $Qcd = $lC_Database->query('delete from :table_categories_description where categories_id = :categories_id'); $Qcd->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); $Qcd->bindInt(':categories_id', $category['id']); $Qcd->setLogging($_SESSION['module'], $id); $Qcd->execute(); if (!$lC_Database->isError()) { $Qp2c = $lC_Database->query('delete from :table_products_to_categories where categories_id = :categories_id'); $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); $Qp2c->bindInt(':categories_id', $category['id']); $Qp2c->setLogging($_SESSION['module'], $id); $Qp2c->execute(); if (!$lC_Database->isError()) { // permalink $Qpb = $lC_Database->query('delete from :table_permalinks where item_id = :item_id'); $Qpb->bindTable(':table_permalinks', TABLE_PERMALINKS); $Qpb->bindInt(':item_id', $category['id']); $Qpb->execute(); if (!$lC_Database->isError()) { $lC_Database->commitTransaction(); lC_Cache::clear('categories'); lC_Cache::clear('category_tree'); lC_Cache::clear('also_purchased'); if (!lc_empty($Qimage->value('categories_image'))) { $Qcheck = $lC_Database->query('select count(*) as total from :table_categories where categories_image = :categories_image'); $Qcheck->bindTable(':table_categories', TABLE_CATEGORIES); $Qcheck->bindValue(':categories_image', $Qimage->value('categories_image')); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 0) { if (file_exists(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image')))) { @unlink(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image'))); } } } } else { $lC_Database->rollbackTransaction(); } } else { $lC_Database->rollbackTransaction(); } } else { $lC_Database->rollbackTransaction(); } } else { $lC_Database->rollbackTransaction(); } } foreach ($products_delete as $id) { lC_Products_Admin::remove($id); } lC_Cache::clear('categories'); lC_Cache::clear('category_tree'); lC_Cache::clear('also_purchased'); return true; } return false; }
</style> <div class="with-padding-no-top"> <div id="categories_filter_container"> <div id="categories_filter"> <form name="products_categories_filter" id="products_categories_filter" action="" onchange="updateProductFilter($('#filter').val());"> <label for="filter" class="white mid-margin-right"><?php echo $lC_Language->get('text_categories'); ?> :</label> <select class="input with-small-padding" id="filter" name="filter"> <option value=""><?php echo $lC_Language->get('text_all'); ?> </option> <?php echo lC_Products_Admin::assignedCategoryTreeSelect(3); ?> </select> </form> </div> </div> <form name="batch" id="batch" action="#" method="post"> <table border="0" width="100%" cellspacing="0" cellpadding="0" class="table responsive-table" id="dataTable"> <thead> <tr> <th scope="col" class="hide-on-mobile align-left"><input onclick="toggleCheck();" id="check-all" type="checkbox" value="1" name="check-all"></th> <th scope="col" class="align-left"><?php echo $lC_Language->get('table_heading_products'); ?> </th> <th scope="col" class="align-left hide-on-tablet"><?php
<span><?php echo $lC_Language->get('field_weight_class'); ?> </span><?php echo lc_show_info_bubble($lC_Language->get('info_bubble_shipping_weight_class')); ?> </div> <div class="twelve-columns no-margin-bottom small-margin-top"> <?php echo lc_draw_pull_down_menu('products_weight_class', $weight_class_array, isset($pInfo) ? $pInfo->get('products_weight_class') : SHIPPING_WEIGHT_UNIT, 'class="select full-width small-margin-top"'); ?> </div> </div> </div> </fieldset> </div> <div class="twelve-columns"> <fieldset class="fieldset"> <legend class="legend"><?php echo $lC_Language->get('text_supplier_characteristics'); ?> </legend> <div class="columns no-margin-bottom"> <?php echo lC_Products_Admin::getProductAttributeModules('shippingSupplierCharacteristics'); ?> </div> </fieldset> </div> </div> </div>
public static function getOptionsPricingContent() { global $lC_Language, $pInfo; $content = ''; $groups = lC_Customer_groups_Admin::getAll(); foreach ($groups['entries'] as $key => $value) { $content .= '<dt id="dt-' . $value['customers_group_id'] . '"><span class="strong">' . $value['customers_group_name'] . '</span></dt>' . '<dd id="dd-' . $value['customers_group_id'] . '">' . ' <div class="with-padding" id="options-pricing-entries-div-' . $value['customers_group_id'] . '">'; if (isset($pInfo) && is_array($pInfo->get('simple_options'))) { $content .= '<div class="simple-options-pricing-container">' . ' <div class="big-text underline margin-top" style="padding-bottom:8px;">' . $lC_Language->get('text_simple_options') . '</div>' . ' <table class="simple-table simple-options-pricing-table">' . ' <tbody id="tbody-simple-options-pricing-' . $value['customers_group_id'] . '">' . lC_Products_Admin::getSimpleOptionsPricingTbody($pInfo->get('simple_options'), $value['customers_group_id']) . '</tbody>' . ' </table>' . '</div>'; } else { $content .= '<table class="simple-table no-options-defined"><tbody id="tbody-options-pricing-' . $value['customers_group_id'] . '"><tr id="no-options-' . $value['customers_group_id'] . '"><td>' . $lC_Language->get('text_no_options_defined') . '</td></tr></tbody></table>'; } $content .= ' </div>' . '</dd>'; } return $content; }
public function __construct() { global $lC_Language, $lC_MessageStack; parent::__construct(); $this->_page_contents = 'edit.php'; if ((lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT)) && !lC_Image_Admin::hasGDSupport()) { $_SESSION['error'] = true; $_SESSION['errmsg'] = $lC_Language->get('ms_warning_image_processor_not_available'); } if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') { $error = false; $has_variants = isset($_POST['variants']) ? true : false; $data = array('id' => isset($_POST['products_id']) ? $_POST['products_id'] : 0, 'quantity' => isset($_POST['products_quantity']) && $has_variants === false ? $_POST['products_quantity'] : 0, 'cost' => number_format(is_numeric($_POST['products_cost']) ? $_POST['products_cost'] : 0, DECIMAL_PLACES, '.', ''), 'price' => number_format(is_numeric($_POST['products_price']) ? $_POST['products_price'] : 0, DECIMAL_PLACES, '.', ''), 'msrp' => number_format(is_numeric($_POST['products_msrp']) ? $_POST['products_msrp'] : 0, DECIMAL_PLACES, '.', ''), 'weight' => $_POST['products_weight'], 'weight_class' => isset($_POST['products_weight_class']) ? $_POST['products_weight_class'] : '', 'status' => isset($_POST['products_status']) && $_POST['products_status'] == 'on' ? true : false, 'model' => isset($_POST['products_model']) ? $_POST['products_model'] : '', 'sku' => isset($_POST['products_sku']) ? $_POST['products_sku'] : '', 'tax_class_id' => isset($_POST['products_tax_class_id']) ? $_POST['products_tax_class_id'] : 0, 'shipping_rule_id' => isset($_POST['shipping_rule_id']) ? $_POST['shipping_rule_id'] : 0, 'products_name' => $_POST['products_name'], 'products_blurb' => $_POST['products_blurb'], 'products_description' => $_POST['products_description'], 'products_keyword' => $_POST['products_keyword'], 'products_tags' => $_POST['products_tags'], 'products_url' => $_POST['products_url'], 'has_children' => $has_variants, 'products_sort_order' => $_POST['products_sort_order']); if (isset($_POST['attributes'])) { $data['attributes'] = $_POST['attributes']; } if (isset($_POST['attributes2'])) { $data['attributes2'] = $_POST['attributes2']; } if (isset($_POST['categories'])) { $data['categories'] = $_POST['categories']; } if (isset($_POST['localimages'])) { $data['localimages'] = $_POST['localimages']; } // simple options if (isset($_POST['simple_options_group_name'])) { $data['simple_options_group_name'] = $_POST['simple_options_group_name']; } if (isset($_POST['simple_options_group_type'])) { $data['simple_options_group_type'] = $_POST['simple_options_group_type']; } if (isset($_POST['simple_options_group_sort_order'])) { $data['simple_options_group_sort_order'] = $_POST['simple_options_group_sort_order']; } if (isset($_POST['simple_options_group_status'])) { $data['simple_options_group_status'] = $_POST['simple_options_group_status']; } if (isset($_POST['simple_options_entry'])) { $data['simple_options_entry'] = $_POST['simple_options_entry']; } if (isset($_POST['simple_options_entry_price_modifier'])) { $data['simple_options_entry_price_modifier'] = $_POST['simple_options_entry_price_modifier']; } // specials if (isset($_POST['specials_pricing_switch']) && $_POST['specials_pricing_switch'] == 'on') { if (is_array($_POST['products_special_pricing'])) { $data['products_special_pricing'] = $_POST['products_special_pricing']; } $data['specials_pricing_switch'] = 1; if (isset($_POST['products_special_pricing_enable1'])) { $data['products_special_pricing_enable1'] = $_POST['products_special_pricing_enable1'] == 'on' ? 1 : 0; } if (isset($_POST['products_special_price'][1])) { $data['products_special_price1'] = $_POST['products_special_price'][1]; } if (isset($_POST['products_special_start_date'][1])) { $data['products_special_start_date1'] = $_POST['products_special_start_date'][1]; } if (isset($_POST['products_special_expires_date'][1])) { $data['products_special_expires_date1'] = $_POST['products_special_expires_date'][1]; } } // sub-products if (is_array($_POST['sub_products_name']) && count($_POST['sub_products_name']) > 1) { $data['has_subproducts'] = '1'; $data['sub_products_name'] = $_POST['sub_products_name']; if (isset($_POST['sub_products_default']) && $_POST['sub_products_default'] != NULL) { $data['sub_products_default'] = $_POST['sub_products_default']; } if (isset($_POST['sub_products_status']) && $_POST['sub_products_status'] != NULL) { $data['sub_products_status'] = $_POST['sub_products_status']; } if (isset($_POST['sub_products_weight']) && $_POST['sub_products_weight'] != NULL) { $data['sub_products_weight'] = $_POST['sub_products_weight']; } if (isset($_POST['sub_products_sku']) && $_POST['sub_products_sku'] != NULL) { $data['sub_products_sku'] = $_POST['sub_products_sku']; } if (isset($_POST['sub_products_qoh']) && $_POST['sub_products_qoh'] != NULL) { $data['sub_products_qoh'] = $_POST['sub_products_qoh']; } if (isset($_POST['sub_products_id']) && $_POST['sub_products_id'] != NULL) { $data['sub_products_id'] = $_POST['sub_products_id']; } if (isset($_POST['sub_products_cost']) && $_POST['sub_products_cost'] != NULL) { $data['sub_products_cost'] = $_POST['sub_products_cost']; } if (isset($_POST['sub_products_price']) && $_POST['sub_products_price'] != NULL) { $data['sub_products_price'] = $_POST['sub_products_price']; } } // qpb $data['qpb_pricing_switch'] = isset($_POST['qpb_pricing_switch']) && $_POST['qpb_pricing_switch'] == 'on' ? true : false; if (is_array($_POST['products_qty_break_point']) && $_POST['products_qty_break_point'][1] != NULL) { $data['products_qty_break_point'] = $_POST['products_qty_break_point']; } if (is_array($_POST['products_qty_break_price']) && $_POST['products_qty_break_price'][1] != NULL) { $data['products_qty_break_price'] = $_POST['products_qty_break_price']; } // multi SKU options if (isset($_POST['variants'])) { $data['variants'] = $_POST['variants']; } // access levels if (isset($_POST['access_levels'])) { $data['access_levels'] = $_POST['access_levels']; } // options pricing if (isset($_POST['options_pricing'])) { $data['options_pricing'] = $_POST['options_pricing']; } // specials pricing if (isset($_POST['specials_pricing'])) { $data['specials_pricing'] = $_POST['specials_pricing']; } // group pricing $data['groups_pricing_switch'] = isset($_POST['groups_pricing_switch']) && $_POST['groups_pricing_switch'] == 'on' ? true : false; if (isset($_POST['group_pricing'])) { $data['group_pricing'] = $_POST['group_pricing']; } if ($error === false) { // the line below is used as a hook match point - do not not modify or remove $id = (int) lC_Products_Admin::save(isset($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) ? $_GET[$this->_module] : null, $data); if (is_numeric($id)) { if (empty($_POST['save_close'])) { lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&action=save&cID=' . $_GET['cID'])); } else { lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&cID=' . $_GET['cID'])); } } else { $_SESSION['error'] = true; $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed'); } lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&cID=' . $_GET['cID'])); } } }
public static function getProductFormData() { $result = lC_Products_Admin::getProductFormData($_GET['pid']); $result['rpcStatus'] = RPC_STATUS_SUCCESS; echo json_encode($result); }
<th scope="col" class="align-left hide-below-480"><?php echo $lC_Language->get('table_heading_sort'); ?> </th> <th scope="col" class="align-center"><?php echo $lC_Language->get('table_heading_on'); ?> </th> <th scope="col" class="align-right" width="50px"><?php echo $lC_Language->get('table_heading_action'); ?> </th> </tr> </thead> <tbody class="sorted_table"><?php echo isset($pInfo) ? lC_Products_Admin::getSimpleOptionsContent($pInfo->get('simple_options')) : null; ?> </tbody> </table> </fieldset> </div> <?php /* <div id="bundleProductsContainer" class="twelve-columns"> <fieldset class="fieldset upsellwrapper"> <legend class="upsellinfo legend" upselltitle="<?php echo $lC_Language->get('text_bundle_products'); ?>" upselldesc="<?php echo $lC_Language->get('text_bundle_products_desc'); ?>"><?php echo $lC_Language->get('text_bundle_products'); ?><?php echo lc_go_pro(); ?></legend> <span class="float-right" style="margin:-23px -8px 0 0;"><a class="button icon-plus-round green-gradient " href="javascript:void(0)" onclick="addNewBundleOption();"><?php echo $lC_Language->get('button_add'); ?></a></span> <span class="thin"><?php echo $lC_Language->get('text_coming_soon'); ?>...</span> </fieldset> </div> */
public static function updateStatus() { $status = lC_Products_Admin::updateStatus($_GET['pid'], $_GET['val']); if ($status) { lC_Cache::clear('category_tree'); $result['rpcStatus'] = RPC_STATUS_SUCCESS; } echo json_encode($result); }
public static function delete($id, $delete_image = false, $delete_products = false) { global $lC_Database; if ($delete_image === true) { $Qimage = $lC_Database->query('select manufacturers_image from :table_manufacturers where manufacturers_id = :manufacturers_id'); $Qimage->bindTable(':table_manufacturers', TABLE_MANUFACTURERS); $Qimage->bindInt(':manufacturers_id', $id); $Qimage->execute(); if ($Qimage->numberOfRows() && !lc_empty($Qimage->value('manufacturers_image'))) { if (file_exists(realpath('../' . DIR_WS_IMAGES . 'manufacturers/' . $Qimage->value('manufacturers_image')))) { @unlink(realpath('../' . DIR_WS_IMAGES . 'manufacturers/' . $Qimage->value('manufacturers_image'))); } } } $Qm = $lC_Database->query('delete from :table_manufacturers where manufacturers_id = :manufacturers_id'); $Qm->bindTable(':table_manufacturers', TABLE_MANUFACTURERS); $Qm->bindInt(':manufacturers_id', $id); $Qm->setLogging($_SESSION['module'], $id); $Qm->execute(); $Qmi = $lC_Database->query('delete from :table_manufacturers_info where manufacturers_id = :manufacturers_id'); $Qmi->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO); $Qmi->bindInt(':manufacturers_id', $id); $Qmi->setLogging($_SESSION['module'], $id); $Qmi->execute(); if ($delete_products === true) { $Qproducts = $lC_Database->query('select products_id from :table_products where manufacturers_id = :manufacturers_id'); $Qproducts->bindTable(':table_products', TABLE_PRODUCTS); $Qproducts->bindInt(':manufacturers_id', $id); $Qproducts->execute(); while ($Qproducts->next()) { lC_Products_Admin::delete($Qproducts->valueInt('products_id')); } } else { $Qupdate = $lC_Database->query('update :table_products set manufacturers_id = null where manufacturers_id = :manufacturers_id'); $Qupdate->bindTable(':table_products', TABLE_PRODUCTS); $Qupdate->bindInt(':manufacturers_id', $id); $Qupdate->setLogging($_SESSION['module'], $id); $Qupdate->execute(); } lC_Cache::clear('manufacturers'); return true; }