28,391
社区成员
发帖
与我相关
我的任务
分享
<!--#include file="fun.asp"-->
<%
Sub main()
id=request("id")
if request("act")="add" then
call add_del_update("product","insert","")
response.write "<script language=javascript>alert('添加成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="edit" Then
call add_del_update("product","update",id)
response.write "<script language=javascript>alert('修改成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="del" then
call add_del_update("product","delete",id)
response.write "<script language=javascript>alert('删除成功!');history.go(-1);self.location=document.referrer;</script>"
end If
%>
<%
if request("do")="edit" Then
id=request.querystring("id")
set rst=server.createobject("adodb.recordset")
sql="select * from product where id="&id
rst.open sql,conn,1,1
end If
%>
<div class="maintitle">公司产品<%if request("do")="edit" Then%>修改<%Else%>添加<%end if%></div>
<table border="1" cellpadding="5" cellspacing="0" class="wmain tabcolor">
<form method="post" name="myform" <%if request("do")="edit" Then%>action="?act=edit&id=<%=rst("id")%>"<%Else%>action="?act=add"<%end If%> onsubmit="return CheckForm(this)">
<tr><td><span class="maintit">标题:</span><input name="title" type="text" size="50" <%if request("do")="edit" Then%>value="<%=rst("title")%>"<%end If%> check="^\S+$" warning="栏目不能为空,且不能含有空格"></td></tr>
<tr><td><span class="maintit">日期:</span><input name="riqi" type="text" size="10" <%if request("do")="edit" Then%>value="<%=rst("riqi")%>"<%else%>value="<%=now()%>"<%end if%> check="^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{2}:\d{2}$" warning="日期格式2004-8-10 12:34:54"></td></tr>
<tr><td><span class="maintit">类别:</span>
<%if request("do")="edit" Then%>
<select name="cid">
<%
set rs1=server.createobject("adodb.recordset")
sql = "select * from productclass where big=0"
rs1.open sql,conn,1,1
if rs1.eof and rs1.bof then
response.write "请先添加类别"
else
%>
<%do while not rs1.eof%>
<optgroup <% if rs1("id")=rst("cid") then response.Write("selected") end if%> label="<%=rs1("title")%>"></optgroup>
<%
set rs2=server.createobject("adodb.recordset")
sql = "select * from productclass where big="& rs1("id") &""
rs2.open sql,conn,1,1
if rs2.eof and rs2.bof then
response.write "请先添加类别"
else
%>
<%do while not rs2.eof%>
<option <% if rs2("id")=rst("cid") then response.Write("selected") end if%> value="<%=rs2("id")%>"> <%=rs2("title")%></option>
<%
rs2.movenext
Loop
end If
rs2.close
Set rs2=Nothing
%>
<%
rs1.movenext
Loop
end If
rs1.close
Set rs1=Nothing
%>
</select>
<%else%>
<%=request.querystring("title")%><input name="cid" type="hidden" value="<%=request.querystring("id")%>">
<%end if%></td></tr>
<tr><td><span class="maintit">图片:</span><input name="photo" type="text" maxlength="50" size="25" <%if request("do")="edit" Then%>value="<%=rst("photo")%>"<%else%>value="nopic.jpg"<%end if%>> <iframe src="Form_UpFiles.asp" frameborder=0 scrolling=no width="300" height="22"></iframe></td></tr>
<tr><td><span class="maintit">推荐:</span><input name="tuijian" type="radio" id="tuijian" value="true" <% If request("do")="edit" and rst("tuijian")=true then response.Write("checked") end if%>>是 <input name="tuijian" type="radio" id="tuijian" value="false" <% if request("do")="edit" And rst("tuijian")=false then response.Write("checked") end if%>>否</td></tr>
<tr><td><span class="maintit">内容:</span><br><input type="hidden" name="content" <%if request("do")="edit" Then%>value="<%=Server.HTMLEncode(rst("content"))%>"<%end If%>>
<IFRAME ID="eWebEditor" src="../eWebEditor/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="548" height="350"></IFRAME></td></tr>
<tr><td><input type="submit" value="提交"></td></tr>
</table>
</form>
<%
if request("do")="edit" Then
rst.close
Set rst=Nothing
end If
End Sub
%>
<!--#include file="system.asp"-->
<!--#include file="fun.asp"-->
<%
Sub main()
id=request("id")
if request("act")="add" then
call add_del_update("product","insert","")
response.write "<script language=javascript>alert('添加成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="edit" Then
call add_del_update("product","update",id)
response.write "<script language=javascript>alert('修改成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="del" then
call add_del_update("product","delete",id)
response.write "<script language=javascript>alert('删除成功!');history.go(-1);self.location=document.referrer;</script>"
end If
%>
<%
if request("do")="edit" Then
id=request.querystring("id")
set rst=server.createobject("adodb.recordset")
sql="select * from product where id="&id
rst.open sql,conn,1,1
end If
%>
<div class="maintitle">公司产品<%if request("do")="edit" Then%>修改<%Else%>添加<%end if%></div>
<table border="1" cellpadding="5" cellspacing="0" class="wmain tabcolor">
<form method="post" name="myform" <%if request("do")="edit" Then%>action="?act=edit&id=<%=rst("id")%>"<%Else%>action="?act=add"<%end If%> onsubmit="return CheckForm(this)">
<tr><td><span class="maintit">标题:</span><input name="title" type="text" size="50" <%if request("do")="edit" Then%>value="<%=rst("title")%>"<%end If%> check="^\S+$" warning="栏目不能为空,且不能含有空格"></td></tr>
<tr><td><span class="maintit">日期:</span><input name="riqi" type="text" size="10" <%if request("do")="edit" Then%>value="<%=rst("riqi")%>"<%else%>value="<%=now()%>"<%end if%> check="^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{2}:\d{2}$" warning="日期格式2004-8-10 12:34:54"></td></tr>
<tr><td><span class="maintit">类别:</span>
<%if request("do")="edit" Then%>
<select name="cid">
<%
set rs1=server.createobject("adodb.recordset")
sql = "select * from productclass where big=0"
rs1.open sql,conn,1,1
if rs1.eof and rs1.bof then
response.write "请先添加类别"
else
%>
<%do while not rs1.eof%>
<optgroup <% if rs1("id")=rst("cid") then response.Write("selected") end if%> label="<%=rs1("title")%>"></optgroup>
<%
set rs2=server.createobject("adodb.recordset")
sql = "select * from productclass where big="& rs1("id") &""
rs2.open sql,conn,1,1
if rs2.eof and rs2.bof then
response.write "请先添加类别"
else
%>
<%do while not rs2.eof%>
<option <% if rs2("id")=rst("cid") then response.Write("selected") end if%> value="<%=rs2("id")%>"> <%=rs2("title")%></option>
<%
rs2.movenext
Loop
end If
rs2.close
Set rs2=Nothing
%>
<%
rs1.movenext
Loop
end If
rs1.close
Set rs1=Nothing
%>
</select>
<%else%>
<%=request.querystring("title")%><input name="cid" type="hidden" value="<%=request.querystring("id")%>">
<%end if%></td></tr>
<tr><td><span class="maintit">图片:</span><input name="photo" type="text" maxlength="50" size="25" <%if request("do")="edit" Then%>value="<%=rst("photo")%>"<%else%>value="nopic.jpg"<%end if%>> <iframe src="Form_UpFiles.asp" frameborder=0 scrolling=no width="300" height="22"></iframe></td></tr>
<tr><td><span class="maintit">推荐:</span><input name="tuijian" type="radio" id="tuijian" value="true" <% If request("do")="edit" and Not IsNull(rst("tuijian").value) and CBool(rst("tuijian").value)=true then response.Write("checked") end if%>>是 <input name="tuijian" type="radio" id="tuijian" value="false" <% if request("do")="edit" And Not IsNull(rst("tuijian").value) and CBool(rst("tuijian").value)=false then response.Write("checked") end if%>>否</td></tr>
<tr><td><span class="maintit">内容:</span><br><input type="hidden" name="content" <%if request("do")="edit" Then%>value="<%=Server.HTMLEncode(rst("content"))%>"<%end If%>>
<IFRAME ID="eWebEditor" src="../eWebEditor/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="548" height="350"></IFRAME></td></tr>
<tr><td><input type="submit" value="提交"></td></tr>
</table>
</form>
<%
if request("do")="edit" Then
rst.close
Set rst=Nothing
end If
End Sub
%>
<!--#include file="system.asp"-->