<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* NSN Banner Ads                                       */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2005 by NukeScripts Network         */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
    redirect_url("../../".$admin_file.".php");
    die();
}
list($latest_bid) = $db->sql_fetchrow($db->sql_query("SELECT max(`bid`) AS `latest_bid` FROM `".TABLE_NSNBA_BANNERS."`"));
$latest_bid = $latest_bid + 1;
$imageurl = baclear_text($imageurl);
$clickurl = baclear_text($clickurl);
$alttext = baclear_text($alttext);
if(!get_magic_quotes_runtime()) {
  $imageurl = addslashes($imageurl);
  $clickurl = addslashes($clickurl);
  $alttext = addslashes($alttext);
}
$db->sql_query("INSERT INTO `".TABLE_NSNBA_BANNERS."` VALUES ($latest_bid, $cid, $pid, $imptotal, 0, 0, '$imageurl', '$clickurl', '$alttext', $code, $flash, $height, $width, '$strdate', '$enddate', $active)");
redirect_url("".$admin_file.".php?op=BAImage&active=$active");