<?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)  {

		if($ok) {
			$result = $GLOBALS['db']->sql_query("DELETE FROM `".TABLE_MESSAGE."` WHERE `mid`='$mid'");
			$GLOBALS['db']->sql_query("OPTIMIZE TABLE `".TABLE_MESSAGE."`");
			if (!$result) {
				return;
			}
			redirect_url("".$admin_file.".php?op=viewmessages");
		} else {
			incoh();
			Max_OpenTable();
			echo "<center><font size=\"4\"><b>" . _MESSAGESADMIN . "</b></font></center>";
			Max_CloseTable();
			br('1');
			Max_OpenTable();
			echo "<center>" . _REMOVEMSG . "";
			echo "<br /><br />[ <a href=\"".$admin_file.".php?op=messages\">" . _NO . "</a> | <a href=\"".$admin_file.".php?op=deletemsg&amp;mid=$mid&amp;ok=1\">" . _YES . "</a> ]</center>";
			Max_CloseTable();
			incof();
		}

}
}else {
	echo "Access Denied";
}