protected function process() { $this->_page_title = OSCOM::getDef('heading_title'); if (isset($_GET['id']) && is_numeric($_GET['id'])) { $this->_page_contents = 'entries.php'; $this->_page_title .= ': ' . TaxClasses::get($_GET['id'], 'tax_class_title'); } }
public static function execute(ApplicationAbstract $application) { if (TaxClasses::delete($_GET['id'])) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } OSCOM::redirect(OSCOM::getLink()); }
public static function execute(ApplicationAbstract $application) { $data = array('zone_id' => $_POST['tax_zone_id'], 'rate' => $_POST['tax_rate'], 'description' => $_POST['tax_description'], 'priority' => $_POST['tax_priority'], 'rate' => $_POST['tax_rate'], 'tax_class_id' => $_GET['id']); if (TaxClasses::saveEntry(isset($_GET['rID']) && is_numeric($_GET['rID']) ? $_GET['rID'] : null, $data)) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id'])); }
public static function execute(ApplicationAbstract $application) { $data = array('title' => $_POST['tax_class_title'], 'description' => $_POST['tax_class_description']); if (TaxClasses::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $data)) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } osc_redirect_admin(OSCOM::getLink()); }
public static function execute() { if (!isset($_GET['search'])) { $_GET['search'] = ''; } if (!empty($_GET['search'])) { $result = TaxClasses::findEntries($_GET['search'], $_GET['id']); } else { $result = TaxClasses::getAllEntries($_GET['id']); } $result['rpcStatus'] = RPC::STATUS_SUCCESS; echo json_encode($result); }
public static function execute() { if (!isset($_GET['search'])) { $_GET['search'] = ''; } if (!isset($_GET['page']) || !is_numeric($_GET['page'])) { $_GET['page'] = 1; } if (!empty($_GET['search'])) { $result = TaxClasses::find($_GET['search'], $_GET['page']); } else { $result = TaxClasses::getAll($_GET['page']); } $result['rpcStatus'] = RPC::STATUS_SUCCESS; echo json_encode($result); }
public static function execute(ApplicationAbstract $application) { $error = false; foreach ($_POST['batch'] as $id) { if (!TaxClasses::delete($id)) { $error = true; break; } } if ($error === false) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } OSCOM::redirect(OSCOM::getLink()); }
<p><?php echo OSCOM::getDef('introduction_batch_delete_tax_classes'); ?> </p> <?php $check_tax_classes_flag = array(); $Qclasses = $OSCOM_Database->query('select tax_class_id, tax_class_title from :table_tax_class where tax_class_id in (":tax_class_id") order by tax_class_title'); $Qclasses->bindRaw(':tax_class_id', implode('", "', array_unique(array_filter(array_slice($_POST['batch'], 0, MAX_DISPLAY_SEARCH_RESULTS), 'is_numeric')))); $Qclasses->execute(); $names_string = ''; while ($Qclasses->next()) { if (TaxClasses::hasProducts($Qclasses->valueInt('tax_class_id'))) { $check_tax_classes_flag[] = $Qclasses->value('tax_class_title'); } $names_string .= osc_draw_hidden_field('batch[]', $Qclasses->valueInt('tax_class_id')) . '<b>' . $Qclasses->value('tax_class_title') . ' (' . sprintf(OSCOM::getDef('total_entries'), TaxClasses::getNumberOfTaxRates($Qclasses->valueInt('tax_class_id'))) . ')</b>, '; } if (!empty($names_string)) { $names_string = substr($names_string, 0, -2); } echo '<p>' . $names_string . '</p>'; if (empty($check_tax_classes_flag)) { echo '<p>' . osc_draw_button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))) . '</p>'; } else { echo '<p><b>' . OSCOM::getDef('batch_delete_warning_tax_class_in_use') . '</b></p>' . '<p>' . implode(', ', $check_tax_classes_flag) . '</p>'; echo '<p>' . osc_draw_button(array('href' => OSCOM::getLink(), 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))) . '</p>'; } ?> </form> </div>
<?php /** * osCommerce Online Merchant * * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com * @license BSD License; http://www.oscommerce.com/bsdlicense.txt */ use osCommerce\OM\Core\HTML; use osCommerce\OM\Core\ObjectInfo; use osCommerce\OM\Core\OSCOM; use osCommerce\OM\Core\Site\Admin\Application\TaxClasses\TaxClasses; $OSCOM_ObjectInfo = new ObjectInfo(TaxClasses::get($_GET['id'])); ?> <h1><?php echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?> <div class="infoBox"> <h3><?php echo HTML::icon('edit.png') . ' ' . $OSCOM_ObjectInfo->getProtected('tax_class_title'); ?> </h3>
<h3><?php echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('tax_class_title'); ?> </h3> <form name="tcDelete" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'Delete&Process&id=' . $OSCOM_ObjectInfo->getInt('tax_class_id')); ?> " method="post"> <?php if (TaxClasses::hasProducts($OSCOM_ObjectInfo->getInt('tax_class_id'))) { ?> <p><?php echo '<b>' . sprintf(OSCOM::getDef('delete_warning_tax_class_in_use'), TaxClasses::getNumberOfProducts($OSCOM_ObjectInfo->getInt('tax_class_id'))) . '</b>'; ?> </p> <p><?php echo osc_draw_button(array('href' => OSCOM::getLink(), 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))); ?> </p> <?php } else { ?> <p><?php echo OSCOM::getDef('introduction_delete_tax_class'); ?>
<?php /* osCommerce Online Merchant $osCommerce-SIG$ Copyright (c) 2010 osCommerce (http://www.oscommerce.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation. */ use osCommerce\OM\Core\ObjectInfo; use osCommerce\OM\Core\Site\Admin\Application\TaxClasses\TaxClasses; use osCommerce\OM\Core\OSCOM; $OSCOM_ObjectInfo = new ObjectInfo(TaxClasses::getEntry($_GET['rID'])); ?> <h1><?php echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?> <div class="infoBox"> <h3><?php echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->get('tax_class_title') . ': ' . $OSCOM_ObjectInfo->getProtected('geo_zone_name'); ?>