📄 cp_action.asp
字号:
<!--#include file="conn.asp"-->
<%
set rs = server.CreateObject("adodb.recordset")
action = request("action")
filename= request("filename")
filename1= request("filename1")
brand = request("brand")
style = request("Styles")
price = request("price")
brand = request("brand")
mycontent= request("mycontent")
state = request("state")
size=request("size")
'on error resume next
if action = "add" then
sql="select * from hw"
rs.open sql,conn,3,3
rs.addnew
rs("sort_name")=brand
rs("nsort_name")=style
rs("hw_cash")=price
rs("hw_pic")=filename1
rs("hw_pic2")=filename
rs("hw_content")=mycontent
rs("hw_name")=size
rs("tuijian") = state
rs("hw_date") = now()
rs.Update
rs.close
msg = "New record input success!"
elseif action = "edit" then
hw_id = request("hw_id")
sql="select * from hw where hw_id="&hw_id
rs.open sql,conn,3,3
rs("sort_name")=brand
rs("nsort_name")=style
rs("hw_cash")=price
rs("hw_name")=size
if filename1<>"" then
rs("hw_pic")=filename1
end if
if filename<>"" then
rs("hw_pic2")=filename
end if
rs("hw_content")=mycontent
rs("tuijian") = state
rs("hw_date") = now()
rs.Update
rs.close
msg = "Alter record success!"
elseif action = "del_all" then
hw_id = request("hw_id")
strid = split(trim(request("strid")),",")
for i = 0 to ubound(strid)
sql = "delete from hw where hw_id ="&strid(i)
conn.execute(sql)
next
msg = "All selected record has deleted."
elseif action="del" then
hw_id = request("hw_id")
sql="delete from hw where hw_id="&hw_id
conn.execute(sql)
msg="One record has deleted."
else
if result = 0 then
if action = "edit" then
msg = "Alter success"
elseif action = "del" then
msg = "Delete success"
end if
end if
end if
set rs=nothing
if err.number <> 0 then
msg = "Fail,errorcode:" & err.number
end if
%>
<script language="javascript">
window.alert("<%=msg%>");
window.opener.parent.main.location.reload();
self.close();
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -