⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_product.asp

📁 后台管理系统
💻 ASP
字号:
<!--#include file="cookies.asp"-->
<!--#include file="conn.asp"-->
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from product_small_sort order by sx ",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("Sort"))%>","<%= rs("big_sortid")%>","<%= rs("id")%>","<%=rs("sort_width")%>","<%=rs("sort_height")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;


function changelocation(locationid)
    {
    document.myform.sort_id.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            {
            document.myform.sort_id.options[document.myform.sort_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    
	function changelocation_small(locationid)
    {
    var locationid=locationid;
    var j;
    for (j=0;j < onecount; j++)
        {
            if (subcat[j][2] == locationid)
            {
             document.myform.sort_width.value = subcat[j][3];
			 document.myform.sort_height.value = subcat[j][4];
			 break;
            }        
        }
        
    }    
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>爱斯特淋浴设备有限公司管理后台</title>
<link href="../file/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../js/validator.js"></script>
</head>

<body>
<form name="myform" method="post" action="save_product.asp?action=add" onSubmit="return Validator.Validate(this,2)">
<table cellpadding="2" cellspacing="1" border="0" width="96%" class="tableBorder" align=center>
    <tr bgcolor="#f0f0f0">
      <th height="25" colspan="2"><strong>
        发布产品信息
      </strong></th>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">类别:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><%
	rs.open "select * from product_sort order by sx",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
          <select name="big_sortid" size="1" id="big_sortid" onChange="changelocation(document.myform.big_sortid.options[document.myform.big_sortid.selectedIndex].value);changelocation_small(document.myform.sort_id.options[document.myform.sort_id.selectedIndex].value);">
            <option selected value="<%=rs("id")%>"><%=trim(rs("sort"))%></option>
            <%      dim selclass
         selclass=rs("id")
        rs.movenext
        do while not rs.eof
%>
            <option value="<%=rs("id")%>"><%=trim(rs("sort"))%></option>
            <%
        rs.movenext
        loop
		end if
        rs.close
%>
          </select>
        &nbsp;小类:
        <select name="sort_id" dataType="Require"  msg="请选择产品小类,没有小类的请先添加产品小类!" onChange="changelocation_small(document.myform.sort_id.options[document.myform.sort_id.selectedIndex].value)">
            <%rs.open "select * from product_small_sort where big_sortid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
            <option selected value="<%=rs("id")%>"><%=rs("sort")%></option>
            <% rs.movenext
do while not rs.eof%>
            <option value="<%=rs("id")%>"><%=rs("sort")%></option>
            <% rs.movenext
loop
end if
        rs.close
        set rs = nothing
%>
          </select>
          <font color="red">*</font> </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="100" height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">名称:</td>
      <td width="628" bgcolor="#FFFFFF" class="TableRow2"><input name="product_name" type="text" class="form2" id="product_name" dataType="Require"  msg="产品名称不能为空!">
          <font color="red">*</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">型号:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="product_sort" type="text" class="form2" id="product_sort"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">小图片:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="small_img" type="text" class="form2" id="small_img" size="30">
          <font color="gray">
          <input type="button" name="Submit22" value="上传小图片" onClick="window.open('../upimg.asp?formname=myform&editname=small_img&uppath=../up_pic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
        </font>&nbsp; <font color="gray">(注意您已经设置好的图片大小规格,否则首页图片会变形)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">小图宽度:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="sort_width" type="text" class="form2" size="10" id="sort_width">
          <font color="gray">(此处是你已经设置好的默认本类别宽度,可以更改)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">小图高度:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="sort_height" type="text" class="form2" id="sort_height" size="10">
          <font color="gray">(此处是你已经设置好的默认本类别高度,可以更改
            
      )</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">大图片:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="big_img" type="text" class="form2" id="big_img" size="30">
        &nbsp;
        <input type="button" name="Submit2" value="上传大图片" onClick="window.open('../upimg.asp?formname=myform&editname=big_img&uppath=../up_pic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
      <font color="gray">(建议将图片大小的宽度不要超过350,可事行在photoshop中处理)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">是否推荐:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="tuijian" type="checkbox" id="tuijian" value="1">
          <font color="gray">(打&quot;√&quot;则为推荐产品)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" bgcolor="#FFFFFF" class="TableRow2">是否显示:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input name="pass" type="checkbox" id="pass" value="1" checked>
          <font color="gray">(打&quot;√&quot;则会在网页上面显示,否则只在后台显示)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" valign="middle" bgcolor="#FFFFFF" class="TableRow2">发布人:</td>
      <td valign="middle" bgcolor="#FFFFFF" class="TableRow2"><input name="sub_person" type="text" class="form2" id="sub_person" value="AST">
          <font color="gray">(填写发布人姓名或者发布单位名称)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" valign="middle" bgcolor="#FFFFFF" class="TableRow2">排序:</td>
      <td valign="middle" bgcolor="#FFFFFF" class="TableRow2"><input name="sx" type="text" class="form2" id="sx" size="10">
          <font color="gray">(此处填数字,用于排列产品的顺序)</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25" align="right" valign="top" bgcolor="#FFFFFF" class="TableRow2">产品信息:</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><textarea name="product_info" cols="70" rows="20" id="product_info" ></textarea>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="35" bgcolor="#FFFFFF" class="TableRow2">&nbsp;</td>
      <td bgcolor="#FFFFFF" class="TableRow2"><input type="submit" name="Submit" value=" 提 交 ">
          <input type="reset" name="Submit" value=" 重 置 "></td>
    </tr>
  </table>
    <script language="javascript">
			changelocation_small(document.myform.sort_id.options[document.myform.sort_id.selectedIndex].value);
			</script>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -