Contribution based on:

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

Copyright (c) 2002 - 2003 osCommerce
Copyright (c) 2003 netz-designer
Copyright (c) 2005 OL-Commerce , 2006 Dipl.-Ing.(TH) Winfried Kaiser (w.kaiser@fortune.de, info@seifenparadies.de)

Copyright (c) 2002 - 2003 osCommerce

Released under the GNU General Public License
---------------------------------------------------------------------------*/
$div_field = '<div id="spiffycalendar" class="text"></div>';
require 'includes/application_top.php';
$affiliate_banner_extension = olc_banner_image_extension();
if ($_GET['action']) {
    switch ($_GET['action']) {
        case 'setaffiliate_flag':
            if ($_GET['affiliate_flag'] == '0' || $_GET['affiliate_flag'] == '1') {
                olc_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');
            }
            olc_redirect(olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $_GET['abID']));
            break;
        case 'insert':
        case 'update':
            $affiliate_banners_id = olc_db_prepare_input($_POST['affiliate_banners_id']);
            $affiliate_banners_title = olc_db_prepare_input($_POST['affiliate_banners_title']);
   OL-Commerce Version 5.x/AJAX
   http://www.ol-commerce.com, http://www.seifenparadies.de

   Copyright (c) 2004 OL-Commerce , 2006 Dipl.-Ing.(TH) Winfried Kaiser (w.kaiser@fortune.de, info@seifenparadies.de)
   --------------------------------------------------------------
   based on: 
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(banner_statistics.php,v 1.4 2002/11/22); www.oscommerce.com 
   (c) 2003	    nextcommerce (banner_statistics.php,v 1.9 2003/08/18); www.nextcommerce.org
(c) 2004      XT - Commerce; www.xt-commerce.com

    Released under the GNU General Public License 
   --------------------------------------------------------------*/
require 'includes/application_top.php';
$banner_extension = olc_banner_image_extension();
// check if the graphs directory exists
$dir_ok = false;
if (function_exists('imagecreate') && $banner_extension) {
    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
        if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
            $dir_ok = true;
        } else {
            $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
        }
    } else {
        $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
}
$banner_query = olc_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . $_GET['bID'] . APOS);
$banner = olc_db_fetch_array($banner_query);