📄 admin_product.asp
字号:
<tr><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=product&upname=<%response.write "pb"&ispic%>&uptext=picb'></iframe></td></tr>
</table></td></tr>
<tr><td colspan=2 align=center height=25><input type=submit value=' 修 改 产 品 '></td></tr>
</form></table><%
end if
end sub
sub news_add()
if trim(request.querystring("add"))="chk" then
name=code_admin(request.form("name"))
csid=trim(request.form("csid"))
remark_1=request.form("remark_1")
remark_2=request.form("remark_2")
price_1=trim(request.form("price_1"))
price_2=trim(request.form("price_2"))
smallimg=trim(request.form("pics"))
bigimg=trim(request.form("picb"))
serial=code_admin(request.form("serial"))
brand=code_admin(request.form("brand"))
stock=code_admin(request.form("stock"))
isgood=trim(request.form("isgood"))
hidden=trim(request.form("hidden"))
down_url=code_admin(request.form("down_url"))
down_remark=code_admin(request.form("down_remark"))
if len(csid)<1 then
response.write "<font class=red_2>请选择产品类型!</font><br><br>"&go_back
elseif len(name)<1 or not(isnumeric(price_1)) or not(isnumeric(price_2)) then
response.write "<font class=red_2>产品名称和产品价格不能为空!</font><br><br>"&go_back
elseif len(remark_1)>250 then
response.write "<font class=red_2>产品简介不能超过250个字!</font><br><br>"&go_back
else
call chk_cid_sid()
set rs=server.createobject("adodb.recordset")
sql="select * from "&data_name
rs.open sql,conn,1,3
rs.addnew
rs("c_id")=cid
rs("s_id")=sid
rs("name")=name
rs("remark_1")=remark_1
rs("remark_2")=remark_2
rs("price_1")=price_1
rs("price_2")=price_2
if len(smallimg)<3 then smallimg="no_pic.gif"
rs("smallimg")=smallimg
if len(bigimg)<3 then bigimg="no_pic.gif"
rs("bigimg")=bigimg
rs("serial")=serial
rs("brand")=brand
rs("stock")=stock
rs("down_url")=down_url
rs("down_remark")=down_remark
if isgood="yes" then
rs("isgood")=true
else
rs("isgood")=false
end if
if hidden="yes" then
rs("hidden")=false
else
rs("hidden")=true
end if
rs("tim")=now_time
rs("counter")=0
rs("buy_counter")=0
rs.update
rs.close:set rs=nothing
call upload_note(data_name,first_id(data_name))
response.write "<font class=red>已成功添加了一个产品!</font><br><br><a href='?c_id="&cid&"&s_id="&sid&"'>点击返回</a><br><br>"
end if
else
%><table border=0 width='100%' cellspacing=0 cellpadding=1>
<form name='add_frm' action='<%response.write pageurl%>add=chk' method=post>
<input type=hidden name=upid value=''>
<tr><td width='14%' align=center>产品名称:</td><td width='86%'><input type=text size=70 name=name maxlength=50><%=redx%></td></tr>
<tr><td align=center>产品类型:</td><td><%call chk_csid(cid,sid)%> 推荐:<input type=checkbox name=isgood value='yes'> 选上为推荐 隐藏:<input type=checkbox name=hidden value='yes'> 选上为隐藏</td></tr>
<tr><td align=center>市场价格:</td><td><input type=text size=15 name=price_1 maxlength=10> 会员价格:<input type=text size=15 name=price_2 maxlength=10> <%response.write redx%>(价格只能为数字)</td></tr>
<tr><td align=center>产品品牌:</td><td><input type=text size=15 name=brand maxlength=20> 产品编号:<input type=text size=15 name=serial maxlength=20> 库存:<select name=stock size=1>
<option>有货</option>
<option>紧张</option>
<option>暂缺</option>
</select> </td></tr>
<tr><td align=center>相关下载:</td><td><input type=text size=70 name=down_url maxlength=100></td></tr>
<tr><td align=center>下载说明:</td><td><input type=text size=70 name=down_remark maxlength=50></td></tr>
<tr><td valign=top align=center><br>产品简介:<br><=250B</td><td><textarea name=remark_1 rows=5 cols=70></textarea></td></tr>
<tr height=35<%response.write format_table(3,1)%>><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb("add_frm","remark_2"," ")%></td></tr>
<tr><td valign=top align=center><br>详细说明:</td><td><textarea name=remark_2 rows=8 cols=70></textarea></td></tr>
<%ispic=upload_time(now_time)%>
<tr><td align=center>小 图 片:</td><td><table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td><input type=text name=pics size=40 maxlength=50></td></tr>
<tr><td><iframe frameborder=0 name=upload_frames width='100%' height=30 scrolling=no src='upload.asp?uppath=product&upname=<%response.write "ps"&ispic%>&uptext=pics'></iframe></td></tr>
</table></td></tr>
<tr><td align=center>大 图 片:</td><td><table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td><input type=text name=picb size=40 maxlength=50> <a href='upload.asp?uppath=product&upname=<%response.write "pb"&ispic%>&uptext=picb' target=upload_frame>上传图片</a> <a href='upload.asp?uppath=product&upname=<%response.write "p"%>&uptext=remark_2' target=upload_frame>上传至详细说明</a></td></tr>
<tr><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=product&upname=<%response.write "pb"&ispic%>&uptext=picb'></iframe></td></tr>
</table></td></tr>
<tr><td colspan=2 align=center height=25><input type=submit value=' 添 加 产 品 '></td></tr>
</form></table><%
end if
end sub
sub news_main()
%>
<script language=javascript src='style/admin_del.js'></script>
<table border=0 width='100%' cellpadding=2>
<tr valign=top height=350>
<td width='25%' class=htd><br><%call left_sort()%></td>
<td width='75%' align=center>
<table border=0 width='98%' cellspacing=0 cellpadding=0>
<form name=del_form action='<%=pageurl%>del_ok=ok' method=post>
<tr><td width='6%'></td><td width='81%'></td><td width='13%'></td></tr>
<%
call sql_cid_sid()
sql="select id,c_id,s_id,name,isgood,hidden from "&data_name&sqladd&" order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rssum=0
else
rssum=rs.recordcount
end if
call format_pagecute()
del_temp=nummer
if rssum=0 then del_temp=0
if int(page)=int(thepages) then
del_temp=rssum-nummer*(thepages-1)
end if
%>
<tr><td colspan=3 align=center height=25>
现有<font class=red><%response.write rssum%></font>篇文章 <%response.write "<a href='?action=add&c_id="&cid&"&s_id="&sid&"'>添加文章</a>"%>
<input type=checkbox name=del_all value=1 onClick=selectall('<%response.write del_temp%>')> 选中所有 <input type=submit value='删除所选' onclick=""return suredel('<%response.write del_temp%>');"">
</td></tr>
<tr><td colspan=3 height=1 bgcolor=#ededede></td></tr>
<%
if int(viewpage)<>1 then
rs.move (viewpage-1)*nummer
end if
for i=1 to nummer
if rs.eof then exit for
now_id=rs("id"):ncid=rs("c_id"):nsid=rs("s_id")
response.write article_center()
rs.movenext
next
rs.close:set rs=nothing
%></form>
<tr><td colspan=3 height=1 bgcolor=#ededede></td></tr>
<tr><td colspan=3 height=25>页次:<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>
分页:<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr></table>
</td></tr></table>
<%
end sub
function article_center()
article_center=VbCrLf & "<tr"&mtr&">" & _
VbCrLf & "<td>" & i+(viewpage-1)*nummer & ". </td><td>" & _
VbCrLf & "<a href='?action=edit&c_id="&ncid&"&s_id="&nsid&"&id=" & now_id & "'>" & cuted(rs("name"),30) & "</a>" & _
"</td><td align=right><a href='?action=hidden&c_id="&cid&"&s_id="&sid&"&id="&now_id&"'>"
if rs("hidden")=true then
article_center=article_center&"显"
else
article_center=article_center&"<font class=red_2>隐</font>"
end if
article_center=article_center&"</a> <a href='?action=isgood&c_id="&cid&"&s_id="&sid&"&id="&now_id&"'>"
if rs("isgood")=true then
article_center=article_center&"<font class=red>是</font>"
else
article_center=article_center&"否"
end if
article_center=article_center&"</a><input type=checkbox name=del_id value='"&now_id&"'></td></tr>"
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -