<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="check.asp"-->
<%Response.Expires=0
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("sjjh_usermdb")
tmprs=conn.execute("Select count(*) As 数量 from sjjh_gvzhu")
gvsl=tmprs("数量")
%>
<html><head><title>游戏影视分类列表</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link href="jh.css" rel="stylesheet" type="text/css"></head>
<script language=JavaScript>
function del(url)
{if(confirm("此操作将要删除此分类，您确定删除此项目吗？"))parent.mainFrame.location.href=url;}
</script>
<%response.write"<SCRIPT language=JavaScript>function check(){"
for t=1 to gvsl
response.write"var id" & t & "=document.form.id" & t & ".value;" & chr(13)&chr(10)
response.write"if (id" & t & "==0 || id" & t & ">" & gvsl & "){alert(" & chr(34) & "提示：ID不能为0且小于" & roomsl & "" & chr(34) & ");return false;}" & chr(13)&chr(10)
next
for t=1 to gvsl
response.write"var name" & t & "=document.form.name" & t & ".value;" & chr(13)&chr(10)
response.write"if (name" & t & "=="&chr(34)& chr(34) &"){alert(" & chr(34) & "提示：ID["& t &"]的分类名不能为空!" & chr(34) & ");return false;}" & chr(13)&chr(10)
next
for t=1 to gvsl
for tt=t+1 to gvsl
response.write"if (id" & t & "==id" & tt & "){alert(" & chr(34) & "提示：ID[" & t & "]与ID(" & tt & ")序更号不可以重复!" & chr(34) & ");return false;}" & chr(13)&chr(10)
next
next
for t=1 to gvsl
for tt=t+1 to gvsl
response.write"if (name" & t & "==name" & tt & "){alert(" & chr(34) & "提示：ID[" & t & "]与ID(" & tt & ")的分类名相同，请更改，不要重复!!" & chr(34) & ");return false;}" & chr(13)&chr(10)
next
next
response.write"}</SCRIPT>"
%>
<%
sql="SELECT * from sjjh_gvzhu order by a"
Set Rs=conn.Execute(sql)
t=0
%>
<form method="post" action="jhgl.asp?act=gvtypemodi" name="form" onSubmit="return check(this);">
  <table width="50%" border="1" align="center" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF">
    <tr align="center"> 
      <td colspan="5" bgcolor="#d7ebff">游戏影视分类列表</td>
    </tr>
    <tr align="center"> 
      <td width="17%" bgcolor="#d7ebff">原顺序</td>
      <td width="20%" bgcolor="#d7ebff">新的顺序</td>
      <td width="18%" bgcolor="#d7ebff">类别</td>
      <td width="33%" bgcolor="#d7ebff">分类名字</td>
      <td width="12%" bgcolor="#d7ebff"><a href="gvtypeadd.asp"><b>添加</b></a></td>
    </tr>
    <%
do while not rs.bof and not rs.eof
t=t+1
%>
    <tr align="center"> 
      <td><%=rs("a")%> <input type="hidden" name="oldname<%=t%>" value="<%=rs("b")%>"  style="text-align:center;"></td>
      <td><input type="text" name="id<%=t%>" value="<%=rs("a")%>" size="2" maxlength="2"  style="text-align:center;"></td>
      <td><select name="gvtype<%=t%>">
          <option value="1" <%if rs("c")=1 then%>selected<%end if%>>游戏</option>
          <option value="2" <%if rs("c")=2 then%>selected<%end if%>>影视</option>
          <option value="0" <%if rs("c")=0 then%>selected<%end if%>>隐藏</option>
        </select></td>
      <td><input type="text" name="name<%=t%>" value="<%=rs("b")%>" size="15" maxlength="10"  style="text-align:center;"></td>
      <td><a href=Javascript:del("jhgl.asp?act=gvzhudel&id=<%=rs("a")%>");>删除</a></td>
    </tr>
    <%rs.movenext
loop
%>
    <tr align="center" bgcolor="#009933"> 
      <td colspan="5"><input name="submit" type="submit" value="确 定"> <input  onClick="javascript:window.document.location.href='roomlist.asp'" value="返 回" type=button name="back"></td>
    </tr>
  </table>
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
