www.gusucode.com > 深度梦想整站系统(asp) 1.14.02源码程序 > admin/soft/soft_Update.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% projectRootPath = "../../" '相对当前应用程序根的位置 %> <!-- #include file="../web.config.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex,nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>管理</title> <link href="../themes/<%=theme_Path%>/main.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function checkForm(){ if(document.form1.fTitle.value==""){ alert("下载标题不能为空!!"); document.form1.fTitle.focus(); return false; } if(document.form1.fclass_ID.value==""){ alert("下载分类必须选择!!"); document.form1.fclass_ID.focus(); return false; } //下载地址 for(var i=0;i<document.form1.DownloadUrl.length;i++){ if (document.form1.fDownloadUrl.value=='') { document.form1.fDownloadUrl.value=document.form1.DownloadUrl.options[i].value; }else{ document.form1.fDownloadUrl.value+='$$$'+document.form1.DownloadUrl.options[i].value; } } document.form1.button.value="提交中,请稍候..."; document.form1.button.disabled=true; return true; } </script> </head> <body id="bodyBg1"> <br /> <a href="soft_Manage.asp">下载管理</a> | <a href="soft_Add.asp">添加下载</a> <hr class="Nav-hr" /> <br /> <dl class="manageContent"> <dt>下载管理</dt> <dd> <br /> <% if(Request.Form("fTitle")<>"" and Request.Form("fid")<>"")then fid=Request.Form("fid") fclass_ID=Request.Form("fclass_ID") fTitle=Request.Form("fTitle") fAuthor=Request.Form("fAuthor") fCopyFrom=Request.Form("fCopyFrom") fSoftType=Request.Form("fSoftType") fSoftLanguage=Request.Form("fSoftLanguage") fCopyrightType=Request.Form("fCopyrightType") fplatform=Request.Form("fplatform") fauthorUrl=Request.Form("fauthorUrl") fDemoUrl=Request.Form("fDemoUrl") fContent=Request.Form("fContent") fkeyWord=Request.Form("fkeyWord") fStars=Request.Form("fStars") fSoftSize=Request.Form("fSoftSize") fDownloadUrl=Request.Form("fDownloadUrl") fHits=Request.Form("fHits") fdayHits=Request.Form("fdayHits") fweekHits=Request.Form("fweekHits") fmonthHits=Request.Form("fmonthHits") fCreateTime=Request.Form("fCreateTime") fUpdateTime=Request.Form("fUpdateTime") fisHot=Request.Form("fisHot") fisOnTop=Request.Form("fisOnTop") fisElite=Request.Form("fisElite") fisView=Request.Form("fisView") fisIncludePic=Request.Form("fisIncludePic") fuploadFiles=Request.Form("fuploadFiles") fDefaultPicUrl=Request.Form("fDefaultPicUrl") sql="update deep_Soft set fTitle='"&fTitle&"',fclass_ID="&fclass_ID&",fAuthor='"&fAuthor&"',fCopyFrom='"&fCopyFrom&"',fSoftType='"&fSoftType&"',fSoftLanguage='"&fSoftLanguage&"',fCopyrightType='"&fCopyrightType&"',fplatform='"&fplatform&"',fauthorUrl='"&fauthorUrl&"',fDemoUrl='"&fDemoUrl&"',fContent='"&fContent&"',fkeyWord='"&fkeyWord&"',fStars="&fStars&",fSoftSize="&fSoftSize&",fDownloadUrl='"&fDownloadUrl&"',fHits="&fHits&",fdayHits="&fdayHits&",fweekHits="&fweekHits&",fmonthHits="&fmonthHits&",fCreateTime='"&fCreateTime&"',fUpdateTime='"&fUpdateTime&"',fisHot="&fisHot&",fisOnTop="&fisOnTop&",fisElite="&fisElite&",fisView="&fisView&",fisIncludePic="&fisIncludePic&",fuploadFiles='"&fuploadFiles&"',fDefaultPicUrl='"&fDefaultPicUrl&"' where fid=" & fid 'response.Write(sql) conn.execute(sql) Response.Write("["&fTitle&"]修改成功!!") end if id=request.QueryString("id") if(id<>"")then sql_soft="select * from deep_Soft where fid=" & id set rsSoft=conn.execute(sql_soft) if(rsSoft.eof and rsSoft.bof)then response.Write("没有记录!") else %> <form id="form1" name="form1" method="post" action="" onSubmit="return checkForm()"> <table width="99%" class="tableBoderForm"> <tr> <td>所属栏目:</td> <td><select name="fclass_ID" id="fclass_ID"> <option value=""> 选择分类 </option> <% SqlArticleClass="Select * from deep_SoftClass where fparentID=0 order by fOrderID" Set rsArticleClass=conn.execute(SqlArticleClass) if rsArticleClass.Eof and rsArticleClass.Bof then Response.Write("<option>请先添加栏目!</option>") else while (not rsArticleClass.eof) %> <option value="<%=rsArticleClass("fclass_ID")%>" <%if(rsArticleClass("fclass_ID")=rsSoft("fclass_ID"))then%> selected="selected"<%end if%>><%=rsArticleClass("fClassName")%></option> <% call getSubList(rsArticleClass("fclass_ID"),rsSoft("fclass_ID"),0,"select fclass_ID,fparentID,fclassName from deep_SoftClass") rsArticleClass.MoveNext wend end if rsArticleClass.close Set rsArticleClass =Nothing %> </select></td> </tr> <tr> <td>下载标题:</td> <td><input name="fTitle" type="text" id="fTitle" value="<%=rsSoft("fTitle")%>" size="60" /></td> </tr> <tr> <td>开 发 商:</td> <td><input name="fAuthor" type="text" id="fAuthor" value="<%=rsSoft("fAuthor")%>" /> <=【<span onClick="document.form1.fAuthor.value='佚名'" style="cursor:pointer;color:#070;">佚名</span>】 【<span onClick="document.form1.fAuthor.value='未知'" style="cursor:pointer;color:#070;">未知</span>】 【<span onClick="document.form1.fAuthor.value='<%=session("adminName")%>'" style="cursor:pointer;color:#070;"><%=session("adminName")%></span>】 </td> </tr> <tr> <td>软件来源:</td> <td><input name="fCopyFrom" type="text" id="fCopyFrom" value="<%=rsSoft("fCopyFrom")%>" size="50" /> <=【<span onClick="document.form1.fCopyFrom.value='本站原创'" style="cursor:pointer;color:#070;">本站原创</span>】 </td> </tr> <tr> <td>软件类别:</td> <td> <select name="fSoftType" id="fSoftType"> <option value="国产软件" <%if(rsSoft("fSoftType")="国产软件")then%>selected="selected"<%end if%>>国产软件</option> <option value="国外软件" <%if(rsSoft("fSoftType")="国外软件")then%>selected="selected"<%end if%>>国外软件</option> <option value="程序源码" <%if(rsSoft("fSoftType")="程序源码")then%>selected="selected"<%end if%>>程序源码</option> <option value="教学课件" <%if(rsSoft("fSoftType")="教学课件")then%>selected="selected"<%end if%>>教学课件</option> <option value="汉化补丁" <%if(rsSoft("fSoftType")="汉化补丁")then%>selected="selected"<%end if%>>汉化补丁</option> <option value="电影下载" <%if(rsSoft("fSoftType")="电影下载")then%>selected="selected"<%end if%>>电影下载</option> <option value="其它" <%if(rsSoft("fSoftType")="")then%>selected="selected"<%end if%>>其它</option> </select> 软件语言: <select name="fSoftLanguage" id="fSoftLanguage"> <option value="简体中文" <%if(rsSoft("fSoftLanguage")="简体中文")then%>selected="selected"<%end if%>>简体中文</option> <option value="繁体中文" <%if(rsSoft("fSoftLanguage")="繁体中文")then%>selected="selected"<%end if%>>繁体中文</option> <option value="简繁中文" <%if(rsSoft("fSoftLanguage")="简繁中文")then%>selected="selected"<%end if%>>简繁中文</option> <option value="多国语言" <%if(rsSoft("fSoftLanguage")="多国语言")then%>selected="selected"<%end if%>>多国语言</option> <option value="英文" <%if(rsSoft("fSoftLanguage")="英文")then%>selected="selected"<%end if%>>英文</option> <option value="其他语言" <%if(rsSoft("fSoftLanguage")="其他语言")then%>selected="selected"<%end if%>>其他语言</option> </select> 授权方式: <select name="fCopyrightType" id="fCopyrightType"> <option value="免费版" <%if(rsSoft("fCopyrightType")="免费版")then%>selected="selected"<%end if%>>免费版</option> <option value="共享版" <%if(rsSoft("fCopyrightType")="共享版")then%>selected="selected"<%end if%>>共享版</option> <option value="试用版" <%if(rsSoft("fCopyrightType")="试用版")then%>selected="selected"<%end if%>>试用版</option> <option value="演示版" <%if(rsSoft("fCopyrightType")="演示版")then%>selected="selected"<%end if%>>演示版</option> <option value="注册版" <%if(rsSoft("fCopyrightType")="注册版")then%>selected="selected"<%end if%>>注册版</option> <option value="破解版" <%if(rsSoft("fCopyrightType")="破解版")then%>selected="selected"<%end if%>>破解版</option> <option value="零售版" <%if(rsSoft("fCopyrightType")="零售版")then%>selected="selected"<%end if%>>零售版</option> <option value="OEM版" <%if(rsSoft("fCopyrightType")="OEM版")then%>selected="selected"<%end if%>>OEM版</option> </select></td> </tr> <tr> <td>运行平台:</td> <td> <input name="fplatform" type="text" id="fplatform" value="<%=rsSoft("fplatform")%>" size="70" maxlength="200"> <font color="#FF0000"> *</font><br /> <font color="#808080">平台选择:</font> <span onClick="document.form1.fplatform.value+='/Linux'" style="cursor:pointer;color:#070;">/Linux</span> <span onClick="document.form1.fplatform.value+='/asp'" style="cursor:pointer;color:#070;">/asp</span> <span onClick="document.form1.fplatform.value+='/asp.Net'" style="cursor:pointer;color:#070;">/asp.Net</span> <span onClick="document.form1.fplatform.value+='/php'" style="cursor:pointer;color:#070;">/php</span> <span onClick="document.form1.fplatform.value+='/java'" style="cursor:pointer;color:#070;">/java</span> </td> </tr> <tr> <td>相关链接:</td> <td><input name="fauthorUrl" type="text" id="fauthorUrl" value="<%=rsSoft("fauthorUrl")%>" size="50" maxlength="100" /></td> </tr> <tr> <td> 演示地址:</td> <td><input name="fDemoUrl" type="text" id="fDemoUrl" value="<%=rsSoft("fDemoUrl")%>" size="80" maxlength="200"></td> </tr> <tr> <td>下载内容:</td> <td><script type="text/javascript"> // 当上传图片等文件时,往下拉框中填入图片路径,可根据实际需要更改此函数 function doChange(objText, objDrop){ if (!objDrop) return; var str = objText.value; var arr = str.split("|"); var nIndex = objDrop.selectedIndex; objDrop.length=1; for (var i=0; i<arr.length; i++){ objDrop.options[objDrop.length] = new Option(arr[i], arr[i]); } objDrop.selectedIndex = nIndex; } </script><textarea name="fContent" id="fContent" style="display:none;"><%=rsSoft("fContent")%></textarea> <iframe id="eWebEditor1" src="../include/eWebEditor/eWebEditor.asp?id=fContent&style=deep_light_soft&savepathfilename=fuploadFiles" frameborder="0" scrolling="no" width="650" height="400"></iframe> <input type="hidden" name="fuploadFiles" id="fuploadFiles" onchange="doChange(this,document.form1.fDefaultPicUrl)"/><% ' ewebeditor.asp文件调用的参数: ' id:下面表单项textarea的名称,在此表单中是Content,注意大小写 ' style:编辑器的样式名称,可在eWebEditor的后台设置 ' originalfilename:用于获取源文件名(上传前的原文件名), ' savefilename:用于获取保存文件名(上传后的文件名), 在此表单中是fuploadFiles ' savepathfilename:用于获取保存带路径文件名(上传后的文件名), %> </td> </tr> <tr> <td>关键字:</td> <td><input name="fkeyWord" type="text" id="fkeyWord" value="<%=rsSoft("fkeyWord")%>" size="60" /><br /> <span style="color:#00F;font-family:'宋体';">用来查找关联信息,可输入多个关键字,中间用“<span style="color:#F00; font-weight:bolder;">,</span>”英文逗号分隔。不能出现""'*?,.()等字符。</span></td> </tr> <tr> <td>软件评价:</td> <td> <select name="fStars" id="fStars"> <option value="5" <%if(rsSoft("fStars")=5)then%>selected="selected"<%end if%> >★★★★★</option> <option value="4" <%if(rsSoft("fStars")=4)then%>selected="selected"<%end if%> >★★★★</option> <option value="3" <%if(rsSoft("fStars")=3)then%>selected="selected"<%end if%>>★★★</option> <option value="2" <%if(rsSoft("fStars")=2)then%>selected="selected"<%end if%>>★★</option> <option value="1" <%if(rsSoft("fStars")=1)then%>selected="selected"<%end if%>>★</option> <option value="0" <%if(rsSoft("fStars")=0)then%>selected="selected"<%end if%>>无</option> </select> 文件大小: <input name="fSoftSize" type="text" id="fSoftSize" value="<%=rsSoft("fSoftSize")%>" size="15" />K </td> </tr> <tr> <td>上传软件:</td> <td> <font color="#FF0000">*</font> 基于系统安全,未开发无组件上传,请用FTP上传到对应文件夹后,在下载地址处输入文件名 <!--系统提供的上传功能只适合上传比较小的软件(如ASP源代码压缩包)。如果软件比较大(2M以上),请先使用FTP上传,而不要使用系统提供的上传功能,以免上传出错或过度占用服务器的CPU资源。FTP上传后请将地址复制到下面的地址框中。 --> </td> </tr> <tr> <td>下载地址:</td> <td> <input type='hidden' name='fDownloadUrl' value=''> <select name="DownloadUrl" size="5" id="DownloadUrl"style='width:500px;height:100px' ondblclick='return ModifyUrl();'> <% if(rsSoft("fDownloadUrl")<>"")then arrDownloadUrls=split(rsSoft("fDownloadUrl"),"$$$") for each DownloadUrl in arrDownloadUrls 'arrDownloadUrl=split(item1,"|") response.Write("<option value='"&DownloadUrl&"'>"&DownloadUrl&"</option>") next end if %> </select> <font color="#FF0000">*</font> <br /> <input type='button' name='Softselect' value='从已上传软件中选择' onclick='SelectFile()'> <input type='button' name='addurl' value='添加外部地址' onclick='AddUrl();'> <input type='button' name='modifyurl' value='修改当前地址' onclick='return ModifyUrl();'> <input type='button' name='delurl' value='删除当前地址' onclick='DelUrl();'> <script type="text/javascript"> function SelectFile(){ /*模态窗口 var arr=showModalDialog('soft_Select.asp?upLoadDir=soft', '', 'dialogWidth:820px; dialogHeight:600px; help: no; scroll: yes; status: no'); if(arr!=null){ var ss=arr.split('|'); strSoftUrl=ss[0]; var url='下载地址'+(document.form1.fDownloadUrl.length+1)+'|'+strSoftUrl; document.form1.fDownloadUrl.options[document.form1.fDownloadUrl.length]=new Option(url,url); } */ var newWin=window.open('soft_Select.asp?upLoadDir=soft', 'newWin', 'width=800, height=600, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=yes'); } function SelectFileAddUrl(strUrl,strSoftSize){ var thisurl='下载地址'+(document.form1.fDownloadUrl.length+1)+'|'+strUrl; //var url=prompt('请输入下载地址名称和链接,中间用“|”隔开:',thisurl); document.form1.DownloadUrl.options[document.form1.DownloadUrl.length]=new Option(thisurl,thisurl); document.form1.fSoftSize.value=strSoftSize; } function AddUrl(){ var thisurl='下载地址'+(document.form1.DownloadUrl.length+1)+'|http://'; var url=prompt('请输入下载地址名称和链接,中间用“|”隔开:',thisurl); if(url!=null&&url!=''){document.form1.DownloadUrl.options[document.form1.DownloadUrl.length]=new Option(url,url);} } function ModifyUrl(){ if(document.form1.DownloadUrl.length==0) return false; var thisurl=document.form1.DownloadUrl.value; if (thisurl=='') {alert('请先选择一个下载地址,再点修改按钮!');return false;} var url=prompt('请输入下载地址名称和链接,中间用“|”隔开:',thisurl); if(url!=thisurl&&url!=null&&url!=''){document.form1.DownloadUrl.options[document.form1.DownloadUrl.selectedIndex]=new Option(url,url);} } function DelUrl(){ if(document.form1.DownloadUrl.length==0) return false; var thisurl=document.form1.DownloadUrl.value; if (thisurl=='') {alert('请先选择一个下载地址,再点删除按钮!');return false;} document.form1.DownloadUrl.options[document.form1.DownloadUrl.selectedIndex]=null; } </script> </td> </tr> <tr> <td>点击数:</td> <td> 今日:<input name="fdayHits" type="text" id="fdayHits" value="<%=rsSoft("fdayHits")%>" size="5" /> 本周:<input name="fweekHits" type="text" id="fweekHits" value="<%=rsSoft("fweekHits")%>" size="5" /> 本月:<input name="fmonthHits" type="text" id="fmonthHits" value="<%=rsSoft("fmonthHits")%>" size="5" /> 总计:<input name="fHits" type="text" id="fHits" value="<%=rsSoft("fHits")%>" size="5" /> </td> </tr> <tr> <td>生成时间:</td> <td><input name="fCreateTime" type="text" id="fCreateTime" value="<%=rsSoft("fCreateTime")%>" size="30" /> 时间格式为“年-月-日 时:分:秒”,如:2004-11-18 12:32:47 </td> </tr> <tr> <td>更新时间:</td> <td><input name="fUpdateTime" type="text" id="fUpdateTime" value="<%=now()%>" size="30" /> (原日期:<span class="cBlue"><%=rsSoft("fUpdateTime")%></span>) </td> </tr> <tr> <td>热点下载:</td> <td><input name="fisHot" type="radio" id="radio" value="1" <%if(rsSoft("fisHot")=1)then%>checked="checked"<%end if%> /> 是 <input name="fisHot" type="radio" id="radio2" value="0" <%if(rsSoft("fisHot")=0)then%>checked="checked"<%end if%>/> 否</td> </tr> <tr> <td>固顶:</td> <td><input type="radio" name="fisOnTop" id="radio3" value="1" <%if(rsSoft("fisOnTop")=1)then%>checked="checked"<%end if%>/>是 <input name="fisOnTop" type="radio" id="radio4" value="0" <%if(rsSoft("fisOnTop")=0)then%>checked="checked"<%end if%>/>否</td> </tr> <tr> <td>精华下载:</td> <td><input type="radio" name="fisElite" id="radio5" value="1" <%if(rsSoft("fisElite")=1)then%>checked="checked"<%end if%>/>是 <input name="fisElite" type="radio" id="radio6" value="0" <%if(rsSoft("fisElite")=0)then%>checked="checked"<%end if%>/>否</td> </tr> <tr> <td>是否审核:</td> <td><input name="fisView" type="radio" id="radio7" value="1" <%if(rsSoft("fisView")=1)then%>checked="checked"<%end if%> />是 <input name="fisView" type="radio" id="radio8" value="0" <%if(rsSoft("fisView")=0)then%>checked="checked"<%end if%>/>否</td> </tr> <tr> <td>包含图片:</td> <td><input name="fisIncludePic" type="radio" id="radio9" value="1" <%if(rsSoft("fisIncludePic")=1)then%>checked="checked"<%end if%>/>是 <input name="fisIncludePic" type="radio" id="radio10" value="0" <%if(rsSoft("fisIncludePic")=0)then%>checked="checked"<%end if%>/>否</td> </tr> <tr> <td>标题图片:</td> <td><% ' 把带"|"的字符串转为数组,用于初始下拉框表单 if(rsSoft("fuploadFiles")<>"") then uploadFiles=rsSoft("fuploadFiles") else uploadFiles="" end if aSavePathFileName = Split(uploadFiles, "|") ' 根据新闻内容中相关上传文件为数据,初始下拉框表单 ' 函数InitSelect,根据数组值及初始值返回下拉框输出字串,具体请见startup.asp文件中函数的说明部分 Dim sOptionSavePath response.Write( InitSelect("fDefaultPicUrl", aSavePathFileName, aSavePathFileName, rsSoft("fDefaultPicUrl"), "", " 点击选择jpg图片 ") ) %><br/> 当编辑区有插入图片时,将自动填充此下拉框,标题图片必须是jpg格式 </td> </tr> <tr> <td><input name="fid" type="hidden" id="fid" value="<%=id%>" /></td> <td><input type="submit" name="button" id="button" value="修改" /> <input type="reset" name="button2" id="button2" value="重置" /></td> </tr> </table> </form> <% end if end if %> <br /> <br /> </dd> </dl> <br /> </body> </html> <% call closeConnDB() %> <% ' =============================================== ' 初始化下拉框 ' s_FieldName : 返回的下拉框名 ' a_Name : 定值名数组 ' a_Value : 定值值数组 ' v_InitValue : 初始值 ' s_Sql : 从数据库中取值时,select name,value from table ' s_AllName : 空值的名称,如:"全部","所有","默认" ' =============================================== Function InitSelect(s_FieldName, a_Name, a_Value, v_InitValue, s_Sql, s_AllName) Dim i InitSelect = "<select name='" & s_FieldName & "' size=1>" If s_AllName <> "" Then InitSelect = InitSelect & "<option value=''>" & s_AllName & "</option>" End If If s_Sql <> "" Then oRs.Open s_Sql, oConn, 0, 1 Do While Not oRs.Eof InitSelect = InitSelect & "<option value=""" & inHTML(oRs(1)) & """" If oRs(1) = v_InitValue Then InitSelect = InitSelect & " selected" End If InitSelect = InitSelect & ">" & outHTML(oRs(0)) & "</option>" oRs.MoveNext Loop oRs.Close Else For i = 0 To UBound(a_Name) InitSelect = InitSelect & "<option value=""" & inHTML(a_Value(i)) & """" If a_Value(i) = v_InitValue Then InitSelect = InitSelect & " selected" End If InitSelect = InitSelect & ">" & outHTML(a_Name(i)) & "</option>" Next End If InitSelect = InitSelect & "</select>" End Function ' ============================================ ' 去除Html格式,用于从数据库中取出值填入输入框时 ' 注意:value="?"这边一定要用双引号 ' ============================================ Function inHTML(str) Dim sTemp sTemp = str inHTML = "" If IsNull(sTemp) = True Then Exit Function End If sTemp = Replace(sTemp, "&", "&") sTemp = Replace(sTemp, "<", "<") sTemp = Replace(sTemp, ">", ">") sTemp = Replace(sTemp, Chr(34), """) inHTML = sTemp End Function ' ============================================ ' 把字符串进行HTML解码,替换server.htmlencode ' 去除Html格式,用于显示输出 ' ============================================ Function outHTML(str) Dim sTemp sTemp = str outHTML = "" If IsNull(sTemp) = True Then Exit Function End If sTemp = Replace(sTemp, "&", "&") sTemp = Replace(sTemp, "<", "<") sTemp = Replace(sTemp, ">", ">") sTemp = Replace(sTemp, Chr(34), """) sTemp = Replace(sTemp, Chr(10), "<br>") outHTML = sTemp End Function %>