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

📄 addbook.asp

📁 超市管理系统数据库脚本和数据库备份超市管理系统数据库脚本和数据库备份
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');history.go(-1);</script>"
response.End
end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass order by Nclassidorder ",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("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;

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

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
             document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<body bgcolor="#799AE1">
<table width="80%" border="0" cellspacing="0" cellpadding="1" bordercolor="#336699" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td background="../images/back_3.gif" rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6B8FC8">
                          <tr> 
                            <td bgcolor="#FFFFFF" height="20"> 
                              <div align="center"><font color="#000000">添加新图片</font></div>
                            </td>
                          </tr>
                          <tr> 
                            <form name="myform" method="post" action="saveaddbook.asp?action=add">
                              <td height="126" bgcolor="#E8F1FF"> 
                                <table width="707" border="0" align="center" cellpadding="2" cellspacing="0">
                                  <tr> 
                                    <td width="52"> </td>
                                    <td width="71" align="right">选择分类: </td>
                                    <td colspan="2" width="572"> <%
        rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%> 
                                      <select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                                        <option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                                        <%      dim selclass
         selclass=rs("anclassid")
        rs.movenext
        do while not rs.eof
%> 
                                        <option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                                        <%
        rs.movenext
        loop
	end if
        rs.close
%> 
                                      </select>
                                      小类: 
                                      <select name="Nclassid">
                                        <%rs.open "select * from shop_Nclass where anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%> 
                                        <option selected value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                                        <% rs.movenext
do while not rs.eof%> 
                                        <option value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                                        <% rs.movenext
loop
end if
        rs.close
        set rs = nothing
%> 
                                      </select>
                                      <font color="#FF0000">&nbsp;</font></td>
                                  </tr>
                                  <tr> 
                                    <td rowspan="2" width="52"> </td>
                                    <td width="71" align="right">图片名称:</td>
                                    <td colspan="2" width="572"> 
                                      <input name="bookname" type="text" id="bookname" size="30">
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td width="71" align="right"> 
 </td>
                                    <td colspan="2" width="572"> 
                                       </td>
                                  </tr>
                                  <tr> 
                                    <td height="18" width="52">&nbsp;</td>
                                    <td height="18" width="71" align="right">图片来源:</td>
                                    <td height="18" colspan="2" width="572"> 
                                      <input name="bookpic1" type="text" id="bookpic" size="30">
                                      &nbsp;&nbsp; 
                                      <input type="button" name="Submit2" value="上传小图片" onClick="window.open('../upload_flash.asp?formname=myform&editname=bookpic1&uppath=bookpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td height="18" width="52">&nbsp;</td>
                                    <td height="18" width="71" align="right">&nbsp; </td>
                                    <td height="18" colspan="2" width="572"> 
                                      <input name="zhuang" type="text" id="bookpic" size="30">
                                      &nbsp;&nbsp; 
                                      <input type="button" name="Submit2" value="上传大图片" onClick="window.open('../upload_flash.asp?formname=myform&editname=zhuang&uppath=bookpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td valign="top" width="52"> </td>
                                    <td valign="top" width="71" align="right">图片说明:</td>
                                    <td colspan="2" width="572"> 
                                      <textarea name="bookcontent" cols="46" rows="8" id="bookcontent"></textarea>
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td valign="top" width="52"> </td>
                                    <td valign="top" width="71" align="right">相关知识:</td>
                                    <td colspan="2" width="572"> 
                                      <textarea name="bookmulu" cols="46" rows="8" id="bookmulu"></textarea>
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td height="32" colspan="2" width="127"> 
                                      <div align="center"> </div>
                                    </td>
                                    <td width="203" height="32"> 
                                      <div align="center"> 
                                        <input type="submit" name="Submit" value="添 加" onClick="return check();">
                                      </div>
                                    </td>
                                    <td width="365"> 
                                      <input name="bestbook" type="checkbox" id="bestbook" value="1">
                                      推荐此图片</td>
                                  </tr>
                                </table>
                              </td>
                            </form>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<!--#include file="copyright.asp"-->
</body>
</html>

<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
   if(checkspace(document.myform.bookname.value)) {
	document.myform.bookname.focus();
    alert("请输入图片名称!");
	return false;
  }
     if(checkspace(document.myform.shichangjia.value)) {
	document.myform.shichangjia.focus();
    alert("请输入图片价格!");
	return false;
  }
     if(checkspace(document.myform.huiyuanjia.value)) {
	document.myform.huiyuanjia.focus();
    alert("请输入图片价格!");
	return false;
  }
 
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>
<script>
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
</script>

⌨️ 快捷键说明

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