<!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" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>GmAmxBans 1.3 - Upgrade</title>
	<link rel="stylesheet" type="text/css" href="upgrade/css/main.css" />
	<script type="text/javascript" src="upgrade/js/niftycube.js"></script>
	<script type="text/javascript" src="templates/_js/jquery.js"></script>
	<script type="text/javascript">
		var step = 1;
		$(document).ready(function(){
			$('#mainForm').bind('submit', function(){
				switch (step)
				{
					case 1:
						$.getJSON('upgrade.inc.php', {step: 1, login: $('#name').attr('value'), password:$('#password').attr('value')},function(data,status){
							$('#result').html(data.message);
							if (data.result)
							{
								$('#mainForm').html('<input type="submit" id="step2" class="button" name="step2" value="Next" />');
								step = 2;
							}						
						});
						break;
					case 2:
						$.getJSON('upgrade.inc.php', {step: 2},function(data,status){
							console.log(data);
							$('#result').html(data.message);
							if (data.result)
							{
								$('#mainForm').replaceWith('');
								step = 3;
							}	
						});
				}
				return false;
			});
		
		
		});
		function removeText(element, defValue) {
			if (element.value == defValue)
				element.value = "";
		}

		function checkInput(element, text) {
			if (!element.value)
				element.value = text;
		}

		window.onload=function() {
			Nifty("div#page","big");
		}
	</script>
</head>
<body>
	<body> 
		<div class="head_bg"> 
			<a href="http://www.gm-project.net"> 
				<img style="border:none" src="upgrade/images/logo_staff.png" alt=""> 
			</a> 
		</div>
		<div class="majic"> 
			<div id="page">
				<div align="center">
					<div id="result">Status info</div>
						<form method="GET" id="mainForm">
							<input type="text" class="login" id="name" name="name" value="Database user" name="name" onclick="removeText(this, 'Database user')" />
							<input type="text" class="login" id="password" name="password" value="Database password" name="name" onclick="removeText(this, 'Database password')" />
							<input type="submit" class="button" value="Login" />
						</form>
				</div>
				<br />
 				<table width='100%' style='background:transparent url(upgrade/images/strike.gif) repeat-x scroll 0 0;'> 
					<tr> 
						<td valign='middle'> 
							<br /> 
							<div> 
								<div><a href='http://gm-project.net'><img src='upgrade/images/gmstaff0.png' border='0' alt='By Flazher, a.aqua, Fedcomp'></a></div> 
							</div> 
						</td> 
						<td valign='middle'> 
							<div align='right'> 
								<strong>AMXBans: Gm 1.3. Upgrade script</strong> 
							</div> 
						</td> 
					</tr> 
				</table> 

</body>
</html>