⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setcount.asp

📁 程序介绍: 1、内嵌式投票系统
💻 ASP
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
'  TXSite / 通用网站系统
'
'  版本    :v1.8.20
'
'  制作人  :milp(milp@21cn.com)
'
'  版权所有:源码之家(http://www.21tx.com)
'
'  主页地址:http://www.21tx.com
'            http://www.bestnets.net
'            http://www.soucn.com
'
'  技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序名称:
'程序作用:
'程序创建时间:18:58 2001-8-7
'程序完成时间:21:50 2001-8-7
'最后修改时间:21:50 2001-8-7
if session("adminflag")="" then Response.Redirect "default.asp"
const thisprog="setcount.asp"
dim sqlfenye,txtitle
txtitle=request("searchtxt")
if txtitle<>"" then
  sqlfenye="select * from txcount where name like '%"&trim(txtitle)&"%' order by id desc"
else
  sqlfenye="select * from txcount order by id desc"
end if
Sub deleteid(id)
  conn.execute "delete from txcount where id="&cstr(id)
End sub
Sub isUseid(id)
  if session("adminflag")>2 then PrintMsg(NotAdmin)
  conn.execute "update txcount set isUse=True where id="&cstr(id)
End Sub
Sub notisUseid(id)
  if session("adminflag")>2 then PrintMsg(NotAdmin)
  conn.execute "update txcount set isUse=False where id="&cstr(id)
End Sub

dim action,id,name,cIntro,cTotal
action=request("action")
%>
<!--#include file=base.asp-->
<!--#include file="subs.asp"-->
<%
if action="" then action="dis"
if session("adminflag")>2 and action<>"dis" then Call PrintMsg(NotAdmin)
if action="fenye" then
  Call fenye
elseif action="add" then
  Call addcount
elseif action="mod" then
  Call modcount
elseif action="saveadd" or action="savemod" then
  Call savecount
else
  Call discount
end if
%>
<!--#include file=end.asp-->

<%Sub modcount
rSub.open "select * from txcount where id="&request("id"),conn,1,1
if rSub.bof and rSub.eof then Call PringMsg("操作错误!")
id=rSub("id")
name=rSub("name")
cIntro=rSub("cIntro")
cTotal=rSub("cTotal")
rSub.close
Call addcount
End Sub

Sub discount()
rSub.open "select * from TXcount Order By id asc",conn,1,1
if rSub.bof and rSub.eof then
rSub.close
Call PrintMsg("<p align=center>还没有记录!")
end if%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="100%">
      <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#999999">
        <tr bgcolor="#666666">
          <td>页面名称</td>
          <td>总计访问</td>
          <td>今日访问</td>
          <td>昨日访问</td>
          <td>上月访问</td>
          <td>本月访问</td>
          <td>最后访问IP</td>
          <td>最后访问时间</td>
        </tr><%do while not rSub.eof%>
        <tr bgcolor="#999999">
          <td><a href="<%=rSub("name")%>" title="<%=rSub("cIntro")%>" target="_blank"><%=rSub("name")%></a></td>
          <td bgcolor="#666666"><%=rSub("cTotal")%></td>
          <td bgcolor="#666666"><%=rSub("cToday")%></td>
          <td bgcolor="#666666"><%=rSub("cYesterday")%></td>
          <td bgcolor="#666666"><%=rSub("cLastMonth")%></td>
          <td bgcolor="#666666"><%=rSub("cMonth")%></td>
          <td bgcolor="#666666"><%=rSub("cIP")%></td>
          <td bgcolor="#666666"><%=rSub("cDate")%></td>
        </tr>
        <%rSub.MoveNext
          Loop%>
      </table>
    </td>
  </tr>
</table>
<%End Sub

Sub addcount%>
<form method="post" action="<%=thisprog%>?action=save<%=action%>&id=<%=id%>">
  <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
      <td align=center colspan="2" height=30><font color=red><b><%=request("msg")%></b></font></td>
    </tr>
    <tr> 
      <td align=center colspan="2" height=30 valign=middle><b>统计页面管理</b></td>
    </tr>
    <tr> 
      <td width="20%">页面链接:</td>
      <td width="80%"> 
        <input type="text" name="name" maxlength="100" value="<%=name%>">
        (例如:default.asp,最长100字符)</td>
    </tr>
    <tr> 
      <td width="20%">页面名称:</td>
      <td width="80%"> 
        <input type="text" name="cIntro" maxlength="100" value="<%=cIntro%>">
        (例如:源码之家首页,最长100字符)</td>
    </tr>
    <tr> 
      <td width="20%">初始数据:</td>
      <td width="80%"> 
        <input type="text" name="cTotal" value="<%=cTotal%>">
        (例如:10000)</td>
    </tr>
    <tr> 
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"> 
        <div align="center"><input type=hidden name=action value=save>
          <input type="submit" value="添加">
          <input type="reset" value="取消">
        </div>
      </td>
    </tr>
  </table>
</form>
<%End Sub

Sub savecount
name=trim(request.form("name"))
cTotal=trim(request.form("cTotal"))
cIntro=trim(request.form("cIntro"))
if cTotal="" then cTotal=1
if name="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入页面链接!"
founderr=true
end if
if cIntro="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入页面名称!"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)

if action="saveadd" then
  rSub.open "select * from txcount where id is null",conn,1,3
  rSub.AddNew
  rSub("cLastMonth")=cTotal
elseif action="savemod" then
  rSub.open "select * from txcount where id="&request("id"),conn,1,3
end if
rSub("name")=name
rSub("cIntro")=cIntro
rSub("cTotal")=cTotal
rSub.Update
id=rSub("id")
rSub.Close
%>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align=center>
  <tr>
    <td height=50 align=center valign=middle><b>统计页面添加成功</b></td>
  </tr>
  <tr>
    <td>
      页面代码为:<textarea cols="70" rows="2"><script language=javascript src="count.asp?s=1&id=<%=id%>"></script></textarea>
    </td>
  </tr>
  <tr>
    <td height=30>s=1的效果:<script language=javascript src="../count.asp?s=1&id=1"></script></td>
  </tr>
  <tr>
    <td height=30>s=2的效果:<script language=javascript src="../count.asp?s=2&id=1"></script></td>
  </tr>
  <tr>
    <td height=30>s为其他值时没有任何输出。</td>
  </tr>
</table>
<%End Sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -