Dim wb5 As New WeUI
Dim renshuguanwai As Integer
Dim renshuwaidian As Integer
Dim renshuzijia As Integer
Dim renshushanmen As Integer
Dim renshuweizhi As Integer
Dim renshuzong As Integer
Dim zclriqi As Date
wb5.AddForm("", "form1", "list.htm")
With wb5.AddButtonGroup("form1", "btg2", False) '水平排列
.Add("btn1", "昨天", "submit").FormAction = "list.htm?btn=1"
.Add("btn2", "今日", "submit").FormAction = "list.htm?btn=2"
.Add("btn3", "明日", "submit").FormAction = "list.htm?btn=3"
.Add("btn4", "<", "submit").FormAction = "list.htm?btn=4"
.Add("btn5", ">", "submit").FormAction = "list.htm?btn=5"
.Add("btn6", "筛选", "submit").FormAction = "list.htm?btn=6"
End With
Sel*t 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.AddDays( - 1)'e.PostValues("startdate")
zclriqi = Date.Today.AddDays( - 1)
End With
Else
End If
If e.GetValues("btn") = 2 Then
With wb5.AddInputGroup("form1", "ipg1", "")
.AddInput("startdate", "日期", "date").Value = Date.Today 'e.PostValues("startdate")
zclriqi = Date.Today
End With
Else
End If
If e.GetValues("btn") = 3 Then
With wb5.AddInputGroup("form1", "ipg1", "")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(1) 'e.PostValues("startdate")
zclriqi = Date.Today.AddDays(1)
End With
Else
End If
If e.GetValues("btn") = 4 Then
With wb5.AddInputGroup("form1", "ipg1", "")
zclriqi = e.PostValues("startdate")
zclriqi = zclriqi.AddDays( - 1)
.AddInput("startdate", "日期", "date").Value = zclriqi
End With
Else
End If
If e.GetValues("btn") = 5 Then
With wb5.AddInputGroup("form1", "ipg1", "")
zclriqi = e.PostValues("startdate")
zclriqi = zclriqi.AddDays(1)
.AddInput("startdate", "日期", "date").Value = zclriqi
End With
End If
If e.GetValues("btn") = 6 Then
With wb5.AddInputGroup("form1", "ipg1", "")
zclriqi = e.PostValues("startdate")
.AddInput("startdate", "日期", "date").Value = zclriqi
End With
End If
flt = "日期='" & zclriqi & "'" ' e.PostValues("startdate")
' msgbox(flt)
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = " Sele8ct 产品, 时间,组别, 姓名, 人数, 手机, 酒店, 总金额-定金-已收尾款 as 欠款 From ({table_dingdan} Inner Join {table_kehu} On {table_kehu}.[idkehu] = {table_dingdan}.[idkehu]) "
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt & " and ( 状态<>'取消' or 状态 is null ) Order By 酒店 "
End If
Dim dt As DataTable = cmd.ExecuteReader
With wb5.AddTable("", "Table1")
renshuguanwai = dt.compute("sum(人数)", "酒店='关外'")
renshuwaidian = dt.compute("sum(人数)", "酒店<>'关外' and 酒店<>'自驾' and 酒店<>'' and 酒店<>'蓝景' and 酒店<>'希尔顿' and 酒店<>'皇冠' and 酒店<>'黄松浦' and 酒店<>'山门' and 酒店<>'奶头山' ")
renshuzijia = dt.compute("sum(人数)", "酒店='自驾' ")
renshushanmen = dt.compute("sum(人数)", "酒店='蓝景' or 酒店='希尔顿' or 酒店='皇冠' or 酒店='黄松浦' or 酒店='山门' or 酒店='奶头山' ")
renshuweizhi = dt.compute("sum(人数)", " 酒店 is null ")
renshuzong = dt.compute("sum(人数)")
.CreateFromDataTable(cmd.ExecuteReader)
With .Body.AddRow()
.Attribute = "style='background-color:#FFFFE0'"
.AddCell("总人数:" & renshuzong & "人。 其中:关外: " & renshuguanwai & "人,镇上外店:" & renshuwaidian & "人,自驾:" & renshuzijia & "人,山门附近:" & renshushanmen & "人,其他:" & renshuweizhi & "人" , "colspan = '8'")
End With
End With
End Sele
e.WriteString(wb5.Build)