Esempio n. 1
0
 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 .= ': ' . ZoneGroups::get($_GET['id'], 'geo_zone_name');
     }
 }
Esempio n. 2
0
 public static function execute(ApplicationAbstract $application)
 {
     if (ZoneGroups::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');
     }
     osc_redirect_admin(OSCOM::getLink());
 }
Esempio n. 3
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('group_id' => $_GET['id'], 'country_id' => $_POST['zone_country_id'], 'zone_id' => $_POST['zone_id']);
     if (ZoneGroups::saveEntry(isset($_GET['zID']) && is_numeric($_GET['zID']) ? $_GET['zID'] : 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(null, null, 'id=' . $_GET['id']));
 }
Esempio n. 4
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('zone_name' => $_POST['zone_name'], 'zone_description' => $_POST['zone_description']);
     if (ZoneGroups::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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!empty($_GET['search'])) {
         $result = ZoneGroups::findEntries($_GET['search'], $_GET['id']);
     } else {
         $result = ZoneGroups::getAllEntries($_GET['id']);
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
Esempio n. 6
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['batch'] as $id) {
         if (!ZoneGroups::deleteEntry($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');
     }
     osc_redirect_admin(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
Esempio n. 7
0
 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 = ZoneGroups::find($_GET['search'], $_GET['page']);
     } else {
         $result = ZoneGroups::getAll($_GET['page']);
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
<?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\ZoneGroups\ZoneGroups;
$zones_array = array();
foreach (ObjectInfo::to(ZoneGroups::getAll(-1))->get('entries') as $group) {
    $zones_array[] = array('id' => $group['geo_zone_id'], 'text' => $group['geo_zone_name']);
}
?>

<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 
Esempio n. 9
0
  <p><?php echo OSCOM::getDef('introduction_batch_delete_zone_groups'); ?></p>

<?php
  $check_tax_zones_flag = array();

  $Qzones = $OSCOM_PDO->query('select geo_zone_id, geo_zone_name from :table_geo_zones where geo_zone_id in (\'' . implode('\', \'', array_unique(array_filter(array_slice($_POST['batch'], 0, MAX_DISPLAY_SEARCH_RESULTS), 'is_numeric'))) . '\') order by geo_zone_name');
  $Qzones->execute();

  $names_string = '';

  while ( $Qzones->fetch() ) {
    if ( ZoneGroups::hasTaxRates($Qzones->valueInt('geo_zone_id')) ) {
      $check_tax_zones_flag[] = $Qzones->value('geo_zone_name');
    }

    $names_string .= HTML::hiddenField('batch[]', $Qzones->valueInt('geo_zone_id')) . '<b>' . $Qzones->valueProtected('geo_zone_name') . ' (' . sprintf(OSCOM::getDef('total_entries'), ZoneGroups::getNumberOfEntries($Qzones->valueInt('geo_zone_id'))) . ')</b>, ';
  }

  if ( !empty($names_string) ) {
    $names_string = substr($names_string, 0, -2);
  }

  echo '<p>' . $names_string . '</p>';

  if ( empty($check_tax_zones_flag) ) {
    echo '<p>' . HTML::button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))) . '</p>';
  } else {
    echo '<p><b>' . OSCOM::getDef('batch_delete_warning_group_in_use_tax_rate') . '</b></p>' .
         '<p>' . implode(', ', $check_tax_zones_flag) . '</p>';

    echo '<p>' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'primary', 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))) . '</p>';
Esempio n. 10
0
<?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\ZoneGroups\ZoneGroups;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(ZoneGroups::get($_GET['id']));
?>

<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('edit.png') . ' ' . $OSCOM_ObjectInfo->getProtected('geo_zone_name');
?>
Esempio n. 11
0
  <h3><?php 
echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('geo_zone_name');
?>
</h3>

  <form name="zDelete" class="dataForm" action="<?php 
echo OSCOM::getLink(null, null, 'Delete&Process&id=' . $OSCOM_ObjectInfo->getInt('geo_zone_id'));
?>
" method="post">

<?php 
if (ZoneGroups::hasTaxRates($OSCOM_ObjectInfo->getInt('geo_zone_id'))) {
    ?>

  <p><?php 
    echo '<b>' . sprintf(OSCOM::getDef('delete_warning_group_in_use_tax_rate'), ZoneGroups::getNumberOfTaxRates($OSCOM_ObjectInfo->getInt('geo_zone_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_zone_group');
    ?>
Esempio n. 12
0
<?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\ZoneGroups\ZoneGroups;
use osCommerce\OM\Core\OSCOM;
$zones_array = array();
foreach (osc_toObjectInfo(ZoneGroups::getAll(-1))->get('entries') as $group) {
    $zones_array[] = array('id' => $group['geo_zone_id'], 'text' => $group['geo_zone_name']);
}
?>

<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">
Esempio n. 13
0
?>

<script type="text/javascript">
  function update_zone(theForm) {
    var NumState = theForm.zone_id.options.length;
    var SelectedCountry = "";

    while(NumState > 0) {
      NumState--;
      theForm.zone_id.options[NumState] = null;
    }

    SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;

<?php 
echo ZoneGroups::getJSList('SelectedCountry', 'theForm', 'zone_id');
?>
  }
</script>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>
Esempio n. 14
0
<?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\ZoneGroups\ZoneGroups;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(ZoneGroups::getEntry($_GET['zID']));
?>

<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->getProtected('countries_name') . ': ' . $OSCOM_ObjectInfo->getProtected('zone_name');
?>