DownEdit.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:15k
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <TITLE>编辑下载</TITLE>
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../skweb/JS/Admin.js"></script>
- </HEAD>
- <!--#include file="../skweb/Const.asp" -->
- <!--#include file="../skweb/ConnSiteData.asp" -->
- <!-- #include file="../fckeditor/fckeditor.asp" -->
- <!--#include file="CheckAdmin.asp"-->
- <%
- if Instr(session("AdminPurview"),"|53,")=0 then
- response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
- response.end
- end if
- '========判断是否具有管理权限
- %>
- <BODY>
- <%
- dim Result
- Result=request.QueryString("Result")
- dim ID,DownName,ViewFlag,SortName,SortID,SortPath
- dim SmallPic,BigPic,softClass,approof,star,language,accmode
- dim FileSize,FileUrl,CommendFlag,GroupID,GroupIdName,Exclusive,Content
- ID=request.QueryString("ID")
- call DownEdit()
- %>
- <table width="100%" border="0" cellpadding="3" >
- <form name="editForm" method="post" action="DownEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
- <tr>
- <td height="24" nowrap bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" id=editDown idth="100%">
- <tr>
- <td height="29" colspan="2" background="Images/menutitle.gif" bgcolor="#FFFFFF"><table width="470" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="121"><strong><font color="#000000" size="2">下载管理</font></strong></td>
- <td width="87"><a href="DownEdit.asp?Result=Add"><img src="Images/x1.gif" width="52" height="17" border="0"></a></td>
- <td width="87"><a href="DownList.asp"><img src="Images/xlm.gif" width="52" height="17" border="0"></a></td>
- <td width="87"><a href="DownSort.asp"><img src="Images/xx.gif" width="52" height="17" border="0"></a></td>
- <td width="88"> </td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">下载名称:</td>
- <td bgcolor="#FFFFFF"><input name="DownName" type="text" class="textfield" id="DownName" style="WIDTH: 240;" value="<%=DownName%>" maxlength="100"> * 不少于3个字符
- <input name="ViewFlag" type="checkbox" style='HEIGHT: 13px;WIDTH: 13px;' value="1" <%if ViewFlag then response.write ("checked")%>>
- 发布
- <input name="CommendFlag" type="checkbox" style="HEIGHT: 13px;WIDTH: 13px;" value="1" <%if CommendFlag then response.write ("checked")%>>
- 推荐</td>
- </tr>
- <tr>
- <td height="24" align="right" bgcolor="#FFFFFF">所属类别:</td>
- <td bgcolor="#FFFFFF"><input name="SortID" type="text" class="textfield" id="SortID" style="WIDTH: 40;background-color:#EBF2F9;" value="<%=SortID%>" readonly> <input name="SortPath" type="text" class="textfield" id="SortPath" style="WIDTH: 80;background-color:#EBF2F9;" value="<%=SortPath%>" readonly> <input name="SortName" type="text" class="textfield" id="SortName" value="<%=SortName%>" style="WIDTH: 140;background-color:#EBF2F9;" readonly> <a href="javaScript:OpenScript('SelectSort.asp?Result=Download',500,500,'')"><img src="Images/Select.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">查看权限:</td>
- <td bgcolor="#FFFFFF"><select name="GroupID" class="textfield">
- <% call SelectGroup() %>
- </select>
- <input name="Exclusive" type="radio" value=">=" <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>>
- 隶属
- <input type="radio" <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">
- 专属 [隶属:权限值≥可查看,专属:权限值=可查看]</td>
- </tr>
- <tr>
- <td height="25" align="right" valign="middle" bgcolor="#FFFFFF">授权方式:</td>
- <td valign="middle" bgcolor="#FFFFFF">
- <select name="accmode">
- <%if accmode="免费软件" then%>
- <option value="免费软件" selected> 免费软件</option>
- <%else%>
- <option value="免费软件">免费软件</option>
- <%end if%>
- <%if accmode="共享软件" then%>
- <option value="共享软件" selected> 共享软件</option>
- <%else%>
- <option value="共享软件">共享软件</option>
- <%end if%>
- <%if accmode="破解软件" then%>
- <option value="破解软件" selected> 破解软件</option>
- <%else%>
- <option value="破解软件"> 破解软件</option>
- <%end if%>
- <%if accmode="商业软件" then%>
- <option value="商业软件" selected> 商业软件</option>
- <%else%>
- <option value="商业软件"> 商业软件</option>
- <%end if%>
- </select> 语言界面:
- <select name="language">
- <%if language="简体中文" then%>
- <option value="简体中文" selected>简体中文</option>
- <%else%>
- <option value="简体中文">简体中文</option>
- <%end if%>
- <%if language="繁体中文" then%>
- <option value="繁体中文" selected>繁体中文</option>
- <%else%>
- <option value="繁体中文">繁体中文</option>
- <%end if%>
- <%if language="英语" then%>
- <option value="英语" selected>英语</option>
- <%else%>
- <option value="英语">英语</option>
- <%end if%>
- <%if language="多国语言" then%>
- <option value="多国语言" selected>多国语言</option>
- <%else%>
- <option value="多国语言">多国语言</option>
- <%end if%>
- <%if language="其它语言" then%>
- <option value="其它语言" selected>其它语言</option>
- <%else%>
- <option value="其它语言">其它语言</option>
- <%end if%>
- </select> </td>
- </tr>
- <tr>
- <td height="25" align="right" valign="middle" bgcolor="#FFFFFF">软件评级:</td>
- <td valign="middle" bgcolor="#FFFFFF">
- <select name="star">
- <%if Cint(star)=1 then%>
- <option value="1" selected>★☆☆☆☆</option>
- <%else%>
- <option value="1">★☆☆☆☆</option>
- <%end if%>
- <%if Cint(star)=2 then%>
- <option value="2" selected>★★☆☆☆</option>
- <%else%>
- <option value="2">★★☆☆☆</option>
- <%end if%>
- <%if Cint(star)=3 then%>
- <option value="3" selected>★★★☆☆</option>
- <%else%>
- <option value="3">★★★☆☆</option>
- <%end if%>
- <%if Cint(star)=4 then%>
- <option value="4" selected>★★★★☆</option>
- <%else%>
- <option value="4">★★★★☆</option>
- <%end if%>
- <%if Cint(star)=5 then%>
- <option value="5" selected>★★★★★</option>
- <%else%>
- <option value="5">★★★★★</option>
- <%end if%>
- </select> </td>
- </tr>
- <tr>
- <td height="25" align="right" valign="middle" bgcolor="#FFFFFF">运行环境:</td>
- <td valign="middle" bgcolor="#FFFFFF"> <input type="text" name="approof" class="textfield" id="approof" size="30" value="<%=approof%>"> <a href="javascript:" onClick="approof.value+='Win9x'">Win9x</a>|<a href="javascript:" onClick="approof.value+='/WinNT'">WinNT</a>|<a href="javascript:" onClick="approof.value+='/WinNT'">Win2K</a>|<a href="javascript:" onClick="approof.value+='/WinXP'">WinXP</a>|<a href="javascript:" onClick="approof.value+='/Win2003'">Win2003</a>|<a href="javascript:" onClick="approof.value+='/其它'">其它</a></td>
- </tr>
- <tr>
- <td height="25" align="right" valign="middle" bgcolor="#FFFFFF">演示地址:</td>
- <td valign="middle" bgcolor="#FFFFFF"> <input type="text" name="softClass" class="textfield" size="30" value="<%=softClass%>"><a href="javascript:" onClick="softClass.value+='暂无演示'">暂无演示</a></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">下载地址一:</td>
- <td bgcolor="#FFFFFF"><input name="FileUrl" type="text" class="textfield" style="WIDTH: 240;" value="<%=FileUrl%>" maxlength="100"> <a href="javaScript:OpenScript('UpFileForm.asp?Result=FileUrl',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">文件大小:</td>
- <td bgcolor="#FFFFFF"><input name="FileSize" type="text" class="textfield" id="FileSize" style="WIDTH: 240;" value="<%=FileSize%>" maxlength="100"></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">下载地址二:</td>
- <td bgcolor="#FFFFFF"><input name="SmallPic" type="text" class="textfield" style="WIDTH: 240;" value="<%=SmallPic%>" maxlength="100"> <a href="javaScript:OpenScript('UpFileForm.asp?Result=SmallPic',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">文件主图:</td>
- <td bgcolor="#FFFFFF"><input name="BigPic" type="text" class="textfield" style="WIDTH: 240;" value="<%=BigPic%>" maxlength="100"> <a href="javaScript:OpenScript('UpFileForm.asp?Result=BigPic',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
- </tr>
- <tr>
- <td height="20" align="right" valign="top" bgcolor="#FFFFFF">信息内容:<br>
- <td bgcolor="#FFFFFF"><%
- Dim oFCKeditor
- Set oFCKeditor = New FCKeditor
- oFCKeditor.BasePath = "../fckeditor/"
- oFCKeditor.ToolbarSet = "Default"
- oFCKeditor.Width = "100%"
- oFCKeditor.Height = "400"
- oFCKeditor.Value = content
- oFCKeditor.Create "Content"
- %></td>
- </tr>
- <tr>
- <td height="30" align="right" bgcolor="#FFFFFF"> </td>
- <td valign="bottom" bgcolor="#FFFFFF"><input name="submitSaveEdit" type="submit" class="button" id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
- </tr>
- </table></td>
- </tr>
- </form>
- </table>
- </BODY>
- </HTML>
- <%
- sub DownEdit()
- dim Action,rsRepeat,rs,sql
- Action=request.QueryString("Action")
- if Action="SaveEdit" then '保存编辑下载信息
- set rs = server.createobject("adodb.recordset")
- if len(trim(request.Form("DownName")))<3 then
- response.write ("<script language=javascript> alert('下载名称为必填项目!');history.back(-1);</script>")
- response.end
- end if
- if len(trim(request.Form("approof")))<1 then
- response.write ("<script language=javascript> alert('运行环境为必填项目!');history.back(-1);</script>")
- response.end
- end if
- if len(trim(request.Form("softClass")))<1 then
- response.write ("<script language=javascript> alert('演示地址为必填项目!');history.back(-1);</script>")
- response.end
- end if
- if Result="Add" then '创建下载信息
- sql="select * from sk_Download"
- rs.open sql,conn,1,3
- rs.addnew
- rs("DownName")=trim(Request.Form("DownName"))
- if Request.Form("ViewFlag")=1 then
- rs("ViewFlag")=Request.Form("ViewFlag")
- else
- rs("ViewFlag")=0
- end if
- if Request.Form("SortID")="" and Request.Form("SortPath")="" then
- response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
- response.end
- else
- rs("SortID")=Request.Form("SortID")
- rs("SortPath")=Request.Form("SortPath")
- end if
- if Request.Form("CommendFlag")=1 then
- rs("CommendFlag")=Request.Form("CommendFlag")
- else
- rs("CommendFlag")=0
- end if
- GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
- rs("GroupID")=GroupIdName(0)
- rs("Exclusive")=trim(Request.Form("Exclusive"))
- rs("accmode")=trim(Request.Form("accmode"))
- rs("language")=trim(Request.Form("language"))
- rs("star")=trim(Request.Form("star"))
- rs("approof")=trim(Request.Form("approof"))
- rs("softClass")=trim(Request.Form("softClass"))
- rs("FileSize")=trim(Request.Form("FileSize"))
- rs("FileUrl")=trim(Request.Form("FileUrl"))
- rs("SmallPic")=trim(Request.Form("SmallPic"))
- rs("BigPic")=trim(Request.Form("BigPic"))
- rs("Content")=Request.Form("Content")
- rs("AddTime")=now()
- end if
- if Result="Modify" then '修改下载信息
- sql="select * from sk_Download where ID="&ID
- rs.open sql,conn,1,3
- rs("DownName")=trim(Request.Form("DownName"))
- if Request.Form("ViewFlag")=1 then
- rs("ViewFlag")=Request.Form("ViewFlag")
- else
- rs("ViewFlag")=0
- end if
- if Request.Form("SortID")<>"" and Request.Form("SortPath")<>"" then
- rs("SortID")=Request.Form("SortID")
- rs("SortPath")=Request.Form("SortPath")
- else
- response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
- response.end
- end if
- if Request.Form("CommendFlag")=1 then
- rs("CommendFlag")=Request.Form("CommendFlag")
- else
- rs("CommendFlag")=0
- end if
- GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
- rs("GroupID")=GroupIdName(0)
- rs("Exclusive")=trim(Request.Form("Exclusive"))
- rs("accmode")=trim(Request.Form("accmode"))
- rs("language")=trim(Request.Form("language"))
- rs("star")=trim(Request.Form("star"))
- rs("approof")=trim(Request.Form("approof"))
- rs("softClass")=trim(Request.Form("softClass"))
- rs("FileSize")=trim(Request.Form("FileSize"))
- rs("FileUrl")=trim(Request.Form("FileUrl"))
- rs("SmallPic")=trim(Request.Form("SmallPic"))
- rs("BigPic")=trim(Request.Form("BigPic"))
- rs("Content")=Request.Form("Content")
- end if
- rs.update
- rs.close
- set rs=nothing
- Response.Redirect("Tips/down.asp")
- else '提取产品信息
- if Result="Modify" then
- set rs = server.createobject("adodb.recordset")
- sql="select * from sk_Download where ID="& ID
- rs.open sql,conn,1,1
- if rs.bof and rs.eof then
- response.write ("数据库读取记录出错!")
- response.end
- end if
- DownName=rs("DownName")
- ViewFlag=rs("ViewFlag")
- SortName=SortText(rs("SortID"))
- SortID=rs("SortID")
- SortPath=rs("SortPath")
- CommendFlag=rs("CommendFlag")
- GroupID=rs("GroupID")
- Exclusive=rs("Exclusive")
- accmode=rs("accmode")
- language=rs("language")
- star=rs("star")
- approof=rs("approof")
- softClass=rs("softClass")
- FileSize=rs("FileSize")
- FileUrl=rs("FileUrl")
- SmallPic=rs("SmallPic")
- BigPic=rs("BigPic")
- Content=rs("Content")
- rs.close
- set rs=nothing
- end if
- end if
- end sub
- %>
- <%
- sub SelectGroup()
- dim rs,sql
- set rs = server.createobject("adodb.recordset")
- sql="select GroupID,GroupName from sk_MemGroup"
- rs.open sql,conn,1,1
- if rs.bof and rs.eof then
- response.write("未设组别")
- end if
- while not rs.eof
- response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupName")&"'")
- if GroupID=rs("GroupID") then response.write ("selected")
- response.write(">"&rs("GroupName")&"</option>")
- rs.movenext
- wend
- rs.close
- set rs=nothing
- end sub
- %>
- <%
- '生成所属类别--------------------------
- Function SortText(ID)
- Dim rs,sql
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From sk_DownSort where ID="&ID
- rs.open sql,conn,1,1
- SortText=rs("SortName")
- rs.close
- set rs=nothing
- End Function
- %>