KEMBAR78
From Laporan VB Dab Export Excel | PDF | Typefaces | Verdana
0% found this document useful (0 votes)
2 views38 pages

From Laporan VB Dab Export Excel

Uploaded by

AsySyifaClk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views38 pages

From Laporan VB Dab Export Excel

Uploaded by

AsySyifaClk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

VERSION 5.

00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmLapParkir
Caption = "Laporan Parkir"
ClientHeight = 8475
ClientLeft = 4170
ClientTop = 1800
ClientWidth = 14010
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "FrmLapParkir.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8475
ScaleWidth = 14010
StartUpPosition = 2 'CenterScreen
Visible = 0 'False
Begin VB.CommandButton cmdPosting
Caption = "Posting"
BeginProperty Font
Name = "Verdana"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 9720
TabIndex = 47
Top = 6120
Width = 1935
End
Begin VB.TextBox txtJumlahNilai
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6960
TabIndex = 45
Top = 8040
Width = 1815
End
Begin VB.CommandButton cmdLapHari
Caption = "Laporan Harian"
BeginProperty Font
Name = "Verdana"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 11760
TabIndex = 44
Top = 6120
Width = 1935
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmLapParkir.frx":0442
Height = 6255
Left = 120
TabIndex = 38
Top = 1680
Width = 9375
_ExtentX = 16536
_ExtentY = 11033
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 14345
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 14345
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 6840
Top = 7080
Width = 2055
_ExtentX = 3625
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=parkir2023"
OLEDBString = "DSN=parkir2023"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT KodeTransaksi, Jenis, Nilai, LamaParkir FROM
parkir WHERE (aktif= 0)"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame5
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 9720
TabIndex = 21
Top = 3960
Width = 3975
Begin VB.TextBox txtTotBox
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1680
TabIndex = 25
Top = 195
Width = 1455
End
Begin VB.TextBox Text4
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 24
Top = 600
Width = 2175
End
Begin VB.TextBox txtNilaiBox
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1800
TabIndex = 22
Top = 720
Width = 1815
End
Begin VB.Label Label9
Caption = "Unit"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 30
Top = 360
Width = 495
End
Begin VB.Label Label6
Caption = "Total Box :"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 23
Top = 195
Width = 1335
End
End
Begin VB.Frame Frame4
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 9720
TabIndex = 17
Top = 2760
Width = 3975
Begin VB.TextBox txtTotMobil
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1680
TabIndex = 26
Top = 195
Width = 1455
End
Begin VB.TextBox Text3
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 18
Top = 600
Width = 2175
End
Begin VB.TextBox txtNilaiMobil
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1800
TabIndex = 19
Top = 720
Width = 1695
End
Begin VB.Label Label8
Caption = "Unit"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 29
Top = 360
Width = 495
End
Begin VB.Label Label5
Caption = "Total Mobil :"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 20
Top = 240
Width = 1695
End
End
Begin VB.Frame Frame2
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 9720
TabIndex = 14
Top = 1600
Width = 3975
Begin VB.TextBox Text2
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 36
Top = 600
Width = 2175
End
Begin VB.TextBox txtTotMotor
Alignment = 1 'Right Justify
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
TabIndex = 27
Top = 195
Width = 1455
End
Begin VB.TextBox txtNilaiMotor
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1680
TabIndex = 15
Top = 630
Width = 1935
End
Begin VB.Label Label7
Caption = "Unit"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 28
Top = 240
Width = 495
End
Begin VB.Label Label3
Caption = "Total Motor:"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 16
Top = 195
Width = 1695
End
End
Begin VB.Frame Frame3
Caption = "Total"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 9720
TabIndex = 2
Top = 5160
Width = 3975
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 1680
TabIndex = 4
Top = 240
Width = 2175
End
Begin VB.TextBox TxtJumlah
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2280
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.Label lblUnit
Alignment = 1 'Right Justify
Caption = "Unit"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 32
Top = 315
Width = 735
End
Begin VB.Label Label10
Caption = "Unit"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 31
Top = 315
Width = 615
End
End
Begin VB.Frame Frame1
Caption = "Data berdasarkan "
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1455
Left = 120
TabIndex = 1
Top = 120
Width = 13515
Begin VB.OptionButton Option1
Caption = "Operator:"
Height = 375
Left = 7320
TabIndex = 43
Top = 600
Width = 1215
End
Begin VB.TextBox txtOperator
Height = 375
Left = 8640
TabIndex = 42
Top = 600
Width = 495
End
Begin VB.OptionButton Option6
Caption = "Pagi dan Sore"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 33
Top = 600
Width = 1575
End
Begin VB.OptionButton Option5
Caption = "Sore"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 960
TabIndex = 34
Top = 600
Width = 1095
End
Begin VB.OptionButton Option4
Caption = "Pagi"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 35
Top = 600
Width = 1095
End
Begin MSComCtl2.DTPicker DTPTgl4
Height = 315
Left = 5880
TabIndex = 12
Top = 960
Width = 1335
_ExtentX = 2355
_ExtentY = 556
_Version = 393216
Format = 124059649
CurrentDate = 39705
End
Begin MSComCtl2.DTPicker DTPTgl3
Height = 315
Left = 3960
TabIndex = 11
Top = 960
Width = 1335
_ExtentX = 2355
_ExtentY = 556
_Version = 393216
Format = 124059649
CurrentDate = 39705
End
Begin VB.TextBox txtJenis
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2040
TabIndex = 10
Top = 960
Width = 1455
End
Begin VB.OptionButton Option3
Caption = "Jenis Kendaraan :"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 9
Top = 960
Width = 1935
End
Begin VB.CommandButton cmdTampilkan
Caption = "&Tampilkan"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 12240
Picture = "FrmLapParkir.frx":0457
Style = 1 'Graphical
TabIndex = 8
Top = 240
Width = 1095
End
Begin MSComCtl2.DTPicker DTPTgl2
Height = 375
Left = 5880
TabIndex = 6
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 124059649
CurrentDate = 39636
End
Begin MSComCtl2.DTPicker dtpTgl1
Height = 360
Left = 3960
TabIndex = 5
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 635
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 124059649
CurrentDate = 39167
End
Begin MSComCtl2.DTPicker DTPTgl7
Height = 375
Left = 10800
TabIndex = 39
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 124059649
CurrentDate = 39636
End
Begin MSComCtl2.DTPicker DTPTgl6
Height = 360
Left = 9120
TabIndex = 40
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 635
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 124059649
CurrentDate = 39167
End
Begin VB.Label Label1
Caption = "s/d"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 10440
TabIndex = 41
Top = 645
Width = 375
End
Begin VB.Label Label4
Caption = "s/d"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5400
TabIndex = 13
Top = 1005
Width = 255
End
Begin VB.Label Label1
Caption = "s/d"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 5370
TabIndex = 7
Top = 645
Width = 375
End
End
Begin VB.PictureBox Picture2
AutoSize = -1 'True
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 6960
Picture = "FrmLapParkir.frx":0899
ScaleHeight = 675
ScaleWidth = 2325
TabIndex = 37
Top = 2040
Width = 2385
End
Begin VB.Label Label2
Caption = "Total Rp. :"
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5760
TabIndex = 46
Top = 8160
Width = 975
End
Begin VB.Label LblWaktu
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 0
Top = 1590
Width = 2415
End
End
Attribute VB_Name = "FrmLapParkir"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strSQL, OpID As String

Private Sub HIdeUM(X As Boolean)


If X Then
' Label3.Visible = False
' Label4.Visible = False
' TxtBayar.Visible = False
' TxtSisa.Visible = False
Else
' Label3.Visible = True
' Label4.Visible = True
' TxtBayar.Visible = True
' TxtSisa.Visible = True
End If
End Sub

Private Sub cmdCetak_Click()


Dim TotalUnit, Total, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Operator = GetSetting(App.EXEName, "User", "Nama")
TotMobil = txtTotMobil.Text
TotMotor = txtTotMotor.Text
TotBox = txtTotBox.Text
NilaiMobil = txtNilaiMobil.Text
NilaiMotor = txtNilaiMotor.Text
NilaiBox = txtNilaiBox.Text
Total = TxtJumlah.Text
TotalUnit = Val(lblUnit.Caption)

Printer.PaintPicture Picture2.Picture, 900, 0


Printer.CurrentY = 700
Printer.Font = "Courier New"
Printer.FontSize = 12
Printer.FontBold = True
Printer.Print "Laporan Parkir"
Printer.Print dtpTgl1.Value & " s.d " & DTPTgl2.Value
If Option4.Value = True Then Printer.Print "SHIFT PAGI"
If Option5.Value = True Then Printer.Print "SHIFT SORE"
If Option6.Value = True Then Printer.Print "ALL SHIFT"

Printer.FontSize = 10
Printer.Print ""
Printer.Print "Mobil : " & TotMobil & " Unit"
Printer.Print " Nilai : Rp. " & RKanan(NilaiMobil, "#,###,##0")
Printer.Print ""
Printer.Print "Motor : " & TotMotor & " Unit"
Printer.Print " Nilai : Rp. " & RKanan(NilaiMotor, "#,###,##0")
Printer.Print ""
Printer.Print "Truk/Box: " & TotBox & " Unit"
Printer.Print " Nilai : Rp. " & RKanan(NilaiBox, "#,###,##0")
Printer.FontSize = 14
Printer.Print ""
Printer.Print "Total Unit : " & RKanan(TotalUnit, "##,###,##0")
Printer.Print "Total : Rp. " & RKanan(Total, "##,###,##0")
Printer.FontSize = 12
Printer.Print ""
Printer.Print Format(Date, "dd mmm yyyy")
Printer.Print "Operator"
Printer.Print ""
Printer.Print ""
Printer.Print ""
Printer.Print "(" & Operator & ")"
Printer.Print ""
Printer.Print ""
Printer.EndDoc
End Sub

Private Sub ByJenis()


Dim SSQl, Jenis As String
Dim TGV, Jumlah, Total As Single
Dim TgAwal, TgAkhir As String
Dim TOTAL2, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JUnit, JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Dim rsLap As New ADODB.Recordset

Operator = GetSetting(App.EXEName, "User", "Nama")


TglNowValue = Format(Date, "##0")

Jenis = txtJenis.Text
TgAwal = Format(DTPTgl3.Value, "yyyy-mm-dd")
TgAkhir = Format(DTPTgl4.Value, "yyyy-mm-dd")
SSQl = "Select KodeTransaksi, Jenis, LamaParkir, Nilai " & _
"FROM parkir WHERE " & _
"(TglExitParkir Between '" & TgAwal & "' AND '" & TgAkhir & "') AND
(parkir.Jenis = '" & Jenis & "') AND " & _
"(parkir.Aktif = 0) AND (parkir.Tag=-1) AND (CardID IS NULL) ORDER By
parkir.KodeTransaksi"
rsLap.Open SSQl, ConnP, adOpenStatic, adLockPessimistic
If Not rsLap.EOF Then
JUnit = 0
rsLap.MoveFirst
Do While Not rsLap.EOF
JUnit = JUnit + 1
rsLap.MoveNext
Loop
End If
Adodc1.RecordSource = SSQl
Adodc1.Refresh
'DataGrid1.DataSource = "adodc1"
DataGrid1.Refresh
Jumlah = 0
Total = 0
If Not rsLap.EOF Then
rsLap.MoveFirst
Do While Not rsLap.EOF
Jumlah = rsLap!Nilai
Total = Total + Jumlah
rsLap.MoveNext
Loop
End If

TxtJumlah.Text = Total
txtJumlahNilai.Text = Format(Total, "#,##0")
'lblUnit.Caption = JUnit
lblUnit.Caption = Adodc1.Recordset.RecordCount
txtTotMotor.Text = JUnit
Exit Sub

End Sub

Private Sub ShiftSore()


Dim SSQl, QMob, QMot, QBox, Jenis As String
Dim TGV, Jumlah, Total, SumBox, SumMot, SumMob As Single
Dim TgAwal, TgAkhir As String
Dim TOTAL2, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JUnit, JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Dim rsQty As New ADODB.Recordset
Dim rsLap As New ADODB.Recordset
Dim rsLapMob As New ADODB.Recordset
Dim rsLapMot As New ADODB.Recordset
Dim rsLapBox As New ADODB.Recordset
Dim rsNilai As New ADODB.Recordset

Operator = GetSetting(App.EXEName, "User", "Nama")


TglNowValue = Format(Date, "##0")

TgAwal = Format(dtpTgl1.Value, "yyyy-mm-dd")


TgAkhir = Format(DTPTgl2.Value, "yyyy-mm-dd")

SSQl = "Select KodeTransaksi, Jenis, LamaParkir, Nilai " & _


"FROM parkir WHERE " & _
"(TglExitParkir Between '" & TgAwal & "' AND '" & TgAkhir & "') AND
(parkir.Shift = 'SORE') AND " & _
"(parkir.Aktif = 0) AND (parkir.Abodemen = '0') ORDER By parkir.KodeTransaksi"
rsLap.Open SSQl, ConnP, adOpenStatic, adLockPessimistic
Adodc1.RecordSource = SSQl
Adodc1.Refresh
'DataGrid1.DataSource = "adodc1"
DataGrid1.Refresh
Jumlah = 0
Total = 0
If Not rsLap.EOF Then
rsLap.MoveFirst
Do While Not rsLap.EOF
Jumlah = rsLap!Nilai
Total = Total + Jumlah
rsLap.MoveNext
Loop
End If

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMobil = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMobil = TotMobil + 1
rsQty.MoveNext
Loop
End If
txtTotMobil.Text = TotMobil
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMotor = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMotor = TotMotor + 1
rsQty.MoveNext
Loop
End If
txtTotMotor.Text = TotMotor
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotBox = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotBox = TotBox + 1
rsQty.MoveNext
Loop
End If
txtTotBox.Text = TotBox
Set rsQty = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMobil.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMobil.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMotor.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMotor.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'SORE') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiBox.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiBox.Text = "0"
End If
Set rsNilai = Nothing

TxtJumlah.Text = Total
txtJumlahNilai.Text = Format(Total, "#,##0")
'lblUnit.Caption = JUnit
lblUnit.Caption = Adodc1.Recordset.RecordCount
Exit Sub

End Sub

Private Sub ShiftPagi()


Dim SSQl, QMob, QMot, QBox, Jenis As String
Dim TGV, Jumlah, Total, SumBox, SumMot, SumMob As Single
Dim TgAwal, TgAkhir As String
Dim TOTAL2, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JUnit, JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Dim rsQty As New ADODB.Recordset
Dim rsLap As New ADODB.Recordset
Dim rsLapMob As New ADODB.Recordset
Dim rsLapMot As New ADODB.Recordset
Dim rsLapBox As New ADODB.Recordset
Dim rsNilai As New ADODB.Recordset

Operator = GetSetting(App.EXEName, "User", "Nama")


TglNowValue = Format(Date, "##0")

TgAwal = Format(dtpTgl1.Value, "yyyy-mm-dd")


TgAkhir = Format(DTPTgl2.Value, "yyyy-mm-dd")

SSQl = "Select KodeTransaksi, Jenis, LamaParkir, Nilai " & _


"FROM parkir WHERE " & _
"(TglExitParkir Between '" & TgAwal & "' AND '" & TgAkhir & "') AND
(parkir.Shift = 'PAGI') AND " & _
"(parkir.Aktif = '0') AND (parkir.Abodemen= '0') ORDER By parkir.KodeTransaksi"
rsLap.Open SSQl, ConnP, adOpenStatic, adLockPessimistic
Adodc1.RecordSource = SSQl
Adodc1.Refresh
'DataGrid1.DataSource = "adodc1"
DataGrid1.Refresh
Jumlah = 0
Total = 0
If Not rsLap.EOF Then
rsLap.MoveFirst
Do While Not rsLap.EOF
Jumlah = rsLap!Nilai
Total = Total + Jumlah
rsLap.MoveNext
Loop
End If

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMobil = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMobil = TotMobil + 1
rsQty.MoveNext
Loop
End If
txtTotMobil.Text = TotMobil
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMotor = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMotor = TotMotor + 1
rsQty.MoveNext
Loop
End If
txtTotMotor.Text = TotMotor
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotBox = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotBox = TotBox + 1
rsQty.MoveNext
Loop
End If
txtTotBox.Text = TotBox
Set rsQty = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMobil.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMobil.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMotor.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMotor.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (Shift = 'PAGI') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiBox.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiBox.Text = "0"
End If
Set rsNilai = Nothing

TxtJumlah.Text = Total
txtJumlahNilai.Text = Format(Total, "#,##0")
'lblUnit.Caption = JUnit
lblUnit.Caption = Adodc1.Recordset.RecordCount
Exit Sub

End Sub

Private Sub AllShift()


Dim SSQl, QMob, QMot, QBox, Jenis As String
Dim TGV, Jumlah, Total, SumBox, SumMot, SumMob As Single
Dim TgAwal, TgAkhir As String
Dim TOTAL2, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JUnit, JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Dim rsQty As New ADODB.Recordset
Dim rsLap As New ADODB.Recordset
Dim rsLapMob As New ADODB.Recordset
Dim rsLapMot As New ADODB.Recordset
Dim rsLapBox As New ADODB.Recordset
Dim rsNilai As New ADODB.Recordset

Operator = GetSetting(App.EXEName, "User", "Nama")


TglNowValue = Format(Date, "##0")

TgAwal = Format(dtpTgl1.Value, "yyyy-mm-dd")


TgAkhir = Format(DTPTgl2.Value, "yyyy-mm-dd")

SSQl = "Select KodeTransaksi, Jenis, LamaParkir, Nilai " & _


"FROM parkir WHERE " & _
"(TglExitParkir Between '" & TgAwal & "' AND '" & TgAkhir & "') AND " & _
"(parkir.Aktif = '0') AND (parkir.Abodemen='0') ORDER By parkir.KodeTransaksi"
rsLap.Open SSQl, ConnP, adOpenStatic, adLockPessimistic
Adodc1.RecordSource = SSQl
Adodc1.Refresh
'DataGrid1.DataSource = "adodc1"
DataGrid1.Refresh
Jumlah = 0
Total = 0
If Not rsLap.EOF Then
rsLap.MoveFirst
Do While Not rsLap.EOF
Jumlah = rsLap!Nilai
Total = Total + Jumlah
rsLap.MoveNext
Loop
End If

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMobil = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMobil = TotMobil + 1
rsQty.MoveNext
Loop
End If
txtTotMobil.Text = TotMobil
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMotor = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMotor = TotMotor + 1
rsQty.MoveNext
Loop
End If
txtTotMotor.Text = TotMotor
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotBox = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotBox = TotBox + 1
rsQty.MoveNext
Loop
End If
txtTotBox.Text = TotBox
Set rsQty = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMobil.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMobil.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMotor.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMotor.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiBox.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiBox.Text = "0"
End If
Set rsNilai = Nothing

TxtJumlah.Text = Total
txtJumlahNilai.Text = Format(Total, "#,##0")
'lblUnit.Caption = JUnit
lblUnit.Caption = Adodc1.Recordset.RecordCount
Exit Sub

End Sub

Private Sub cmdPosting_Click()


Dim strSUM, strSUMIdx, DateNow As String
Dim UMotor, NMotor, UMobil, NMobil, UBox, NBox, UTotal, NTotal As Single

DateNow = Format(dtpTgl1, "yyyy-mm-dd")


UMotor = Val(txtTotMotor.Text)
NMotor = Val(txtNilaiMotor.Text)
UMobil = Val(txtTotMobil.Text)
NMobil = Val(txtNilaiMobil.Text)
UBox = Val(txtTotBox.Text)
NBox = Val(txtNilaiBox.Text)
UTotal = Val(lblUnit.Caption)
NTotal = Val(TxtJumlah.Text)

'strSUM = "SELECT * FROM Summary"


'rsSUM.Open strSUM, ConnP, adOpenDynamic, adLockOptimistic
strSUMIdx = "SELECT * FROM Summary WHERE (Tanggal = '" & DateNow & "')"
rsSUMIdx.Open strSUMIdx, ConnP, adOpenDynamic, adLockOptimistic
If rsSUMIdx.EOF = True Then
ConnP.Execute "INSERT INTO Summary (Tanggal,Unit_Motor, Income_Motor, " & _
"Unit_Mobil, Income_Mobil, Unit_Box, Income_Box, Total_Unit,
Total_Income) VALUES " & _
"('" & DateNow & "', '" & UMotor & "', '" & NMotor & "', '" &
UMobil & "', '" & NMobil & "', " & _
"'" & UBox & "', '" & NBox & "', '" & UTotal & "', '" & NTotal &
"')"

' With rsSUM


' .AddNew
' !Tanggal = DateNow
' !Unit_Motor = UMotor
' !Income_Motor = NMotor
' !Unit_Mobil = UMobil
' !Income_Mobil = NMobil
' !Unit_Box = UBox
' !Income_Box = NBox
' !Total_Unit = UTotal
' !Total_Income = NTotal
' .Update
' End With
Else
ConnP.Execute "UPDATE Summary SET Tanggal = '" & DateNow & "', Unit_Motor = '"
& UMotor & "', Income_Motor = '" & NMotor & "', " & _
"Unit_Mobil = '" & UMobil & "', Income_Mobil= '" & NMobil & "',
Unit_Box = '" & UBox & "', " & _
"Income_Box = '" & NBox & "', Total_Unit = '" & UTotal & "',
Total_Income = '" & NTotal & "' WHERE " & _
"(Tanggal = '" & DateNow & "')"
End If
MsgBox ("Data Tersimpan"), vbInformation + vbOKOnly, "SISTEM"
Set rsSUM = Nothing
rsSUMIdx.Close

End Sub

Private Sub cmdTampilkan_Click()

If Option3.Value = True Then ByJenis


If Option4.Value = True Then ShiftPagi
If Option5.Value = True Then ShiftSore
If Option6.Value = True Then AllShift
If Option1.Value = True Then ByOperator
DataGrid1.Columns(3).Alignment = dbgRight
DataGrid1.Columns(2).Alignment = dbgCenter
DataGrid1.Columns(3).NumberFormat = "#,##0"
DataGrid1.Columns(2).NumberFormat = "hh:mm"

cmdTampilkan.SetFocus
End Sub

Private Sub Command1_Click()


Unload Me
End
End Sub

Private Sub cmdLapHari_Click()


Me.Hide
FrmLapHarian.Show
End Sub

Private Sub Command3_Click()

End Sub

Private Sub dtpTgl1_Change()


DTPTgl2.Value = dtpTgl1.Value
End Sub

Private Sub Form_Activate()


Dim DT1, DT2 As String
Dim Jumlah, Total As Single
'ConnP.Execute "UPDATE `parkir` SET `Nilai`= `Nilai`*1000 WHERE `nilai`< 20"
'ConnP.Execute "UPDATE `parkir` SET `Nilai`= 0 WHERE `nilai`=1000"

' Option1.Value = True


' dtpTgl1.Value = Format(Date - 30, "dd/mm/yyyy")
' DTPTgl2.Value = Format(Date, "dd/mm/yyyy")
' txtPalka.Text = "ALL"
DT1 = Format(Date, "yyyy-mm-dd")
DT2 = Format(Date, "yyyy-mm-dd")

Adodc1.RecordSource = "Select KodeTransaksi, Jenis, Nilai, LamaParkir FROM


parkir WHERE (TglTransaksi = '" & DT1 & "') AND (Nilai > 0)"
Adodc1.Refresh

Jumlah = 0
Total = 0
' On Error GoTo Hell
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
Jumlah = Val(Adodc1.Recordset!Nilai)
Total = Total + Jumlah
Adodc1.Recordset.MoveNext
Loop
End If

Option4.Value = True
' cboNoFaktur.Visible = False
' DtpTgl.Value = Format(Date, "dd/mm/yyyy")
dtpTgl1.Value = Format(Date, "dd/mm/yyyy")
DTPTgl2.Value = Format(Date, "dd/mm/yyyy")
DTPTgl3.Value = Format(Date, "dd/mm/yyyy")
DTPTgl4.Value = Format(Date, "dd/mm/yyyy")
DTPTgl6.Value = Format(Date, "dd/mm/yyyy")
DTPTgl7.Value = Format(Date, "dd/mm/yyyy")
DataGrid1.Columns(2).Alignment = dbgRight
DataGrid1.Columns(3).Alignment = dbgCenter
DataGrid1.Columns(2).NumberFormat = "#,##0"
DataGrid1.Columns(3).NumberFormat = "hh:mm"
txtJumlahNilai.Text = Format(Total, "#,##0")
DataGrid1.Refresh
' Me.WindowState = 2
'Hell:
'MsgBox (Err.Description)
End Sub

Private Function RKanan(NData, CFormat) As String


RKanan = Format(NData, CFormat)
RKanan = Space(Len(CFormat) - Len(RKanan)) + RKanan
End Function

Private Sub Form_Load()


Me.Width = 14130
Me.Height = 9060
End Sub

Private Sub Form_Unload(Cancel As Integer)


Me.Hide
End
End Sub

Private Sub Option1_Click()


txtOperator.SetFocus
End Sub

Private Sub ByOperator()


Dim SSQl, QMob, QMot, QBox, Jenis, OpID As String
Dim TGV, Jumlah, Total, SumBox, SumMot, SumMob As Single
Dim TgAwal, TgAkhir As String
Dim TOTAL2, TotMotor, TotMobil, TotBox, NilaiMotor, NilaiMobil, NilaiBox,
TglNowValue As Single
Dim JUnit, JumlahNilaiMobil, JumlahNilaiMotor, JumlahNilaiBox As Single
Dim Operator As String
Dim rsQty As New ADODB.Recordset
Dim rsLap As New ADODB.Recordset
Dim rsLapMob As New ADODB.Recordset
Dim rsLapMot As New ADODB.Recordset
Dim rsLapBox As New ADODB.Recordset
Dim rsNilai As New ADODB.Recordset

OpID = txtOperator.Text
'Operator = GetSetting(App.EXEName, "User", "Nama")
TglNowValue = Format(Date, "##0")

TgAwal = Format(DTPTgl6.Value, "yyyy-mm-dd")


TgAkhir = Format(DTPTgl7.Value, "yyyy-mm-dd")

SSQl = "Select KodeTransaksi, Jenis, LamaParkir, Nilai " & _


"FROM parkir WHERE " & _
"(TglExitParkir Between '" & TgAwal & "' AND '" & TgAkhir & "') AND
(parkir.OperatorExit = '" & OpID & "') AND " & _
"(parkir.Aktif = 0) AND (parkir.Tag=-1) AND (CardID IS NULL) ORDER By
parkir.KodeTransaksi"
rsLap.Open SSQl, ConnP, adOpenStatic, adLockPessimistic
Adodc1.RecordSource = SSQl
Adodc1.Refresh
'DataGrid1.DataSource = "adodc1"
DataGrid1.Refresh
Jumlah = 0
Total = 0
If Not rsLap.EOF Then
rsLap.MoveFirst
Do While Not rsLap.EOF
Jumlah = rsLap!Nilai
Total = Total + Jumlah
rsLap.MoveNext
Loop
End If

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMobil = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMobil = TotMobil + 1
rsQty.MoveNext
Loop
End If
txtTotMobil.Text = TotMobil
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotMotor = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotMotor = TotMotor + 1
rsQty.MoveNext
Loop
End If
txtTotMotor.Text = TotMotor
Set rsQty = Nothing

rsQty.Open "SELECT KodeTransaksi FROM parkir WHERE (TglExitParkir " & _


"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
TotBox = 0
If Not rsQty.EOF Then
rsQty.MoveFirst
Do While Not rsQty.EOF
TotBox = TotBox + 1
rsQty.MoveNext
Loop
End If
txtTotBox.Text = TotBox
Set rsQty = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'MOBIL') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMobil.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMobil.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'MOTOR') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiMotor.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiMotor.Text = "0"
End If
Set rsNilai = Nothing

rsNilai.Open "SELECT SUM(Nilai) AS TotalNilai FROM parkir WHERE (TglExitParkir


" & _
"BETWEEN '" & TgAwal & "' AND '" & TgAkhir & "') AND (OperatorExit = '" & OpID
& " ') " & _
"AND (Jenis = 'BOX') AND (Aktif = 0)", ConnP, adOpenDynamic, adLockOptimistic
If IsNull(rsNilai!TotalNilai) = False Then
txtNilaiBox.Text = Val(rsNilai!TotalNilai)
Else
txtNilaiBox.Text = "0"
End If
Set rsNilai = Nothing

TxtJumlah.Text = Total
txtJumlahNilai.Text = Format(Total, "#,##0")
'lblUnit.Caption = JUnit
lblUnit.Caption = Adodc1.Recordset.RecordCount
Exit Sub

End Sub

Private Sub Option3_Click()


' cboNoFaktur.Visible = False
' DtpTgl.Visible = True
' cmdTampil.Visible = False
' dtpTgl1.Visible = False
' cboCustomer.Visible = False
' cmdCari.Visible = True
txtJenis.Visible = True
TxtJumlah.Text = "0"
txtJenis.SetFocus
End Sub

Private Sub Option4_Click()


' cboNoFaktur.Visible = False
' cboCustomer.Visible = False
' DtpTgl.Visible = False
' txtOpID.Visible = False
' cmdCari.Visible = False
dtpTgl1.Visible = True
' cmdTampil.Visible = True
' cmdTampil.SetFocus
TxtJumlah.Text = "0"
End Sub

Private Sub Option5_Click()


' cboNoFaktur.Visible = False
' cboCustomer.Visible = True
' DtpTgl.Visible = False
' txtOpID.Visible = False
' cmdCari.Visible = False
' dtpTgl1.Visible = False
' cmdTampil.Visible = False
' cboCustomer.SetFocus
' TxtJumlahHarga.Text = "0"

End Sub

Private Sub Text1_GotFocus()


Command1.SetFocus
End Sub
Private Sub ByNoPol()
Dim Jumlah, Total, TglValue As Single
TglValue = Format(DtpTgl.Value, "##0")
strSQL = "SELECT parkir.KodeTransaksi, parkir.Tanggal, parkir.Jam, " & _
"parkir.Nilai, Operator.NamaOperator as [Operator] " & _
"FROM Parkir, Operator WHERE " & _
"(parkir.OpID = '" & OpID & "') AND " & _
"(parkir.OpID = Operator.OperatorID) AND " & _
"(parkir.TglValue = " & TglValue & ")"
Data1.RecordSource = strSQL
Data1.Refresh

Jumlah = 0
Total = 0
' On Error GoTo Hell
If Not Data1.Recordset.RecordCount = 0 Then
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
Jumlah = Data1.Recordset![Nilai]
Total = Total + Jumlah
Data1.Recordset.MoveNext
Loop
' DBGrid1.Top = 2160
' DBGrid1.Height = 5535
Else
Exit Sub
End If

' HIdeUM False


TxtJumlahHarga.Text = Total
Exit Sub
'Hell:
'MsgBox (err.Description)

End Sub

Private Sub txtJenis_Click()


Option3.Value = True
End Sub

Private Sub txtJenis_KeyPress(KeyAscii As Integer)


StrValid 3, KeyAscii, True, cmdTampilkan
End Sub

Private Sub TxtJumlah_Change()


Text1.Text = Format(TxtJumlah.Text, "#,###,##0")
End Sub
Private Sub txtNilaiBox_Change()
Text4.Text = Format(txtNilaiBox.Text, "#,##0")
End Sub

Private Sub txtNilaiMobil_Change()


Text3.Text = Format(txtNilaiMobil.Text, "#,##0")
End Sub

Private Sub txtNilaiMotor_Change()


Text2.Text = Format(txtNilaiMotor.Text, "#,##0")
End Sub

You might also like