📄 admin_editinfo.asp
字号:
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="include/access.asp"-->
<%
subname0 = request("subname0")
action = request("action")
IndexNO = request("SubIndexNO")
InfoName = request("InfoName")
InfoNote = request("InfoNote")
InfoPrice = request("InfoPrice")
action = request("action")
if instr(IndexNO,"||||") > 0 then
SBIndexNO = split(IndexNO,"||||")
SubIndexNO = SBIndexNO(0)
BigIndexNO = SBIndexNO(1)
end if
if instr(IndexNO,"||||") <= 0 and subname0 <> "" then
response.write "对不起,请选择小类"
response.end
end if
if isNum(request("InfoID")) then
InfoID = cint(request("InfoID"))
end if
if isNum(request("NInfoID")) then
NInfoID = cint(request("NInfoID"))
end if
if isNum(request("InfoPrice")) then
InfoPrice = clng(request("InfoPrice"))
end if
if isNum(request("InfoStatus")) then
InfoStatus = cint(request("InfoStatus"))
end if
if action = "add" and subname0 <> ""then
action = "add"
sql = "insert into [Info] (InfoName,InfoNote,InfoStatus,InfoPrice,SubIndexNO,BigIndexNO) values ('"&InfoName&"','"&InfoNote&"',"&InfoStatus&","&InfoPrice&",'"&SubIndexNO&"','"&BigIndexNO&"')"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
response.write "<script>alert('添加信息成功');</script>"
end if
if request("action") = "add" then
action = "add"
submittext = "添加"
else
action = "add"
submittext = "添加"
end if
if request("action") = "edit" and subname0 <> "" then
sql = "select * from [Info] where InfoID = "&InfoID&""
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof then
response.write "<script>alert('该信息不存在');</script>"
else
sql = "update [Info] set InfoName = '"&InfoName&"',InfoNote = '"&InfoNote&"',InfoStatus = "&InfoStatus&",InfoPrice = "&InfoPrice&",SubIndexNO = '"&SubIndexNO&"',BigIndexNO = '"&BigIndexNO&"' where InfoID = "&InfoID&""
response.write sql
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
end if
response.write "<script>alert('编辑成功');</script>"
end if
if request("action") = "edit" then
action = "edit"
submittext = "编辑"
else
action = "add"
submittext = "添加"
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=MSThemeCompatible content=Yes>
<LINK href="images/css.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.0" name=GENERATOR>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<%
sql = "select * from [Info] where InfoID = "&InfoID&""
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
SoldStaus = rs("InfoStatus")
InfoName = rs("InfoName")
InfoNote = rs("InfoNote")
InfoPrice = rs("InfoPrice")
UserID = rs("UserID")
SubIndexNO = rs("SubIndexNO")
select case SoldStaus
case 0
getstatus = "出售"
case 1
getstatus = "求购"
end select
end if
%>
<form method="post" action="?action=<%=action%>">
<table width="570" border="0" align="center" cellpadding="0" cellspacing="2" bordercolor="#999999">
<tbody>
<tr class="line_1">
<td width="79" height="25" align="right"> </td>
<td colspan="2"> </td>
</tr>
<tr class="line_1">
<td height="25" align="right">种类: </td>
<td colspan="2">
<select name="InfoStatus" id="InfoStatus">
<% if getstatus = "出售" then%>
<option value=0 selected="yes">出 售</option>
<option value=1>求 购</option>
<%else%>
<option value=0>出 售</option>
<option value=1 selected="yes">求 购</option>
<%end if%>
</select>
*务必选正确</td>
</tr>
<tr class="line_1">
<td height="25" align="right">分类: </td>
<td colspan="2">
<select name="SubIndexNO">
<%
sql = "select SubIndexNO,BigIndexNO from [Info] where InfoId = "&InfoID&""
set rs = conn.execute(sql)
NSubIndexNO = rs(0)
NBigIndexNO = rs(1)
sql = "select * from BigClass"
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof and not rs.bof
%>
<option value="<%=rs("BigIndexNO")%>">+<%=rs("BigName")%></option>
<%
sql = "select * from SubClass where BigIndexNO = '"&rs("BigIndexNO")&"'"
response.write sql
set rs1 = server.CreateObject("adodb.recordset")
rs1.open sql,conn,1,1
do while not rs1.eof and not rs1.bof
if NSubIndexNO = rs1("SubIndexNO") then
%>
<option value=<%=rs1("SubIndexNO")&"||||"&rs("BigIndexNO")%> selected>--<%=rs1("SubName")%></option>
<% else
%>
<option value=<%=rs1("SubIndexNO")&"||||"&rs("BigIndexNO")%>>--<%=rs1("SubName")%></option>
<% end if
rs1.movenext
loop
rs.movenext
loop
%>
</select>
如果不做修改,将保持原来的分类 </td>
</tr>
<tr class="line_1">
<td height="25" align="right">标题: </td>
<td colspan="2">
<input name="InfoName" id="InfoName" maxlength="20" type="text" value=<%=InfoName%>>
*请直接描述产品,请勿使用不雅字眼,亦不用写求或供</td>
</tr>
<tr class="line_1">
<td height="25" align="right">价格: </td>
<td colspan="2">
<input name="InfoPrice" id="InfoPrice" maxlength="5" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" type="text" value=<%=InfoPrice%>>
元 *请使用整数,求购信息不能确定价格时请写0</td>
</tr>
<tr valign="top" class="line_1">
<td height="135" align="right">内容: </td>
<td width="372">
<textarea name="InfoNote" id="InfoNote" cols="70" rows="10"><%=InfoNote%></textarea>
</td>
<td width="119" valign="middle">*内容请详细描述您的物品,诸如几成新等等。请注明交易方式、时间、联系方法</td>
</tr>
<tr class="line_1">
<td align="right">商品图片: </td>
<td colspan="2">
<input name="pic" id="pic" type="text" value=<%=InfoPic%>>
*上传图片后该项系统自动填写</td>
</tr>
<tr>
<td colspan="3" class="line_2">
<iframe src="writeInfo_files/upfile.htm" frameborder="0" height="30" scrolling="no" width="100%"></iframe></td>
</tr>
<tr class="line_1">
<td height="25" align="right">有效期: </td>
<td colspan="2"> 10 天</td>
</tr>
<tr class="line_1">
<td height="25" align="right">手机/电话: </td>
<td colspan="2">
<input name="phone" id="phone" maxlength="20" type="text">
<input name="InfoID" id="InfoID" type="hidden" value=<%=InfoID%>>
*在内容中注明了其他联系方式,此项可以不填</td>
</tr>
<tr class="line_1">
<td align="right">信息推送: </td>
<td colspan="2">
<input name="ifpush" id="ifpush" value="push" type="checkbox">
*若选择该项系统将会发送小纸条提示与你这条信息相关的信息(详情请参阅帮助)</td>
</tr>
<tr class="line_1">
<td align="right"> </td>
<td colspan="2"> </td>
</tr>
<tr class="line_1">
<td></td>
<td height="25" colspan="2" align="left">
<%if request("action") = "edit" then%>
<input name="subname0" type="submit" id="subname0" value="编辑信息">
<%else
%>
<input name="subname0" type="submit" id="subname0" value="添加信息">
<%end if%>
</td>
</tr>
<tr class="line_1">
<td align="right"> </td>
<td colspan="2"> </td>
</tr>
<tr class="line_1">
<td height="25" align="right">提示:</td>
<td colspan="2"> </td>
</tr>
<tr class="line_1">
<td height="25" align="right">1.</td>
<td colspan="2"> 请在发布信息前先搜索</td>
</tr>
<tr class="line_1">
<td height="25" align="right">2.</td>
<td colspan="2"> 如您发布信息成功后发现信息有误,请到用户面板中修改信息</td>
</tr>
<tr class="line_1">
<td height="25" align="right">3.</td>
<td colspan="2"> 如果该信息已成交,请到用户面板中修改信息状态,防止别人打扰</td>
</tr>
<tr class="line_1">
<td height="25" align="right"></td>
<td colspan="2"> </td>
</tr>
</tbody>
</table>
</form>
<BR>
<BR>
<BR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -