📄 product_edit.asp
字号:
<!--#include file="../inc/CheckAdmin.asp"-->
<!--#include file="../inc/Config.asp"-->
<!--#include file="../inc/Navtree.asp"-->
<!--#include file="../inc/Conn.asp"-->
<!--#include file="setting.asp"-->
<%
Dim Language,table,Sortid,delsImg
Language=formatStr(Request("Language"))
if Language="" then Language="C"
table_behind="ProductSort_"
table=Get_Table(table_behind,Language)
Sortid=request("Sortid")
id=request("id")
If id="" or not isnumeric(id) then Check_Alert "非法操作","Product_admin.asp"
Sortid=request("Sortid")
If Sortid="" or not isnumeric(Sortid) then Check_Alert "非法操作","Product_admin.asp"
Sortid2=request("Sortid2")
If Sortid2="" or not isnumeric(Sortid2) then Check_Alert "非法操作","Product_admin.asp"
area=request("area")
If area="" or not isnumeric(area) then Check_Alert "非法操作","Product_admin.asp"
if request.form("add")=1 then
rs.open"select * from Product where P_id="&request("id"),conn,1,3
rs("P_Name")=request("P_Name")
'rs("P_Name2")=request("P_Name2")
'rs("P_Language")=language
'rs("P_Sortid")=Sortid
rs("P_Content")=request("content1")
'rs("P_Power")=request("power")
'rs("P_Pic")=request("textimg")
'rs("P_Pic2")=request("textimage")
rs("P_Model")=request("P_Model")
rs("P_Model2")=request("P_Model2")
rs("P_Model3")=request("sel1")
rs("P_Model4")=request("sel2")
'rs("P_Price")=request("P_Price")
rs("P_Model5")=request("sel3")
rs("P_Model6")=request("P_Model3")
rs("P_Model7")=request("sel4")
'rs("P_Model8")=request("P_Model8")
'rs("P_Price2")=request("P_Price2")
'rs("P_Memo")=request("Others")
rs("P_Special")=request("Commend")
rs("P_Editor")=session("admin")
rs.update
set delImg=nothing
closeconn
response.redirect("Product_Admin.asp?language="&language&"&sortid="&request.form("Sortid"))
response.end
end if
if request("id")<>"" then
rs.open"select * from Product where P_Id="&request("id"),conn,1,1
if not rs.eof then
title=rs("P_Name")
'title2=rs("P_Name2")
content=rs("P_Content")
id=rs("P_id")
'Sortid=rs("P_Sortid")
'Power=rs("P_Power")
'Memo=rs("P_Memo")
' textimg=rs("P_Pic")
'textimage=rs("P_Pic2")
Commend=rs("P_special")
Model=rs("P_Model")
Model2=rs("P_Model2")
sel1=rs("P_Model3")
sel2=rs("P_Model4")
'Price=rs("P_Price")
sel3=rs("P_Model5")
Model6=rs("P_Model6")
sel4=rs("P_Model7")
'Model8=rs("P_Model8")
'Price2=rs("P_Price2")
end if
rs.close
end if
if left(textimg,4)=cstr(year(now())) then
spicpath="../../uploadfile/product_small/"&textimg
elseif textimg<>"" then
spicpath=textimg
end if
if left(textimage,4)=cstr(year(now())) then
bpicpath="../../uploadfile/product_big/"&textimage
elseif textimage<>"" then
bpicpath=textimage
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站管理系统</title>
<link href="../Css_Main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #FF0000}
.style1 {color: #CCCCCC}
.Maxl { height: auto;
width: 100px;
}
-->
</style>
</head>
<script language="JavaScript">
function Check()
{
if (form.sel1.value == "")
{alert("请选择发货城市。");
form.sel1.focus();
return false;
}
if (form.sel2.value == "")
{alert("请选择区域。");
form.sel2.focus();
return false;
}
if (form.sel3.value == "")
{alert("路线名称到货城市。");
form.sel3.focus();
return false;
}
document.form.submit();
}
</script>
<script language="JavaScript">
function GetResult(str,classid)
{
/*
*--------------- GetResult(str,classid) -----------------
* GetResult(str)
* 功能:通过XMLHTTP发送请求,返回结果.
* 参数:str,字符串,发送条件;classid,数字,菜单级别
* 实例:GetResult(document.all.userid.value,1);
*--------------- GetResult(str,classid) -----------------
*/
//定义菜单级数,菜单ID数组,菜单对应字段数组
var MenuIdArr,MenuFieldArr,MenuClass
MenuIdArr= new Array()
MenuFieldArr=new Array()
MenuClass=3
MenuIdArr[1]="sel1"
MenuIdArr[2]="sel2"
MenuIdArr[3]="sel3"
//MenuIdArr[4]="sel4"
MenuFieldArr[1]="ps_name"
MenuFieldArr[2]="ps_name"
MenuFieldArr[3]="ps_name"
//MenuFieldArr[4]="ps_name"
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
var linkurl="../../inc/ajax_server.asp?classid="+classid+"&sel="+str+"&fieldname="+MenuFieldArr[classid+1]
http_request.open("GET",linkurl,false);
http_request.send(null);
//服务器端处理返回的是经过escape编码的字符串.
//在页面显示服务器查询结果
var returntxt=unescape(http_request.responseText)
/*if(returntxt.length>0)
{document.all,ajax.innerHTML="服务器返回结果:<font color='red'>"+returntxt+"</font> [Powered by AJAX]"}
else
{document.all,ajax.innerHTML=""}*/
//通过XMLHTTP返回数据,开始构建Select.
//BuildSel(returntxt,eval("document.all."+MenuIdArr[classid+1]))
BuildSel(returntxt,document.getElementById(MenuIdArr[classid+1]))
//============更改下下级以下菜单为空==============
var kkk
for(kkk=classid+2;kkk<=MenuClass;kkk++)
{
submenu=document.getElementById(MenuIdArr[kkk])
submenu.length=1
submenu.options[0].selected=true
}
}
function BuildSel(str,sel)
{
/*
*--------------- BuildSel(str,sel) -----------------
* BuildSel(str,sel)
* 功能:通过str构建Select.
* 参数:str,字符串,由服务端返回的.有特定结构"字符串1|,字符串2,字符串3"
* 也可为"字符串1序号|字符串1文本,字符串2序号|字符串2文本,字符串3序号|字符串3文本",如本例
* 参数:sel,要构建的Select
* 实例:BuildSel(unescape(oBao.responseText),document.all.sel2)
*--------------- BuildSel(str,sel) -----------------
*/
//先清空原来的数据.
sel.options.length=0;
var arrstr = new Array();
arrstr = str.split(",");
//开始构建新的Select.
sel.options.add(new Option( "---请选择---",""));
if(str.length>0)
{
for(var i=0;i<arrstr.length;i++)
{
//分割字符串
var subarrstr=new Array
subarrstr=arrstr[i].split("|")
//生成下级菜单
sel.options.add(new Option(subarrstr[1],subarrstr[0]));
}
sel.options[0].selected=true
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -