admin_lockip.asp
资源名称:qnmov30.rar [点击查看]
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:16k
源码类别:
家庭/个人应用
开发平台:
ASP/ASPX
- <!--#include file="../checkpost.asp"-->
- <!--#include file="articleconn.asp" -->
- <!--#include file="security.asp"-->
- <%
- if session("flag")>2 then
- response.write "<br><p align=center>您没有操作的权限</p>"
- response.end
- end if
- %>
- <link rel="stylesheet" type="text/css" href="inc/Admin_STYLE.CSS">
- <META content="Microsoft FrontPage 6.0" name=GENERATOR><style type="text/css">
- <!--
- body,td,th {
- font-size: 9pt;
- }
- .??1 {
- color: #000000;
- font-weight: bold;
- }
- .??2 {color: #000000}
- .??1 {color: #000000}
- -->
- </style></HEAD>
- <BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
- <TABLE class=tableBorder width="98%" align=center border=0>
- <TR>
- <TH height=25 style="background-image: url('images/admin_bg_1.gif')">
- <font face="宋体"> 授权网吧管理</font></TH></TR>
- <TR>
- <TD class=forumrow height=100>
- <table border="0" style="border-collapse: collapse" width="100%">
- <tr><td>
- </TD></TR>
- <TR>
- <TD class=forumrow height=100>
- <%
- call main()
- sub main()
- dim userip,ips,GetIp1,GetIp2
- if request("userip")<>"" then
- userip=request("userip")
- ips=Split(userIP,".")
- GetIp1=ips(0)&"."&ips(1)&"."&ips(2)&".1"
- GetIp2=ips(0)&"."&ips(1)&"."&ips(2)&".255"
- else
- userip=""
- GetIp1=""
- GetIp2=""
- end if
- if request("action")="add" then
- %>
- <table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder">
- <%
- dim sip,str1,str2,str3,str4,num_1,num_2
- if request.querystring("reaction")="save" then
- sip=cstr(request.form("ip1"))
- 'dot=instr(ip,".")-1
- 'response.write dot
- str1=left(sip,cint(instr(sip,".")-1))
- sip=mid(sip,cint(instr(sip,"."))+1)
- str2=left(sip,cint(instr(sip,"."))-1)
- sip=mid(sip,cint(instr(sip,"."))+1)
- str3=left(sip,cint(instr(sip,"."))-1)
- str4=mid(sip,cint(instr(sip,"."))+1)
- num_1=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
- mbname=cstr(request.form("mbname"))
- mbpass=cstr(request.form("mbpass"))
- data=cstr(request.form("data"))
- sip=cstr(request.form("ip2"))
- str1=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str2=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str3=left(sip,instr(sip,".")-1)
- str4=mid(sip,instr(sip,".")+1)
- num_2=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
- 'response.write num_1 &","& num_2
- 'response.end
- set rs = server.CreateObject ("adodb.recordset")
- sql="select * from goip"
- rs.open sql,conn,1,3
- rs.addnew
- rs("ip1")=num_1
- rs("why")=trim(request.form("why"))
- rs("ip2")=num_2
- rs("sip1")=request.form("ip1")
- rs("sip2")=request.form("ip2")
- rs("mbname")=mbname
- rs("mbpass")=mbpass
- rs("time")=now()+data
- rs.update
- rs.close
- set rs=nothing
- conn.close
- set conn=nothing
- %>
- </span>
- <tr>
- <td width="100%" class=forumrow>
- <span style="font-size: 9pt">添加成功!</td>
- </tr>
- </table>
- <%
- elseif request("mb")="mb" then
- %>
- <table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr class="title">
- <tr>
- <th width="98%" height="22" colspan=2 class="title" ><span style="font-size: 9pt"> 网吧IP开通管理--添加</th>
- </tr>
- <form action="?action=add&reaction=save" method="post">
- <tr>
- <td width="20%" class=tdbg><div align="center"><span style="font-size: 9pt">网吧名称</span></div></td>
- <td width="76%" class=tdbg><span style="font-size: 9pt">
- <input type="text" name="mbname" size="30" value="<%=mbname%>">
- </span></td>
- </tr>
- <tr>
- <td width="20%" class=tdbg><div align="center"><span style="font-size: 9pt">起始I P</span></div></td>
- <td width="76%" class=tdbg><span style="font-size: 9pt">
- <input type="text" name="ip1" size="30" value="<%=GetIp1%>">
- 如202.96.0.0</span></td>
- </tr>
- <tr>
- <td width="20%" class=tdbg><div align="center"><span style="font-size: 9pt">结尾I P</span></div></td>
- <td width="76%" class=tdbg><span style="font-size: 9pt">
- <input type="text" name="ip2" size="30" value="<%=GetIp2%>">
- 如202.96.0.255</span></td>
- </tr>
- <tr>
- <td width="20%" class=tdbg><div align="center"><font color="#FF0000">管理密码</font></div></td>
- <td width="76%" class=tdbg><span style="font-size: 9pt">
- <input type="text" name="mbpass" size="30" value="<%=mbpass%>"></span></td>
- </tr>
- <tr>
- </tr>
- <tr>
- <td width="20%" class=tdbg><div align="center">到期时间</div></td>
- <td width="76%" class=tdbg><span style="font-size: 9pt">
- <select size="1" name="data">
- <option value="30" selected>一个月</option>
- <option value="60">三个月</option>
- <option>半年</option>
- <option value="365">一年</option>
- <option value="800">二年</option>
- <option value="9999">无限制</option>
- </select>
- </span></td>
- </tr>
- <tr>
- <td width="20%" class=tdbg><div align="center">授权说明</div></td>
- <td width="76%" class=tdbg> <span style="font-size: 9pt">
- <textarea rows="3" name="why" cols="28">没有说明</textarea>
- </span></td>
- </tr>
- <tr>
- <td width="20%" class=tdbg></td>
- <td width="76%" class=tdbg> <span style="font-size: 9pt">
- <input type="submit" name="Submit" value="提 交"> </td>
- </tr>
- </form>
- <%else%>
- <%end if
- elseif request("action")="delip" then
- conn.execute("delete from goip where id in ("&request.form("delid")&")")
- response.write "删除成功!"
- else
- %> <FORM METHOD=POST ACTION="?action=delip">
- <tr>
- <th width="100%" colspan=8 height="14" style="background-image: url('images/admin_bg_1.gif')">
- <p align="right"><font color="#FFFFFF"> <span style="font-size: 9pt">
- <input type=submit name=submit value="删除">
- <input type=checkbox value="on" name="chkall" onclick="CheckAll(this.form)">
- </span></th>
- </tr>
- <tr class="title">
- <td width="38" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式1"> <span style="font-size: 9pt">ID</span></span></td>
- <%if request("action")="mb" then%>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式1">网吧名称</span></td>
- <%end if%>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"><B> <span style="font-size: 9pt">起始IP</span></B></span></td>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"><B> <span style="font-size: 9pt">结尾IP</span></B></span></td>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"> <b>原因说明</b></span></td>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"> <b>時間</b></span></td>
- <td width="15%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"> <b>到期</b></span></td>
- <td width="5%" height="22" align="center" class="forumHeaderBackgroundAlternate" >
- <span class="样式2"><B> <span style="font-size: 9pt">操作</span></B></span></td>
- </tr>
- <%
- dim currentpage,page_count,Pcount
- dim totalrec,endpage
- currentPage=request("page")
- if currentpage="" then
- currentpage=1
- else
- currentpage=clng(currentpage)
- if err then
- currentpage=1
- err.clear
- end if
- end if
- if request("action")="mb" then
- sql="select * from goip where mbname<>'' order by id desc"
- else
- sql="select * from goip where mbname='' order by id desc"
- end if
- Set rs= Server.CreateObject("ADODB.Recordset")
- rs.open sql,conn,1,3
- if rs.eof and rs.bof then
- %>
- <tr>
- <td width="846" colspan=8 class=forumrow> <span style="font-size: 9pt">还没有任何IP限制数据。</td>
- </tr>
- <%
- else
- rs.PageSize = 500
- 'rs.AbsolutePage=currentpage
- page_count=0
- totalrec=rs.recordcount
- while (not rs.eof) and (not page_count = 15)
- %>
- <tr class="tdbg">
- <td width="38" align="center" class=forumrow><%=rs("id")%></td>
- <%if request("action")="mb" then%>
- <td width="15%" align="center" class=forumrow><%=rs("mbname")%></td>
- <%end if%>
- <td width="15%" align="center" class=forumrow><%=rs("sip1")%></td>
- <td width="15%" align="center" class=forumrow><%=rs("sip2")%></td>
- <td width="15%" align="center" class=forumrow><%=rs("why")%></td>
- <td width="15%" align="center" class=forumrow><%=rs("tim")%></td>
- <td width="15%" align="center" class=forumrow><%=rs("time")%></td>
- <td width="5%" align="center" class=forumrow>
- <span style="font-size: 9pt">
- <input type=checkbox name="delid" value="<%=cstr(rs("ID"))%>">
- <a href="?action=mod&id=<%=rs("id")%>">修改</a> </span></td>
- </tr>
- <%
- page_count = page_count + 1
- rs.movenext
- wend
- %>
- <span style="font-size: 9pt"> </span>
- <tr>
- <td colspan=8 class=forumrow align=center width="846" height="18">
- <span style="font-size: 9pt">分页:
- <%Pcount=rs.PageCount
- if currentpage > 4 then
- response.write "<a href=""?page=1"">[1]</a> ..."
- end if
- if Pcount>currentpage+3 then
- endpage=currentpage+3
- else
- endpage=Pcount
- end if
- for i=currentpage-3 to endpage
- if not i<1 then
- if i = clng(currentpage) then
- response.write " <font color=red>["&i&"]</font>"
- else
- response.write " <a href=""?page="&i&""">["&i&"]</a>"
- end if
- end if
- next
- if currentpage+3 < Pcount then
- response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
- end if
- %>
- </span> </td>
- </tr>
- <%
- end if
- rs.close
- set rs=nothing
- %>
- <span style="font-size: 9pt"> </span>
- </FORM>
- </table>
- </div>
- <script language="JavaScript">
- <!--
- function CheckAll(form) {
- for (var i=0;i<form.elements.length;i++) {
- var e = form.elements[i];
- if (e.name != 'chkall') e.checked = form.chkall.checked;
- }
- }
- //-->
- </script></form>
- <%
- if request("action")="mod" then
- id=request("id")
- sql="select * from goip where id="&id
- Set rs= Server.CreateObject("ADODB.Recordset")
- rs.open sql,conn,1,3
- %>
- <table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr class="title">
- <tr>
- <th height="22" colspan=3 class="title" > 网吧IP管理--<span style="font-size: 9pt">修改</span></th>
- </tr>
- <form action="?action=mod1&reaction=save" method="post">
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center"><span style="font-size: 9pt">网吧名称</span></div></td>
- <td colspan="2" class=forumrow><span style="font-size: 9pt">
- <input type="text" name="mbname" size="30" value="<%=rs("mbname")%>">
- <input name="id" type="hidden" id="id" value="<%=id%>">
- </span></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center"><span style="font-size: 9pt">起始I P</span></div></td>
- <td colspan="2" class=forumrow><span style="font-size: 9pt">
- <input type="text" name="ip1" size="30" value="<%=rs("sip1")%>">
- 如202.96.0.0</span></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center"><span style="font-size: 9pt">结尾I P</span></div></td>
- <td colspan="2" class=forumrow><span style="font-size: 9pt">
- <input type="text" name="ip2" size="30" value="<%=rs("sip2")%>">
- 如202.96.0.255</span></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center"><span style="font-size: 9pt">开始时间</span></div></td>
- <td width="23%" class=forumrow><span style="font-size: 9pt">
- <input name="starttime" type="text" id="starttime" value="<%=rs("tim")%>" size="15">
- </span></td>
- <td width="60%">结束时间
- <input name="endtime" type="text" id="endtime" value="<%=rs("time")%>" size="15"></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center"><font color="#FF0000">管理密码</font></div></td>
- <td colspan="2" class=forumrow>
- <span style="font-size: 9pt">
- <input type="text" name="mbpass" size="30" value="<%=rs("mbpass")%>"></span></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow><div align="center">授权说明</div></td>
- <td colspan="2" class=forumrow>
- <span style="font-size: 9pt">
- <textarea rows="3" name="why" cols="28"><%=rs("why")%></textarea>
- </span></td>
- </tr>
- <tr class="tdbg">
- <td width="17%" class=forumrow></td>
- <td colspan="2" class=forumrow> <span style="font-size: 9pt">
- <input type="submit" name="Submit" value="提 交"> </td>
- </tr>
- </form>
- </table></td>
- </tr>
- </table>
- <%
- rs.close
- end if
- if request("action")="mod1" and request("reaction")="save" then
- id=request("id")
- sip=cstr(request.form("ip1"))
- 'dot=instr(ip,".")-1
- 'response.write dot
- str1=left(sip,cint(instr(sip,".")-1))
- sip=mid(sip,cint(instr(sip,"."))+1)
- str2=left(sip,cint(instr(sip,"."))-1)
- sip=mid(sip,cint(instr(sip,"."))+1)
- str3=left(sip,cint(instr(sip,"."))-1)
- str4=mid(sip,cint(instr(sip,"."))+1)
- num_1=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
- mbname=cstr(request.form("mbname"))
- mbpass=cstr(request.form("mbpass"))
- data=cstr(request.form("data"))
- sip=cstr(request.form("ip2"))
- str1=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str2=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str3=left(sip,instr(sip,".")-1)
- str4=mid(sip,instr(sip,".")+1)
- num_2=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
- 'response.write num_1 &","& num_2
- 'response.end
- set rs = server.CreateObject ("adodb.recordset")
- sql="select * from goip where id="&id
- rs.open sql,conn,1,3
- rs("ip1")=num_1
- rs("why")=trim(request.form("why"))
- rs("ip2")=num_2
- rs("sip1")=request.form("ip1")
- rs("sip2")=request.form("ip2")
- rs("mbname")=mbname
- rs("mbpass")=mbpass
- rs("tim")=request("starttime")
- rs("time")=request("endtime")
- rs.update
- rs.close
- set rs=nothing
- %>
- <table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td align="center"> <span style="font-size: 9pt">修改成功!</span></td>
- </tr>
- </table>
- <%
- end if
- conn.close
- set conn=nothing
- end if
- end sub
- %>
- </BODY></HTML>