以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  移动开发,统计人数怎么显示在html页面?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=194809)

--  作者:zhchling
--  发布时间:2025/1/16 13:29:00
--  移动开发,统计人数怎么显示在html页面?
移动开发。 

怎么添加到页面,各酒店统计人数,

比如,关外客栈 ? 人

1.怎么写sql语句统计各酒店人数
2.怎么写显示到html页面的代码
3.我现在点击按钮(比如今日),按一下能把今天日期显示出来,按第2下,才能列出今天数据。   或者第二下点“确定”也能列出今天数据, 没看明白是怎么回事。   怎么改成按一次就能显示出来今天数据。



Dim wb5 As New WeUI
wb5.AddForm("", "form1", "list.htm")
With wb5.AddButtonGroup("form1", "btg2", False) \'水平排列
    .Add("btn3", "昨天", "submit").FormAction = "list.htm?btn=3"
    .Add("btn1", "今日", "submit").FormAction = "list.htm?btn=1" 
    .Add("btn2", "明日", "submit").FormAction = "list.htm?btn=2" 
    .Add("btn4", "后天", "submit").FormAction = "list.htm?btn=4"
    .Add("btn5", "确定", "submit").FormAction = "list.htm?btn=5"
    
End With


Selec* Case e.Path 
    
    Case "list.htm"
        Dim flt As String
        \'          e.WriteString(e.PostValues("startdate"))
        If e.GetValues("btn") = 1 Then 
            With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
                .AddInput("startdate", "日期", "date").Value = date.Today  \'e.PostValues("startdate")
            End With
        End If
        
        If e.GetValues("btn") = 2 Then 
            With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
                .AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(1) \'e.PostValues("startdate")
            End With
        End If
        If e.GetValues("btn") = 3 Then 
            With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
                .AddInput("startdate", "日期", "date").Value = Date.Today.AddDays( - 1) \'e.PostValues("startdate")
            End With
        End If
        If e.GetValues("btn") = 4 Then 
            With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
                .AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(2) \'e.PostValues("startdate")
            End With
        End If 
        If e.GetValues("btn") = 5 Then 
            With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
                .AddInput("startdate", "日期", "date").Value =  e.PostValues("startdate")
            End With
        End If 
        
        
        flt = "日期=\' " & e.PostValues("startdate") & " \'"
        
        Dim cmd As New SQL1Command
        cmd.C
        cmd.CommandText = " Selec*  人数, 姓名, 手机,  酒店, 状态  From ({table_dingdan} Inner Join {table_kehu} On {table_kehu}.[idkehu] = {table_dingdan}.[idkehu]) "
        
        If flt > "" Then
            cmd.CommandText = cmd.CommandText & " where " & flt & " and  状态<>\'取消\' Order By 酒店 "
            
        End If
        
        
        With wb5.AddTable("", "Table1") 
            
            .CreateFromDataTable(cmd.ExecuteReader)
        End With
        
        
        
End Select1
e.WriteString(wb5.Build)



图片点击可在新窗口打开查看此主题相关图片如下:ls.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2025/1/16 13:36:31编辑过]

--  作者:有点蓝
--  发布时间:2025/1/16 13:32:00
--  
这种?http://www.foxtable.com/mobilehelp/topics/0135.htm
--  作者:zhchling
--  发布时间:2025/1/16 13:50:00
--  
是要在页面上,添加文字,显示统计 的酒店人数。不是在表格里汇总显示合计人数 


--  作者:有点蓝
--  发布时间:2025/1/16 14:09:00
--  
……
        dim dt as datatable = cmd.ExecuteReader
dim a as integer = dt.compute("sum(人数)")
wb5.InsertHTML("<h3 style=\'margin-top:5px\'>总人数:" & a & "</h3>")
        With wb5.AddTable("", "Table1") 
            .CreateFromDataTable(dt )
        End With
        
        
……