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

📄 g_bmbj.asp

📁 一个很好的在线购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubFun.asp"--> 
<% username=Getuser()%>
<%
'**************************************
'Author:Ruphi  Update Time:2001-09-06
'功能说明:
'************************************* 

%>
<%
'将临时表中的数据删除
set bmbj2=server.Createobject("adodb.recordset")
sql="select *  from G_Tblbmbj"
bmbj2.open sql,Pubconn,1
if bmbj2.RecordCount>0 then
   set bmbj1=server.Createobject("adodb.recordset")
   m_sql="delete from G_Tblbmbj"
   bmbj1.open m_sql,Pubconn,1,3
end if 
%>
 <%                                                           
    '部门列表                                                           
    set rst=Server.CreateObject("ADODB.RecordSet")                                                           
    sql1="Select * from A_DepartInfo where departcode<>'01'and delflag<>'1'"                                                           
    rst.open sql1,pubconn,1                                                           
    'rst.movefirst
     '找出公司所有的
    set myrs=Server.CreateObject("ADODB.RecordSet")
    sql="Select count(stuffnum) as total from A_StuffInfo Where SaleFlag='1' and delflag='0' and Departcode like '"&Session("DepartID")&"%' "  
    myrs.open sql,pubconn,1
    if not myrs.eof then
       ywytotal=myrs("total")
    else
       ywytotal=0
    end if     
    'response.write ywytotal  
    '统计总的预期客户数量
         set rs1=Server.CreateObject("ADODB.RecordSet")
         sql="SELECT count(clientnum) AS total FROM D_clientInfo WHERE type='预期客户'  GROUP BY type"
         rs1.open sql,Pubconn,1
         if rs1.eof  then
            yqtotal=0
         else
            yqtotal=rs1("total")
        end if 
                                                                                               
    %>    
<%
curyear=year(date())
yearid=request("yearID")    '年份
if yearid="" then
   yearid=curyear
end if 
 
monthid=request("monthid")  '月份
yy=len(monthid)
if yy=4 then
   uu=right(monthid,1)
end if 
if yy=5  then
   uu=right(monthid,2)
end  if 

sid=request("departID")  '部门代号
if sid="" then
   sid=rst("departcode")
end if 
%>
<%
set rsbm=server.createobject("adodb.recordset")

if monthid="" then   '当没有月份时
  
      str="select object,objyear from G_viewaim1  where  year='"&yearid&"' and departcode='"&sid&"' "
 
else    '当选择了月份时
       select case monthid
             case "obj1"
               str="select object,obj1 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj2"
               str="select object,obj2 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj3"
               str="select object,obj3 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj4"
               str="select object,obj4 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj5"
               str="select object,obj5 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj6"
               str="select object,obj6 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
             case "obj7"
               str="select object,obj7 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
            case "obj8"
               str="select object,obj8 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
            case "obj9"
               str="select object,obj9 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
            case "obj10"
               str="select object,obj10 from G_viewaim1 where departcode='"&sid&"' and year='"&yearid&"'"
            case "obj11"
               str="select object,obj11 from G_viewaim1 where departcode='"&sid&"'and year='"&yearid&"'"
            case "obj12"
               str="select object,obj12 from G_viewaim1 where departcode='"&sid&"'and year='"&yearid&"'"
          end select
   
  

end if   
rsbm.open str,Pubconn,1
'response.write str


%>                                     
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>统计查询</title><link href="cread.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="100%"><b><font size="3"><img border="0" src="../pic/it_22.gif" width="34" height="15"> 
      </font><font size="2">部门报警</font></b><hr width="40%" size="1" align="left">          
                
    </td>          
  </tr>          
</table>                 
<form method="post" action="G_bmbj.asp" name="myform">                                                
<p>                                                
                                                
                                                             
                                                             
<table border="0" cellspacing="0" width="100%" align="center">                                                              
  <tr>                                                               
    <td width="12%" align="center" bgcolor="#F1E8DA">              
              
     <p align="right">             
     <font size="2">时间  
     </font>  
             
     </p>             
             
    </td>                                                                
    <td width="19%" align="center" bgcolor="#F1E8DA">                                                              
             
    <p align="left">             
    <select name="yearID" size="1" style="width: 57; height: 23">                                                            
                                                           
           <%for i=1990 to 2010 %>                                                          
              <option value="<%=i%>" <% 
              if yearid<>"" then  
                  if cint(yearid)=i  then  
                     response.write ("selected")  
                  end  if   
             end if   
                
              %> ><%=i%></option>                                                          
          <%next%>                           
                                                   
    </select> 年  
    <select name="monthID" size="1" style="width: 50; height: 23">                                                            
                                        
              <option value="">全部</option>                                                          
           <%for p=1 to 12 %>                                                          
              <option value="obj<%=p%>" <%   
              tt=len(monthid) 
              if tt=4 then 
                 if cint(uu)=p then  
                    response.write ("selected")  
                end if   
              end if  
              if tt=5 then 
                 if cint(right(monthid,2))=p then  
                    response.write ("selected")  
                end if   
 
              end if  
            
                
              %>   
                
            ><%=p%></option>                                                          
          <%next%>                           
                                                       
    </select>月             
             
    </p>             
             
    </td>                                                                       
    <td width="11%" align="center" bgcolor="#F1E8DA">             
             
     <p align="right">             
     <font size="2">公司  
     </font>  
            
     </p>            
            
    </td>                                                            
                                                                 
    <td width="29%" align="center" bgcolor="#F1E8DA">                                                                  
            
      <p align="left">            
      <select  name="departID" style="width:100" size="1">                           
                                                        
                                                      
       <% 
       rst.movefirst 
       do while not rst.eof%>                                                           
        <option  value="<%=rst("DepartCode")%>" <%                
        if sid<>"" then                
           if trim(sid)=rst("DepartCode") then                
               response.write("selected")                
           end if                 
        end if                 
                        
        %> ><%=rst("Name")%></option>                                                           
       <%                                                          
       rst.movenext                                                          
       loop                                                          
      set rst=nothing                                                          
        %>                                                          
                                                           
      </select>&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="查询" class="hand" style="background-color: #D1D1D1; border-style: solid; border-width: 1"  >                   
                  
      </p>                  
                  
    </td>                                                                                         
 </tr>                                                                                        
</table>                                                                                 
                                                                                     
 <%                      
 if rsbm.eof then%>            
 <p>                      
<center><font size="2">没有符合条件的记录!        
         <a href="G_bjxx.asp">返回</a></font></center>                     
       
                           
                      
 <%  response.end       
 else         
                                                  
%>                      
                                                                                   
                                                                                               
                                                                
                                                                                                
     <% for n=1  to rsbm.recordcount%>                     
          
     <%      
       select case  rsbm.fields(0).value     
           case "订单金额(万元)"     
                   
                if monthid="" then     
                   sql="select sum(money) as total from G_vieworder where year(orddate)='"&yearid&"' and departcode='"&sid&"'"     
                end if      
                if monthid<>""  then     
                   sql="select sum(money) as total from G_vieworder where year(orddate)='"&yearid&"' and month(orddate)='"&uu&"' and departcode='"&sid&"'"     

⌨️ 快捷键说明

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