<?
error_reporting ( 0 );
require_once('inc.php');

$txt='../inc/password.key';
if(file_exists($txt)){
	$fp=fopen($txt,"a+");
    $con=fread($fp,filesize($txt));
	}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<link href="css/jquery.css" rel="stylesheet" type="text/css">
<link href="css/base.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function tab(no,n){
	for(var i=1;i<=n;i++){
		$('#config'+i).hide();
	}
	$('#config'+no).show();
} 
</script>
</head>
<body> 
<?
if ($_GET ['id'] == 'man') {
?>
<div class="right">
 <? include "welcome.php";?>
  <div class="right_main">

<table width="98%" border="0" cellpadding="4" cellspacing="1"
	class="tableoutline">
	<form action="?id=save" method="post">
	<tbody >
		<tr nowrap class="tb_head">
			<td colspan="4">
			<h2>授权管理：</h2>			</td>
		</tr>
		<tr nowrap class="firstalt">
			<td width="260"><b>授权码：</b><br>			  <font color="red">请支持正版，购买授权码请联系<a href="http://wpa.qq.com/msgrd?v=3&uin=86226656&site=qq&menu=yes" target="_blank"><img border="0" src="http://wpa.qq.com/pa?p=2:86226656:51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a></font>		</td>
			<td><input type="text" name="password" size="25" maxlength="50" value="<?=$con?>" onFocus="this.style.borderColor='#00CC00'" onBlur="this.style.borderColor='#dcdcdc'" ><input type="hidden" name="action" value="setting"> <input class="bginput" type="submit" name="submit" value=" 提交 "></td>
		</tr></tbody>
	</form>
</table>
</div>
</div>
<? include "footer.php";?>
</body>
</html>
<?php
} elseif ($_GET ['id'] == 'save') {	

		$fp = fopen ( "../inc/password.key", "w" );
		fwrite ( $fp, $_POST ['password'] );
		fclose ( $fp );
		
		echo "<script>alert('\u63d0\u4ea4\u6210\u529f\uff01');window.location='admin_index.php';</script>" ;
		exit ();
	}

?>
