📄 movieclass.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="../inc/conn.asp"-->
<!--#include file="AdminChkPurview.asp"-->
<script language = "JavaScript">
function isNumber(String)
{
var Letters = "1234567890";
var i;
var c;
if(String.charAt( 0 )=='-')
return false;
if( String.charAt( String.length - 1 ) == '-' )
return false;
for( i = 0; i < String.length; i ++ )
{
c = String.charAt( i );
if (Letters.indexOf( c ) < 0)
return false;
}
return true;
}
function CheckForm()
{
if (document.FrontPage_Form1.type.value=="")
{
alert("栏目名称不能为空!");
document.FrontPage_Form1.type.focus();
return false;
}
if (document.FrontPage_Form1.arrange.value=="")
{
alert("栏目排序不能为空!");
document.FrontPage_Form1.arrange.focus();
return false;
}
if(!isNumber(document.FrontPage_Form1.arrange.value))
{
alert("栏目排序只能为数字!");
document.FrontPage_Form1.arrange.focus();
return false;
}
return true;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>影片类别管理</title>
<link rel="stylesheet" type="text/css" href="../inc/Admin_Style.css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table cellpadding="0" cellspacing="1" border="0" width="100%">
<tr>
<td height="22" align="center" class="title"><b>影 片 类 别 管 理</b></td>
</tr>
<tr class="tdbg">
<td height="468" align="center">
<table width="80%" border="0" cellspacing="0" id="table1" ize="20" maxlength="200">
<tr>
<td height="0">
<%
if request("edit")="1" and request("typeid")<>"" then
sql = "select * from type where typeid="&request("typeid")
Set rs1 = Server.CreateObject("ADODB.RecordSet")
rs1.Open sql,conn,1,1
end if
%>
<form action="?flash=flashlmok<%if request("edit")="1" then response.write "&typeid="&rs1("typeid")%>" method="post" name="FrontPage_Form1" id="FrontPage_Form1" onSubmit="return CheckForm();">
<table width="100%" border="1" cellpadding="5" cellspacing="0" size="20" maxlength="200">
<tr>
<td width="112">栏目名称:</td>
<td width="843"><input name="type" maxlength="20" type="text" id="lm" size="31"
<%
if request("edit")=1 then
response.write "value="&rs1("type")
end if
%> /></td>
</tr>
<tr>
<td height="10">栏目排序: </td>
<td><input name="arrange" maxlength="5" type="text" id="px" size="31"
<%
if request("edit")=1 then
response.write "value="&rs1("arrange")
end if
%> />
小到大 </td>
</tr>
<tr>
<td height="33"> </td>
<td><input type="submit" value="修改 增加" name="B12" style="cursor: hand;background-color: #cccccc;">
<input type="reset" value="重置" name="B2" style="cursor: hand;background-color: #cccccc;">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<table width="80%" border="1" cellpadding="4" cellspacing="0" size="20" maxlength="200">
<tr>
<td height="24" align="center">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from type order by arrange"
rs.Open sql,conn,1,1
%>分类管理
</td>
</tr>
</table>
<table width="80%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999" class="border" size="20" maxlength="200">
<tr>
<td width="19%" align="center">排序</td>
<td width="33%" align="center">栏目名称</td>
<td width="48%" align="center">操作</td>
</tr>
<%
if rs.recordcount<>0 then
for i=0 to rs.recordcount
%>
<tr>
<td height="20" align="center" bgcolor="#EEEEEE" ><%=rs("arrange")%></td>
<td align="center" bgcolor="#EEEEEE"><%=rs("type")%></td>
<td align="center" bgcolor="#EEEEEE"><a href="?typeid=<%=rs("typeid")%>&edit=1">修改</a>
<a href="?del=1&typeid=<%=rs("typeid")%>" onClick="{if(confirm('你真的要删除此栏目吗?将会删除栏目下的所有数据?')){this.document.form1.submit();return true;}return false;}">删除</a> </td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
end if
%>
</table>
</td>
</tr>
<tr class="tdbg">
<td width="254" align="right"> </td>
</tr>
</table>
<!--#include file="AdminFooder.asp"-->
</body>
</html>
<%
if request("type")<>"" and request("arrange")<>"" then
if request("typeid")="" then
sql = "select top 1 * from type"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs.addnew
else
sql = "select * from type where typeid="&request("typeid")
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
end if
rs("type")=request("type")
rs("arrange")=request("arrange")
rs.update
rs.close
set rs=nothing
response.redirect Request.ServerVariables("HTTP_REFERER")
end if
if request("del")="1" and request("typeid")<>"" then
conn.execute"delete from type where typeid="&request("typeid")
response.redirect Request.ServerVariables("HTTP_REFERER")
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -