📄 add.asp
字号:
<!--#include file="../manage/check-0.asp"-->
<!--#include file="../conn/conn.asp" -->
<%
dim rs
dim count
set rs = conn.execute("select * from sia_class order by claid asc")
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("claname"))%>","<%= trim(rs("clid"))%>","<%= trim(rs("claid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.claid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.claid.options[document.myform.claid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<link href="../conn/css.css" rel="stylesheet" type="text/css">
<form action="add-end.asp" method="post" name="myform" id="myform">
<script language="javascript">
<!--//
function checksignup() {
if ( document.myform.clid.value == '' ) {
window.alert('请选择产品类别!!');
document.myform.clid.focus();
}
else if ( document.myform.claid.value == '' ) {
window.alert('小类别不能为空,请先加入该大类下的小类别!!');
document.myform.claid.focus();
}
else if ( document.myform.stock.value == '' ) {
window.alert('产品数量不能为空!!');
document.myform.stock.focus();
}
else if (isNaN( document.myform.stock.value)) {
window.alert('产品数量只能是数字!!');
document.myform.stock.focus();
}
else if ( document.myform.code.value == '' ) {
window.alert('请输入产品编号!!');
document.myform.code.focus();
}
else if ( document.myform.proname.value == '' ) {
window.alert('请输入产品名称!!');
document.myform.proname.focus();
}
else if ( document.myform.proprice.value == '' ) {
window.alert('请输入产品售价!!');
document.myform.proprice.focus();
}
else if (isNaN( document.myform.proprice.value)) {
window.alert('请输入产品售价,只能是数字!!');
document.myform.proprice.focus();
}
else if ( document.myform.company.value == '' ) {
window.alert('请输入产品产地或厂家!!');
document.myform.company.focus();
}
else if ( document.myform.info.value == '' ) {
window.alert('请输入产品介绍!!');
document.myform.info.focus();
}
else if (document.myform.info.value.length>5000)
{
window.alert("产品介绍不能超过5000字!");
document.myform.info.focus();
}
else {
return true;
}
return false;
}
//-->
</script>
<table width="500" align="center" cellpadding="0" cellspacing="2">
<tr valign="middle">
<td height="25" colspan="4" bgcolor="#CCCCCC"><font color="#FF3333">>>产品添加</font></td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品类别</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<%
set rs = conn.execute("select * from sia_category")
if rs.eof and rs.bof then
response.write "请先添加类别。"
response.end
else
%> <select name="clid" size="1" class="textbox" onChange="changelocation(document.myform.clid.options[document.myform.clid.selectedIndex].value)">
<option value="" selected>==请选大类别==</option>
<%do while not rs.eof%>
<option value="<%=trim(rs("clid"))%>"><%=trim(rs("clname"))%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
conn.Close
set conn = nothing
%>
</select> <select name="claid" class="textbox">
<option selected value="">==请选小类别==</option>
</select></td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品数量</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="stock" type="text" class="textbox" id="stock" size="10" maxlength="20">
<font color="#FF3333">*</font> </td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品编号</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="code" type="text" class="textbox" id="code" size="25" maxlength="25">
<font color="#FF3333">*</font> </td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品名称</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="proname" type="text" class="textbox" id="proname" size="40" maxlength="28">
<font color="#FF3333">*</font> </td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品价格</td>
<td width="98" height="25" bgcolor="#f1f1f1">
<input name="proprice" type="text" class="textbox" id="proprice" size="10" maxlength="20">
<font color="#FF3333">*</font></td>
<td width="75" align="center" bgcolor="#f1f1f1">优惠价格</td>
<td width="232" bgcolor="#f1f1f1">
<input name="disprice" type="text" class="textbox" id="disprice" size="10" maxlength="20">
</td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产地厂家</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="company" type="text" class="textbox" id="company" size="40" maxlength="45">
<font color="#FF3333">*</font> </td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">厂家网址</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="companyurl" type="text" class="textbox" id="companyurl" value="http://" size="40" maxlength="45">
</td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品缩图</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="smallpic" type="text" class="textbox" id="smallpic" size="40" maxlength="50">
<input class="submit" type="button" name="Submit11" value="上传图片" onClick="window.open('../pic_upfile.asp?formname=myform&editname=smallpic&uppath=images/upfile&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
</td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品全图</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="bigpic" type="text" class="textbox" id="bigpic" size="40" maxlength="50">
<input class="submit" type="button" name="Submit11" value="上传图片" onClick="window.open('../pic_upfile.asp?formname=myform&editname=bigpic&uppath=images/upfile&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">产品简介</td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<textarea name="info" cols="60" rows="6" class="textbox" id="info"></textarea>
<font color="#FF3333">*</font></td>
</tr>
<tr valign="middle">
<td width="120" height="25" align="center" bgcolor="#f1f1f1">
<input type="checkbox" name="hide" value="true" onFocus="this.blur()">
产品隐藏 </td>
<td height="25" colspan="3" bgcolor="#f1f1f1">
<input name="Submit" type="submit" class="textbox-1" value="提交" ONCLICK="javascript:return checksignup()">
<input name="Submit2" type="reset" class="textbox-1" value="重置"></td>
</tr>
<tr valign="middle">
<td height="25" colspan="4"><font color="#FF9966"><strong>注:</strong></font>产品类别您可自己编号,以科学的管理您的产品。<br>
如果产品的优惠售价为空,则产品优惠售价将自动成为产品价格。<br>
同时须注意产品售价不能小于等于"0"。<br>
产品如果不添加图片信息,将使用默认图片。(admin/images/nopic.gif)
</td>
</tr>
</table>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -