<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="check.asp"-->
<%Response.Expires=0
name=trim(request("name"))
url=trim(request("url"))
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_gvurl where a='"& name &"'")
gvurlsl=tmprs("数量")
%>
<html><head><title><%=name%>下载URL修改</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("此操作将要删除此url地址，您确定删除此项目吗？"))parent.mainFrame.location.href=url;}
</script>
<%
response.write"<SCRIPT language=JavaScript>function check(){"& chr(13)&chr(10)
response.write"var name=document.form.name.value;"& chr(13)&chr(10)
response.write"var pattern = /^([0-9])+$/;"& chr(13)&chr(10)
response.write"if(name=="& chr(34) & chr(34) &"){alert("& chr(34) &"提示：请输入名称！"& chr(34) &");return false;}"& chr(13)&chr(10)
for i=1 to gvurlsl
response.write"var url"& i &"=document.form.url"& i &".value;"& chr(13)&chr(10)
response.write"var urlid"& i &"=document.form.urlid"& i &".value;"& chr(13)&chr(10)
response.write"if(url"& i &"=="& chr(34) & chr(34) &"){alert("& chr(34) &"提示：联接地址"& i &"不可以为空！"& chr(34) &");return false;}"& chr(13)&chr(10)
response.write"if(urlid"& i &"=="& chr(34) & chr(34) &"){alert("& chr(34) &"提示：地址"& i &"不可以为空！"& chr(34) &");return false;}"& chr(13)&chr(10)
response.write"if(urlid"& i &"==0 || urlid"& i &" > "& gvurlsl &"){alert("& chr(34) &"提示：地址"& i &"不可以为0也不可以大于"& gvurlsl &"！"& chr(34) &");return false;}"& chr(13)&chr(10)
response.write"if(pattern.test(urlid"& i &")!=true){alert("& chr(34) &"提示：地址"& i &"请使用数字！"& chr(34) &");return false;}"& chr(13)&chr(10)
next
for t=1 to gvurlsl
for tt=t+1 to gvurlsl
response.write"if (urlid" & t & "==urlid" & tt & "){alert(" & chr(34) & "提示：地址[" & t & "]与地址(" & tt & ")序更号不可以重复!" & chr(34) & ");return false;}" & chr(13)&chr(10)
next
next
response.write"}</script>"& chr(13)&chr(10)
%>
<div align="center"><font size="+1"><%=name%>下载URL修改</font></div>
<form name="form" method="post" action="jhgl.asp?act=gvmodiurl&url=<%=url%>" onSubmit="return check(this);">
<input name="name" type="hidden" id="name" value="<%=name%>" size="4="4">
<input name="urlsl" type="hidden" id="urlsl" value="<%=urlsl%>" size="4="4">
  <table width="70%" border=1 align="center" cellpadding=1 cellspacing=0  bordercolor="#000000" bordercolordark="#FFFFFF">
    <tr> 
      <td colspan="7" align="center" bgcolor="#d7ebff"><%=name%>下载URL修改</td>
    </tr>
    <%rs.Open "select * from sjjh_gvurl where a='"& name &"' Order by id", conn, 1,1
     urlsl=0
     do while (Not RS.Eof)
     urlsl=urlsl+1%>
    <tr> 
      <td width="11%" align="center" bgcolor="#d7ebff">址址<%=urlsl%></td>
      <td colspan="5"><input name="url<%=urlsl%>" type="text" id="url<%=urlsl%>" size="50" value="<%=rs("b")%>"> 
        <input name="urlid<%=urlsl%>" type="text" id="urlid<%=urlsl%>" size="2" value="<%=rs("id")%>"> 
      </td>
      <td width="8%"><a href=Javascript:del("jhgl.asp?act=gvurldel&name=<%=name%>&id=<%=rs("id")%>");>删除</a></td>
    </tr>
    <%RS.MoveNext    
	Loop%>
    <tr> 
      <td colspan="7" align="center" bgcolor="#d7ebff"><input type="SUBMIT" name="Submit" value="确定"> 
        <input type="RESET" name="Reset" value="清除"></td>
    </tr>
  </table>
</form>
</body>
</html>
