<?php
	$acl=$_SESSION["acl"];
	if (strlen($acl)<1 || !strpos($acl,"<0019>")) {	//没有权限
		ob_clean();
		header("Location: accesserror.html");
		exit;
	}
?>

<?php
   	$strYear=trim($_REQUEST["year"]);
   	if ($strYear=="") {
		ob_clean();
		echo("必须输入年度！");
		exit;
   	}
   	$timestr=$strYear."-";

	$db=mysql_pconnect(get_cfg_var("SIPSERVER"),get_cfg_var("SIPUSER"),get_cfg_var("SIPPWD"));
	mysql_select_db(get_cfg_var("SIPDB"),$db);
	mysql_query( "delete from users where addtime like '".$timestr."%'",$db );
	mysql_query( "delete from history where starttime like '".$timestr."%'",$db );
	mysql_query( "delete from account where checktime like '".$timestr."%'",$db );
	mysql_query( "delete from operation where opertime like '".$timestr."%'",$db );
	mysql_close($db);
?>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>清除历史数据</title>
</head>

<body background="bkg.bmp">

<p align="center"><font size="5"><b>清除历史数据</b></font></p>
<hr color="#999966">
<p align="center"><b>
<?php echo $strYear; ?>年度历史数据已经成功清除！</b>
<p align="center">　</p>
<hr>
<p align="center">SIP酒店上网计费管理系统</p>
<p align="center">作者：<b>深圳市飞沃软件有限公司</b></p>

</body>

</html>
