<style type="text/css">
<!--
.style3 {
	font-size: 7pt;
	color: #F75D31;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
}
.style4 {
	color: #990000;
	font-weight: bold;
	
}
.copyright {
	PADDING-RIGHT: 1px; BORDER-TOP: #6595d6 1px dashed; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; FONT: 11px verdana,arial,helvetica,sans-serif; COLOR: #4455aa; PADDING-TOP: 1px; TEXT-DECORATION: none
}
-->
</style>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="inc.asp"-->
 <!--#include file="rolecheckout.asp"-->
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="<%=HOPE_InstallDir%>member/images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE5 {color: #FF0000}
-->
</style>
<BODY style="BACKGROUND-REPEAT: no-repeat" bgcolor="#C4D8ED"  >
<script src="js/calendar.js"></script>
<%
Set vRs = GetRs("select WebName,WebUrl,WebEmail,WebMaster,WebCountTime,WebExp from websen_WebInfo")
				
				if not vRs.eof then	
					WebEmail = vRs("WebEmail")
					WebMaster = vRs("WebMaster")
					WebCountTime=vRs("WebCountTime")
					WebExp = vRs("WebExp")
					Exe = "update"
				else
					Exe = "insert"
				end if
				vRs.close:Set vRs=nothing
			
%>
<table width="725" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#E1ECF2">
      
      <div align="right">
        <div align="left">如果您第一次使用系统，请先设置网站基本资料，方可开始统计</div>
        初始化数据 <a href="out.asp">退出维护</a></div></td>
  </tr>
  <tr>
    <td><img src="images/body_line.gif" width="725" height="6"></td>
  </tr>
  <tr>
    <td class="body_bg"><table width="100%" height="203%"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center" valign="middle"><br>
            <table width="90%" border="0" cellspacing="0" cellpadding="2">
              <form name="form1" method="post" action="websen_long.ASP?act=admin&exe=<%=Exe%>">
                <tr>
                  <td width="10%" nowrap>网站名称：</td>
                  <td width="39%"><input name="WebName" type="text" class="input" id="WebName" value="<%=company%>" ></td>
                  <td width="9%" nowrap>网站地址：</td>
                  <td width="42%"><input name="WebUrl" type="text" class="input" id="WebUrl" value="<%=WebUrl%>" ></td>
                </tr>
                <tr >
                  <td nowrap>网站电话：</td>
                  <td><input name="WebMaster" type="text" class="input" id="WebMaster" value="<%=hottel%>" ></td>
                  <td nowrap>网站信箱：</td>
                  <td><input name="WebEmail" type="text" class="input" id="WebEmail" value="<%=WebEmail%>" ></td>
                </tr>
                <tr>
                  <td nowrap>初始开始统计时间：</td>
                  <td><input name="WebCountTime" type="text" class="input" id="WebCountTime" onBlur="checkDateInput(this)" value="<%=WebCountTime%>" onFocus="setday(this)" >
                      <span class="STYLE5">*</span></td>
                </tr>
                <tr>
                  <td valign="top" nowrap>初始化表(<font color="#FF0000">时</font>,日,月):</td>
                  <td colspan="3"><%set aRs=UIRs("select  * from  websen_cH ") 
					if aRs.recordcount <> abs(24) then
					 response.Write "未初始化数据表"
					 else
					 response.Write "初始化数据表成功"
					 aRs.close
					 end if
					%>
                  <span class="STYLE5">*</span></td>
                </tr>
				<tr>
                  <td valign="top" nowrap>初始化表(时,<font color="#FF0000">日</font>,月):</td>
                  <td colspan="3">
				  <%set aRs=UIRs("select  * from  websen_cD ") 
					if aRs.recordcount <> abs(31) then
					 response.Write "未初始化数据表"
					 else
					 response.Write "初始化数据表成功"
					 aRs.close
					 end if
					%>
				  <span class="STYLE5">*</span></td>
                </tr>
				<tr>
                  <td valign="top" nowrap>初始化表(时,日,<font color="#FF0000">月</font>):</td>
                  <td colspan="3">
				  <%set aRs=UIRs("select  * from  websen_cM ") 
					if aRs.recordcount <> abs(12) then
					 response.Write "未初始化数据表"
					 else
					 response.Write "初始化数据表成功"
					 aRs.close
					 end if
					%>
				  <span class="STYLE5">*</span></td>
                </tr>
                <tr>
                  <td>显示图片统计:</td>
                  <td nowrap colspan="3"><select name="countid" id="countid" onChange='dis_msg(countid.value)'>
                      <option  value="1">1</option>
                      <option value="2">2</option>
                      <option value="3">3</option>
                      <option value="4">4</option>
                      <option value="5">5</option>
                      <option value="6">6</option>
                      <option value="7">7</option>
                      <option value="8">8</option>
                      <option value="9">9</option>
                      <option value="10">10</option>
                      <option value="11">11</option>
                      <option value="12">12</option>
                      <option value="13">13</option>
                    </select>
                      <div id="img"></div></td>
                </tr>
                <tr>
                  <td valign="top" nowrap>网站介绍：</td>
                  <td colspan="3"><textarea name="WebExp"  class="input" id="WebExp" style="width:400;height:100"><%=WebExp%></textarea></td>
                </tr>
                <tr>
                  <td valign="top" nowrap>&nbsp;</td>
                  <td colspan="3"><input name="Submit22" type="submit" class="button" value="  初始数据  " align="absmiddle"></td>
                </tr>
              </form>
            </table>
            <br>
            <br>
            <br></td></tr>
    </table></td>
  </tr>
  <tr>
    <td><img src="images/body_line.gif" width="725" height="6"></td>
  </tr>
  <tr bgcolor="#E1ECF2" align=center>
    <td  width="100%" class=copyright>
专业的B2B行业网站系统，行业门户网站的首选系统·中国, Copyright (c) All Rights Reserved 
</td>
  </tr>
</table>
<br />
<%
act = Request("act")
	Select Case act
		Case "admin" 
		Call Sb_Admin()	
	End Select
	Dim WebCountTime
	Dim vOnline
	Dim vYToday,vToday,vCDate,vAveCount,vYCount,vMCount

	Sub Sb_Admin()
		If request.ServerVariables("REQUEST_METHOD") = "POST" then
			WebName = Request("WebName")
			WebUrl1 = Request("WebUrl")
			WebEmail1 = Request("WebEmail")
			WebMaster1 = Request("WebMaster")
			countid= Request("countid")
			WebExp1 = Request("WebExp")
			Exe = Request("exe")
			Select Case Exe
				Case "insert"
				
				
				
				
				WebCountTime1=request("WebCountTime")
					vSql = "insert into websen_WebInfo(id,WebName,WebUrl,WebEmail,WebMaster,WebExp,WebCountTime,countid) values('1','"&company&"','"&WebUrl1&"','"&WebEmail1&"','"&WebMaster1&"','"&WebExp1&"','"&WebCountTime1&"','"&ountid&"')"
		Conn.execute vSql
			
			Conn.execute"insert into websen_flux(refurbish,id)values('0','1')"
		    Conn.execute"insert into websen_Last20Vister(cCIP,cCW,cCOS,cCEXP,cCR)values('0','0','0','0','0')"
		    conn.execute"truncate table websen_cW"	
			 
					set aRs=UIRs("select  * from  websen_cD") 
					if aRs.recordcount <> 31 then 
					   for i=1 to 31  
				    Conn.execute"insert into websen_cD(cDay,cTDC,cCDC)values('"&i&"','0','0')" 
		              next
					  aRs.close    
					end if 
				  set  aRs=UIRs("select  * from  websen_cH")
				    if aRs.recordcount <> 24 then	
					   for i=0 to 23
					    Conn.execute"insert into websen_cH(cHour,cTHC,cCHC)values('"&i&"','0','0')"
					   next
					   aRs.close  
				    end if
				  set aRs=UIRs("select  * from  websen_cM")
				     if aRs.recordcount <> 12 then
					    for i=1 to 12
						 Conn.execute"insert into websen_cM(cMonth,cTMC,cCMC)values('"&i&"','0','0')"
						next
					   aRs.close  
				    end if
					
		 response.Write("<script >alert('网站信息录入成功');window.location.href='index.asp?act=main'</script>")		
	
	 
					Exe = "update"
				Case "update"   
				WebCountTime1=request("WebCountTime")
				countid= Request("countid")
				WebEmail1 = Request("WebEmail")
		        WebExp = Fn_DeChar(WebExp)
	vSql = "update websen_WebInfo set WebName='"&company&"',WebUrl='"&WebUrl1&"',WebEmail='"&WebEmail1&"',WebMaster='"&WebMaster&"',WebExp='"&WebExp1&"',WebCountTime='"&WebCountTime1&"' ,countid='"&countid&"'"
					Conn.execute vSql
					




		           set aRs=UIRs("select  * from  websen_cD ") 
					if aRs.recordcount <> 31 then 
					   for i=1 to 31
					    Conn.execute"insert into websen_cD(cDay,cTDC,cCDC)values('"&i&"','0','0')"   
		               next
					  ' aRs.UpdateBatch
					  aRs.close    
					end if 

				  set  aRs=UIRs("select  * from  websen_cH")
				    if aRs.recordcount <> 24 then	
					   for i=0 to 23
			
					 Conn.execute"insert into websen_cH(cHour,cTHC,cCHC)values('"&i&"','0','0')"
					
					   next
					   aRs.close  
				    end if
				  
				  
				  set aRs=UIRs("select  * from  websen_cM")
				     if aRs.recordcount <> 12 then
					    for i=1 to 12
						 Conn.execute"insert into websen_cM(cMonth,cTMC,cCMC)values('"&i&"','0','0')"
					next
					   aRs.close  
				    end if
			
End Select
response.Write("<script >alert('网站信息维护成功');window.location.href='index.asp?act=main' ;</script>")
				
		end if

End Sub

response.Write company&"|"&WebUrl1&"|"&WebEmail&"|"&WebMaster&"|"&WebExp&"|"&WebCountTime1&"|"&countid
%>
</BODY>
