<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Modified by PHP-Fusion SF Group
| Copyright © 2007 by SF
| http://www.rus-phpfusion.com/
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once ADMIN."navigation.php";

if (!checkrights("U")) fallback("../index.php");

opentable("Upgrade");
if (str_replace(",","",$settings['version']) !== "6.01.19.4") {
	if (!isset($_POST['stage'])) {
		echo "<table align='center' cellpadding='0' cellspacing='0' class='body'>
<form name='upgradeform' method='post' action='upgrade.php'>
<tr>
<td>
<center>
Обновить систему.<br><br>
<input type='hidden' name='stage' value='2'>
<input type='submit' name='upgrade' value='Обновить' class='button'>
</center>
</td>
</tr>
</form>
</table>\n";
	}
	if (isset($_POST['stage']) && $_POST['stage'] == 2) {
		if (isset($_POST['upgrade'])) {

$result = dbquery("UPDATE ".$db_prefix."settings SET version='6.01.19.4'");


echo "<center><br>\nОбновление завершено.<br><br>\n</center>\n";							
		}
	}
} else {
	echo "<center><br>\nСистема имеет актуальную версию.<br><br>\n</center>\n";
}
closetable();

echo "</td>\n";
require_once BASEDIR."footer.php";
?>