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

📄 productadd.asp

📁 简洁清爽的网站管理管理系统,基本功能都具备了
💻 ASP
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}

function CheckForm()
{
  if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
  else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

  if (document.myform.Title.value=="")
  {
    alert("产品名称?");
	document.myform.Title.focus();
	return false;
  }
  if (document.myform.Product_Id.value=="")
  {
    alert("产品编号?");
	document.myform.Product_Id.focus();
	return false;
  }
  
  if (document.myform.Content.value=="")
  {
    alert("产品说明?");
	editor.HtmlEdit.focus();
	return false;
  }
  return true;  
}

</script>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="862" align="center" valign="top"><br>
        <b> </b>
        <form method="POST" name="myform" onSubmit="return CheckForm();" action="ProductSave.asp?action=add">
          <table width="620" border="0" align="center" cellpadding="2" cellspacing="1" class="table_southidc">
            <tr>
              <td class="back_southidc" height="22" colspan="2" align="right" bgcolor="#C0C0C0"><div align="center"><b>添 加 产 品</b> </div></td>
            </tr>
            <tr>
              <td width="152" height="22" align="right" bgcolor="#C0C0C0">所属栏目:</td>
              <td width="462" bgcolor="#E3E3E3"><%
	if session("purview")=3 or session("purview")=4 then
		response.write rsArticle("BigClassName") & "<input name='BigClassName' type='hidden' value='" & rsArticle("BigClassName") & "'>&gt;&gt;"
	else		
        sql = "select * from BigClass"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
                  <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
                    <%
		    do while not rs.eof
			%>
                    <option <% if rs("BigClassName")=rsArticle("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                    <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
                  </select>
                  <%
	end if
	if session("purview")=4 then
		response.write rsArticle("SmallClassName") & "<input name='SmallClassName' type='hidden' value='" & rsArticle("SmallClassName") & "'>"
	else
	%>
                  <select name="SmallClassName">
                    <option value="" <%if rsArticle("SmallClassName")="" then response.write "selected"%>>不指定小类</option>
                    <%
			sql="select * from SmallClass where BigClassName='" & rsArticle("BigClassName") & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
				do while not rs.eof%>
                    <option <% if rs("SmallClassName")=rsArticle("SmallClassName") then response.Write("selected") end if%> value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
                    <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                  </select>
                  <%
	end if
	%>
              </td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">产品编号:</td>
              <td bgcolor="#E3E3E3"><input name="Product_Id" type="text"
           id="Product_Id" size="9" maxlength="9">
                  <font color="#FF0000">*</font> </td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">产品名称:</td>
              <td bgcolor="#E3E3E3"><input name="Title" type="text"
           id="Title" size="50" maxlength="80">
                  <font color="#FF0000">*</font></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">产品进价:</td>
              <td bgcolor="#E3E3E3"><input name="Buy_price" type="text"
           id="Buy_price" size="10" maxlength="80"></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">产品利润:</td>
              <td bgcolor="#E3E3E3"><input name="Product_Gain" type="text"
           id="price" size="10" maxlength="80">
                  <font color="#FF0000">*(输入产品的利润,如0.1为10%的利润)</font></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">规格:</td>
              <td bgcolor="#E3E3E3"><input name="Spec" type="text"
           id="Spec" size="20" maxlength="80"></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">单位:</td>
              <td bgcolor="#E3E3E3"><input name="Unit" type="text"
           id="spec" size="20" maxlength="80"></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">备注:</td>
              <td bgcolor="#E3E3E3"><input name="Memo" type="text"
           id="unit" size="50" maxlength="80"></td>
            </tr>
            <tr>
              <td height="22" align="right" valign="middle" bgcolor="#C0C0C0">产品说明:</td>
              <td bgcolor="#E3E3E3"></td>
            </tr>
            <tr bgcolor="#E3E3E3">
              <td colspan="2" align="right" valign="middle"><div align="left">
                  <textarea name="Content" style="display:none"></textarea>
                  <iframe ID="editor" src="../editor.asp?Action=add" frameborder=1 scrolling=no width="620" height="405"></iframe>
              </div></td>
            </tr>
            <tr>
              <td width="152" align="right" bgcolor="#C0C0C0">首页图片:
                  <input name="IncludePic" type="hidden" id="IncludePic" value="yes"></td>
              <td colspan="3" bgcolor="#E3E3E3"><input name="DefaultPicUrl" type="text" id="DefaultPicUrl" maxlength="50">
                <input name="Submit44" type="button" class="input" onClick="window.open('upload_flash.asp?formname=myform&editname=DefaultPicUrl&uppath=UploadFiles&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" value="上传">
                <br>
                如要在首显示产品图片,上传                <font color="#FF0000">105x80</font>像素图片,否则不要上传</td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">已通过审核:</td>
              <td bgcolor="#E3E3E3"><input name="Passed" type="checkbox" id="Passed" value="yes" <% if rsArticle("Passed")=true then response.Write("checked") end if%>>
              是<font color="#0000FF">(如果选中的话将直接发布)</font></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">首页显示:</td>
              <td bgcolor="#E3E3E3"><input name="Elite" type="checkbox" id="Elite" value="yes" <% if rsArticle("Elite")=true then response.Write("checked") end if%>>
              是<font color="#0000FF">(如果选中的话将在首页做为新产品显示)</font></td>
            </tr>
            <tr>
              <td height="22" align="right" bgcolor="#C0C0C0">录入时间:</td>
              <td bgcolor="#E3E3E3"><input name="UpdateTime" type="text" id="UpdateTime" value="<%=now()%>" maxlength="50">
              当前时间为:<%=now()%> 注意不要改变格式。</td>
            </tr>
          </table>
          <div align="center">
            <p>
              <input  name="Save" type="submit"  id="Save" value="保存修改结果">
            </p>
          </div>
      </form></td>
  </tr>
</table>
<br>
<!-- #include file="Inc/Foot.asp" -->

⌨️ 快捷键说明

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