<?php

/* Nulled by Wizzywig */

	session_start();
	include_once ("../includes/data_core.php");
	
	// Logout
	if ($_GET['do'] == "logout") {
		unset($_SESSION['arrowchat_admin']);
	}

	// Check Admin is Logged In
	require ("../admin/includes/functions_login.php");
	
	$ran = false;
	
	if (isset($_POST['upgrade']) || isset($_POST['upgrade_x'])) 
	{
	
		$sql = "CREATE INDEX `to` ON arrowchat (`to`)";
		mysql_query($sql);
		$sql = "CREATE INDEX `read` ON arrowchat (`read`)";
		mysql_query($sql);
		$sql = "CREATE INDEX `user_read` ON arrowchat (`user_read`)";
		mysql_query($sql);
		$sql = "CREATE INDEX `to_id` ON arrowchat_notifications (`to_id`)";
		mysql_query($sql);
		$sql = "CREATE INDEX `hash_id` ON arrowchat_status (`hash_id`)";
		mysql_query($sql);
		
		$ran = true;
		
	}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> 
<head profile="http://gmpg.org/xfn/11"> 
 
	<title>ArrowChat | Upgrade Installation</title> 
 
</head> 
 
<body> 

	<div style="font-size: 14px; font-family: arial, verdana; margin: 0 auto; width: 700px; margin-top: 50px;">
	
		<span style="font-weight: bold; font-size: 18px;">ArrowChat Upgrade Process</span>
		
		<br /><br />
		
<?php
	if ($ran) {
?>
		Your ArrowChat installation has been upgraded.  It is safe to delete the upgrade folder.
<?php
	} else {
?>
		Running this upgrade process will make the necessary upgrades to your ArrowChat database structure.  This is not requried on a fresh install of ArrowChat.  It is safe to delete the upgrade folder after this process is run or on a fresh install of ArrowChat.
		
		<br /><br />
		
		<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"> 
		
			<input type="submit" name="upgrade" value="Run Upgrade" />
		
		</form>
<?php
	}
?>
	
	</div>

</body>
</html>