📄 addhw.asp
字号:
<%
if session("admin_name")="" then
response.end
end if%>
<!--#include file="../inc/adconn.asp"-->
<!--#include file="../css.asp"-->
<%
if request("action")="save" then
hw_name=request("hw_name")
hw_content=request("hw_content")
hw_cash=request("hw_cash")
chubsh=request("chubsh")
zhuang=request("zhuang")
yeshu=request("yeshu")
isbn=request("isbn")
sort_id=request("sort_id")
Nsort_id=request("Nsort_id")
company=request("company")
pifa=request("pifa")
daili=request("daili")
hwsn=request("hwsn")
data=request("data")
kaiben=request("kaiben")
tuijian=request("tuijian")
hw_pic=request("upfile")
hw_pic2=request("upfile2")
if not(isnumeric(hw_cash)) then
errmsg="<br>"+"<li>作品的价格应该为数字"
founderr=true
end if
if hw_name="" then
errmsg=errmsg+"<br>"+"<li>作品名称不能为空"
founderr=true
end if
if sort_id="" then
errmsg=errmsg+"<br>"+"<li>作品类别不能为空"
founderr=true
end if
if founderr=true then
response.write errmsg
response.write "<br>"
response.write "<a href=addhw.asp>返回</a>"
response.end
else
if hw_pic="" then
hw_pic="images/noimage.gif"
end if
if hw_pic2="" then
hw_pic2="images/noimage.gif"
end if
dim hw_id
set rs=server.createobject("adodb.recordset")
sql="select * from hw"
rs.open sql,conn,3,3
rs.addnew
hw_id=rs("hw_id")
rs("hw_name")=hw_name
rs("hw_content")=hw_content
rs("hw_cash")=hw_cash
rs("sort_id")=sort_id
rs("Nsort_id")=Nsort_id
rs("company")=company
rs("daili")=daili
rs("pifa")=pifa
rs("hw_sn")=hwsn
rs("chubsh")=chubsh
rs("kaiben")=kaiben
rs("yeshu")=yeshu
rs("data")=data
rs("isbn")=isbn
rs("zhuang")=zhuang
rs("tuijian")=tuijian
rs("hw_pic")=hw_pic
rs("hw_pic2")=hw_pic2
rs.update
end if
hw_id=rs("hw_id")
rs.close
response.write("<a href='addhw.asp'>继续添加作品!!!</a>")
%>
<br>
<%else%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<title>添加作品</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from Nsort order by Nsort_id asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nsort_name"))%>","<%= trim(rs("sort_id"))%>","<%= trim(rs("Nsort_id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.Nsort_id.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.Nsort_id.options[document.form1.Nsort_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<SCRIPT language=javascript>
var upfile_obj;
var upfile_obj2;
function OnUpFile()
{
upfile_obj.src=upfile_obj.lowsrc;
upfile_obj.src=document.forms["form1"].upfile.value;
}
function OnUpFile2()
{
upfile_obj2.src=upfile_obj2.lowsrc;
upfile_obj2.src=document.forms["form1"].upfile2.value;
}
</SCRIPT>
<form method="POST" name="form1" action="addhw.asp?action=save">
<INPUT name=upfile onchange=return(OnUpFile()) type=hidden>
<INPUT name=upfile2 onchange=return(OnUpFile2()) type=hidden>
<TABLE cellSpacing=1 cellPadding=0 width="550" align=center bgColor=#999999
border=0>
<TBODY>
<TR>
<TD width="735" bgcolor="f0f0f0" id=maintitleback>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD><IMG height=8 src="../../images/pics/nav_m.gif" width=8
border=0></TD>
<TD width="100%" height="30" valign="bottom" id=maintitle>作品管理 -><b>所有选项都必须填写</b></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR>
<TD id=mainbg>
<TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="435">
<TBODY>
<TR>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium> <div align="center"><font color="#FFFFFF">作品分类</font></div></TD>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium> <div align="center">
<%
sql = "select * from sort"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else%>
<select name="sort_id" onChange="changelocation(document.form1.sort_id.options[document.form1.sort_id.selectedIndex].value)" size="1">
<option selected value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<% dim selclass
selclass=rs("sort_id")
rs.movenext
do while not rs.eof
%>
<option value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select>
<select name="Nsort_id">
<%sql="select * from Nsort where sort_id="&selclass
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option selected value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>
</div></TD>
<TD height="30" align=middle noWrap background=../images/pics/tile_sub.gif id=titlemedium> <div align="center"><font color="#FFFFFF">作品名称</font></div></TD>
<TD height="30" align=center noWrap background=../images/pics/tile_sub.gif id=titlemedium> <input style="FONT-SIZE: 12px; WIDTH: 110px" type="text" name="hw_name" size="20" class=input>
</TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30"> <div align="center"><font color="#FF0000">作品价格</font></div></TD>
<TD width=122 height="30" align=left bgColor=#ffffff> <font color=#333333>
<input style="FONT-SIZE: 12px; WIDTH: 60px" name="pifa" type="text" class=input id="pifa5" size="7">
元</font></TD>
<TD align=middle bgColor=#ffffff height="30"> </TD>
<TD height="30" bgColor=#ffffff> </TD>
<TR>
<TD bgColor=#ffffff height="30"> <div align="center">规格</div></TD>
<TD height="30" align=left bgColor=#ffffff>
<input style="FONT-SIZE: 12px; WIDTH: 110px" type="text" name="chubsh" size="20" class=input value="多种">
</TD>
<TD align=middle bgColor=#ffffff height="30"> <div align="center">成 份
</div></TD>
<TD height="30" bgColor=#ffffff>
<input style="FONT-SIZE: 12px; WIDTH: 110px" type="text" name="kaiben" size="9" class=input value="不详">
</TD>
</TR>
<TR>
<TD align=middle bgColor=#ffffff height="30"> <div align="center">尺寸</div></TD>
<TD height="30" bgColor=#ffffff>
<input name="hwsn" type="text" class=input id="hwsn" style="FONT-SIZE: 12px; WIDTH: 110px" value="不详" size="9">
</TD>
<TD align=center bgColor=#ffffff height="30">联系人</TD>
<TD height="30" bgColor=#ffffff>
<input name="isbn" type="text" class=input id="isbn" style="FONT-SIZE: 12px; WIDTH: 110px" value="不详" size="9"></TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30">
<div align="center"><font color="#FF0000">作品简介</font></div></TD>
<TD height="30" colspan="3" align=center bgColor=#ffffff><input type="hidden" name="hw_content" value=""> <IFRAME ID="eWebEditor1" SRC="../eWebEditor/ewebeditor.asp?id=hw_content&style=standard_coolblue" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME><font color=#ff6600> *</font></TD>
</TR>
<TR>
<TD height="30" colspan="4" bgColor=#ffffff><table width="100%" border="0" cellspacing="0">
<TR>
<TD>上传作品图片 <input name="hw_Content"type=hidden style="display:none"><iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=upload.asp></iframe></TD>
</TR>
</table></TD>
</TR>
<TR>
<TD height="30" colspan="4" bgColor=#ffffff> <div align="center">推荐此作品
<input type="radio" name="tuijian" value="-1">不推荐
<input type="radio" name="tuijian" value="0" checked>
</div></TD>
</TR>
<TR>
<TD height="30" colspan="4" bgColor=#ffffff> <div align="center"></div></TD>
</TR>
<TR>
<TD id=mainfoot colSpan=4 height="30"> <div align="center">
<table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"> <div align="center">
<input name=submit2 type=image src="../IMAGES/pics/s_button000.gif" alt=进入 align=absMiddle width="45" height="20" cache tppabs="" >
</div></td>
<td> <div align="center">
<input type="reset" value="全部重写" name="B22" class=input>
</div></td>
</tr>
</table>
</div></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE></form>
</body>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -