📄 soft_edit.asp
字号:
<!--#include file="admin_include.asp"-->
<%
if request.Form.Count>0 then
id = request.Form("id")
Soft_Name = trim(request.Form("SoftName1"))&"【"&trim(request.Form("SoftName2"))&"】"&trim(request.Form("SoftName3")) '软件名称
Soft_Class = trim(request.Form("Soft_Class")) '软件分类
Soft_Level = trim(request.Form("Soft_Level")) '软件等级
Soft_Img = session("UploadFile") '软件图片
Soft_Size_1 = trim(request.Form("Soft_Size_1"))
Soft_Size_2 = trim(request.Form("Soft_Size_2")) '软件大小
Soft_Language = trim(request.Form("Soft_Language")) '软件语言
Soft_Operation = trim(request.Form("Soft_Operation")) '运行环境
Soft_Developer = trim(request.Form("Soft_Developer")) '开发商
Soft_Right = trim(request.Form("Soft_Right")) '授权方式
Soft_Update = trim(request.Form("Soft_Update")) '更新时间
Soft_Info = trim(request.Form("Soft_Info")) '软件简介
'Soft_Url = trim(request.Form("Soft_Url")) '下载地址
Addr_name = trim(request.Form("Addr_name"))
Addr_Server = trim(request.Form("Addr_Server"))
Addr_url = trim(request.Form("Addr_url"))
Soft_Commend = request.Form("Soft_Commend") '推荐软件
ParentId = request.Form("ParentId") '推荐软件
Soft_Info=replace(Soft_Info,"<p>","")
Soft_Info=replace(Soft_Info,"<P>","")
Soft_Info=replace(Soft_Info,"</p>","<br />")
Soft_Info=replace(Soft_Info,"<BR><BR>","<br />")
sql="select * from [Soft] where SD_Soft_id<>"&id&" and SD_Soft_Name='"& Soft_Name &"'"
'debug(sql)
rs.open sql,conn,1,1
if not rs.eof then
rs.close
call pagend()
response.Write("软件名称重复!")
response.End()
else
rs.close
sql="select * from [Soft] where SD_Soft_id="&id
'debug(sql)
rs.open sql,conn,1,3
rs("SD_Soft_Class")=Soft_Class
rs("SD_Soft_Name")=Soft_Name
rs("SD_Soft_Img")=session("UploadFile")
rs("SD_Soft_Size")=Soft_Size_1&Soft_Size_2
rs("SD_Soft_Language")=Soft_Language
rs("SD_Soft_Operation")=Soft_Operation
rs("SD_Soft_Right")=Soft_Right
rs("SD_Soft_Level")=Soft_Level
rs("SD_Soft_Developer")=Soft_Developer
rs("SD_Soft_Update")=Soft_Update
rs("SD_Soft_Info")=RemoveHTML(DelJS(Soft_Info)) '去除JS A Div
'rs("SD_Soft_Url")=Soft_Url
rs("SD_Soft_Url")=replace(Addr_name,",",";")&"$$$$$"&replace(Addr_Server,",",";")&"$$$$$"&replace(Addr_url,",",";")
rs("SD_Soft_Commend")=Soft_Commend
rs("SD_Soft_Del")=1
rs("SD_Soft_Html")=0 '设置为需生成Html
rs.update
rs.close
sql="update [S_Class] set SD_S_Class_Html=0 where SD_S_Class_Id="&ParentId
application.Lock()
conn.execute(sql)
application.UnLock()
response.Write("修改成功!")
session("UploadFile")=""
call pagend()
response.End()
end if
elseif request.QueryString.Count>0 then
id = request.QueryString("id")
page = request.QueryString("page")
T = request.QueryString("T")
sql="select * from [Softs] where SD_Soft_id="& id
rs.open sql,conn,1,1
if not rs.eof then
Soft_Id = rs("SD_Soft_id")
S_Class_Id = rs("S_Class.SD_S_Class_Id")
S_Class_Parent = rs("S_Class_1.SD_S_Class_Id")
Soft_Class=rs("SD_Soft_Class")
S_Class_Name=rs("S_Class.SD_S_Class_Name")
Soft_Name=rs("SD_Soft_Name")
Soft_Img=rs("SD_Soft_Img")
Soft_Size_1=rs("SD_Soft_Size")
Soft_Language=rs("SD_Soft_Language")
Soft_Operation=rs("SD_Soft_Operation")
Soft_Right=rs("SD_Soft_Right")
Soft_Level=rs("SD_Soft_Level")
Soft_Developer=rs("SD_Soft_Developer")
Soft_Update=rs("SD_Soft_Update")
Soft_Annex=rs("SD_Soft_Annex")
Soft_Info=rs("SD_Soft_Info")
Soft_Url=rs("SD_Soft_Url")
Soft_Commend=rs("SD_Soft_Commend")
Soft_Name1 = left(Soft_Name,instr(Soft_Name,"【")-1)
Soft_Name2 = mid(Soft_Name,instr(Soft_Name,"【")+1,instr(Soft_Name,"】")-instr(Soft_Name,"【")-1)
Soft_Name3 = right(Soft_Name,len(Soft_Name)-instr(Soft_Name,"】"))
end if
rs.close
end if
session("UploadFile")=""
function IfCheck(obj,Array2)
if instr(Array2,obj) then
IfCheck=" checked='checked'"
else
IfCheck=""
end if
end function
%>
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="Css/main.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/jquery.form.js"></script>
<script language="javascript" src="../js/Date.js"></script>
<script language="javascript" src="../js/Soft.js"></script>
<script language="javascript">
<!--
function ChkVal(obj,Val,CssVal){
var objVal = obj.value;
if (objVal == Val){
obj.className = CssVal;
obj.value = "";
}
obj.onblur = function(){
if (obj.value == ""){
obj.className = CssVal+" font-color";
obj.value = Val;
}
}
}
function SoftUpTextCmd(){
a=showModalDialog('UploadFile.asp','window2','dialogWidth=500px;dialogheight=300px;dialogTop=200px;dialogLeft=300px');
if(a=="undefined" || a==null){
a="";
}
//alert(a);
pick2(a);
}
function pick2(text) {
if (text != ""){
document.SoftEditForm.Addr_Server.value="-1"
document.SoftEditForm.Addr_name.value="本地下载点";
document.SoftEditForm.Addr_url.value=text;
document.SoftEditForm.Addr_name.className="TextBox2";
document.SoftEditForm.Addr_url.className="TextBox3";
window.close();
return false;
}
}
function AddClass_Submit(){
document.all.Soft_Info.value = window.frames["eWebEditor1"].frames["eWebEditor"].document.body.innerHTML;
var options = {
beforeSubmit: showRequest,
success: showResponse
};
$("#SoftEditForm").ajaxForm(options);
}
function showRequest(formData,jqForm){
//return true;
var Soft_Info2 = window.frames["eWebEditor1"].frames["eWebEditor"].document.body.innerHTML;
var obj = document.SoftEditForm;
if (obj.SoftName1.value == "" || obj.SoftName1.value == "名称"){
alert("没有填写软件名称!");
obj.SoftName1.focus();
return false;
}
if (obj.Soft_Class.options[obj.Soft_Class.selectedIndex].value == "-1"){
alert("没有选择软件分类!");
obj.ParentId.focus();
return false;
}
if (obj.Soft_Size_1.value == ""){
alert("没有填写软件大小!");
obj.Soft_Size_1.focus();
return false;
}
if (obj.Soft_Update.value == ""){
alert("没有更新时间");
obj.Soft_Update.focus();
return false;
}
if (Soft_Info2 == ""){
alert("没有填写软件简介!");
return false;
}
DownName = document.getElementsByName("Addr_name");
Down_Url = document.getElementsByName("Addr_url");
for(var i=0;i<DownName.length;i++){
if (DownName[i].value=="" || DownName[i].value=="下载点名称"){
alert("请填写下载点名称!");
DownName[i].value="";
DownName[i].focus();
return false;
}
if (Down_Url[i].value=="" || Down_Url[i].value=="下载点链接"){
alert("请填写下载点链接!");
Down_Url[i].value="";
Down_Url[i].focus();
return false;
}
}
//alert($.param(formData))
return true;
}
function showResponse(Re,statusText){
alert(Re);
if (Re.search("成功") >= 0){
if ("<%=T%>" == "New"){
if (<%=page%> != 0)
location.href='Soft.asp?page=<%=page%>';
else
location.href='Soft.asp';
}
if ("<%=T%>" == "Re"){
location.href='Soft_Re.asp';
}
}
}
function ReSetBut(){
$('#SoftEditForm').resetForm();
}
function Asp_Clone(objId,objId2,objId3,objId4){
objval = document.getElementById(objId).value;
obj2val = document.getElementById(objId2).value;
obj3val = document.getElementById(objId3).value;
if (objval=="" || objval=="下载点名称"){
alert("请填写下载点名称!");
document.getElementById(objId).value="";
document.getElementById(objId).className += "TextBox2";
document.getElementById(objId).focus();
return false;
}
if (obj3val=="" || obj3val=="下载点链接"){
alert("请填写下载点链接!");
document.getElementById(objId3).value="";
document.getElementById(objId3).className += "TextBox3";
document.getElementById(objId3).focus();
return false;
}
$.post("op.asp",
{objval: objval, obj2val:obj2val, obj3val:obj3val },
function(Re){
document.getElementById(objId).value=""
document.getElementById(objId2).value="-1";
document.getElementById(objId3).value="";
document.getElementById(objId4).innerHTML+=Re;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -