📄 admin_book.asp
字号:
<!-- #include file="conn.asp"-->
<%
set rs=server.CreateObject("ADODB.recordset")
rs.open "index",conn,3,3
name=rs("name")
rs.close
set rs=nothing
%>
<title><%=name%>购物--管理系统</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta NAME=GENERATOR Content=""Microsoft FrontPage 4.0"" CHARSET=GB2312>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<%
if request("action")="save" then
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<script language=JavaScript>{window.location='error.asp'}</script>"
response.end
end if
set rs=server.CreateObject("ADODB.recordset")
sql="select * from gys where http='"&request("http")&"'"
rs.open sql,conn,3,3
zzs=rs("zzs")
rs.close
set rs=nothing
set rs=server.CreateObject("ADODB.recordset")
sql="select * from products where zlb='"&request("zlb")&"' order by id desc"
rs.open sql,conn,3,3
if len(request("lb"))=1 then
lb=0&request("lb")
else
lb=request("lb")
end if
if len(request("zlb"))=1 then
zlb=0&request("zlb")
else
zlb=request("zlb")
end if
if rs.recordcount=0 then
item=lb&"-"&zlb&"-"&"0001"
else
item=right(rs("item"),4)+0001
if len(item)=1 then
item="000"&item
elseif len(item)=2 then
item="00"&item
elseif len(item)=3 then
item="0"&item
end if
item=lb&"-"&zlb&"-"&item
end if
rs.close
set rs=nothing
set rs=server.CreateObject("ADODB.recordset")
sql="select * from products where zlb='"&request("zlb")&"' and name='"&request("name")&"' and typed='"&request("typed")&"'"
rs.open sql,conn,3,3
if not rs.eof then
response.write "<script language=JavaScript>{window.alert('对不起,已经有相同的商品名称和型号!');window.history.go(-1)}</script>"
response.end
else
rs.addnew
rs("item")=item
rs("name")=request("name")
rs("typed")=request("typed")
rs("zzs")=zzs
rs("http")=request("http")
rs("content")=request("content")
rs("jiage")=request("jiage")
rs("kucun")=request("kucun")
rs("cp")=request("cp")
rs("lb")=request("lb")
rs("zlb")=request("zlb")
rs("zhongl")=request("zhongl")
rs("image")="pic/"&request("image")
rs("canshu")=request("canshu")
rs("qita")=request("qita")
rs("meiti")=request("meiti")
rs("qudong")=request("qudong")
rs("time")=Now()
rs.update
rs.close
set rs=nothing
end if
set rs=server.CreateObject("ADODB.recordset")
rs.open "pic",conn,3,3
rs.addnew
rs("item")=item
rs("image")="pic/"&request("image")
rs.update
response.write "<script language=JavaScript>{window.alert('商品添加成功!');window.location='admin_book.asp'}</script>"
response.end
rs.close
set rs=nothing
end if
%>
<script language="JAVAScript">
function check_copy()
{
document.addbook.http.value = document.addbook.zzs.value;
}
</script>
<br>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align="center" class="tableBorder">
<form action="admin_book.asp?action=save" method="post" name="addbook">
<tr>
<th width="100%" colspan="2" height="25">添加新商品(注意:先传图片后选类别再填其他资料)</th>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">商品类别</td>
<td width="70%" class="forumrow">大类:
<select name="cpid" onChange="var url=this.options[this.selectedIndex].value ; if(url!='') {window.location=url;} else {this.selectedIndex=0 ;}">
<option value="admin_book.asp?cpid=0" <%if request("cpid")=0 then%>selected<%end if%>>请选择大类名称</option>
<option value="admin_book.asp?cpid=1" <%if request("cpid")=1 then%>selected<%end if%>>IT产品</option>
</select>
中类:
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from lb where cpid="&request("cpid")
rs.open sql,conn,3,3
if rs.eof and rs.bof then
%>
<select name="lbb">
<option>请选择中类名称</option>
</select>
<%else%>
<select name="lbb" onChange="var url=this.options[this.selectedIndex].value ; if(url!='') {window.location=url;} else {this.selectedIndex=0 ;}">
<option>请选择中类名称</option>
<%do while not rs.eof%>
<option value="admin_book.asp?cpid=<%=request("cpid")%>&lbid=<%=rs("id")%>&lbmc=<%=rs("lb")%>" <%if request("lbmc")=rs("lb") then%>selected<%end if%>><%=rs("lb")%></option>
<% rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</select>
小类:
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from zlb where lid="&request("lbid")
rs.open sql,conn,3,3
if rs.eof and rs.bof then
%>
<select name="zlb">
<option>选择小类名称</option>
</select>
<%else%>
<select name="zlb">
<%do while not rs.eof%>
<option value="<%=rs("id")%>"><%=rs("zlb")%></option>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</select>
<input type="hidden" name="cp" value="<%=request("cpid")%>">
<input type="hidden" name="lb" value="<%=request("lbid")%>">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">商品名称</td>
<td width="70%" height="25" class="forumrow">
<input name="name" size="40">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">商品型号</td>
<td width="70%" class="forumrow">
<input name="typed" size="40">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">制 造 商</td>
<td width="70%" class="forumrow">
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from gys order by id"
rs.open sql,conn,3,3
%>
<select name="zzs" onchange="check_copy()">
<%do while not rs.eof%>
<option value="<%=rs("http")%>"><%=rs("zzs")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">制造商网址</td>
<td width="70%" class="forumrow">
<input name="http" size="40" value="#">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">商品价格</td>
<td width="70%" class="forumrow">
<input name="jiage" size="40">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">商品重量</td>
<td width="70%" class="forumrow">
<input name="zhongl" size="40">
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">首页图片</td>
<td width="70%" class="forumrow">
<input name="image" size="40" value="<%if session("pic")="" then%>none.gif<%else%><%=session("pic")%><%end if%>">
<a href="upload.asp?url=admin_book.asp"><font color="#ff0000"> (图片上传)</font></a>
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow"><font color="#000000"><b>
产 品 性 能 指 标</b></font></td>
<td width="70%" class="forumrow" rowspan="4">
<span style="cursor: hand;color:blue;font-size: 9pt" onClick="window.open('htmledit/editor.html','HTMLEditor','width=544,height=300,resizable=0,scrollbars=0,menubar=0,status=0');" Language="javascript">HTML 编辑器</span>
<br>
<textarea name="content" cols="90" rows="35"></textarea>
</td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow"> </td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow"> </td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow"> </td>
</tr>
<tr>
<td width="30%" height="25" class="forumrow">联系方式</td>
<td width="70%" class="forumrow">
<textarea name="qudong" cols="56" rows="6"></textarea>
<textarea rows="6" name="S1" cols="36"><table borderColor="#FFFFFF" cellSpacing="0" cellPadding="0" width="550" bgColor="#666666" border="1" id="table1" height="156"> <tr align="left" bgColor="#999999"> <td colSpan="2" bgcolor="#84DE0A"><font color="#FFFFFF"><b>联系本公司方式:</b></font></td> </tr> <tr bgColor="#ffffff"> <td class="unnamed1" width="80" bgcolor="#D3FB9F" height="28"><b> 地 址:</b></td> <td class="unnamed2" width="464" bgcolor="#D3FB9F" height="28"> 广西钦州市新兴西路93号(便民市场斜对面)</td> </tr> <tr bgColor="#ffffff"> <td class="unnamed1" width="80" bgcolor="#D3FB9F" height="26"><b> 邮 编:</b></td> <td class="unnamed2" width="464" bgcolor="#D3FB9F" height="26"> 535000</td> </tr> <tr bgColor="#ffffff"> <td class="unnamed1" width="80" bgcolor="#D3FB9F" height="26"><b> 电 话:</b></td> <td class="unnamed2" width="464" bgcolor="#D3FB9F" height="26"> 0777-2100188 2100198</td> </tr> <tr bgColor="#ffffff"> <td class="unnamed1" width="80" bgcolor="#D3FB9F" height="28"><b> 传 真:</b></td> <td class="unnamed2" width="464" bgcolor="#D3FB9F" height="28"> 0777-2873925</td> </tr> <tr bgColor="#ffffff"> <td class="unnamed1" width="80" bgcolor="#D3FB9F"><b> 手 机:</b></td> <td class="unnamed2" width="464" bgcolor="#D3FB9F"> 13317777288 (赖快昌) 13317775818 (赖懂昌)</td> </tr> </table></textarea></td>
</tr>
<tr>
<td height="15" colspan="2" class="forumrow">
<input type="submit" style="CURSOR:hand" value="添 加">
</td>
</tr>
</form>
</table><br>
<%
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -