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

📄 fenlei_search_jg.asp

📁 management of the library
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="manage/inc/config.asp"--> 
<!--#include file="manage/inc/conn.asp"--> 
<!--#include file="chk.asp"--> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图书馆管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css">


<script language="JavaScript" src="calendar.js"></script>

</head>

<body>
<!--#include file="head.htm"-->


<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="219" align="center" valign="top">
      <table width="167" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="60">&nbsp;</td>
        </tr>
        <tr> 
          <td height="20" align="center"><a href="fenlei_search.asp">名称检索</a></td>
        </tr>
        <tr> 
          <td height="20" align="center"><a href="fenlei_search_zz.asp">作者检索</a></td>
        </tr>
        <tr> 
          <td height="20" align="center"><a href="fenlei_search_cbs.asp">出版社检索</a></td>
        </tr>
        <tr> 
          <td height="20" align="center"><a href="fenlei_search_cbsj.asp">出版时间检索</a></td>
        </tr>
        <tr>
          <td height="20" align="center"><a href="fenlei_search_jg.asp">价格检索</a></td>
        </tr>
      </table>
    </td>
    <td width="561" align="left" valign="top">
      <br>      <script language=javascript>
var whitespace = " \t\n\r";

function IsWhitespace (s)
{
  var i;
  if (IsEmpty(s)) return true;

  for (i = 0; i < s.length; i++)
  {
    var c = s.charAt(i);
    if (whitespace.indexOf(c) == -1) return false;
  }
  return true;
}

function IsEmpty(s)
{ 
  return ((s == null) || (s.length == 0))
}





function IsDate(fDate)
{

    var arrDaysInMonth=new Array(12);
    arrDaysInMonth[1]=31;
    arrDaysInMonth[2]=29;
    arrDaysInMonth[3]=31;
    arrDaysInMonth[4]=30;
    arrDaysInMonth[5]=31;
    arrDaysInMonth[6]=30;
    arrDaysInMonth[7]=31;
    arrDaysInMonth[8]=31;
    arrDaysInMonth[9]=30;
    arrDaysInMonth[10]=31;
    arrDaysInMonth[11]=30;
    arrDaysInMonth[12]=31;
    
    if (IsEmpty(fDate))
        return true
        
    var NameList=fDate.split("-");
    if (NameList.length!=3)
        return false
    
//if (!(IsYear(NameList[0]))||!(IsMonth(NameList[1]))||!(IsDay(NameList[2])) )
//return false
    
    if ( NameList[1]>arrDaysInMonth[NameList[1]] )
        return false
        
    if ( (NameList[1]==2) && (NameList[2]>DaysInFebruary(NameList[0]) ) )
        return false
        
    return true

}


function search()   
{
  var name          = document.forms['frmdata'].elements['name'].value;
  var author        = document.forms['frmdata'].elements['author'].value;
  var manufacturer  = document.forms['frmdata'].elements['manufacturer'].value;
  var smallprice    = document.forms['frmdata'].elements['smallprice'].value;
  var largeprice    = document.forms['frmdata'].elements['largeprice'].value;
  var enabledate    = document.forms['frmdata'].elements['enabledate'].value;
  var expiredate    = document.forms['frmdata'].elements['expiredate'].value;



  if (!IsWhitespace(enabledate))
  {
    if (!IsDate(enabledate))
    {
      alert("出版日期 开始日期格式错误!");
      return false;
    }
  }


  if (!IsWhitespace(expiredate))
  {
    if (!IsDate(expiredate))
    {
      alert("出版日期 结束日期格式错误!");
      return false;
    }
  }

  var allNotEmpty = (!IsWhitespace(name)) ||
	             (!IsWhitespace(author)) ||
	             (!IsWhitespace(manufacturer)) ||
	             (!IsWhitespace(smallprice)) ||
	             (!IsWhitespace(largeprice))||
	             (!IsWhitespace(enabledate)) ||
	             (!IsWhitespace(expiredate));

  if (!allNotEmpty)
  {
      alert("必需输入一个搜索条件");
      return false;
  }

  if (!IsWhitespace(smallprice))
  {
    if (!checknumber(smallprice))
    {
      alert("价格数据不合法");
      return false;
    }
  }

  if (!IsWhitespace(largeprice))
  {
    if (!checknumber(largeprice))
    {
      alert("价格数据不合法");
      return false;
    }
  }
  
  function checknumber(str)
{
        var i;
        for(i=0;i<str.length;i++)
        {
                if (str.charAt(i)<"0" || str.charAt(i)>"9")
                {
                        return false;
               }
        }
        return true;
}

  if ((!IsWhitespace(enabledate)) && (!IsWhitespace(expiredate)))
  {
	  if (enabledate>expiredate)
	  {
	    alert("出版日期范围错误");
        return false;
	  }
  }

  if ((!IsWhitespace(smallprice)) && (!IsWhitespace(largeprice)))
  {
	  if (parseFloat(smallprice)>parseFloat(largeprice))
	  {
	    alert("价格范围错误");
        return false;
	  }
  }
}
                </script>      <br>      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><img src="images/w.gif"></td>
          <td style="color:#415373">分类检索</td>
        </tr>
      </table>      <br>      <FORM name=frmdata  method=get action="rsearch.asp">
        <TABLE cellSpacing=10 cellPadding=0 width="100%" border=0>
         
          <TBODY>
<INPUT type=hidden name=name class="inputstyle">
<INPUT type=hidden name=author class="inputstyle">
<INPUT type=hidden name=manufacturer class="inputstyle">
<INPUT type=hidden name=enabledate class="inputstyle" size=12>
              <INPUT type=hidden name=expiredate class="inputstyle" size=12>
              <script language=JavaScript>
  var cal1 = new calendar1(document.forms['frmdata'].elements['enabledate']);
  cal1.year_scroll = true;
  cal1.time_comp = false;
  var cal2 = new calendar1(document.forms['frmdata'].elements['expiredate']);
  cal2.year_scroll = true;
  cal2.time_comp = false;
                  </script>
            <TR>
              <TD align=right width="31%" height=30>价格范围:</TD>
              <TD width="69%">                <input name="smallprice" type="text" id="smallprice"  size="5" >
              
              <input name="largeprice" type="text" id="largeprice" 
 size="5" >
              </TD>
            </TR>
            <TR>
              <TD align=right height=30>分类:</TD>
              <TD><select name=code>
                <option value="" selected>所有图书</option>
                <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from category",conn,1,1
do while not rs.eof
%>
                <option value="<%=rs("categoryid")%>" ><%=rs("category")%></option>
                <%
rs.movenext
loop
rs.close
set rs=nothing
%>
              </select></TD>
            </TR>
            <TR>
              <TD align=right height=30>排序字段:</TD>
              <TD><input name="OrderField" type="radio" value="adddate" checked>
                添加日期&nbsp;                  <input type="radio" name="OrderField" value="productdate">
                  出版日期
                  <input type="radio" name="OrderField" value="price">
              价钱
                 
              <input type="radio" name="OrderField" value="pagenum">
              页数&nbsp;&nbsp;&nbsp;&nbsp;</TD>
            </TR>
            <TR>
              <TD align=right width="31%" height=30>排序方式:</TD>
              <TD width="69%"><input type="radio" name="Order" value="ASC"> 
                升序
                  <input name="Order" type="radio" value="DESC" checked>
              降序</TD>
            </TR>
            <TR align=center>
              <TD height=40 colSpan=2><INPUT type=submit value=开始搜索 name=Submit2 onClick="return search()">              </TD>
            </TR>
          
      </TABLE>
    </FORM></td>
  </tr>
</table>

<!--#include file="foot.htm"-->
</body>
</html>

⌨️ 快捷键说明

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