gyaction.asp

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

ASP
279
字号
                          if s_day<>0 then 
                             set rs_sx=server.CreateObject("adodb.recordset")
                                 rs_sx.open "SELECT shop_books.bookname, shop_books.shichangjia,Sum(shop_cgaction.cgcount) AS Sum_cgcount, Sum(shop_cgaction.cgsy) AS Sum_cgsy, Sum(shop_cgaction.xscount) AS sumxs, Sum(shop_cgaction.tscount) AS sumts, Sum(shop_cgaction.kccount) AS sumkc FROM shop_books INNER JOIN shop_cgaction ON shop_books.bookid = shop_cgaction.bookid WHERE ((shop_cgaction.gyid="&s_gyid&") AND ((year(shop_cgaction.cgdate))="&s_year&") AND ((Month(shop_cgaction.cgdate))="&s_month&") AND ((day(shop_cgaction.cgdate))="&s_day&")) GROUP BY shop_books.bookname, shop_books.shichangjia, shop_books.sumxs, shop_books.sumts, shop_books.sumkc",conn,1,3
                          '//没选日
                          else
                             set rs_sx=server.CreateObject("adodb.recordset")
                                 rs_sx.open "SELECT shop_books.bookname, shop_books.shichangjia,Sum(shop_cgaction.cgcount) AS Sum_cgcount, Sum(shop_cgaction.cgsy) AS Sum_cgsy, Sum(shop_cgaction.xscount) AS sumxs, Sum(shop_cgaction.tscount) AS sumts, Sum(shop_cgaction.kccount) AS sumkc FROM shop_books INNER JOIN shop_cgaction ON shop_books.bookid = shop_cgaction.bookid WHERE ((shop_cgaction.gyid="&s_gyid&") AND ((year(shop_cgaction.cgdate))="&s_year&") AND ((Month(shop_cgaction.cgdate))="&s_month&")) GROUP BY shop_books.bookname, shop_books.shichangjia, shop_books.sumxs, shop_books.sumts, shop_books.sumkc",conn,1,3
                          end if
                       '//没选月
                       else
                          set rs_sx=server.CreateObject("adodb.recordset")
                              rs_sx.open "SELECT shop_books.bookname, shop_books.shichangjia,Sum(shop_cgaction.cgcount) AS Sum_cgcount, Sum(shop_cgaction.cgsy) AS Sum_cgsy, Sum(shop_cgaction.xscount) AS sumxs, Sum(shop_cgaction.tscount) AS sumts, Sum(shop_cgaction.kccount) AS sumkc FROM shop_books INNER JOIN shop_cgaction ON shop_books.bookid = shop_cgaction.bookid WHERE ((shop_cgaction.gyid="&s_gyid&") AND ((year(shop_cgaction.cgdate))="&s_year&")) GROUP BY shop_books.bookname, shop_books.shichangjia, shop_books.sumxs, shop_books.sumts, shop_books.sumkc",conn,1,3
                       end if
                   %>
 
                <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>
                       <% if rs_sx.bof and rs_sx.eof then
                             response.write "<tr><td colspan=8 align=center bgcolor=#ffffff><div align=center><font color=blue>没有你要查询的记录!</font></td></tr>"
                          else
                             '/先计算出总数量和总码洋
                             do while not rs_sx.eof 
                                ccount=ccount+rs_sx("Sum_cgcount")
                                scount=scount+rs_sx("Sum_cgsy") 
                             rs_sx.MoveNext
                             loop

                             '/记录指针到第一条
                             rs_sx.Movefirst

                             '/分页显示上部分
                             Page = rs_sx.AbsolutePage
                             rs_sx.PageSize=15
                             if Not IsEmpty(Request("Page")) then
                                Page = CInt(Request("Page"))
                                if Page > rs_sx.PageCount then 
                                   rs_sx.AbsolutePage = rs_sx.PageCount 
                                elseif Page <= 0 then 
                                   Page = 1 
                                else
                                   rs_sx.AbsolutePage = Page 
                                end if
                             else
                                Page = 1
                             end if
                      
                              For i =0 to rs_sx.PageSize
                                  if rs_sx.EOF then Exit For
 
                                  
                       %>
                       <tr>
                          <td bgcolor="#ffffff"><div align="center"><%=rs_sx.bookmark%></div></td>
                          <td bgcolor="#ffffff" STYLE='PADDING-LEFT: 5px'><%=rs_sx("bookname")%></td>
                          <td bgcolor="#ffffff"><div align="center"><font color=blue><%=rs_sx("shichangjia")%></font></div></td>
                              
                          <td bgcolor="#ffffff"><div align="center"><font color=blue><%=formatnumber(rs_sx("Sum_cgsy"),2)%></font></div></td>
                          <td bgcolor="#ffffff"><div align="center"><font color=blue><%=rs_sx("Sum_cgcount")%></font></div></td>        
                          <td bgcolor="#ffffff"><div align="center"><font color=green><%=rs_sx("sumxs")%></font></div></td>
                          <td bgcolor="#ffffff"><div align="center"><font color=red><%=rs_sx("sumts")%></font></div></td>
                          <td bgcolor="#ffffff"><div align="center"><font color=brown><%=rs_sx("sumkc")%></font></div></td>

                       </tr> 
                       <% '/分页显示下部分
                          rs_sx.MoveNext
                          next    

                           end if%>
                       <tr> 
                          <td colspan=8 bgcolor="#ece9d8" height=40><div align="center">共<font color=blue><%=rs_sx.recordcount%></font>条<font color=blue><%=rs_sx.pagecount%></font>页 
                          <%if request("page")>1 then%>
                               <a Href="gyaction.asp?action=list_search&s_gyid=<%=s_gyid%>&s_year=<%=s_year%>&s_month=<%=s_month%>&s_day=<%=s_day%>&Page=<%=1%>">首页</a>&nbsp;&nbsp;<a Href="gyaction.asp?action=list_search&s_gyid=<%=s_gyid%>&s_year=<%=s_year%>&s_month=<%=s_month%>&s_day=<%=s_day%>&Page=<%=page-1%>">上一页</a>
                          <%end if %>
                          <%if request("page")<>rs_sx.pagecount and page<rs_sx.pagecount then %>
                               <a Href="gyaction.asp?action=list_search&s_gyid=<%=s_gyid%>&s_year=<%=s_year%>&s_month=<%=s_month%>&s_day=<%=s_day%>&Page=<% =page + 1%>">下一页</a>&nbsp;&nbsp;<a Href="gyaction.asp?action=list_search&s_gyid=<%=s_gyid%>&s_year=<%=s_year%>&s_month=<%=s_month%>&s_day=<%=s_day%>&Page=<%=rs_sx.PageCount%>">尾页</a> 
                          <%end if
                          if rs_sx.pagecount>0 then %>
                             第<font color="#FF3300"><%=page%></font>页		
                          <%end if%></font></div></td>
                       </tr>
                    </table>

                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                       <tr height=30>
                       <%
                        if s_month=0 then

                           if s_day=0 then
                              response.write "<td width=40% align=center>统计日期:<b><font color=red>"&s_year&"</font></b> 年 <b><font color=red> 全年</font></b>"
                           end if

                        else

                           if s_day=0 then
                              response.write "<td width=40% align=center>统计日期:<b><font color=red>"&s_year&"</font></b> 年 <b><font color=red>"&s_month&"</font></b> 月"
                           else
                              response.write "<td width=40% align=center>统计日期:<b><font color=red>"&s_year&"</font></b> 年 <b><font color=red>"&s_month&"</font></b> 月 <b><font color=red>"&s_day&"</font></b> 日"
                           end if

                        end if

                        response.write "<td>采购合计数:<b><font color=red>"&ccount&"</font></b> 册"

                        if scount=0 then
                           response.write "<td>合计实洋:<b><font color=red>0:00</font></b> 元"
                        else
                           response.write "<td>合计实洋:<b><font color=red>"&formatnumber((scount),2)&"</font></b> 元"
                        end if
                       %> 

                       </tr>
                   </table>
              <%end select%>
             
                  </tr>
                </table>

              </tr>
            </table>

        </tr>
      </table>

   </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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