<%@page contentType="text/html; charset=UTF-8"%>
<%@include file="/inc/init.jsp" %>
<%@include file="/inc/checklogin.jsp" %>
<%@include file="inc/header.jsp" %>
<%
Config siteconfig=new Config();
String systemVersion=Config.get("version");
/*if(systemVersion.indexOf("2.7")==-1){
	systemVersion=systemVersion.replaceAll("V.*","V2.7");
	siteconfig.set("version",systemVersion);
	ConfigUtil.init();
	Install_db idb=new Install_db();
	idb.bug();
}*/
Order_list_db oldb=new Order_list_db();
DOC doc=oldb.getCount();
int todaynum=doc.geti("num");
Product_db pdb=new Product_db();
int proCount=0;
doc=pdb.getCount();
proCount=doc.geti("num");
doc=null;  //清空对象
//加入显示系统信息
Runtime runtime = Runtime.getRuntime(); 
long freeMemoery = runtime.freeMemory(); 	//可用内存
long totalMemory = runtime.totalMemory(); 	//总共内存
long usedMemory = totalMemory - freeMemoery;	//已用内存
long maxMemory = runtime.maxMemory();			//最大可用内存
long useableMemory = maxMemory - totalMemory + freeMemoery;//
	
	long timePageStart = System.currentTimeMillis();
%>
<%
class EnvServlet
{
	public long timeUse=0;
	public Hashtable htParam=new Hashtable();
	private Hashtable htShowMsg=new Hashtable();
	public void setHashtable()
	{
		Properties me=System.getProperties();
		Enumeration em=me.propertyNames();
		while(em.hasMoreElements())
		{
			String strKey=(String)em.nextElement();
			String strValue=me.getProperty(strKey);
			htParam.put(strKey,strValue);
		}
	}	
	public void getHashtable(String strQuery)
	{
		Enumeration em=htParam.keys();
		while(em.hasMoreElements())
		{
			String strKey=(String)em.nextElement();
			String strValue=new String();
			if(strKey.indexOf(strQuery,0)>=0)
			{
				strValue=(String)htParam.get(strKey);
				htShowMsg.put(strKey,strValue);
			}
		}
	}
	public String queryHashtable(String strKey)
	{
		strKey=(String)htParam.get(strKey);
		return strKey;
	}
	public long test_int()
	{
		long timeStart = System.currentTimeMillis();
		int i=0;
		while(i<3000000)i++;
		long timeEnd = System.currentTimeMillis();
		long timeUse=timeEnd-timeStart;
		return timeUse;
	}
	public long test_sqrt()
	{
		long timeStart = System.currentTimeMillis();
		int i=0;
		double db=(double)new Random().nextInt(1000);
		while(i<200000){db=Math.sqrt(db);i++;}
		long timeEnd = System.currentTimeMillis();
		long timeUse=timeEnd-timeStart;
		return timeUse;
	}
}
%>
<%
	EnvServlet env=new EnvServlet();
	env.setHashtable();
	String action=new String(" ");
	String act=new String("action");
	if(request.getQueryString()!=null&&request.getQueryString().indexOf(act,0)>=0)action=request.getParameter(act);
%>
<div id="c">
<%@include file="inc/left.jsp" %>
<div id="right">
<%@include file="inc/position.jsp" %>
<div class="right">
<div id="right_box">
<div class="blank20"></div>
<style type="text/css">
.i_box {
  width:730px;
  height:520px;
  padding:15px;
  background:url(skin/images/i_box/i_bg.jpg);
  border:1px solid #ccc;
}
/* 横向 */
.i_info {
clear:both;
width:686px;
height:174px;
padding:0px 20px;
}
.i_info ul {height:134px;}
.i_info li,#information li {
  line-height:22px;
  padding-left:15px;
  background:url(skin/images/i_box/icon06.gif) left 9px no-repeat;
}
#information {
  height:110px;
}
#information a {color:#333;}
#i_info {
clear:both;
width:684px;
height:315px;
margin:20px 0px 0px 0px;
padding:0px 20px;
line-height:24px;
}
.homecon_title { 
line-height:34px; 
height:34px; 
color:#008901;
font-weight:bold;
padding:0px 0px 0px 20px;
background:url(skin/images/i_box/ico_11.gif) left center no-repeat;
}
.homecon_title a,.homecon_title a:hover { color:#008901; }
#i_info .t1 {
  float:left;
  width:650px;
}
.i_table_a {
  height:160px;
}
#i_info .t2 {
  float:right;
  width:320px;
}
.ms{
  margin:50px 0px 0px 0px;
  line-height:28px;
  padding:10px 10px 10px 30px;
  border:1px dotted #98C700;
  background:#EFFEB9 url(skin/images/i_box/announ.gif) 10px 16px no-repeat;
}
.i_table_b li {
  padding-left:10px;
  background:url(skin/images/i_box/dot_r.gif) left center no-repeat;
}
.i_table_b span {color:#1650AB;}
.i_links_bg {
height:121px; width:270px; padding:10px 20px; 
}
.btn_a {
  display:block;
  float:left;
  width:102px;
  height:31px;
  line-height:28px;
  margin:5px;
  color:white;
  background:url(skin/images/i_box/btn_02.gif) left top no-repeat;
  border:none;
  text-align:center;
  cursor: pointer;
  font-weight:bold;
}
#right .btn_d {
  height:22px;
  line-height:22px;
  margin:0px 2px;
  padding:0px 6px;
  background:url(skin/images/i_box/btn_04.gif) left top repeat-x;
  border:none;
  border-right:1px solid #888;
  border-bottom:1px solid #888;
  color:white;
  font-size:12px;
}
.btn_e {
  height:22px;
  line-height:22px;
  margin:0px 2px;
  padding:0px 6px;
  background:url(skin/images/i_box/btn_05.gif) left top repeat-x;
  border:none;
  color:white;
  font-size:12px;
  border-right:1px solid #888;
  border-bottom:1px solid #888;
}
</style>
 <div class="i_box">
<div class="i_info">
<ul>
<li>[今日订单：<a href="orderList.jsp" class="fontred"><%=todaynum %>张</a>]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;</li>
<li>服务器环境：<%=env.queryHashtable("os.name")%>&nbsp;<%=env.queryHashtable("os.version")%>+<%= getServletContext().getServerInfo() %>+mySql</li>
<li>数据库连接方式：<%=Config.geti("usepool")==1?"连接池":"普通连接"%></li>
<li>当前网站语言：中文</li>
<li>系统版本：<%=Config.get("version")%>&nbsp;&nbsp;<a href="http://www.xinluu.com/a/log/" style="color:#F00" target="_blank">查看更新日志</a></li>
<li>上次登陆时间：<%=admindoc.get("last_time")%>&nbsp;&nbsp;上次登陆IP：<%=admindoc.get("last_ip")%></li>
</ul>
</div>
<div id="i_info">
<div class="t1">
<h5 class="homecon_title" style="margin-bottom:10px;">内存状态及通知信息</h5>
<div id="systeminfo">
<li>系统总共内存：<%=totalMemory/(1000*1000)%>M&nbsp;&nbsp;&nbsp;&nbsp;系统已用内存：<%=usedMemory/(1000*1000)%>M&nbsp;&nbsp;&nbsp;&nbsp;系统可用内存：<%=freeMemoery/(1000*1000)%>M</li>
</div>
</div>
</div>
 </div>
<div class="clear"></div>
</div>
</div>
<div class="right_bottom">
</div>
</div>
<div id="footer">
</div>
</div>
<script language="javascript">
	   $(document).ready(function(){
		   $.ajax({
				contentType: "application/x-www-form-urlencoded; charset=utf-8", 
				url:'/dpax/msgGet.jsp',
				type:'get',
				success:function(html){
				var tmep=$('#systeminfo').html();
				$('#systeminfo').html(tmep+$.trim(html));
				}
		 	})
	   });
</script>
<%@include file="inc/msg.jsp" %>
<%@include file="inc/footer.jsp" %>