<?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)  {
        incoh();
        menu();
        status();
	echo "<script type='text/javascript' src='kernel/addons/selall.js'></script>\n";
        Max_OpenTable();
        echo "<form method=\"post\" name=\"backup\" action=\"".$admin_file.".php\">"
            ."<table><tr>"
	    ."<td valign='top'>";


echo "<select name=\"tablelist\" size=\"20\" multiple>";
        $tables = mysql_list_tables($dbname);
        for ($i = 0; $i < mysql_num_rows($tables); $i++) {
            $table = mysql_tablename($tables, $i);
            echo "<option value=\"$table\">$table</option>";
        }
        mysql_free_result($result);

        echo "</select></td>";
echo "<input type='button' value='"._SEL_ALL."' onclick='selAll(true)' />"
    ."<input type='button' value='"._SEL_NONE."' onclick='selAll(false)' />"
            ."<td valign='top'>"._ACTION."<br /><select name=\"op\">"
            ."<option value=\"BackupDB\">"._DB_BackupDB."</option>"
            ."<option value=\"OptimizeDB\">"._DB_OptimizeDB."</option>"
            ."<option value=\"CheckDB\">"._DB_CheckDB."</option>"
            ."<option value=\"AnalyzeDB\">"._DB_AnalyzeDB."</option>"
            ."<option value=\"RepairDB\">"._DB_RepairDB."</option>"
            ."<option value=\"StatusDB\">"._DB_StatusDB."</option>"
            ."</SELECT>";
	br('2');
        echo ""._DB_01.":<br /><input type=\"checkbox\" value=\"1\" name=\"drop\" />"._DB_02."";
        br('1');
        echo "<input type=\"checkbox\" value=\"1\" name=\"gzip\" />"._DB_03."";
        br('2');
        
        echo "<input type=\"submit\" value=\""._GO."\" /></td><td width=\"50%\">";
        Max_OpenTable2();
        echo ""._DB_05."";
        Max_CloseTable2();
        echo "</td></tr></table></form>";
        Max_CloseTable();
        br('1');
        Max_OpenTable();
        echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"".$admin_file.".php\" name=\"restore\">"._DB_04."<br />
        <input type=\"file\" name=\"sqlfile\" size=\"80\" />&nbsp;&nbsp;
	<input type=\"hidden\" name=\"op\" value=\"RestoreDB\" />
	<input type=\"submit\" value=\""._OK."\" />
        </form>";
        Max_CloseTable();
        incof();
}
} else {
	echo "Access Denied";
}