";
if (!$user->isAdmin()) {
	print "ERROR: You must be administrator to execute the update";
	die;
}
function update_db()
{
	global $db;
	$fd = fopen ("update.sql", "r");
	
	if (is_bool($fd)&&!$fd) return false;
	$queryStr = fread($fd, filesize("update.sql"));
	
	if (is_bool($queryStr)&&!$queryStr) return false;
	
	fclose ($fd);
	if (!$db->getResult($queryStr)) return false;
	
	return true;
}
print "Updating ...please wait
";
print "
";
if (!update_db()) {
	print "";
	print "ERROR: An error occurred during the DB update";
	print "