-----------------------------------------------------------------------------
   based on:
   (c) 2003 OSC-Affiliate (affiliate_banners.php, v 1.6 2003/07/12);
   http://oscaffiliate.sourceforge.net/

   Contribution based on:

   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com

   Copyright (c) 2002 - 2003 osCommerce

   Released under the GNU General Public License
   ---------------------------------------------------------------------------*/
require 'includes/application_top.php';
$affiliate_banner_extension = xtc_banner_image_extension();
if ($_GET['action']) {
    switch ($_GET['action']) {
        case 'setaffiliate_flag':
            if ($_GET['affiliate_flag'] == '0' || $_GET['affiliate_flag'] == '1') {
                xtc_set_banner_status($_GET['abID'], $_GET['affiliate_flag']);
                $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success');
            } else {
                $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
            }
            xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $_GET['abID']));
            break;
        case 'insert':
        case 'update':
            $affiliate_banners_id = xtc_db_prepare_input($_POST['affiliate_banners_id']);
            $affiliate_banners_title = xtc_db_prepare_input($_POST['affiliate_banners_title']);
   XT-Commerce - community made shopping
   http://www.xt-commerce.com

   Copyright (c) 2003 XT-Commerce
   --------------------------------------------------------------
   based on: 
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(banner_manager.php,v 1.70 2003/03/22); www.oscommerce.com 
   (c) 2003	 nextcommerce (banner_manager.php,v 1.9 2003/08/18); www.nextcommerce.org

   Released under the GNU General Public License 
   --------------------------------------------------------------*/
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
$banner_extension = xtc_banner_image_extension();
if (xtc_not_null($action)) {
    switch ($action) {
        case 'setflag':
            if ($_GET['flag'] == '0' || $_GET['flag'] == '1') {
                xtc_set_banner_status($_GET['bID'], $_GET['flag']);
                $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success');
            } else {
                $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
            }
            xtc_redirect(xtc_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . (int) $_GET['bID']));
            break;
        case 'insert':
        case 'update':
            if (isset($_POST['banners_id'])) {
                $banners_id = xtc_db_prepare_input($_POST['banners_id']);