novaldoankajaAvatar border
TS
novaldoankaja
Membuat Aplikasi billing tanpa server dengan vb 6.0
Assalamualaikum Wr. Wb.
Lam Kenal… saya noval ingin berbagi tentang cara pembuatan applikasi billing sederhana tanpa server menggunakan pemrograman visual basic 6.0
Mudah2xan bisa bermanfaat untuk pembelajaran atau untuk pembuatan program sejenisnya…
Ok kita mulai saja
Berikut sample program yang sudah pernah saya buat billing tanpa server ver 1.14
Spoiler for "tampilan awal":

Spoiler for "tampilan masuk billing":

Applikasi billing tanpa server ver 1.14 (versi trial ada iklannya) dapat di download di
Spoiler for "link download":

Kali ini saya akan membuat inti programnya saja dengan tampilan yang lebih sederhana yaitu fitur halaman depan, masuk login, fitur untuk setting biaya dan lihat data pengguna tanpa menggunakan tambahan efek tombol dan icon2x seperti program diatas..

Ok kita mulai… bismillah,, mudah2xan gampang di mengerti… mohon maaf apabila ada kekurangan dalam penjelasan.. saya harap dengan hanya melihat koding dan tampilannya saja sudah bisa dimengerti..

Ada dua FORM… Form_utama dan masuk_billing
Spoiler for "tampilan form_utama":

Spoiler for "tampilan form masuk_billing":


Databaseny pake msaccess kk
Kita bikin dulu strukturny seperti ini
table data_pengguna
Code:
Field name data type
Id autonumber
Tanggal text
Jam_mulai text
Nama_user text
Jenis_paket text
Biaya text

Table setting_biaya
Code:
Field name data type
Id autonumber
Nama_paket text
Tarif_awal text
Menit_awal text
Tariff_berikutnya text
Menit_berikutnya text
Otomatis_mati text

Spoiler for "tampilan database ms access":

Ok kita mulai koding ny …

Dimulai yang di form_utama
Code:

'========source code billing sederhana tanpa server ===========
'== created by novaldoankaja ==
'== website [url=http://www.komputerservicecenter.com]www.komputerservicecenter.com[/url] ==
'== email [email]novaldoankaja@gmail.com[/email] ==
'== karawang, 29 november 2013 ==
'== === == == == ==
'== == == == === ==
'== == == = == == ==
'== == === == == was here ==
'==============================================================


'api function on top windows

Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, _
ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long


Public Function SetTopMostWindow(hwnd As Long, Topmost As Boolean) As Long
If (Topmost) Then
SetTopMostWindow = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
Else
SetTopMostWindow = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
SetTopMostWindow = False
End If
End Function

Private Sub Check1_Click()
If Check1.Value = 0 Then
Text7.Text = "0"
End If
End Sub



Private Sub Command1_Click()
End
End Sub

Private Sub Command10_Click() 'tutup frame setting dan kembali ke frame utama
If Command10.Caption = "Close" Then
Frame_utama.Visible = True
Frame_setting.Visible = False
ElseIf Command10.Caption = "Cancel" Then
Command7.Caption = "Add"
Command10.Caption = "Close"
Command8.Enabled = True
Command9.Enabled = True
DataGrid1.Enabled = True
End If
End Sub

Private Sub Command11_Click() 'tutup data pengguna kembali ke frame utama
Frame_utama.Visible = True
Frame_pengguna.Visible = False

End Sub

Private Sub Command2_Click() 'shutdown kompi om
Call Shell("shutdown -s -t 0 -f")
End Sub

Private Sub Command3_Click() 'restart komputer mas bro
Call Shell("shutdown -r -t 0 -f")
End Sub

Private Sub Command4_Click() 'START MASUK billing
If Not Text1.Text = "" Then
If Not Combo1.Text = "" Then
masuk_billing.Show
masuk_billing.Text1.Text = Form_utama.Text1.Text
masuk_billing.Text3.Text = Form_utama.Combo1.Text
masuk_billing.Text2.Text = Time
Unload Me
End If
End If
End Sub

Private Sub Command5_Click() 'buka frame setting biaya
Frame_setting.Visible = True
Frame_utama.Visible = False
End Sub

Private Sub Command6_Click() 'tampil frame pengguna untuk melihat data pengguna
Frame_pengguna.Visible = True
Frame_utama.Visible = False
End Sub

Private Sub Command7_Click() 'add setting biaya
If Command7.Caption = "Add" Then
Command8.Enabled = False
Command9.Enabled = False
Command10.Caption = "Cancel"
Command7.Caption = "Save"
Text2.Text = ""
Text3.Text = "0"
Text4.Text = "0"
Text5.Text = "0"
Text6.Text = "0"
Text7.Text = "0"
Check1.Value = 0
DataGrid1.Enabled = False
ElseIf Command7.Caption = "Save" Then
If Not Text2.Text = "" Then
simpan_setting_biaya
'reload program untuk reload data di combo1
Combo1.Clear
isi_combo1 'memanggil prosedur tampilkan jenis paket di combo1
End If
End If
End Sub
Private Sub simpan_setting_biaya()
With Adodc1
.Recordset.AddNew
.Recordset("nama_paket") = Text2.Text
.Recordset("tarif_awal") = Text3.Text
.Recordset("menit_awal") = Text4.Text
.Recordset("tarif_berikutnya") = Text5.Text
.Recordset("menit_berikutnya") = Text6.Text
.Recordset("otomatis_mati") = Text7.Text
.Recordset.Update
End With
Command7.Caption = "Add"
Command10.Caption = "Close"
Command8.Enabled = True
Command9.Enabled = True
DataGrid1.Enabled = True
End Sub

Private Sub Command8_Click() 'update jenis paket
If Not Text2.Text = "" Then
With Adodc1
.Recordset("nama_paket") = Text2.Text
.Recordset("tarif_awal") = Text3.Text
.Recordset("menit_awal") = Text4.Text
.Recordset("tarif_berikutnya") = Text5.Text
.Recordset("menit_berikutnya") = Text6.Text
.Recordset("otomatis_mati") = Text7.Text
.Recordset.Update
End With
End If
'reload program untuk reload data di combo1
Combo1.Clear
isi_combo1 'memanggil prosedur tampilkan jenis paket di combo1
End Sub

Private Sub Command9_Click() 'delete / hapus jenis biaya
With Adodc1
If Not .Recordset.RecordCount = 0 Then
.Recordset.Delete
End If
End With
'reload program untuk reload data di combo1
Combo1.Clear
isi_combo1 'memanggil prosedur tampilkan jenis paket di combo1
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
tampil_data_setting
End Sub
Private Sub tampil_data_setting()
On Error Resume Next
With Adodc1
If Not .Recordset.RecordCount = 0 Then
Text2.Text = .Recordset("nama_paket")
Text3.Text = .Recordset("tarif_awal")
Text4.Text = .Recordset("menit_awal")
Text5.Text = .Recordset("tarif_berikutnya")
Text6.Text = .Recordset("menit_berikutnya")
Text7.Text = .Recordset("otomatis_mati")
If Not Text7.Text = "0" Then
Check1.Value = 1
ElseIf Text7.Text = "0" Then
Check1.Value = 0
End If
End If
End With
End Sub

Private Sub Form_Load()
'SetTopMostWindow Me.hwnd, True 'fungsi on top windows
'App.TaskVisible = False 'hidden dari task manager


koneksi_data_setting_biaya 'memanggil koneksi data setting biaya
isi_combo1 'memanggil prosedur tampilkan jenis paket di combo1
koneksi_data_pengguna


tampilan_awal 'tampilan awal ketika program baru di jalankan

End Sub
Private Sub tampilan_awal()
'tampilan awal ketika program baru di jalankan

'====================posisi frame_utama ke tengah layar==============
Dim Atas1 As Long
Dim Kiri1 As Long
Atas1 = (Screen.Height - Frame_utama.Height) / 2
Kiri1 = (Screen.Width - Frame_utama.Width) / 2
Frame_utama.Move Kiri1, Atas1

'=================posisis frame_setting ke tengah layar============
Dim atas2 As Long
Dim kiri2 As Long
atas2 = (Screen.Height - Frame_setting.Height) / 2
kiri2 = (Screen.Width - Frame_setting.Width) / 2
Frame_setting.Move kiri2, atas2

'=================posisis frame_pengguna ke tengah layar============
Dim atas3 As Long
Dim kiri3 As Long
atas3 = (Screen.Height - Frame_pengguna.Height) / 2
kiri3 = (Screen.Width - Frame_pengguna.Width) / 2
Frame_pengguna.Move kiri3, atas3


'frame yang ditampilkan awal frame_utama
Frame_utama.Visible = True
Frame_setting.Visible = False
Frame_pengguna.Visible = False

'tampilkan tanggal data pengguna skg
Text8.Text = Format(Date, "dd/mm/yyyy")

End Sub
Private Sub koneksi_data_setting_biaya()
'on error resume next
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\billing.mdb;Persist Security Info=false"
.CommandType = adCmdUnknown
'buka data jenis paket
.RecordSource = "select * from jenis_paket"
.Refresh
End With
End Sub

Private Sub isi_combo1() 'fungsi menampilkan jenis paket di combo1
With Adodc1
If Not .Recordset.RecordCount = 0 Then
.Recordset.MoveFirst
Do Until .Recordset.EOF = True
Combo1.AddItem .Recordset("nama_paket")
.Recordset.MoveNext
Loop
End If
End With
End Sub
Private Sub koneksi_data_pengguna()
With Adodc2
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\billing.mdb;Persist Security Info=false"
.CommandType = adCmdUnknown

End With
End Sub

Private Sub Text7_Change()
If Text7.Text = "0" Then
Check1.Value = 1
End If
End Sub

Private Sub Text8_Change() 'tampilkan data pengguna
On Error Resume Next 'error handler pencegahan salah input pencarian database
isi_tanggal = Text8.Text
With Adodc2
.RecordSource = "select * from data_pengguna where tanggal = '" & isi_tanggal & "'"
.Refresh
End With
End Sub

Yang di form masuk_billing
Code:

'========source code billing sederhana tanpa server ===========
'== created by novaldoankaja ==
'== website [url=http://www.komputerservicecenter.com]www.komputerservicecenter.com[/url] ==
'== email [email]novaldoankaja@gmail.com[/email] ==
'== karawang, 29 november 2013 ==
'== === == == == ==
'== == == == === ==
'== == == = == == ==
'== == === == == was here ==
'==============================================================


Dim TotalTenthDetik, TotalDetik, TenthDetik, Detik, _
Menit, Jam As Integer
Dim Jam1 As String

Private Sub Command1_Click() 'STOP Billing
Unload Me
End Sub

Private Sub Form_Load()

Timer1.Enabled = True
TotalTenthDetik = -1
koneksi_jenis_paket
koneksi_data_pengguna
masuk_billing.Height = 3825
masuk_billing.Width = 4500
End Sub
Private Sub koneksi_data_pengguna()
With Adodc2
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\billing.mdb;Persist Security Info=False"
.CommandType = adCmdUnknown
End With
End Sub
Private Sub koneksi_jenis_paket()
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\billing.mdb;Persist Security Info=False"
.CommandType = adCmdUnknown
End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
simpan_data
Form_utama.Show
Unload Me
End Sub
Private Sub simpan_data()
'on error resume next
With Adodc2
.RecordSource = "select * from data_pengguna"
.Refresh
.Recordset.AddNew
.Recordset("tanggal") = Text5.Text
.Recordset("jam_mulai") = Text2.Text
.Recordset("nama_user") = Text1.Text
.Recordset("jenis_paket") = Text3.Text
.Recordset("biaya") = Text4.Text
.Recordset.Update
End With
End Sub

Private Sub Label6_Change() 'menampilkan status timer di form masuk billing
masuk_billing.Caption = Label6.Caption
End Sub

Private Sub Text3_Change()
'tampil jenis paket
isi_paket = Text3.Text
With Adodc1
.RecordSource = "select * from jenis_paket where nama_paket = '" & isi_paket & "'"
.Refresh
If Not .Recordset.RecordCount = 0 Then
Text5.Text = Format(Date, "dd/mm/yyyy")
Text10.Text = .Recordset("tarif_awal")
Text9.Text = .Recordset("menit_awal")
If Len(Text9.Text) = 1 Then
Text9.Text = "0" & Text9.Text
End If
Text8.Text = .Recordset("tarif_berikutnya")
Text6.Text = .Recordset("menit_berikutnya")
If Len(Text6.Text) = 1 Then
Text6.Text = "0" & Text6.Text
End If

Text7.Text = .Recordset("otomatis_mati")
Text4.Text = Val(Text4.Text) + Val(Text10.Text)
text_stack.Text = Text6.Text
End If
End With
End Sub

Private Sub Label8_Change()
Dim bantuan As String
If text_stack.Text = Label8.Caption Then
Text4.Text = Val(Text4.Text) + Val(Text8.Text)
text_stack.Text = Val(text_stack.Text) + Val(Text6.Text)
If Len(text_stack.Text) = 1 Then
bantuan = "0"
text_stack.Text = bantuan & text_stack.Text
End If
End If
End Sub

Private Sub text_stack_Change() 'batasan melewati 60 menit
If text_stack.Text >= 60 Then
text_stack.Text = Text6.Text
End If
End Sub

Private Sub Text7_Change() 'bantuan agar selalu dalam 2 digit
If Len(Text7.Text) = 1 Then
Text7.Text = "0" & Text7.Text
End If
End Sub

Private Sub Timer1_Timer() 'inti pemrograman billing ada pada timer
'Tambah dengan satu untuk total sepersepuluh detik.
'Kita mengeset interval Timer menjadi 10, jadi
'setiap sepersepuluh detik prosedur ini akan
'dieksekusi
TotalTenthDetik = TotalTenthDetik + 1
'Jika TotalTenthSeconds = 10,
'set kembali menjadi 0.
TenthDetik = TotalTenthDetik Mod 10
'10 kali sepersepuluh detik sama dengan 1 detik.
'int - akan mengembalikan bilangan integer (bulat)
'dari pecahan 'Contoh: Int(0.9) = 0 menghasilkan 0
TotalDetik = Int(TotalTenthDetik / 10)
'Jika variabel Seconds = 60, set kembali menjadi 0
Detik = TotalDetik Mod 60
If Len(Detik) = 1 Then
Detik = "0" & Detik 'Agar selalu dalam dua
'digit
End If
Menit = Int(TotalDetik / 60) Mod 60
If Len(Menit) = 1 Then
Menit = "0" & Menit 'Agar selalu dalam dua
'digit
End If
'==============tambahan rumus=============
batas_mati = Int(TotalDetik / 60)
If Len(batas_mati) = 1 Then
batas_mati = "0" & batas_mati
End If
'=========================================
Jam = Int(TotalDetik / 3600)
If Jam < 9 Then
Jam1 = "0" & Jam 'Agar selalu dalam dua
'digit
End If
'Tampilkan hasilnya di Label6 (update terus Label6)
Label6 = Jam1 & " : " & Menit & " : " & Detik

Label8 = Menit
Label22 = batas_mati
End Sub

Private Sub Label22_Change() 'otimatis mati berdasarkan menit
If Not Text7.Text = "0" Then
If Label22.Caption = Text7.Text Then

Unload Me
End If
End If
End Sub

dan hasilnya emoticon-I Love Indonesia (S)emoticon-I Love Indonesia (S) emoticon-I Love Indonesia (S)
Spoiler for "tampilan depan":

Spoiler for "masuk billing":

Trima kasih…
Download source code di
[url]http://www.zid*du.com/download/23369750/sourcecode.zip.html[/url] >>>via zid*du
Pengen kenal ma saya
add fb nkkeren@yahoo.comemoticon-Malu
sya cuman tukang service komputer panggilan emoticon-Malu
website www.komputerservicecenter.com
Diubah oleh novaldoankaja 30-12-2013 01:18
0
7K
12
GuestAvatar border
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
Programmer ForumKASKUS Official
20.2KThread4.3KAnggota
Terlama
GuestAvatar border
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Ikuti KASKUS di
© 2023 KASKUS, PT Darta Media Indonesia. All rights reserved.