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

📄 tvname.asp

📁 网络电视类型的好网站
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="kz.asp" -->
<% SUB pageUrl(pUrl)
Dim eUrl
txts = Request.ServerVariables("URL")
txts = left(txts,instrrev(txts,"/",len(txts))-1)
eUrl = "http://"&Request.ServerVariables("server_name")&txts
For i =1 to allpages
txt = ""
txt = "<strong>" 
txt = txt &  "<a href=" &  eUrl &  pUrl &  "page="&i & ">"
if i = Cint(Page) then txt = txt &  "<font color=’bb0000’>"
txt = txt &  (i) 
if i = Cint(Page) then txt = txt &  "</font>"
txt = txt &  "</a> | </strong>"
Response.Write(txt)
Next
END sub %> 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电视台名称管理</title>
<LINK href="../style.css" type=text/css rel=stylesheet>
</head>
<body>
<div align="center"> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td height="30">
<div align="center"><font color="#FF0000">电视台名称管理</font></div></td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><div align="center"></div></td>
    </tr>
  </table>
</div>
<form method=post action=? name="diqu">
</form>
<table width="700" border="0" cellspacing="0" cellpadding="0" align=center>
  <tr> 
    <td align=center> <form name="form1" method="post" action="savetvname.asp?quyu=<%= quyuid %>&action=add">
        <div align="left">排序 
          <input name="paixu" type="text" id="paixu22" size="10" maxlength="10">
          名称 
          <input name="tvname" type="text" id="tvname" size="30" maxlength="30">
          <select name="gs">
            <option value="">选择格式</option>
            <option value="wmv" selected>.wmv</option>
            <option value="ram">.ram</option>
          </select>
          <input type="submit" name="Submit" value="添加">
        </div>
      </form></td>
    <td align=center><form method=post action=? name="diqu">
        <select  name="quyu" onChange="document.diqu.submit();">
          <option value=""  selected>全部区域</option>
          <%  
set rsd=server.createobject("adodb.recordset")
rsd.open "select * from diqu",conn,1,1
if rsd.recordcount<>0 then
 do while not rsd.eof 
  %>
          <option <% If  rsd("id") =cdbl(quyuid ) Then %> selected <% End If %>  value=<%= rsd("id") %>><%= rsd("quyu") %></option>
          <% rsd.movenext 
 loop
 end if
 rsd.Close
set rsd=nothing
  %>
        </select>
      </form> </td>
    <td align=center>
      <%
quyuid=Request("quyu")
if quyuid<>"" then
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from diqu where id="&quyuid,conn,1,1
if rs1.recordcount<>0 then
Response.Write(rs1("quyu")) 
  rs1.Close
set rs1=nothing
Else 
Response.Write( "请选择区域!")
end if
end if
 %>
    </td>
  </tr>
</table>
<%  
set rs=server.createobject("adodb.recordset")
if quyuid<>"" then
rs.open "select * from tvname where quyu="&quyuid&" order by cdbl(paixu) ",conn,1,3
 Else 
rs.open "select * from tvname ",conn,1,3
 End If 
if not rs.eof then
pages = 18 '定义每页显示的记录数
rs.pageSize = pages '定义每页显示的记录数
allPages = rs.pageCount'计算一共能分多少页
page = Request.QueryString("page")'通过浏览器传递的页数
'if语句属于基本的排错处理
if isEmpty(page) or Cint(page) < 1 then
page = 1
elseif Cint(page) > allPages then
page = allPages 
end if
rs.AbsolutePage = page %>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td>&nbsp;</td>
  </tr>
</table>
<table width=700 border=1 cellpadding=0 cellspacing=0 align=center>
  <tr> 
    <td height="20"><div align="center">编号</div></td>
    <td height="20"><div align="center">排序</div></td>
    <td height="20"  align=center>名称</td>
    <td height="20"  align=center>格式</td>
    <td height="20"  align=center>操作</td>
  </tr>
  <% 
Do while not rs.eof and pages > 0 
   %>
  <tr> 
    <td width="40" height="25" ><div align="center"><%= rs("id") %></div></td>
    <td width="65" height="25" ><div align="center"><%= rs("paixu") %></div></td>
    <td width="395" height="25" ><a href="tvdizhi.asp?id=<%= rs("id") %>&gs=<%= rs("gs") %>" ><%= rs("name") %></a></td>
    <td width="81" height="25" ><div align="center"><%= rs("gs") %></div></td>
    <td width="107" height="25"><a href=# onClick="show(<%= rs("id") %>)">修改</a><a href="savetvname.asp?quyu=<%= quyuid %>&action=del&id=<%= rs("id")%>">|删除</a></td>
  </tr>
  <tr id='xg<%=rs("id") %>' style="display:none"> 
    <form action="savetvname.asp?quyu=<%= quyuid %>&action=edit&id=<%=rs("id") %>" method="post">
      <td height="38" colspan="5"  align="center" bgcolor="#00CCFF" > 排序: 
        <input name="paixu" type="text" id="paixu" value=<%= rs("paixu") %> size="10" maxlength="10">
        名称:
        <input name="tvname" type="text"  value=<%= rs("name") %> id="tvname" size="30" maxlength="30">
        名称: 
        <select name="gs">
          <option value="">选择格式</option>
          <option value="wmv" <% If rs("gs")="wmv" Then %>selected<% End If %>>.wmv</option>
          <option value="ram" <% If rs("gs")="ram" Then %>selected<% End If %>>.ram</option>
        </select> <input type="submit" name="Submit2" value="提交"> </td>
    </form>
  </tr>
  <% pages = pages - 1
rs.MoveNext
Loop %>
  <tr> 
    <td height="25" colspan="5" align="center"> 
      <% call pageUrl("/tvname.asp?quyu="&quyuid&"&") %>
    </td>
  </tr>
</table>
<% 
else
Response.Write("数据库暂无内容!")
End if
rs.Close
Set rs = Nothing 

%>

<SCRIPT language=javascript1.2>
function show(i){
whichEl = eval("xg" + i);
if (whichEl.style.display == "none")
{
eval("xg" + i + ".style.display=\"\";");
}
else
{
eval("xg" + i + ".style.display=\"none\";");
}

}
</SCRIPT>
</body>
</html>

⌨️ 快捷键说明

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