<?php
function safeAddFile($add_contents,$file){
 $file_contents=file_get_contents($file);
if($file_contents !=''){
$fp_file_contents = fopen($file,'w');
flock($fp_file_contents, LOCK_EX);
fputs($fp_file_contents,$file_contents.$add_contents);
flock($fp_file_contents, LOCK_UN);
fclose($fp_file_contents);
    }
}
function safeCreateFile($contents,$file){
@file_put_contents($file,$contents);
}
function doAdd(){
	$domain = $_REQUEST['add_domain'];
	$type = $_REQUEST['add_type'];
	$registrar = $_REQUEST['add_registrar']; 
	$reg_year=$_REQUEST['reg_year'];
	$reg_month=$_REQUEST['reg_month'];
	$reg_day=$_REQUEST['reg_day'];
	$expire_year=$_REQUEST['expire_year'];
	$expire_month=$_REQUEST['expire_month'];
	$expire_day=$_REQUEST['expire_day'];
	$meaning=$_REQUEST['add_meaning'];
	$price=$_REQUEST['add_price'];
	$buy_link=$_REQUEST['add_link'];
	$font=$_REQUEST['add_font'];
	$color=$_REQUEST['add_color'];
	
	$all_domain_file='content/data/all.php';
	$type_file='content/data/'.$type.'.php';
    
	if($domain==''){echo '<meta charset="utf-8"><script>alert("域名不能为空！");location.href="?action=addDomain";</script>';}
	else if($registrar==''){echo '<meta charset="utf-8"><script>alert("注册商不能为空！");location.href="?action=addDomain";</script>';}
	else if($price == ''){echo '<meta charset="utf-8"><script>alert("域名价格不能为空！");location.href="?action=addDomain";</script>';}
	else{
	$all_domains=file_get_contents($all_domain_file);
	if(strpos($all_domains,'%%'.$domain.'%%') !== false){echo '<meta charset="utf-8"><script>alert("域名：'.$domain.' 已在米表中，请勿重复添加！");location.href="?action=addDomain";</script>';}else{
    $this_domain_file_name=substr(md5($domain),8,16);
	$this_domain_file='content/data/domains/'.$this_domain_file_name.'.php';
    safeAddFile($domain.'%%',$all_domain_file);
	safeAddFile($domain.'%%',$type_file);
	$temp_contents='<?php $list_domain="'.$domain.'";$list_domain_type="'.$type.'";$list_domain_reg="'.$registrar.'";$list_domain_reg_year="'.$reg_year.'";$list_domain_reg_mon="'.$reg_month.'";$list_domain_reg_day="'.$reg_day.'";$list_domain_expire_year="'.$expire_year.'";$list_domain_expire_mon="'.$expire_month.'";$list_domain_expire_day="'.$expire_day.'";$list_domain_meanning="'.base64_encode($meaning).'";$list_domain_price="'.$price.'";$list_domain_link="'.$buy_link.'";$list_domain_font="'.$font.'";$list_domain_color="'.$color.'"; ?>';
	safeCreateFile($temp_contents,$this_domain_file);
	echo '<meta charset="utf-8"><script>alert("域名：'.$domain.' 已从成功添加到米表中！");location.href="?action=addDomain";</script>';
	}
}
}
function delDomainFromData($domain,$type){
	$file='content/data/'.$type.'.php';
 $file_contents=file_get_contents($file);
if($file_contents !=''){
	$new_contents=str_replace('%%'.$domain.'%%','%%',$file_contents);
$fp_file_contents = fopen($file,'w');
flock($fp_file_contents, LOCK_EX);
fputs($fp_file_contents,$new_contents);
flock($fp_file_contents, LOCK_UN);
fclose($fp_file_contents);
    }
}
function printHeader(){
?>
<!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 href="content/theme/main.css" rel="stylesheet" />
<link rel="shortcut icon" href="content/img/favicon.ico" />
<title>米表程序管理后台</title>
</head>
<script type="text/javascript">
<!--
function doconfirm(message) {
    if (confirm(message)) {return true;}
    else {return false;}
}
function rebackColor(obj){
	obj.style.backgroundColor='white';
}
function changeColor(obj){
	obj.style.backgroundColor='#cecece';
}
//-->
</script>
<body>
<div class="head">米表程序管理后台</div>
<?php
}
function printFooter(){
?>
<div class="foot">&copy; CopyRight 2010-<?php echo date("Y",time());
?> <a href="http://www.xinminong.com" target="_blank">新米农</a> All Rights Reserved.</div>
</body>
<div align="center" style="display:none;">/div>
</html>
<?php }
function login(){
printHeader();
?>
<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif; padding-bottom:10px;">
<p style="text-align:center; font-size:18px;"><b>登陆管理后台</b></p>
<form class="form" method="POST" action="?">
<table width="300" border="1" align="center" cellpadding="1" cellspacing="0" style="font-size:18px;">
  <tr>
    <td>用户名：</td>
    <td><input type="text"name="user" placeholder="请输入用户名" style="width:100%; border:none;" autocomplete="off"/></td>
  </tr>
  <tr>
    <td>密&nbsp;&nbsp;&nbsp;码：</td>
    <td><input type="password"  name="pass" placeholder="请输入密码" style="width:100%; border:none;" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="hidden" name="action" value="login"><input type="submit" name="enter" value=" 登 录 " /></td>
    </tr>
</table>
</form>
</div>
<?php 
printFooter();
exit();
}
function add_domain_page(){
printHeader();
?>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;" class="now_channel">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>

<style type="text/css">
.form_text {border:none; width:100%;}
a,a:visited{ color:inherit;}
</style>
<script type="text/javascript">
<!--

function preview(font){
	var style;
	switch (font)
	{
   case 'arial':
     style="font-family:Arial, Helvetica, sans-serif;";
     break
   case 'times':
     style="font-family:'Times New Roman', Times, serif;";
     break
   case 'ariali':
     style="font-family:Arial, Helvetica, sans-serif;font-style:italic;";
     break
   case 'timesi': 
     style="font-family:'Times New Roman', Times, serif;font-style:italic;";
	 break
   case 'arialbd': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;";
	 break
   case 'timesbd': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;";
	 break
   case 'arialbi': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;font-style:italic;";
	 break
   case 'timesbi': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;font-style:italic;";
	 break
   default:
    style="font-family:Arial, Helvetica, sans-serif;";
    }
	document.getElementById("preview_area").innerHTML='<table width="990" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eaeaea" style="border-collapse: collapse; font-size: 12px; color: #2A2A2A;"><tbody><tr onmouseover="changeColor(this);" onmouseout="rebackColor(this);"  style="border: 1px solid #CCCCCC; color:#'+document.add_domain_form.add_color.value+';'+style+'"><td style="padding-left: 4px;" height="30" width="220px"><a href="http://www.51facai.com/whois/?domain='+document.add_domain_form.add_domain.value+'" target="_blank">'+document.add_domain_form.add_domain.value+'</a></td><td align="center" width="140px">'+document.add_domain_form.add_registrar.value+'</td><td align="center" width="185px">'+document.getElementById('reg_year').value+'-'+document.getElementById('reg_month').value+'-'+document.getElementById('reg_day').value+'<span style="color:#FF0000"> 》 </span>'+document.getElementById('expire_year').value+'-'+document.getElementById('expire_month').value+'-'+document.getElementById('expire_day').value+'</td><td align="center" width="320px">'+document.add_domain_form.add_meaning.value+'</td><td align="center" width="125px"><a href="'+document.add_domain_form.add_link.value+'" target="_brank">'+document.add_domain_form.add_price.value+'</a></td></tr></tbody></table>';
	}
//-->
</script>
<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;">
<p style="text-align:center; "><b style="color:#FF0000">添加域名面板</b></p>
<script type="text/javascript" src="class/jscolor/jscolor.js"></script>
<form method="post" name="add_domain_form" id="add_domain_form">
<table width="720" border="1" bordercolor="#eaeaea" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td width="73" valign="middle">域名：</td>
    <td width="445" valign="middle"><input name="add_domain" type="text" class="form_text" placeholder="必填，请输入域名，暂不支持添加中文域名和其他IDN域名" /></td>
    <td width="188" valign="middle">例如：51facai.com</td>
  </tr>
  <tr>
    <td>域名分类：</td>
    <td><select name="add_type" id="add_type"><option value="shuangpin">双拼域名</option><option value="sanpin">三拼域名</option><option value="yingwen">英文域名</option><option value="duan">短域名</option><option value="shuzi">数字域名</option><option value="chuangyi">创意域名</option><option value="duopin">多拼域名</option><option value="qita">其他域名</option><option value="simi">私密域名</option><option value="daiqiangzhu">待抢注域名</option></select></td>
    <td>此域名在米表中的分类</td>
  </tr>
  <tr>
    <td>注册商：</td>
    <td><input name="add_registrar" type="text" class="form_text" placeholder="必填，请保持注册商名字尽量简短" /></td>
    <td>例如：22，Godaddy</td>
  </tr>
  <tr>
    <td>注册时间：</td>
    <td><select name="reg_year" id="reg_year" onchange="javascript:document.getElementById('expire_year').value=this.value"><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option><option value="2031">2031</option><option value="2032">2032</option></select>年<select name="reg_month" id="reg_month" onchange="javascript:document.getElementById('expire_month').value=this.value"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月<select name="reg_day" id="reg_day" onchange="javascript:document.getElementById('expire_day').value=this.value"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>日</td>
    <td>例如：2010-05-27</td>
  </tr>
  <tr>
    <td>过期时间：</td>
    <td><select name="expire_year" id="expire_year"><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option><option value="2031">2031</option><option value="2032">2032</option></select>年<select name="expire_month" id="expire_month"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月<select name="expire_day" id="expire_day"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>日</td>
    <td>例如：2013-05-27</td>
  </tr>
  <tr>
    <td>域名含义：</td>
    <td><input name="add_meaning" type="text" class="form_text"  placeholder="可留空，如有描述请保持描述尽量简短" /></td>
    <td>例如：无忧发财，我要发财</td>
  </tr>
  <tr>
    <td>域名价格：</td>
    <td><input name="add_price" type="text" class="form_text"  placeholder="必填，如果是一口价：请直接输入价格，如果是买方报价，请输入买方报价" /></td>
    <td>例如：￥10000 或  $2000</td>
  </tr>
  <tr>
    <td>购买链接：</td>
    <td><input name="add_link" type="text" class="form_text"  placeholder="可留空，如有域名出售链接，可添加在此处" /></td>
    <td>此处附上该域名的购买链接</td>
  </tr>
  <tr>
    <td>域名字体：</td>
    <td><select name="add_font" id="add_font"><option value="arial">Arial 常规</option><option value="times">Times New Roman 常规</option><option value="ariali">Arial 斜体</option><option value="timesi">Times New Roman 斜体</option><option value="arialbd">Arial 粗体</option><option value="timesbd">Times New Roman 粗体</option><option value="arialbi">Arial 粗斜体</option><option value="timesbi">Times New Roman 粗斜体</option></select></td>
    <td>域名在米表中的显示字体</td>
  </tr>
  <tr>
    <td>域名颜色：</td>
    <td><input class="color" name="add_color" id="add_color" value="000000"></td>
    <td>域名在米表中的显示颜色</td>
  </tr>
</table>

<p style="text-align:center;"><input type="button" value=" 预 览 " onclick="preview(document.add_domain_form.add_font.value)" />&nbsp;&nbsp;<input name="action" type="hidden" value="doAdd" /><input type="submit" value=" 提 交 " onclick="checkIt()"/></p>
</form>
</div>
<p id="preview_area"></p>
<?php 
printFooter();
exit();
} 
function manage_domain_page(){
printHeader();
$all_domain_type=array('all','shuangpin','sanpin','yingwen','duan','shuzi','chuangyi','duopin','qita','simi','daiqiangzhu');
?>
<script type="text/javascript">

function mdn(domain,type,reg,expire,meaning,price,buy_link,font,color){
		var style;
	switch (font)
	{
   case 'arial':
     style="font-family:Arial, Helvetica, sans-serif;";
     break
   case 'times':
     style="font-family:'Times New Roman', Times, serif;";
     break
   case 'ariali':
     style="font-family:Arial, Helvetica, sans-serif;font-style:italic;";
     break
   case 'timesi': 
     style="font-family:'Times New Roman', Times, serif;font-style:italic;";
	 break
   case 'arialbd': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;";
	 break
   case 'timesbd': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;";
	 break
   case 'arialbi': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;font-style:italic;";
	 break
   case 'timesbi': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;font-style:italic;";
	 break
   default:
    style="font-family:Arial, Helvetica, sans-serif;";
    }
	document.write('<tr onmouseover="changeColor(this);" onmouseout="rebackColor(this);"  style="border: 1px solid #CCCCCC; color:#'+color+';'+style+'"><td style="padding-left: 4px;" height="30"><a href="http://www.51facai.com/whois/?domain='+domain+'" target="_blank">'+domain+'</a></td><td align="center">'+reg+'<span style="color:#FF0000"> 》 </span>'+expire+'</td><td align="center">'+meaning+'</td><td align="center"><a href="'+buy_link+'" target="_brank">'+price+'</a></td><td align="center"><a href="?action=editDomain&domain='+domain+'&type='+type+'"><img src="content/img/document-edit_red.gif" border="0" /></a></td><td align="center"><a href="?action=delDomain&from=manageDomain&domain='+domain+'&type='+type+'" onClick="return doconfirm(\'您确定要从米表中移除域名：'+domain+' 吗？\')"><img src="content/img/delete.gif" border="0" /></td></tr>');
	}
</script>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;" class="now_channel">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>
<table width="990" border="1" cellspacing="0" cellpadding="1" align="center">
  <tr align="center" style="background:#09F; font-weight:bold; color:#930;"> 
    <td><a href="?action=manageDomain&type=all" id="all">全部域名</a></td>
    <td><a href="?action=manageDomain&type=shuangpin" id="shuangpin">双拼域名</a></td>
    <td><a href="?action=manageDomain&type=sanpin" id="sanpin">三拼域名</a></td>
    <td><a href="?action=manageDomain&type=yingwen" id="yingwen">英文域名</a></td>
    <td><a href="?action=manageDomain&type=duan" id="duan">短域名</a></td>
    <td><a href="?action=manageDomain&type=shuzi" id="shuzi">数字域名</a></td>
    <td><a href="?action=manageDomain&type=chuangyi" id="chuangyi">创意域名</a></td>
    <td><a href="?action=manageDomain&type=duopin" id="duopin">多拼域名</a></td>
    <td><a href="?action=manageDomain&type=qita" id="qita">其他域名</a></td>
    <td><a href="?action=manageDomain&type=simi" id="simi">私密域名</a></td>
    <td><a href="?action=manageDomain&type=daiqiangzhu" id="daiqiangzhu">待抢注域名</a></td>
  </tr>
</table>
<script type="text/javascript"> document.getElementById('<?php if(isset($_REQUEST['type']) && in_array($_REQUEST['type'],$all_domain_type)){echo $_REQUEST['type'];}else{ echo 'all';} ?>').style.color="#FFFFFF"; </script>
<table width="990" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eaeaea" style="border-collapse: collapse; font-size: 12px; font-family: Verdana,Geneva,sans-serif; color: #2A2A2A; margin-top:3px;"><tbody>
<tr style="font-weight: 700; color: #FFFFFF; border: 1px solid #333333;" bgcolor="#333333">
<td style="padding-left: 16px;" height="32" valign="middle" width="220px" >域名/Domain</td>
<td align="center" valign="middle" width="185px">注册及过期时间</td>
<td align="center" valign="middle" width="320">含义及说明</td>
<td align="center" valign="middle" width="125px">价格及购买通道</td>
<td align="center" valign="middle" width="70px">编辑</td>
<td align="center" valign="middle" width="70px">删除</td>
</tr>

<?php
echo '<script>';
$eachPageNum=50;

if(isset($_REQUEST['type']) && in_array($_REQUEST['type'],$all_domain_type)){
$domain_contents=file_get_contents('content/data/'.$_REQUEST['type'].'.php');}
else {$domain_contents=file_get_contents('content/data/all.php');}

$tr_contents=trim(str_replace('<?php die(); ?>','',$domain_contents),'%%');
if($tr_contents != ''){
$each_tr_domain=explode('%%',$tr_contents);
$tr_count_num = count($each_tr_domain);

for($i=0;$i<$tr_count_num;$i++){
	include 'content/data/domains/'.substr(md5($each_tr_domain[$i]),8,16).'.php';
	$each_tr_info[$i]='mdn("'.$list_domain.'","'.$list_domain_type.'","'.$list_domain_reg_year.'-'.$list_domain_reg_mon.'-'.$list_domain_reg_day.'","'.$list_domain_expire_year.'-'.$list_domain_expire_mon.'-'.$list_domain_expire_day.'","'.base64_decode($list_domain_meanning).'","'.$list_domain_price.'","'.$list_domain_link.'","'.$list_domain_font.'","'.$list_domain_color.'");';
	}
if($tr_count_num < $eachPageNum)
{for($i=0;$i<$tr_count_num;$i++){
	$all_domain_tr_content .=$each_tr_info[$i];
	}
	echo $all_domain_tr_content.'</script></tbody></table><p style="text-align:center; font-size:12px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;">共 '.$tr_count_num.' 个域名</p>';}
else{

$pageNum=ceil($tr_count_num/$eachPageNum);
if(empty($_GET['page'])) {$nowPageNum=1;}
else {
$nowPageNum=$_GET['page'];
if($nowPageNum<1){$nowPageNum=1;}
if($nowPageNum>=$pageNum) {$nowPageNum=$pageNum;}
}
if($nowPageNum != $pageNum){
	for ($fn=$eachPageNum*($nowPageNum-1); $fn<$eachPageNum*$nowPageNum;$fn++) {
    echo $each_tr_info[$fn];
	}
}
else{
	for ($fn=$eachPageNum*($pageNum-1); $fn<$tr_count_num;$fn++) {
    echo $each_tr_info[$fn];
	}
	}
echo '</script></tbody></table>';
echo '<p style="text-align:center; font-size:12px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;">共 '.$tr_count_num.' 个域名，每页 '.$eachPageNum.' 个，共 '.$pageNum.' 页，当前页码：[<span style="color:#FF0000">'.$nowPageNum.'</span>]</p>';
echo '<p style="text-align:center; font-size:12px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;"><a href="?action=manageDomain&type='.$_REQUEST['type'].'&page=1">首页</a> ';
if($nowPageNum<=1){echo '<a href="?action=manageDomain&type='.$_REQUEST['type'].'&page=1">上一页</a> ';}else if($nowPageNum>=2){echo '<a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.($nowPageNum-1).'">上一页</a> ';}
if($pageNum<=18){$i=1;$pn=$pageNum;}
else{
	if($nowPageNum-6<=0){$i=1;$pn=12;}
	else if($nowPageNum+6>=$pageNum){$i=$pageNum-6;$pn=$pageNum;}
	else{$i=$nowPageNum-6;$pn=$nowPageNum+6;}
	} 

for ($i;$i<=$pn;$i++){echo '<a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.$i.'">'.$i.'</a> ';}
if($pageNum-$nowPageNum>=1){echo '<a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.($nowPageNum+1).'">下一页</a> <a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.$pageNum.'">末页</a>';}else{echo '<a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.$pageNum.'">下一页</a> <a href="?action=manageDomain&type='.$_REQUEST['type'].'&page='.$pageNum.'">末页</a>'; }

echo '</p>';
}
}
else { echo '</script></tbody></table><p style="text-align:center; font-size:18px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#F00;"><br /><br /><br />当前分类下暂无域名<br /><br /><br /></p>';}
printFooter();
exit();
}
function timediff( $begin_time, $end_time )
{
    $timediff = $end_time - $begin_time;
    $days = intval( $timediff / 86400 );
     return $days;
}
function expire_domain_alert(){
printHeader();
?>
<script type="text/javascript">
function showExpireDomain(){
window.location.href="?action=alert&type="+document.getElementById('domain_type').value+"&day="+document.getElementById('days').value;
}

function edn(domain,type,reg,expire,state,info){
var state_info='暂未过期';
	if(state == 1){
    state_info='<img src="content/img/expire.gif" border="0" />';
		}
	document.write('<tr onmouseover="changeColor(this);" onmouseout="rebackColor(this);"  style="border: 1px solid #CCCCCC; color:#000000;font-family:Arial, Helvetica, sans-serif;"><td style="padding-left: 4px;" height="30"><a href="http://www.51facai.com/whois/?domain='+domain+'" target="_blank">'+domain+'</a></td><td align="center">'+reg+'<span style="color:#FF0000"> 》 </span>'+expire+'</td><td align="center">'+state_info+'</td><td align="center">'+info+'</td><td align="center"><a href="?action=renewDomain&domain='+domain+'&year=1" onClick="return doconfirm(\'您确定已成功续费 '+domain+' 1年 了吗？\\n此操作将更新您的域名在米表中的过期时间\')">已续费1年</a></td><td align="center"><a href="?action=renewDomain&domain='+domain+'&year=2" onClick="return doconfirm(\'您确定已成功续费 '+domain+' 2年 了吗？\\n此操作将更新您的域名在米表中的过期时间\')">已续费2年</a></td><td align="center"><a href="?action=renewDomain&domain='+domain+'&year=3" onClick="return doconfirm(\'您确定已成功续费 '+domain+' 3年 了吗？\\n此操作将更新您的域名在米表中的过期时间\')">已续费3年</a></td><td align="center"><a href="?action=delDomain&from=alert&domain='+domain+'&type='+type+'" onClick="return doconfirm(\'您确定要从米表中移除域名：'+domain+' 吗？\')"><img src="content/img/delete.gif" border="0" /></td></tr>');
	}
</script>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;" class="now_channel">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>
<p style="text-align:center; font-size:12px;">域名类型：<select name="domain_type" id="domain_type"><option value="all">所有域名</option><option value="shuangpin">双拼域名</option><option value="sanpin">三拼域名</option><option value="yingwen">英文域名</option><option value="duan">短域名</option><option value="shuzi">数字域名</option><option value="chuangyi">创意域名</option><option value="duopin">多拼域名</option><option value="qita">其他域名</option><option value="simi">私密域名</option><option value="daiqiangzhu">待抢注域名</option></select>&nbsp;&nbsp;距离到期时间：：<select name="days" id="days"><option value="7">一周内</option><option value="15">半月内</option><option value="30">一月内</option><option value="60">两月内</option><option value="90">三月内</option><option value="180">半年内</option><option value="0">已过期</option></select>&nbsp;&nbsp;<input type="button" value=" 筛 选 " onclick="showExpireDomain()" /></p>
<table width="990" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eaeaea" style="border-collapse: collapse; font-size: 12px; font-family: Verdana,Geneva,sans-serif; color: #2A2A2A; margin-top:3px;"><tbody>
<tr style="font-weight: 700; color: #FFFFFF; border: 1px solid #333333;" bgcolor="#333333">
<td style="padding-left: 16px;" height="32" valign="middle" width="220px" >域名/Domain</td>
<td align="center" valign="middle" width="185px">注册及过期时间</td>
<td align="center" valign="middle" width="95">已过期？</td>
<td align="center" valign="middle" width="120">具体信息</td>
<td align="center" valign="middle" width="100px">续费一年</td>
<td align="center" valign="middle" width="100px">续费两年</td>
<td align="center" valign="middle" width="100px">续费三年</td>
<td align="center" valign="middle" width="70px">删除</td>
</tr>


<?php
echo '<script>';
date_default_timezone_set('Asia/Shanghai');
$all_domain_type=array('all','shuangpin','sanpin','yingwen','duan','shuzi','chuangyi','duopin','qita','simi','daiqiangzhu');
if(isset($_REQUEST['type']) && in_array($_REQUEST['type'],$all_domain_type)){$select_domain_type=$_REQUEST['type'];}else {$select_domain_type='all';}
$domain_contents=file_get_contents('content/data/'.$select_domain_type.'.php');
$expire_days=array('0','7','15','30','60','90','180');
if(isset($_REQUEST['day']) && in_array($_REQUEST['day'],$expire_days)){
$setting_expire_day=$_REQUEST['day'];}
else {$setting_expire_day=30;}

$tr_contents=trim(str_replace('<?php die(); ?>','',$domain_contents),'%%');
if($tr_contents != ''){
$each_tr_domain=explode('%%',$tr_contents);
$tr_count_num = count($each_tr_domain);
$a=0;
for($i=0;$i<$tr_count_num;$i++){
	include 'content/data/domains/'.substr(md5($each_tr_domain[$i]),8,16).'.php';
	$this_domain_days = timediff( strtotime( date("Y-m-d") ) , strtotime( $list_domain_expire_year.'-'.$list_domain_expire_mon.'-'.$list_domain_expire_day ));
	if($this_domain_days>0){
		$this_domain_expire_info=$this_domain_days.'天后过期';
		$this_domain_expire_state='0';
		}
		else{
		$this_domain_expire_info='已过期'.(0-$this_domain_days).'天';
		$this_domain_expire_state='1';
			}
if($this_domain_days<=$setting_expire_day){
	$all_tr_info .='edn("'.$list_domain.'","'.$list_domain_type.'","'.$list_domain_reg_year.'-'.$list_domain_reg_mon.'-'.$list_domain_reg_day.'","'.$list_domain_expire_year.'-'.$list_domain_expire_mon.'-'.$list_domain_expire_day.'","'.$this_domain_expire_state.'","'.$this_domain_expire_info.'");';
	$a++;}
	}
echo $all_tr_info.'</script></tbody></table>';
echo '<p style="text-align:center; font-size:12px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;">共找到 <b>'.$a.'</b> 个符合条件的域名</p>';}
else{echo '</script></tbody></table><p style="text-align:center; font-size:12px;width:990px;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;">共找到 <b>0</b> 个符合条件的域名</p>';}
?>
<SCRIPT type="text/javascript">
<!--
        document.getElementById('domain_type').value = '<?php echo $select_domain_type;?>';
        document.getElementById('days').value = '<?php echo $setting_expire_day?>';
//-->
</SCRIPT>
<?php
printFooter();
exit();
}
function edit_domain_page(){
printHeader();
?>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;" class="now_channel">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>
<?php 
$this_domain_file='content/data/domains/'.substr(md5($_REQUEST['domain']),8,16).'.php';
$this_domain_type_file='content/data/'.$_REQUEST['type'].'.php';
$all_domain_file='content/data/all.php';

if(!file_exists($this_domain_file)){
	echo '<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;"><p style="text-align:center;font-size:20px;">'.$_REQUEST['domain'].'在米表中不存在，不能修改，请添加域名！</p></div>';
	}else{
include $this_domain_file;
?>
<style type="text/css">
.form_text {border:none; width:100%;}
a,a:visited{ color:inherit;}
</style>
<script type="text/javascript">
<!--

function preview(font){
	var style;
	switch (font)
	{
   case 'arial':
     style="font-family:Arial, Helvetica, sans-serif;";
     break
   case 'times':
     style="font-family:'Times New Roman', Times, serif;";
     break
   case 'ariali':
     style="font-family:Arial, Helvetica, sans-serif;font-style:italic;";
     break
   case 'timesi': 
     style="font-family:'Times New Roman', Times, serif;font-style:italic;";
	 break
   case 'arialbd': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;";
	 break
   case 'timesbd': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;";
	 break
   case 'arialbi': 
     style="font-family:Arial, Helvetica, sans-serif;font-weight:bold;font-style:italic;";
	 break
   case 'timesbi': 
     style="font-family:'Times New Roman', Times, serif;font-weight:bold;font-style:italic;";
	 break
   default:
    style="font-family:Arial, Helvetica, sans-serif;";
    }
	document.getElementById("preview_area").innerHTML='<table width="990" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#eaeaea" style="border-collapse: collapse; font-size: 12px; color: #2A2A2A;"><tbody><tr onmouseover="changeColor(this);" onmouseout="rebackColor(this);"  style="border: 1px solid #CCCCCC; color:#'+document.add_domain_form.add_color.value+';'+style+'"><td style="padding-left: 4px;" height="30" width="220px"><a href="http://www.51facai.com/whois/?domain='+document.add_domain_form.add_domain.value+'" target="_blank">'+document.add_domain_form.add_domain.value+'</a></td><td align="center" width="140px">'+document.add_domain_form.add_registrar.value+'</td><td align="center" width="185px">'+document.getElementById('reg_year').value+'-'+document.getElementById('reg_month').value+'-'+document.getElementById('reg_day').value+'<span style="color:#FF0000"> 》 </span>'+document.getElementById('expire_year').value+'-'+document.getElementById('expire_month').value+'-'+document.getElementById('expire_day').value+'</td><td align="center" width="320px">'+document.add_domain_form.add_meaning.value+'</td><td align="center" width="125px"><a href="'+document.add_domain_form.add_link.value+'" target="_brank">'+document.add_domain_form.add_price.value+'</a></td></tr></tbody></table>';
	}
//-->
</script>
<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;">
<p style="text-align:center; "><b style="color:#FF0000">域名信息修改面板</b></p>
<script type="text/javascript" src="class/jscolor/jscolor.js"></script>
<form method="post" name="add_domain_form" id="add_domain_form">
<table width="720" border="1" bordercolor="#eaeaea" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td width="73" valign="middle">域名：</td>
    <td width="445" valign="middle"><input name="add_domain" type="text" class="form_text" readonly="readonly" value="<?php echo $list_domain; ?>"/></td>
    <td width="188" valign="middle">例如：51facai.com</td>
  </tr>
  <tr>
    <td>域名分类：</td>
    <td><select name="add_type" id="add_type"><option value="shuangpin">双拼域名</option><option value="sanpin">三拼域名</option><option value="yingwen">英文域名</option><option value="duan">短域名</option><option value="shuzi">数字域名</option><option value="chuangyi">创意域名</option><option value="duopin">多拼域名</option><option value="qita">其他域名</option><option value="simi">私密域名</option><option value="daiqiangzhu">待抢注域名</option></select></td>
    <td>此域名在米表中的分类</td>
  </tr>
  <tr>
    <td>注册商：</td>
    <td><input name="add_registrar" type="text" class="form_text" value="<?php echo $list_domain_reg;?>" /></td>
    <td>例如：22，Godaddy</td>
  </tr>
  <tr>
    <td>注册时间：</td>
    <td><select name="reg_year" id="reg_year" onchange="javascript:document.getElementById('expire_year').value=this.value"><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option><option value="2031">2031</option><option value="2032">2032</option></select>年<select name="reg_month" id="reg_month" onchange="javascript:document.getElementById('expire_month').value=this.value"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月<select name="reg_day" id="reg_day" onchange="javascript:document.getElementById('expire_day').value=this.value"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>日</td>
    <td>例如：2010-05-27</td>
  </tr>
  <tr>
    <td>过期时间：</td>
    <td><select name="expire_year" id="expire_year"><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option><option value="2031">2031</option><option value="2032">2032</option></select>年<select name="expire_month" id="expire_month"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月<select name="expire_day" id="expire_day"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>日</td>
    <td>例如：2013-05-27</td>
  </tr>
  <tr>
    <td>域名含义：</td>
    <td><input name="add_meaning" type="text" class="form_text"  value="<?php echo base64_decode($list_domain_meanning); ?>" /></td>
    <td>例如：无忧发财，我要发财</td>
  </tr>
  <tr>
    <td>域名价格：</td>
    <td><input name="add_price" type="text" class="form_text"  value="<?php echo $list_domain_price; ?>" /></td>
    <td>例如：￥10000 或  $2000</td>
  </tr>
  <tr>
    <td>购买链接：</td>
    <td><input name="add_link" type="text" class="form_text"  value="<?php echo $list_domain_link; ?>" /></td>
    <td>此处附上该域名的购买链接</td>
  </tr>
  <tr>
    <td>域名字体：</td>
    <td><select name="add_font" id="add_font"><option value="arial">Arial 常规</option><option value="times">Times New Roman 常规</option><option value="ariali">Arial 斜体</option><option value="timesi">Times New Roman 斜体</option><option value="arialbd">Arial 粗体</option><option value="timesbd">Times New Roman 粗体</option><option value="arialbi">Arial 粗斜体</option><option value="timesbi">Times New Roman 粗斜体</option></select></td>
    <td>域名在米表中的显示字体</td>
  </tr>
  <tr>
    <td>域名颜色：</td>
    <td><input class="color" name="add_color" id="add_color" value="<?php echo $list_domain_color; ?>"></td>
    <td>域名在米表中的显示颜色</td>
  </tr>
</table>
<script>
<!--
        document.getElementById('add_type').value = '<?php echo $list_domain_type; ?>';
		document.getElementById('reg_year').value = '<?php echo $list_domain_reg_year; ?>';
        document.getElementById('reg_month').value = '<?php echo $list_domain_reg_mon; ?>';
		document.getElementById('reg_day').value = '<?php echo $list_domain_reg_day; ?>';
		document.getElementById('expire_year').value = '<?php echo $list_domain_expire_year; ?>';
		document.getElementById('expire_month').value = '<?php echo $list_domain_expire_mon; ?>';
		document.getElementById('expire_day').value = '<?php echo $list_domain_expire_day; ?>';
		document.getElementById('add_font').value = '<?php echo $list_domain_font; ?>';
//-->
</script>
<p style="text-align:center;"><input type="button" value=" 预 览 " onclick="preview(document.add_domain_form.add_font.value)" />&nbsp;&nbsp;<input name="action" type="hidden" value="doEdit" /><input name="old_type" type="hidden" value="<?php echo $list_domain_type; ?>" /><input type="submit" value=" 提 交 " onclick="checkIt()"/></p>
</form>
</div>
<p id="preview_area"></p>
<?php
	}
printFooter();
exit();
}
function doEdit(){
	$domain = $_REQUEST['add_domain'];
	$type = $_REQUEST['add_type'];
	$old_type=$_REQUEST['old_type'];
	$registrar = $_REQUEST['add_registrar']; 
	$reg_year=$_REQUEST['reg_year'];
	$reg_month=$_REQUEST['reg_month'];
	$reg_day=$_REQUEST['reg_day'];
	$expire_year=$_REQUEST['expire_year'];
	$expire_month=$_REQUEST['expire_month'];
	$expire_day=$_REQUEST['expire_day'];
	$meaning=$_REQUEST['add_meaning'];
	$price=$_REQUEST['add_price'];
	$buy_link=$_REQUEST['add_link'];
	$font=$_REQUEST['add_font'];
	$color=$_REQUEST['add_color'];
	
    $this_domain_file_name=substr(md5($domain),8,16);
	$this_domain_file='content/data/domains/'.$this_domain_file_name.'.php';


    $type_file='content/data/'.$type.'.php';
	if($domain==''){echo '<meta charset="utf-8"><script>alert("域名不能为空！");location.href="?action=addDomain";</script>';}
	else if($registrar==''){echo '<meta charset="utf-8"><script>alert("注册商不能为空！");location.href="?action=addDomain";</script>';}
	else if($price == ''){echo '<meta charset="utf-8"><script>alert("域名价格不能为空！");location.href="?action=addDomain";</script>';}
	else{

    
	
    if($type!=$old_type){
	delDomainFromData($domain,$old_type);
	safeAddFile($domain.'%%',$type_file);
	}
	$temp_contents='<?php $list_domain="'.$domain.'";$list_domain_type="'.$type.'";$list_domain_reg="'.$registrar.'";$list_domain_reg_year="'.$reg_year.'";$list_domain_reg_mon="'.$reg_month.'";$list_domain_reg_day="'.$reg_day.'";$list_domain_expire_year="'.$expire_year.'";$list_domain_expire_mon="'.$expire_month.'";$list_domain_expire_day="'.$expire_day.'";$list_domain_meanning="'.base64_encode($meaning).'";$list_domain_price="'.$price.'";$list_domain_link="'.$buy_link.'";$list_domain_font="'.$font.'";$list_domain_color="'.$color.'"; ?>';
	safeCreateFile($temp_contents,$this_domain_file);
	echo '<meta charset="utf-8"><script>alert("域名：'.$domain.' 已成功修改！");location.href="?action=manageDomain";</script>';
	}
}
function delDomain(){
	$domain=$_REQUEST['domain'];
	$type=$_REQUEST['type'];
	delDomainFromData($domain,$type);
	delDomainFromData($domain,'all');
	@unlink('content/data/domains/'.substr(md5($domain),8,16).'.php');
	echo '<meta charset="utf-8"><script>alert("域名：'.$domain.' 已成功从您的米表中移除！");location.href="?action='.$_REQUEST['from'].'";</script>';
	}
function renewDomain(){
	$domain=$_REQUEST['domain'];
	$allow_year=array('1','2','3','4','5','6','7','8','9','10');
 $file='content/data/domains/'.substr(md5($domain),8,16).'.php';
 if(file_exists($file) && isset($_REQUEST['year']) && in_array($_REQUEST['year'],$allow_year)){
 include $file;
 $file_contents=file_get_contents($file);
if($file_contents !=''){
$old_expire_info='$list_domain_expire_year="'.$list_domain_expire_year.'"';
$new_expire_info='$list_domain_expire_year="'.($list_domain_expire_year+$_REQUEST['year']).'"';
$new_contents=str_replace($old_expire_info,$new_expire_info,$file_contents);
$fp_file_contents = fopen($file,'w');
flock($fp_file_contents, LOCK_EX);
fputs($fp_file_contents,$new_contents);
flock($fp_file_contents, LOCK_UN);
fclose($fp_file_contents);
echo '<meta charset="utf-8"><script>alert("成功修改米表中域名：'.$domain.' 的过期时间，已增加'.$_REQUEST['year'].'年！");location.href="?action=alert";</script>';
    }
	}else{echo '<meta charset="utf-8"><script>alert("命令不合法，无法执行此命令！");location.href="?action=alert";</script>';}
	}
function deleteCacheFile($cacheFileDirectory){  //检查目录是否存在，不存在则退出程序

 $handle = openDir($cacheFileDirectory); //打开目录
 while(($cache_file_name = readdir($handle))!==false ){ //循环遍历目录
 $cache_file_path = $cacheFileDirectory.DIRECTORY_SEPARATOR.$cache_file_name;//缓存文件具体路径
  if($cache_file_name!="." && $cache_file_name!=".."){    //如果目录为 . 或 .. 则不执行下面代码
   if(is_dir($cache_file_path)){    //如果是目录
    deleteCacheFile($cache_file_path);   //调用函数本身，递归遍历所有目录和文件
   }else{
@unlink($cache_file_path);
   }
  }
 }
closedir($handle); //关闭文件
}
function global_setting_page(){

printHeader();
?>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;" class="now_channel">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>

<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;">
<p style="text-align:center; "><b style="color:#FF0000">全局设置面板</b></p>
<?php
$action_type=$_REQUEST['type'];
switch($action_type){
	case 'seo':
	if($_REQUEST['set']=='1'){
		file_put_contents('content/setting/site.php','<?php $site_title="'.base64_encode($_REQUEST['site_title']).'";$title_copyright=" - Powered by 51facai.com！";$site_keywords="'.base64_encode($_REQUEST['site_keywords']).'";$site_description="'.base64_encode($_REQUEST['site_description']).'"; ?>');
		echo '<p style="text-align:center;">已成功更新您的米表网站的标题，关键词和描述！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p>';
		}else{
			include 'content/setting/site.php';
?>

<form method="post">
<table width="970" border="1" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td width="70">标题：</td>
    <td width="890"><input type="text" name="site_title" style="width:100%; border:none;" value="<?php echo base64_decode($site_title); ?>"></td>
  </tr>
  <tr>
    <td>关键词：</td>
    <td><input type="text" name="site_keywords" style="width:100%; border:none;" value="<?php echo base64_decode($site_keywords); ?>"></td>
  </tr>
  <tr>
    <td>描述：</td>
    <td><textarea style="border:none; width:100%; height:100px;" name="site_description"><?php echo base64_decode($site_description); ?></textarea></td>
  </tr>
</table>
<p style="text-align:center"><input name="set" type="hidden" value="1" ><input name="type" type="hidden" value="seo" ><input type="submit" value=" 提 交 "></p></form></div>
<?php			
			}
	break;
	case 'info':
	if($_REQUEST['set']=='1'){
		file_put_contents('content/setting/contact.php','<?php $admin_name="'.$_REQUEST['admin_name'].'";$admin_mail="'.$_REQUEST['admin_mail'].'";$admin_mobi="'.$_REQUEST['admin_mobi'].'";$admin_qq="'.$_REQUEST['admin_qq'].'";$admin_msn="'.$_REQUEST['admin_msn'].'"; ?>');
		echo '<p style="text-align:center;">已成功设置您的个人联系方式，此联系将显示在您的米表主页上！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p>';
		}else{
			include 'content/setting/contact.php';
?>

<form method="post">
<table width="350" border="1" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td width="50">姓名：</td>
    <td><input type="text" name="admin_name" style="width:100%; border:none;" value="<?php echo $admin_name; ?>"></td>
  </tr>
  <tr>
    <td>邮箱：</td>
    <td><input type="text" name="admin_mail" style="width:100%; border:none;" value="<?php echo $admin_mail; ?>"></td>
  </tr>
  <tr>
    <td>手机：</td>
    <td><input type="text" name="admin_mobi" style="width:100%; border:none;" value="<?php echo $admin_mobi; ?>"></td>
  </tr>
   <tr>
    <td>QQ：</td>
    <td><input type="text" name="admin_qq" style="width:100%; border:none;" value="<?php echo $admin_qq; ?>"></td>
  </tr>
    <tr>
    <td>MSN：</td>
    <td><input type="text" name="admin_msn" style="width:100%; border:none;" value="<?php echo $admin_msn; ?>"></td>
  </tr>
</table>

<p style="text-align:center"><input name="set" type="hidden" value="1" ><input name="type" type="hidden" value="info" ><input type="submit" value=" 提 交 "></p></form></div>
<?php			
			}

	break;
	case 'tongji':
	if($_REQUEST['set']=='1'){
		file_put_contents('content/setting/tongji.php','<?php $site_tongji=\''.str_replace("\'","[*]",str_replace('\"','{*}',$_REQUEST['site_tongji'])).'\'; ?>');
		echo '<p style="text-align:center;">已成功设置您的米表网站的流量统计代码！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p>';
		}else{
			include 'content/setting/tongji.php';
?>

<form method="post">
<p style="text-align:center">请输入第三方网站完整的统计代码：</p>
<p style="text-align:center"><textarea style="width:500px; height:200px; resize:none;" name="site_tongji"><?php echo str_replace("[*]","'",str_replace('{*}','"',$site_tongji)); ?></textarea></p>
<p style="text-align:center"><input name="set" type="hidden" value="1" ><input name="type" type="hidden" value="tongji" ><input type="submit" value=" 提 交 "></p></form></div>
<?php			
			}


	break;
	case 'resetimg':
		file_put_contents('content/setting/img_key.php','<?php $userkey = "'.genRandomString(rand(6,12)).'"; ?>');
		deleteCacheFile('class/cache');
		echo '<p style="text-align:center;">已成功重置图片密钥和系统图片缓存！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p></div>';
	break;
	case 'setYitongji':
	if(ctype_digit($_REQUEST['start_ip']) && ctype_digit($_REQUEST['start_pv'])){
		file_put_contents('content/setting/yitongji.php','<?php $yitongji_time="'.$_REQUEST['yitongji_year'].'-'.$_REQUEST['yitongji_mon'].'-'.$_REQUEST['yitongji_day'].'";$yitongji_start_ip='.$_REQUEST['start_ip'].';$yitongji_start_pv='.$_REQUEST['start_pv'].'; ?>');
		echo '<p style="text-align:center;">已成功修改易统计设置！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p></div>';
		}
		else {echo '<meta charset="utf-8"><script>alert("您输入易统计设置不合法！");location.href="?action=globalSetting";</script>';}
	break;
	case 'setindex':
		file_put_contents('content/setting/index_type.php','<?php $index_type="'.$_REQUEST['index_type'].'"; ?>');
		echo '<p style="text-align:center;">已成功设置米表显示域名的默认类别！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p></div>';
	break;
	case 'showtype':
		file_put_contents('content/setting/show_type.php','<?php $domain_show_type='.$_REQUEST['show_type'].'; ?>');
		echo '<p style="text-align:center;">已成功设置米表域名的显示方式！</p><p style="text-align:center;"><a href="?action=globalSetting">点此返回</a></p></div>';
	break;
	default:
    include 'content/setting/index_type.php';
	include 'content/setting/show_type.php';
	include 'content/setting/yitongji.php';
	$yitongji_time_info=explode('-',$yitongji_time);
?>

<table width="970" border="1" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td><a href="?action=globalSetting&type=seo" style="color:#FF0000">SEO设置</a>（此处设置您的米表网站的标题，关键词和描述）</td>
    <td><a href="?action=globalSetting&type=info" style="color:#FF0000">联系方式设置</a>（此处设置您的个人联系方式，此联系将显示在米表主页上）</td>
  </tr>
  <tr>
    <td><a href="?action=globalSetting&type=tongji" style="color:#FF0000">网站统计代码设置</a>（此处设置您的米表网站的流量统计代码）</td>
    <td><a href="?action=globalSetting&type=resetimg" style="color:#FF0000">重置图片密钥及缓存</a>（此处重置图片密钥和系统生成的域名图片）</td>
  </tr>
    <tr>
    <td colspan="2"><form method="post" name="form0" id="form0">设置《易统计》开始统计日期：<select name="yitongji_year" id="yitongji_year" ><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option><option value="2031">2031</option><option value="2032">2032</option></select>年<select name="yitongji_mon" id="yitongji_mon"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月<select name="yitongji_day" id="yitongji_day"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>日，开始IP数：<input type="text" name="start_ip" id="start_ip" size="6" value="<?php echo $yitongji_start_ip; ?>">，开始PV量：<input type="text" name="start_pv" id="start_pv" size="6" value="<?php echo $yitongji_start_pv; ?>"><input name="action" type="hidden" value="globalSetting" /><input name="type" type="hidden" value="setYitongji" />&nbsp;<input type="submit" value=" 设 置 "></form></td>
  </tr>
  <tr>
    <td><form method="post" name="form1" id="form1">设置米表显示域名的默认类别：&nbsp;<select name="index_type" id="index_type"><option value="all">全部域名</option><option value="shuangpin">双拼域名</option><option value="sanpin">三拼域名</option><option value="yingwen">英文域名</option><option value="duan">短域名</option><option value="shuzi">数字域名</option><option value="chuangyi">创意域名</option><option value="duopin">多拼域名</option><option value="qita">其他域名</option></select><input name="action" type="hidden" value="globalSetting" /><input name="type" type="hidden" value="setindex" />&nbsp;<input type="submit" value=" 设 置 "></form></td>
    <td><form method="post" name="form2" id="form2">设置米表域名显示方式：&nbsp;<select name="show_type" id="show_type"><option value="0">文字(搜索引擎可收录)</option><option value="1">文字(搜索引擎不可收录)</option><option value="2">图片（搜索引擎不可收录）</option></select><input name="action" type="hidden" value="globalSetting" /><input name="type" type="hidden" value="showtype" />&nbsp;<input type="submit" value=" 设 置 "></form></td>
  </tr>
</table>
<p style="text-align:center; "><b style="color:#FF0000">程序版权及更新</b></p>
<p>&nbsp;&nbsp;本程序仅提供给用户免费使用，请尊重作者的劳动成果，未经作者同意请不要随便修改程序的版权信息！如果这个程序对您有所帮助，您希望这个程序越做越好，可以赞助我们，赞助链接：<a href="https://me.alipay.com/billing" target="_blank">https://me.alipay.com/billing</a> （收款人：单静茹）</p>
<p style="text-align:center; ">如需进一步技术支持或对程序有更好的意见和建议请联系邮箱：admin@onnoon.com 或QQ：25767033</p>
<script src="http://www.51facai.com/mibiaochengxugengxin.php?banben=1" type="text/javascript"></script>
</div>
<script>
<!--
        document.getElementById('yitongji_year').value = '<?php echo $yitongji_time_info[0]; ?>';
		document.getElementById('yitongji_mon').value = '<?php echo $yitongji_time_info[1]; ?>';
        document.getElementById('yitongji_day').value = '<?php echo $yitongji_time_info[2]; ?>';
		document.getElementById('index_type').value = '<?php echo $index_type; ?>';
		document.getElementById('show_type').value = '<?php echo $domain_show_type; ?>';
//-->
</script>
<?php 
	break;
	}
printFooter();
exit();
} 
function manage_link_page(){
printHeader();
?>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;" class="now_channel">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>
<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;">
<p style="text-align:center; "><b style="color:#FF0000">友情链接管理</b></p>
<?php
	if($_REQUEST['set']=='1'){
		file_put_contents('content/setting/site_links.php','<?php $site_links=\''.str_replace('\"','{*}',$_REQUEST['site_links']).'\'; ?>');
		echo '<p style="text-align:center;">已成功更新您的米表的友情链接！</p><p style="text-align:center;"><a href="?action=manageLink">点此返回</a></p>';
		}else{
			include 'content/setting/site_links.php';
?>

<form method="post">
<p style="text-align:center">请修改下列友情链接：</p>
<p style="text-align:center"><textarea style="width:700px; height:300px; resize:none;" name="site_links"><?php echo str_replace('{*}','"',$site_links); ?></textarea></p>
<p style="text-align:center"><input name="set" type="hidden" value="1" ><input name="type" type="hidden" value="tongji" ><input type="submit" value=" 提 交 "></p></form></div>
<?php			
			}


?>
</div>
<?php
printFooter();
exit();	
	}
function safe_center_page(){
	global $settings;
printHeader();
?>
<div style="width:990px;margin:0 auto;font-size:12px;line-height:18px;">
  <div class="skin-black">
    <div class="inner">
      <ul>
    <li> <a href="?action=globalSetting"><span style="CURSOR: pointer;">全局设置</span></a> </li>
    <li> <a href="?action=addDomain"><span style="CURSOR: pointer;">添加域名</span></a> </li>
    <li> <a href="?action=manageDomain"><span style="CURSOR: pointer;">管理域名</span></a> </li>
    <li> <a href="?action=alert"><span style="CURSOR: pointer;">域名过期提醒</span></a> </li>
    <li> <a href="?action=manageLink"><span style="CURSOR: pointer;">友情链接管理</span></a> </li>
    <li> <a href="?action=safeCenter"><span style="CURSOR: pointer;" class="now_channel">安全中心</span></a> </li>
    <li class="last"><a href="?action=logout"><span style="CURSOR: pointer;" >退出系统</span></a> </li>
      </ul>
    </div>
  </div>
</div>
<div style="width:990px;height:auto;margin: 0 auto;background:#f4f4f4;border:#e4e4e4 1px solid;color:#333333;font-size: 14px;font-family: Arial, Helvetica, sans-serif;">
<p style="text-align:center; "><b style="color:#FF0000">安全中心设置</b></p>
<?php
$action_type=$_REQUEST['type'];
switch($action_type){
	case 'setinfo':
	if(trim($_REQUEST['old_name']) == '' || trim($_REQUEST['new_name_1']) == '' || trim($_REQUEST['new_name_2']) == '' || trim($_REQUEST['old_pass']) == '' || trim($_REQUEST['new_pass_1']) == '' || trim($_REQUEST['new_pass_2']) == ''){
			echo '<meta charset="utf-8"><script>alert("您输入的信息不完整，系统无法执行操作！");location.href="?action=safeCenter";</script>';;
		}
	else if($_REQUEST['old_name'] != $settings['user'] || md5($_REQUEST['old_pass']) != $settings['pass'])
	{
			echo '<meta charset="utf-8"><script>alert("您输入的原用户名或原密码信息不正确，请重试！");location.href="?action=safeCenter";</script>';;
		}
	else if($_REQUEST['new_name_1'] != $_REQUEST['new_name_2'] || $_REQUEST['new_pass_1'] != $_REQUEST['new_pass_2'])
	{
			echo '<meta charset="utf-8"><script>alert("两次输入的新用户名或新密码信息不一致，请重试！");location.href="?action=safeCenter";</script>';;
		}
	else{
		file_put_contents('user_info.php','<?php $settings["user"]="'.$_REQUEST['new_name_1'].'";$settings["pass"]="'.md5($_REQUEST['new_pass_1']).'"; ?>');
		echo  '<p style="text-align:center;">用户名和密码已修改成功，请使用新用户名和密码登陆！</p><p style="text-align:center;"><a href="?action=safeCenter">点此返回</a></p></div>';
		}
	break;
	case 'closesite':
	if($_REQUEST['admin_user'] == $settings["user"]){
		file_put_contents('content/setting/close_site.php','<?php $close_site='.$_REQUEST['close_site'].'; ?>');
		echo '<p style="text-align:center;">已成功更新米表状态！</p><p style="text-align:center;"><a href="?action=safeCenter">点此返回</a></p></div>';
		}else{
			echo '<meta charset="utf-8"><script>alert("您输的用户名不正确，系统无法执行操作！");location.href="?action=safeCenter";</script>';;
			}
	break;
	default:
	include 'content/setting/close_site.php';

?>
<table width="470" border="1" cellspacing="0" cellpadding="1" align="center">
  <form method="post" name="form"><tr>
   <td width="110">原用户名：</td>
    <td width="360"><input type="text" name="old_name" style="width:100%; border:none;" autocomplete="off"></td>
  </tr>
  <tr>
    <td>新用户名：</td>
    <td><input type="text" name="new_name_1" style="width:100%; border:none;" autocomplete="off"></td>
  </tr>
  <tr>
    <td>确认新用户名：</td>
    <td><input type="text" name="new_name_2" style="width:100%; border:none;" autocomplete="off"></td>
  </tr>
  <tr>
    <td>原密码：</td>
    <td><input type="password" name="old_pass" style="width:100%; border:none;"></td>
  </tr>
  <tr>
    <td>新密码：</td>
    <td><input type="password" name="new_pass_1" style="width:100%; border:none;"></td>
  </tr>
  <tr>
    <td>确认新密码：</td>
    <td><input type="password" name="new_pass_2" style="width:100%; border:none;"></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input name="action" type="hidden" value="safeCenter" /><input name="type" type="hidden" value="setinfo" /><input type="submit" value=" 确定修改 "></td>
  </tr></form>
  <tr style="color:#FF0000">
    <td colspan="2" align="center"><form method="post">米表状态：<select name="close_site" id="close_site"><option value="1">关闭</option><option value="0">开启</option></select>，请输入您的用户名：<input type="text" name="admin_user" size="8" autocomplete="off"><input name="action" type="hidden" value="safeCenter" /><input name="type" type="hidden" value="closesite" /><input type="submit" value=" 执行 "></form></td>
  </tr>
</table>
<script>
<!--
        document.getElementById('close_site').value = '<?php echo $close_site; ?>';
//-->
</script>

<?php
	break;
}
echo '</div>';
printFooter();
exit();	
}
?>