gyaction.asp

来自「创建和运行动态、交互的Web服务器应用程序」· ASP 代码 · 共 279 行 · 第 1/2 页

ASP
279
字号
<!--#include file="conn.asp"-->
<%
  dim action,s_year,s_month,s_day,s_gyid,rs_sx,rs_gy,ccount,scount,i,ii,page

      action = request("action")
      
      ccount=0:scount=0:page=1
%>
<html>
<head>
<title>供应商</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css2.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--

function checksearch()
{
    if(document.gyaction.s_gyid.value==0) {
	document.gyaction.s_gyid.focus();
    alert("请选择供应商!");
	return false;
  }  
    if(document.gyaction.s_year.value==0) {
	document.gyaction.s_year.focus();
    alert("请选择要查询的年份!");
	return false;
  }  
  if(document.gyaction.s_month.value==0 && document.gyaction.s_day.value!=0){
	document.gyaction.s_month.focus();
    alert("请选择要查询的月份!");
	return false;
  }   
}

//-->   
</script>
</head>

<table width="90%" height="450" border="0"  cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#ece9d8"><br><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr><td>

            <table width=77 border="0"  cellpadding="0" cellspacing="0">
              <tr valign=bottom>
                <td background=images/get_img.gif width=77 height=26><P style='PADDING-LEFT: 7px'><div align="center"><font color=#ffffff>往来帐目</font></div></td>
              </tr>
            </table>

            <table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#ffffff" bordercolorlight="#666666">
               <tr><td><table width="100%" border="1" cellspacing="0" cellpadding="0"><tr><td>
                  <table width="100%"  border="0"  align="center" cellpadding="0" cellspacing="0">
                     <form name="gyaction" method="post" action="gyaction.asp?action=list_search" >
                        <tr height=25>
                          <td width="16%" align="right">供应商名称&nbsp;
                          <td width="16%" bgcolor="#ece9d8" align="center">
                            <select name="s_gyid" id="s_gyid">
                            <option value="0" selected>选择供应商</option>
                            <%set rs_gy=server.CreateObject("adodb.recordset")
                                  rs_gy.open "SELECT * FROM shop_gongyi",conn,1,1
                            do while not rs_gy.eof%>
                                 <option value=<%=rs_gy("gyid")%>><%=rs_gy("gyname")%></option>
                            <%rs_gy.movenext
                             loop%>
                          </select>
      
                          <td width="10%" bgcolor="#ece9d8" align="right">日期&nbsp;

                          <td width="10%" bgcolor="#ece9d8">

                          <select name="s_year" id="s_year">
                            <option value="0" selected>选择年</option>
                            <%for ii=2000 to 2010%>
                                 <option value=<%=ii%>><%=ii%></option>
                            <%next%>
                          </select>
           
                          <td width="10%" bgcolor="#ece9d8">

                          <select name="s_month" id="s_month">
                            <option value="0" selected>选择月</option>
                            <%for ii=1 to 12%>
                                 <option value=<%=ii%>><%=ii%></option>
                               <%next%> 
                          </select>
        
                          <td width="10%" bgcolor="#ece9d8">

                          <select name="s_day" id="s_day">
                            <option value="0" selected>选择日</option>
                            <%for ii=1 to 31%>
                                 <option value=<%=ii%>><%=ii%></option>
                            <%next%>
                          </select>
                          <td bgcolor="#ece9d8" align="center"><input type="submit" name="Submit"  class="bt3" value="查 询" onClick="return checksearch();">                     
                          <td bgcolor="#ece9d8" align="center"><input type="button" name="Submit4" class="bt3" value="打 印" onclick="javascript:window.print()">
                         </tr>
                      </form>
                   </table>
               
              <%select case action
                       case ""%>
           
               <tr><td height=300 valign="top">

                   <table width="100%" border="0"  align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
                      <tr> 
                         <td width="6%" bgcolor="#ece9d8"><div align="center">序号</div></td>   
                         <td bgcolor="#ece9d8">&nbsp;&nbsp;&nbsp;&nbsp;商品名称</td>
                         <td bgcolor="#ece9d8"><div align="center">定价</div></td>                         
                         <td bgcolor="#ece9d8"><div align="center">实洋</div></td>
                         <td bgcolor="#ece9d8"><div align="center">采购数</div></td> 
                         <td bgcolor="#ece9d8"><div align="center">销售数</div></td>
                         <td bgcolor="#ece9d8"><div align="center">退书数</div></td>
                         <td bgcolor="#ece9d8"><div align="center">库存数</div></td>
                      </tr>
                      <tr>
                         <td width="6%" bgcolor="#ffffff" height=22></tr>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                         <td bgcolor="#ffffff"></td>
                      </tr>
                   </table>

                   <%
                       case "list_search"

                       s_year    = request("s_year")
                       s_month   = request("s_month")
                       s_day     = request("s_day")
                       s_gyid    = request("s_gyid")
                  
                       '//选月了
                       if s_month<>0 then
                          '//选日了

⌨️ 快捷键说明

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