<?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                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
if ($acces == 1) {
if($admintest && $adminsecu)  {

$id        = $GLOBALS['db']->XMFnum($id);
$brconfig  = $GLOBALS['db']->XMFnum($brconfig);
$firstimg  = htmlentities($firstimg, ENT_QUOTES);
$titre     = htmlentities($titre, ENT_QUOTES);
$title     = htmlentities($title, ENT_QUOTES);
$url       = htmlentities($url, ENT_QUOTES);
$secondimg = htmlentities($secondimg, ENT_QUOTES);

$row = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `pos` FROM `".TABLE_PLAN."` ORDER BY `pos` DESC"));
$pos = $GLOBALS['db']->XMFnum($row['pos']);
$pos = $pos+1;
$GLOBALS['db']->sql_query("INSERT INTO `".TABLE_PLAN."` VALUES ('$id', '$firstimg', '$titre', '$title', '$url', '$secondimg', '$brconfig', 1, '', '','','', 0, '', '$pos' ) ");
$GLOBALS['db']->sql_query("OPTIMIZE TABLE `".TABLE_PLAN."` ");
redirect_url("".$admin_file.".php?op=Plan");

}
}else {
	echo "Access Denied";
}