02.02.2013 Views

DAFTAR PUSTAKA Ridho Mahdi, 2006, Pemrograman Gambas ...

DAFTAR PUSTAKA Ridho Mahdi, 2006, Pemrograman Gambas ...

DAFTAR PUSTAKA Ridho Mahdi, 2006, Pemrograman Gambas ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>DAFTAR</strong> <strong>PUSTAKA</strong><br />

<strong>Ridho</strong> <strong>Mahdi</strong>, <strong>2006</strong>, <strong>Pemrograman</strong> <strong>Gambas</strong>, Penerbit : Andi, Jogjakarta.<br />

http://gambas.sourceforge.net<br />

Fatansyah, Ir.1999, Basis Data, Bandung, Bandung-Informatika<br />

Ir. Harianto kristanto, (1994), Konsep dan Perancangan Database Penerbit : Andi<br />

Offset Yogyakarta<br />

McLeod, Raymond, Jr., Management information System, 5th, Macmillan<br />

Menguasai MySQL, Priyanto Rahmat, Penerbit : PT Elex Media Komputindo<br />

David Axmark dan Michael “Monty” Widenius, MySQL Manual 5.1, MySQL<br />

AB <strong>2006</strong><br />

Ian Gilfillan, Mastering MySQL 4, Sybex, 2003<br />

Luke Welling dan Aura Thomson, MySQL Tutorial, Sams Publishing, 2003<br />

Paul Dubois, MySQL Second Edition, Sam Publishing, 2003<br />

83


UFUtama<br />

PUBLIC SUB sekretaris()<br />

mnuEntryKeuangan.Enabled = FALSE<br />

mnuCetakLapKeuangan.Enabled = FALSE<br />

MuKartuWarga.Enabled = FALSE<br />

MuSetting.Enabled = FALSE<br />

END<br />

PUBLIC SUB bendahara()<br />

mnuEntryDataWarga.Enabled = FALSE<br />

MuKartuWarga.Enabled = FALSE<br />

mnuCetakLapDataWarga.Enabled = FALSE<br />

MuSetting.Enabled = FALSE<br />

END<br />

PUBLIC SUB ketua()<br />

MuCetak.Enabled = FALSE<br />

MuKartuWarga.Enabled = FALSE<br />

MuSetting.Enabled = FALSE<br />

MuData.Enabled = FALSE<br />

END<br />

PUBLIC SUB MnuExit_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB mnuEntryDataWarga_Click()<br />

frmentrydatawarga.Show<br />

END<br />

PUBLIC SUB mnuLapDataWarga_Click()<br />

frmlapdatawarga.show<br />

END<br />

PUBLIC SUB mnuLogin_Click()<br />

frmlogin.show<br />

END<br />

PUBLIC SUB mnuCetakLapDataWarga_Click()<br />

frmcetaklapdatawarga.Show<br />

END<br />

PUBLIC SUB mnuEntryKeuangan_Click()<br />

frmentrydatakeuangan.show<br />

END<br />

PUBLIC SUB mnuPengguna_Click()<br />

frmpengguna.Show<br />

END<br />

PUBLIC SUB Form_Open()<br />

END<br />

PUBLIC SUB mnuKartuWarga_Click()<br />

frmentrykrtwarga.Show<br />

END<br />

PUBLIC SUB mnuLapKeuangan_Click()<br />

frmlapdatakeuangan.Show<br />

END<br />

PUBLIC SUB mnuCetakLapKeuangan_Click()<br />

frmcetaklapdatakeuangan.Show<br />

END<br />

PUBLIC SUB mnuLogout_Click()<br />

MuData.Enabled = FALSE<br />

MuLaporan.Enabled = FALSE<br />

MuKartuWarga.Enabled = FALSE<br />

MuCetak.Enabled = FALSE<br />

A ‐ 2


MuSetting.Enabled = FALSE<br />

MuHelp.Enabled = FALSE<br />

END<br />

UFPengguna<br />

arrtable[4] AS String<br />

PUBLIC sql AS String<br />

PUBLIC SUB Form_Open()<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

tampilan()<br />

END WITH<br />

tbedit.Enabled = FALSE<br />

tbhapus.Enabled = FALSE<br />

save.Enabled = FALSE<br />

TextBox1.Enabled = FALSE<br />

TextBox2.Enabled = FALSE<br />

TextBox3.Enabled = FALSE<br />

ComboBox1.Enabled = FALSE<br />

ME.Center<br />

END<br />

PUBLIC SUB tambah_Click()<br />

TextBox3.SetFocus<br />

TextBox1.Enabled = TRUE<br />

TextBox2.Enabled = TRUE<br />

TextBox3.Enabled = TRUE<br />

ComboBox1.Enabled = TRUE<br />

save.Enabled = TRUE<br />

WITH mdlkoneksi<br />

SELECT CASE LAST.tag<br />

CASE 1<br />

TRY .koneksi.Close<br />

.konekdb()<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF TextBox3.Text = "" THEN<br />

Message.Error("Silahkan mengisi id anda")<br />

ELSE<br />

TextBox3.SetFocus<br />

.rs = .koneksi.Create("user")<br />

.rs!id_penduduk = CStr(TextBox3.Text)<br />

.rs!username = CStr(TextBox1.Text)<br />

.rs!password = CStr(TextBox2.Text)<br />

.rs!level = CStr(ComboBox1.Text)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

tampilan()<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

ComboBox1.Text = ""<br />

tbedit.Enabled = FALSE<br />

tbhapus.Enabled = FALSE<br />

add.Enabled = TRUE<br />

ENDIF<br />

FINALLY<br />

CATCH<br />

Message.Error(DConv( ERROR .Text))<br />

CASE 2<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

ComboBox1.Text = ""<br />

CASE 3<br />

ME.Close<br />

END SELECT<br />

A ‐ 3


END WITH<br />

END<br />

SUB tampilan()<br />

WITH TableView1<br />

.Rows.Count = 0<br />

.Columns.Count = 4<br />

.Columns[0].Text = "Id penduduk"<br />

.Columns[1].Text = "Username"<br />

.Columns[2].Text = "level"<br />

.Columns[0].Width = "125"<br />

.Columns[1].Width = "150"<br />

A ‐ 4<br />

END WITH<br />

mdlkoneksi.isi(TableView1, "SELECT id_penduduk,username,level FROM user order<br />

by id_penduduk")<br />

'mdlkoneksi.isi(TableView1, "SELECT * FROM user order by id")<br />

END<br />

PUBLIC SUB TableView1_Data(Row AS Integer, Column AS Integer)<br />

arrtable[0] = "id_penduduk"<br />

arrtable[1] = "username"<br />

arrtable[2] = "level"<br />

WITH mdlkoneksi<br />

.rs.MoveTo(Row)<br />

TableView1.Data.Text = Str(.rs[arrtable[column]])<br />

END WITH<br />

END<br />

PUBLIC SUB Form_Close()<br />

WITH mdlkoneksi<br />

.koneksi.Close<br />

END WITH<br />

END<br />

PUBLIC SUB tbhapus_Click()<br />

WITH mdlkoneksi<br />

SELECT Message.Question("Yakin akan Menghapus", "Yes", "No")<br />

CASE 1<br />

sql = "delete from user where id_penduduk = '" & TableView1[TableView1.Row,<br />

0].Text & "'"<br />

.rs = .koneksi.EXEC(sql)<br />

tampilan()<br />

CASE 2<br />

TextBox1.SetFocus<br />

END SELECT<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

ComboBox1.Text = ""<br />

END WITH<br />

END<br />

PUBLIC SUB TableView1_Click()<br />

TextBox3.Text = TableView1[TableView1.Row, 0].Text<br />

TextBox1.Text = TableView1[TableView1.Row, 1].Text<br />

ComboBox1.Text = TableView1[TableView1.Row, 2].Text<br />

TextBox3.Enabled = TRUE<br />

TextBox1.Enabled = TRUE<br />

TextBox2.Enabled = TRUE<br />

ComboBox1.Enabled = TRUE<br />

tbhapus.Enabled = TRUE<br />

tbedit.Enabled = TRUE<br />

END<br />

PUBLIC SUB tbreset_Click()<br />

TextBox3.Text = ""<br />

TextBox1.Text = ""


TextBox2.Text = ""<br />

ComboBox1.Text = ""<br />

END<br />

PUBLIC SUB tbedit_Click()<br />

A ‐ 5<br />

WITH mdlkoneksi<br />

sql = "update user set id_penduduk='" & TextBox3.Text & "',username = '" &<br />

TextBox1.Text & "',password = '" & TextBox2.Text & "',Level = '" & ComboBox1.Text<br />

& "'where id_penduduk='" & TableView1[TableView1.Row, 0].Text & "'"<br />

.rs = .koneksi.Exec(sql)<br />

tampilan()<br />

IF NOT ERROR THEN<br />

Message.Info("pengeditan sukses")<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

ComboBox1.Text = ""<br />

ENDIF<br />

END WITH<br />

END<br />

UFLogin<br />

PUBLIC koneksi AS NEW Connection<br />

PUBLIC SUB konekdb()<br />

WITH koneksi<br />

.type = "mysql"<br />

.host = "localhost"<br />

.Login = "root"<br />

.Password = "shandhe"<br />

.Name = "warga"<br />

END WITH<br />

END<br />

PUBLIC SUB Form_Open()<br />

koneksi = NEW Connection<br />

ME.Center<br />

END<br />

PUBLIC SUB sign_in_Click()<br />

DIM sql AS String<br />

DIM rs AS Result<br />

konekdb()<br />

sql = "select * from user where username = '" & TextBox1.Text & "' and<br />

password='" & TextBox2.Text & "' and level='" & ComboBox1.Text & "'"<br />

rs = koneksi.Exec(sql)<br />

IF rs!level = "admin" THEN<br />

ME.Close<br />

WITH frmutama<br />

.Show<br />

END WITH<br />

ELSE IF rs!level = "sekretaris"<br />

ME.Close<br />

WITH frmutama<br />

frmutama.sekretaris<br />

.Show<br />

END WITH<br />

ELSE IF rs!level = "bendahara"<br />

ME.Close<br />

WITH frmutama<br />

frmutama.bendahara<br />

.Show<br />

END WITH<br />

ELSE IF rs!level = "ketua"<br />

ME.Close<br />

WITH frmutama


END<br />

frmutama.ketua<br />

.Show<br />

END WITH<br />

ELSE<br />

ME.Close<br />

WITH frmutama<br />

frmutama.ketua<br />

.Show<br />

END WITH<br />

ENDIF<br />

PUBLIC SUB exit_Click()<br />

END<br />

ME.Close<br />

UFEntryData Warga<br />

PUBLIC sql AS String<br />

PUBLIC SUB Form_Open()<br />

END<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

END WITH<br />

tbreset.Enabled = FALSE<br />

save.Enabled = FALSE<br />

TextBox1.Enabled = FALSE<br />

TextBox2.Enabled = FALSE<br />

TextBox3.Enabled = FALSE<br />

TextBox4.Enabled = FALSE<br />

ComboBox1.Enabled = FALSE<br />

ComboBox2.Enabled = FALSE<br />

ComboBox3.Enabled = FALSE<br />

combobox9.Enabled = FALSE<br />

ComboBox5.Enabled = FALSE<br />

ComboBox6.Enabled = FALSE<br />

ComboBox7.Enabled = FALSE<br />

combobox8.Enabled = FALSE<br />

ME.Center<br />

PUBLIC SUB tambah_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

TextBox1.SetFocus<br />

TextBox1.Enabled = TRUE<br />

TextBox2.Enabled = TRUE<br />

TextBox3.Enabled = TRUE<br />

TextBox4.Enabled = TRUE<br />

ComboBox1.Enabled = TRUE<br />

ComboBox2.Enabled = TRUE<br />

ComboBox3.Enabled = TRUE<br />

combobox9.Enabled = TRUE<br />

ComboBox5.Enabled = TRUE<br />

ComboBox6.Enabled = TRUE<br />

ComboBox7.Enabled = TRUE<br />

combobox8.Enabled = TRUE<br />

save.Enabled = TRUE<br />

tbreset.Enabled = TRUE<br />

WITH mdlkoneksi<br />

SELECT CASE LAST.tag<br />

CASE 1<br />

TRY .koneksi.Close<br />

.konekdb()<br />

A ‐ 6


.koneksi.Open<br />

.koneksi.Begin<br />

IF TextBox1.Text = "" THEN<br />

Message.Error("Silahkan mengisi nama anda")<br />

ELSE<br />

TextBox1.SetFocus<br />

.rs = .koneksi.Create("data_warga")<br />

.rs!id_penduduk = CStr(TextBox1.Text)<br />

.rs!nama_lengkap = CStr(TextBox2.Text)<br />

.rs!alamat = CStr(TextBox3.Text)<br />

.rs!pekerjaan = CStr(TextBox4.Text)<br />

.rs!jns_kelamin = CStr(combobox9.Text)<br />

.rs!pendidikan = CStr(ComboBox5.Text)<br />

.rs!status_rumah = CStr(ComboBox6.Text)<br />

.rs!status_penghuni = CStr(ComboBox7.Text)<br />

.rs!status_keluarga = CStr(combobox8.Text)<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tgl_lahir = Date(thn, bln, tgl)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

add.Enabled = TRUE<br />

ENDIF<br />

FINALLY<br />

CATCH<br />

Message.Error(DConv( ERROR .Text))<br />

CASE 2<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

TextBox4.Text = ""<br />

ComboBox5.Text = ""<br />

ComboBox6.Text = ""<br />

ComboBox7.Text = ""<br />

combobox8.Text = ""<br />

ComboBox1.Text = ""<br />

ComboBox2.Text = ""<br />

ComboBox3.Text = ""<br />

combobox9.Text = ""<br />

CASE 3<br />

ME.Close<br />

END SELECT<br />

END WITH<br />

END<br />

PUBLIC SUB Form_Close()<br />

WITH mdlkoneksi<br />

.koneksi.Close<br />

END WITH<br />

END<br />

PUBLIC SUB tbreset_Click()<br />

A ‐ 7


TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

TextBox4.Text = ""<br />

ComboBox5.Text = ""<br />

ComboBox6.Text = ""<br />

ComboBox7.Text = ""<br />

combobox8.Text = ""<br />

ComboBox1.Text = ""<br />

ComboBox2.Text = ""<br />

ComboBox3.Text = ""<br />

combobox9.Text = ""<br />

END<br />

UFEntry Data Keuangan<br />

PUBLIC sql AS String<br />

PUBLIC SUB Form_Open()<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

END WITH<br />

aturtombol(FALSE)<br />

save1.Enabled = FALSE<br />

save2.Enabled = FALSE<br />

save3.Enabled = FALSE<br />

save4.Enabled = FALSE<br />

save5.Enabled = FALSE<br />

reset.Enabled = FALSE<br />

ME.Center<br />

END<br />

SUB aturtombol1(test AS Boolean)<br />

TextBox1.Text = test<br />

TextBox2.Text = test<br />

TextBox3.Text = test<br />

TextBox4.Text = test<br />

TextBox5.Text = test<br />

TextBox6.Text = test<br />

TextBox7.Text = test<br />

TextBox8.Text = test<br />

TextBox9.Text = test<br />

TextBox10.Text = test<br />

TextBox11.Text = test<br />

TextBox12.Text = test<br />

TextBox13.Text = test<br />

TextBox14.Text = test<br />

TextBox15.Text = test<br />

ComboBox4.Text = test<br />

ComboBox5.Text = test<br />

ComboBox6.Text = test<br />

ComboBox7.Text = test<br />

ComboBox8.Text = test<br />

END<br />

SUB aturtombol(isi AS Boolean)<br />

ComboBox1.Enabled = isi<br />

ComboBox2.Enabled = isi<br />

ComboBox3.Enabled = isi<br />

ComboBox4.Enabled = isi<br />

ComboBox5.Enabled = isi<br />

ComboBox6.Enabled = isi<br />

ComboBox7.Enabled = isi<br />

ComboBox8.Enabled = isi<br />

TextBox1.Enabled = isi<br />

TextBox2.Enabled = isi<br />

TextBox3.Enabled = isi<br />

TextBox4.Enabled = isi<br />

TextBox5.Enabled = isi<br />

TextBox6.Enabled = isi<br />

TextBox7.Enabled = isi<br />

TextBox14.Enabled = isi<br />

TextBox8.Enabled = isi<br />

A ‐ 8


TextBox9.Enabled = isi<br />

TextBox10.Enabled = isi<br />

TextBox11.Enabled = isi<br />

TextBox12.Enabled = isi<br />

TextBox13.Enabled = isi<br />

TextBox14.Enabled = isi<br />

TextBox15.Enabled = isi<br />

END<br />

PUBLIC SUB save1_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

DIM dbt AS Integer<br />

DIM kdt AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF ComboBox4.Text = "" THEN<br />

Message.Error("Silahkan mengisi ID Transaksi")<br />

ELSE<br />

TextBox1.SetFocus<br />

.rs = .koneksi.Create("data_keuangan")<br />

.rs!id_transaksi = CStr(ComboBox4.Text)<br />

.rs!uraian = CStr(TextBox1.Text)<br />

IF TextBox2.Text = "" THEN<br />

dbt = 0<br />

ELSE<br />

dbt = CInt(TextBox2.Text)<br />

ENDIF<br />

IF TextBox3.Text = "" THEN<br />

kdt = 0<br />

ELSE<br />

kdt = CInt(TextBox3.Text)<br />

ENDIF<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tanggal = Date(thn, bln, tgl)<br />

.rs!debit = (dbt)<br />

.rs!kredit = (kdt)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

'aturtombol1("")<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB save5_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

A ‐ 9


DIM dbt AS Integer<br />

DIM kdt AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

.koneksi.Close<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF ComboBox8.Text = "" THEN<br />

Message.Error("Silahkan mengisi ID Transaksi")<br />

ELSE<br />

TextBox1.SetFocus<br />

.rs = .koneksi.Create("data_keuangan")<br />

.rs!id_transaksi = CStr(ComboBox8.Text)<br />

.rs!uraian = CStr(TextBox15.Text)<br />

IF TextBox14.Text = "" THEN<br />

dbt = 0<br />

ELSE<br />

dbt = CInt(TextBox14.Text)<br />

ENDIF<br />

IF TextBox13.Text = "" THEN<br />

kdt = 0<br />

ELSE<br />

kdt = CInt(TextBox13.Text)<br />

ENDIF<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tanggal = Date(thn, bln, tgl)<br />

.rs!debit = (dbt)<br />

.rs!kredit = (kdt)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

'aturtombol1("")<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB save2_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

DIM dbt AS Integer<br />

DIM kdt AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

.koneksi.Close<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF ComboBox5.Text = "" THEN<br />

Message.Error("Silahkan mengisi ID Transaksi")<br />

ELSE<br />

TextBox1.SetFocus<br />

A ‐ 10


.rs = .koneksi.Create("data_keuangan")<br />

.rs!id_transaksi = CStr(ComboBox5.Text)<br />

.rs!uraian = CStr(TextBox6.Text)<br />

IF TextBox5.Text = "" THEN<br />

dbt = 0<br />

ELSE<br />

dbt = CInt(TextBox5.Text)<br />

ENDIF<br />

IF TextBox4.Text = "" THEN<br />

kdt = 0<br />

ELSE<br />

kdt = CInt(TextBox4.Text)<br />

ENDIF<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tanggal = Date(thn, bln, tgl)<br />

.rs!debit = (dbt)<br />

.rs!kredit = (kdt)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

'aturtombol1("")<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB save3_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

DIM dbt AS Integer<br />

DIM kdt AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

.koneksi.Close<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF ComboBox6.Text = "" THEN<br />

Message.Error("Silahkan mengisi ID Transaksi")<br />

ELSE<br />

TextBox1.SetFocus<br />

.rs = .koneksi.Create("data_keuangan")<br />

.rs!id_transaksi = CStr(ComboBox6.Text)<br />

.rs!uraian = CStr(TextBox9.Text)<br />

IF TextBox8.Text = "" THEN<br />

dbt = 0<br />

ELSE<br />

dbt = CInt(TextBox8.Text)<br />

ENDIF<br />

IF TextBox7.Text = "" THEN<br />

kdt = 0<br />

ELSE<br />

A ‐ 11


kdt = CInt(TextBox7.Text)<br />

ENDIF<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tanggal = Date(thn, bln, tgl)<br />

.rs!debit = (dbt)<br />

.rs!kredit = (kdt)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

'aturtombol1("")<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB save4_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

DIM dbt AS Integer<br />

DIM kdt AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

.koneksi.Close<br />

.koneksi.Open<br />

.koneksi.Begin<br />

IF ComboBox7.Text = "" THEN<br />

Message.Error("Silahkan mengisi ID Transaksi")<br />

ELSE<br />

TextBox1.SetFocus<br />

.rs = .koneksi.Create("data_keuangan")<br />

.rs!id_transaksi = CStr(ComboBox7.Text)<br />

.rs!uraian = CStr(TextBox12.Text)<br />

IF TextBox11.Text = "" THEN<br />

dbt = 0<br />

ELSE<br />

dbt = CInt(TextBox11.Text)<br />

ENDIF<br />

IF TextBox10.Text = "" THEN<br />

kdt = 0<br />

ELSE<br />

kdt = CInt(TextBox10.Text)<br />

ENDIF<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

bln = CInt(ComboBox2.Text)<br />

A ‐ 12


ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!tanggal = Date(thn, bln, tgl)<br />

.rs!debit = (dbt)<br />

.rs!kredit = (kdt)<br />

.rs.Update<br />

ENDIF<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

'aturtombol1("")<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB tambah_Click()<br />

aturtombol(TRUE)<br />

save1.Enabled = TRUE<br />

save2.Enabled = TRUE<br />

save3.Enabled = TRUE<br />

save4.Enabled = TRUE<br />

save5.Enabled = TRUE<br />

reset.Enabled = TRUE<br />

END<br />

PUBLIC SUB exit_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB reset_Click()<br />

aturtombol1("")<br />

END<br />

UFEntry Kartu Warga<br />

' <strong>Gambas</strong> class file<br />

PUBLIC sql AS String<br />

PUBLIC SUB Form_Open()<br />

DIM i AS Float<br />

flname = User.Home & "/kartuwarga.html"<br />

ME.Center<br />

ME.Caption = "Kartu Warga"<br />

ME.Center<br />

TextBox1.Enabled = FALSE<br />

TextBox2.Enabled = FALSE<br />

TextBox3.Enabled = FALSE<br />

TextBox4.Enabled = FALSE<br />

TextBox5.Enabled = FALSE<br />

TextBox7.Enabled = FALSE<br />

TextBox8.Enabled = FALSE<br />

ComboBox1.Enabled = FALSE<br />

ComboBox2.Enabled = FALSE<br />

ComboBox3.Enabled = FALSE<br />

tbcari.Enabled = FALSE<br />

tbcari2.Enabled = FALSE<br />

tbcari3.Enabled = FALSE<br />

tbreset.Enabled = FALSE<br />

tbsave.Enabled = FALSE<br />

btntampil1.Enabled = FALSE<br />

btnprint1.Enabled = FALSE<br />

END<br />

PUBLIC SUB tbcari_Click()<br />

WITH mdlkoneksi<br />

.konekdb()<br />

IF TextBox7.Text = "" THEN<br />

Message.Info("Nama Warga masih Kosong...", "OK")<br />

TextBox7.SetFocus<br />

ELSE<br />

A ‐ 13


sql = "select id_penduduk,nama_lengkap,tgl_lahir,alamat,pekerjaan from<br />

data_warga where nama_lengkap REGEXP '" & TextBox7.Text & "' "<br />

.rs1 = .koneksi.Exec(sql)<br />

TextBox8.Text = .rs1!id_penduduk<br />

TextBox1.Text = .rs1!nama_lengkap<br />

TextBox2.Text = .rs1!alamat<br />

TextBox3.Text = .rs1!tgl_lahir<br />

TextBox4.Text = .rs1!pekerjaan<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB exit_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB add_Click()<br />

TextBox1.Enabled = TRUE<br />

TextBox2.Enabled = TRUE<br />

TextBox3.Enabled = TRUE<br />

TextBox4.Enabled = TRUE<br />

TextBox5.Enabled = TRUE<br />

TextBox7.Enabled = TRUE<br />

TextBox8.Enabled = TRUE<br />

ComboBox1.Enabled = TRUE<br />

ComboBox2.Enabled = TRUE<br />

ComboBox3.Enabled = TRUE<br />

tbcari.Enabled = TRUE<br />

tbcari2.Enabled = TRUE<br />

tbcari3.Enabled = TRUE<br />

tbreset.Enabled = TRUE<br />

tbsave.Enabled = TRUE<br />

btntampil1.Enabled = TRUE<br />

btnprint1.Enabled = TRUE<br />

END<br />

PUBLIC SUB tbreset_Click()<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

TextBox4.Text = ""<br />

TextBox7.Text = ""<br />

TextBox8.Text = ""<br />

ComboBox1.Text = ""<br />

ComboBox2.Text = ""<br />

ComboBox3.Text = ""<br />

END<br />

PUBLIC SUB tbsave_Click()<br />

DIM tgl AS Integer<br />

DIM bln AS Integer<br />

DIM thn AS Integer<br />

WITH mdlkoneksi<br />

.konekdb()<br />

TextBox7.SetFocus<br />

.rs = .koneksi.Create("kartu_warga")<br />

.rs!id_penduduk = CStr(TextBox8.Text)<br />

.rs!nama_lengkap = CStr(TextBox1.Text)<br />

.rs!tgl_lahir = CStr(TextBox3.Text)<br />

.rs!alamat = CStr(TextBox2.Text)<br />

.rs!pekerjaan = CStr(TextBox4.Text)<br />

.rs!foto = CStr(TextBox5.Text)<br />

IF ComboBox1.Text = "" THEN<br />

tgl = 0<br />

ELSE<br />

tgl = CInt(ComboBox1.Text)<br />

ENDIF<br />

IF ComboBox2.Text = "" THEN<br />

bln = 0<br />

ELSE<br />

A ‐ 14


ln = CInt(ComboBox2.Text)<br />

ENDIF<br />

IF ComboBox3.Text = "" THEN<br />

thn = 0<br />

ELSE<br />

thn = CInt(ComboBox3.Text)<br />

ENDIF<br />

.rs!masa_berlaku = Date(thn, bln, tgl)<br />

.rs.Update<br />

IF NOT ERROR THEN<br />

Message.Info("penyimpanan sukses")<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox3.Text = ""<br />

TextBox4.Text = ""<br />

TextBox7.Text = ""<br />

' TextBox8.Text = ""<br />

ComboBox1.Text = ""<br />

ComboBox2.Text = ""<br />

ComboBox3.Text = ""<br />

add.Enabled = TRUE<br />

ENDIF<br />

FINALLY<br />

CATCH<br />

Message.Error(DConv( ERROR .Text))<br />

END WITH<br />

END<br />

PUBLIC SUB tbcari2_Click()<br />

SHELL "xawtv"<br />

END<br />

hfile AS File<br />

flname AS String<br />

PUBLIC SUB gbtn2_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB header(prn AS Boolean)<br />

'membuat tabel dengan perintah html+gambas<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Kartu Warga by Sandi"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Kartu WargaRT.04/ RW.17 Villa<br />

Pamulang"<br />

PRINT #hfile, ""<br />

END<br />

A ‐ 15<br />

'Tambah kolom di tabel laporan<br />

PUBLIC SUB content(p1 AS String, p2 AS String, p3 AS String, p4 AS String, p5 AS<br />

String, p6 AS String, p7 AS String)<br />

PRINT #hfile, ""<br />

PRINT #hfile, "ID Warga"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p1 & ""<br />

PRINT #hfile, ""


PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, " "<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Nama"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p2 & ""<br />

PRINT #hfile, ""<br />

A ‐ 16<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Tgl Lahir"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p3 & ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Alamat"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p4 & ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Pekerjaan"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p5 & ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Masa<br />

Berlaku"<br />

PRINT #hfile, ":"<br />

PRINT #hfile, "" & p6 & ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "&nbsp;"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB footer()<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB printit(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("select<br />

id_penduduk,nama_lengkap,tgl_lahir,alamat,pekerjaan,masa_berlaku,foto from<br />

kartu_warga where id_penduduk='" & TextBox8.Text & "'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_penduduk), CStr(.rs!nama_lengkap), CStr(.rs!tgl_lahir),<br />

CStr(.rs!alamat), CStr(.rs!pekerjaan), CStr(.rs!masa_berlaku), (.rs!foto))<br />

i = i + 1


.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB ToolButton1_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB tbcari3_Click()<br />

END<br />

SHELL "nautilus"<br />

UFCetak Data Warga<br />

hfile AS File<br />

flname AS String<br />

PUBLIC SUB form_Open()<br />

END<br />

DIM i AS Float<br />

flname = User.Home & "/datawarga.html"<br />

ME.Center<br />

ME.Caption = "Data Warga"<br />

PUBLIC SUB gbtn1_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB header(prn AS Boolean)<br />

'membuat tabel dengan perintah html+gambas<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Data Warga by Sandi"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Data Warga"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "ID Warga"<br />

PRINT #hfile, "Nama"<br />

PRINT #hfile, "Alamat"<br />

PRINT #hfile, "Pekerjaan"<br />

PRINT #hfile, "Pendidikan"<br />

PRINT #hfile, "Tgl Lahir"<br />

PRINT #hfile, "Jenis Kelamin"<br />

PRINT #hfile, "Status Rumah"<br />

PRINT #hfile, "Status Penghuni"<br />

A ‐ 17


PRINT #hfile, "Status Keluarga"<br />

PRINT #hfile, ""<br />

A ‐ 18<br />

END<br />

'Tambah kolom di tabel laporan<br />

PUBLIC SUB content(p1 AS String, p2 AS String, p3 AS String, p4 AS String, p5 AS<br />

String, p6 AS String, p7 AS String, p8 AS String, p9 AS String, p10 AS String)<br />

PRINT #hfile, ""<br />

PRINT #hfile, "" & p1 & ""<br />

PRINT #hfile, "" & p2 & ""<br />

PRINT #hfile, "" & p3 & ""<br />

PRINT #hfile, "" & p4 & ""<br />

PRINT #hfile, "" & p5 & ""<br />

PRINT #hfile, "" & p6 & ""<br />

PRINT #hfile, "" & p7 & ""<br />

PRINT #hfile, "" & p8 & ""<br />

PRINT #hfile, "" & p9 & ""<br />

PRINT #hfile, "" & p10 & ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB footer()<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB printit(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("select * from data_warga where id_penduduk like 'CG.2%'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_penduduk), CStr(.rs!nama_lengkap), CStr(.rs!alamat),<br />

CStr(.rs!pekerjaan), CStr(.rs!pendidikan), CStr(.rs!tgl_lahir),<br />

CStr(.rs!jns_kelamin), CStr(.rs!status_rumah), CStr(.rs!status_penghuni),<br />

CStr(.rs!status_keluarga))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB gbtn2_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit1(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit1(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB printit1(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("select * from data_warga where id_penduduk like 'CG.3%'")


IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_penduduk), CStr(.rs!nama_lengkap), CStr(.rs!alamat),<br />

CStr(.rs!pekerjaan), CStr(.rs!pendidikan), CStr(.rs!tgl_lahir),<br />

CStr(.rs!jns_kelamin), CStr(.rs!status_rumah), CStr(.rs!status_penghuni),<br />

CStr(.rs!status_keluarga))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB gbtn3_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit2(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit2(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB printit2(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("select * from data_warga where id_penduduk like 'CG.4%'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_penduduk), CStr(.rs!nama_lengkap), CStr(.rs!alamat),<br />

CStr(.rs!pekerjaan), CStr(.rs!pendidikan), CStr(.rs!tgl_lahir),<br />

CStr(.rs!jns_kelamin), CStr(.rs!status_rumah), CStr(.rs!status_penghuni),<br />

CStr(.rs!status_keluarga))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB gbtn4_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit3(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit3(TRUE)<br />

END SELECT<br />

A ‐ 19


END<br />

PUBLIC SUB printit3(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("select * from data_warga where id_penduduk like 'CG.5%'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_penduduk), CStr(.rs!nama_lengkap), CStr(.rs!alamat),<br />

CStr(.rs!pekerjaan), CStr(.rs!pendidikan), CStr(.rs!tgl_lahir),<br />

CStr(.rs!jns_kelamin), CStr(.rs!status_rumah), CStr(.rs!status_penghuni),<br />

CStr(.rs!status_keluarga))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB ToolButton1_Click()<br />

END<br />

ME.Close<br />

UFCetak Data Keuangan<br />

hfile AS File<br />

flname AS String<br />

PUBLIC sql AS String<br />

PUBLIC SUB form_Open()<br />

END<br />

DIM i AS Float<br />

flname = User.Home & "/DataKeuangan.html"<br />

ME.Center<br />

ME.Caption = "Data Keuangan"<br />

PUBLIC SUB gbtn1_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB header(prn AS Boolean)<br />

'membuat tabel dengan perintah html+gambas<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Data Warga by Sandi"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

A ‐ 20


PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Laporan Data Keuangan"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "ID Transaksi"<br />

PRINT #hfile, "Jenis Transaksi"<br />

PRINT #hfile, "Tanggal"<br />

PRINT #hfile, "Uraian"<br />

PRINT #hfile, "Debit"<br />

PRINT #hfile, "Kredit"<br />

PRINT #hfile, ""<br />

A ‐ 21<br />

END<br />

'Tambah kolom di tabel laporan<br />

PUBLIC SUB content(p1 AS String, p2 AS String, p3 AS String, p4 AS String, p5 AS<br />

String, p6 AS String)<br />

PRINT #hfile, ""<br />

PRINT #hfile, "" & p1 & ""<br />

PRINT #hfile, "" & p2 & ""<br />

PRINT #hfile, "" & p3 & ""<br />

PRINT #hfile, "" & p4 & ""<br />

PRINT #hfile, "" & p5 & ""<br />

PRINT #hfile, "" & p6 & ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB footer()<br />

DIM test AS String<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(kredit) - sum(debit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

test = .rs!"sum(kredit) - sum(debit)"<br />

END WITH<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Total Kas"<br />

PRINT #hfile, "" & test &<br />

""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB footer1()<br />

DIM test AS String<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(debit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

test = .rs!"sum(debit)"<br />

END WITH<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Total Debit"<br />

PRINT #hfile, "" & test & ""<br />

PRINT #hfile, "&nbsp;"<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

PUBLIC SUB footer2()<br />

DIM test AS String<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(kredit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

test = .rs!"sum(kredit)"


END WITH<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, "Total<br />

Kredit"<br />

PRINT #hfile, "&nbsp;"<br />

PRINT #hfile, "" & test & ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

PRINT #hfile, ""<br />

END<br />

A ‐ 22<br />

PUBLIC SUB printit(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("SELECT a.id_transaksi, b.nama, a.tanggal, a.uraian, a.debit,<br />

a.kredit FROM data_keuangan a, type_transaksi b where a.id_transaksi = b.id")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_transaksi), CStr(.rs!nama), CStr(.rs!tanggal),<br />

CStr(.rs!uraian), CStr(.rs!debit), CStr(.rs!kredit))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB gbtn2_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit1(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit1(TRUE)<br />

END SELECT<br />

END<br />

PUBLIC SUB printit1(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("SELECT a.id_transaksi, b.nama, a.tanggal, a.uraian, a.debit,<br />

a.kredit FROM data_keuangan a, type_transaksi b where a.id_transaksi = 'Kas /<br />

Db.VP' and b.id = 'Kas / Db.VP'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_transaksi), CStr(.rs!nama), CStr(.rs!tanggal),<br />

CStr(.rs!uraian), CStr(.rs!debit), CStr(.rs!kredit))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND


'tampilkan footer disini<br />

footer1<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB gbtn3_click()<br />

SELECT CASE LAST.tag<br />

CASE 1 'tampilkan kelayar<br />

printit2(FALSE)<br />

CASE 2 'cetak keprinter<br />

printit2(TRUE)<br />

END SELECT<br />

END<br />

A ‐ 23<br />

PUBLIC SUB printit2(prn AS Boolean)<br />

DIM i AS Float<br />

WITH mdlkoneksi<br />

.koneksi = NEW Connection<br />

.konekdb<br />

.rs = .koneksi.Exec("SELECT a.id_transaksi, b.nama, a.tanggal, a.uraian, a.debit,<br />

a.kredit FROM data_keuangan a, type_transaksi b where a.id_transaksi = 'Kas /<br />

Kr.VP' and b.id = 'Kas / Kr.VP'")<br />

IF .rs.Count 0 THEN<br />

IF Exist(flname) THEN KILL flname<br />

OPEN flname FOR WRITE CREATE AS #hfile<br />

'tampilkan header disini<br />

header(prn)<br />

i = 0<br />

WHILE i < .rs.Count<br />

'tampilkan semua data disini<br />

content(CStr(.rs!id_transaksi), CStr(.rs!nama), CStr(.rs!tanggal),<br />

CStr(.rs!uraian), CStr(.rs!debit), CStr(.rs!kredit))<br />

i = i + 1<br />

.rs.MoveNext<br />

WEND<br />

'tampilkan footer disini<br />

footer2<br />

CLOSE #hfile<br />

'menampilkan laporan<br />

frmpreview.SetPath(flname)<br />

frmpreview.ShowModal<br />

ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB ToolButton1_Click()<br />

ME.Close<br />

END<br />

UFLaporan Data Warga<br />

arrtable[10] AS String<br />

PUBLIC sql AS String<br />

hfile AS File<br />

flname AS String<br />

PUBLIC SUB Form_Open()<br />

DIM i AS Float<br />

flname = User.Home & "/datawarga.html"<br />

ME.Center<br />

ME.Caption = "Data Warga"<br />

tampilan()<br />

atur()<br />

END<br />

PUBLIC SUB TableView2_Click()<br />

TextBox8.Text = TableView2[TableView2.Row, 0].Text<br />

TextBox5.Text = TableView2[TableView2.Row, 1].Text


TextBox11.Text = TableView2[TableView2.Row, 2].Text<br />

TextBox12.Text = TableView2[TableView2.Row, 3].Text<br />

TextBox13.Text = TableView2[TableView2.Row, 4].Text<br />

TextBox14.Text = TableView2[TableView2.Row, 5].Text<br />

TextBox3.Text = TableView2[TableView2.Row, 6].Text<br />

TextBox15.Text = TableView2[TableView2.Row, 7].Text<br />

TextBox4.Text = TableView2[TableView2.row, 8].Text<br />

TextBox16.Text = TableView2[TableView2.Row, 9].Text<br />

END<br />

PUBLIC SUB TableView1_Data(Row AS Integer, Column AS Integer)<br />

arrtable[0] = "id_penduduk"<br />

arrtable[1] = "nama_lengkap"<br />

arrtable[2] = "alamat"<br />

arrtable[3] = "pekerjaan"<br />

arrtable[4] = "pendidikan"<br />

arrtable[5] = "tgl_lahir"<br />

arrtable[6] = "jns_kelamin"<br />

arrtable[7] = "status_rumah"<br />

arrtable[8] = "status_penghuni"<br />

arrtable[9] = "status_keluarga"<br />

END<br />

WITH mdlkoneksi<br />

.rs.MoveTo(Row)<br />

TableView1.Data.Text = Str(.rs[arrtable[column]])<br />

END WITH<br />

PUBLIC SUB TableView2_Data(Row AS Integer, Column AS Integer)<br />

arrtable[0] = "id_penduduk"<br />

arrtable[1] = "nama_lengkap"<br />

arrtable[2] = "alamat"<br />

arrtable[3] = "pekerjaan"<br />

arrtable[4] = "pendidikan"<br />

arrtable[5] = "tgl_lahir"<br />

arrtable[6] = "jns_kelamin"<br />

arrtable[7] = "status_rumah"<br />

arrtable[8] = "status_penghuni"<br />

arrtable[9] = "status_keluarga"<br />

END<br />

WITH mdlkoneksi<br />

.rs.MoveTo(Row)<br />

TableView2.Data.Text = Str(.rs[arrtable[column]])<br />

END WITH<br />

SUB tampilan()<br />

WITH TableView1<br />

.Rows.Count = 0<br />

.Columns.Count = 10<br />

.Columns[0].Text = "ID Warga"<br />

.Columns[1].Text = "Nama"<br />

.Columns[2].Text = "Alamat"<br />

.Columns[3].Text = "Pekerjaan"<br />

.Columns[4].Text = "Pendidikan"<br />

.Columns[5].Text = "Tgl Lahir"<br />

.Columns[6].Text = "jns_kelamin"<br />

.Columns[7].Text = "Status Rumah"<br />

.Columns[8].Text = "Status_Penghuni"<br />

.Columns[9].Text = "Status Keluarga"<br />

END WITH<br />

mdlkoneksi.isi(TableView1, "SELECT * FROM data_warga group by id_penduduk<br />

Asc")<br />

END<br />

SUB atur()<br />

WITH TableView1<br />

.Columns.Count = 10<br />

.Columns[0].Width = "85"<br />

.Columns[1].Width = "155"<br />

.Columns[2].Width = "205"<br />

.Columns[3].Width = "130"<br />

.Columns[4].Width = "110"<br />

.Columns[5].Width = "75"<br />

.Columns[6].Width = "85"<br />

A ‐ 24


.Columns[7].Width = "100"<br />

.Columns[8].Width = "120"<br />

.Columns[9].Width = "100"<br />

END WITH<br />

END<br />

SUB atur1()<br />

WITH TableView2<br />

.Columns.Count = 10<br />

.Columns[0].Width = "85"<br />

.Columns[1].Width = "165"<br />

.Columns[2].Width = "205"<br />

.Columns[3].Width = "130"<br />

.Columns[4].Width = "110"<br />

.Columns[5].Width = "75"<br />

.Columns[6].Width = "85"<br />

.Columns[7].Width = "100"<br />

.Columns[8].Width = "120"<br />

.Columns[9].Width = "120"<br />

END WITH<br />

END<br />

A ‐ 25<br />

PUBLIC SUB tbcari_Click()<br />

WITH TableView2<br />

.Rows.Count = 0<br />

.Columns.Count = 10<br />

.Columns[0].Text = "ID Warga"<br />

.Columns[1].Text = "Nama"<br />

.Columns[2].Text = "Alamat"<br />

.Columns[3].Text = "Pekerjaan"<br />

.Columns[4].Text = "Pendidikan"<br />

.Columns[5].Text = "Tgl Lahir"<br />

.Columns[6].Text = "jns_kelamin"<br />

.Columns[7].Text = "Status Rumah"<br />

.Columns[8].Text = "Status_Penghuni"<br />

.Columns[9].Text = "Status Keluarga"<br />

END WITH<br />

mdlkoneksi.isi(TableView2, "select * from data_warga where nama_lengkap regexp<br />

'" & TextBox2.Text & "' ")<br />

atur1()<br />

END<br />

PUBLIC SUB ToolButton1_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB form_Close()<br />

IF Exist(flname) THEN KILL flname<br />

END<br />

PUBLIC SUB tbedit_Click()<br />

WITH mdlkoneksi<br />

sql = "update data_warga set id_penduduk='" & TextBox8.Text & "',nama_lengkap =<br />

'" & TextBox5.Text & "',alamat= '" & TextBox11.Text & "',pekerjaan = '" &<br />

TextBox12.Text & "',pendidikan='" & TextBox13.Text & "',tgl_lahir='" &<br />

TextBox14.Text & "',status_rumah='" & TextBox15.Text & "',status_penghuni='" &<br />

TextBox4.Text & "',status_keluarga='" & TextBox16.Text & "' where id_penduduk='" &<br />

TableView2[TableView2.Row, 0].Text & "'"<br />

.rs = .koneksi.Exec(sql)<br />

tampilan()<br />

IF NOT ERROR THEN<br />

Message.Info("pengeditan sukses")<br />

'tbhapus.Enabled = FALSE<br />

TextBox8.Text = ""<br />

TextBox5.Text = ""<br />

TextBox11.Text = ""<br />

TextBox12.Text = ""<br />

TextBox13.Text = ""<br />

TextBox14.Text = ""<br />

TextBox3.Text = ""<br />

TextBox15.Text = ""<br />

TextBox4.Text = ""<br />

TextBox16.Text = ""


ENDIF<br />

END WITH<br />

END<br />

PUBLIC SUB tbhapus_Click()<br />

WITH mdlkoneksi<br />

SELECT Message.Question("Yakin akan Menghapus", "Yes", "No")<br />

CASE 1<br />

sql = "delete from data_warga where id_penduduk = '" &<br />

TableView2[TableView2.Row, 0].Text & "'"<br />

.rs = .koneksi.EXEC(sql)<br />

tampilan()<br />

CASE 2<br />

TextBox1.SetFocus<br />

END SELECT<br />

IF NOT ERROR THEN<br />

Message.Info("penghapusan sukses")<br />

tbedit.Enabled = FALSE<br />

tbhapus.Enabled = FALSE<br />

TextBox8.Text = ""<br />

TextBox5.Text = ""<br />

TextBox11.Text = ""<br />

TextBox12.Text = ""<br />

TextBox13.Text = ""<br />

TextBox14.Text = ""<br />

TextBox3.Text = ""<br />

TextBox15.Text = ""<br />

TextBox4.Text = ""<br />

TextBox16.Text = ""<br />

END IF<br />

END WITH<br />

END<br />

UFLaporan Data Keuangan<br />

arrtable[6] AS String<br />

PUBLIC sql AS String<br />

hfile AS File<br />

flname AS String<br />

PUBLIC SUB Form_Open()<br />

DIM i AS Float<br />

flname = User.Home & "/DataKeuangan.html"<br />

ME.Center<br />

ME.Caption = "Data Keuangan"<br />

TotalKredit()<br />

TotalDebit()<br />

TotalKas()<br />

tampilan()<br />

atur()<br />

END<br />

PUBLIC SUB TableView1_Data(Row AS Integer, Column AS Integer)<br />

arrtable[0] = "id_transaksi"<br />

arrtable[1] = "nama"<br />

arrtable[2] = "tanggal"<br />

arrtable[3] = "uraian"<br />

arrtable[4] = "debit"<br />

arrtable[5] = "kredit"<br />

WITH mdlkoneksi<br />

.rs.MoveTo(Row)<br />

TableView1.Data.Text = Str(.rs[arrtable[column]])<br />

END WITH<br />

END<br />

PUBLIC SUB TableView2_Data(Row AS Integer, Column AS Integer)<br />

arrtable[0] = "id_transaksi"<br />

arrtable[1] = "nama"<br />

A ‐ 26


arrtable[2] = "tanggal"<br />

arrtable[3] = "uraian"<br />

arrtable[4] = "debit"<br />

arrtable[5] = "kredit"<br />

WITH mdlkoneksi<br />

.rs.MoveTo(Row)<br />

TableView2.Data.Text = Str(.rs[arrtable[column]])<br />

END WITH<br />

END<br />

A ‐ 27<br />

SUB tampilan()<br />

WITH TableView1<br />

.Rows.Count = 0<br />

.Columns.Count = 9<br />

.Columns[0].Text = "ID Transaksi"<br />

.Columns[1].Text = "Jenis Transaksi"<br />

.Columns[2].Text = "Tanggal"<br />

.Columns[3].Text = "Uraian"<br />

.Columns[4].Text = "Debit"<br />

.Columns[5].Text = "Kredit"<br />

END WITH<br />

' mdlkoneksi.isi(TableView1, "SELECT * FROM data_keuangan order by tanggal asc<br />

")<br />

mdlkoneksi.isi(TableView1, "SELECT a.id_transaksi, b.nama, a.tanggal,<br />

a.uraian, a.debit, a.kredit FROM data_keuangan a, type_transaksi b where<br />

a.id_transaksi = b.id")<br />

END<br />

SUB atur()<br />

WITH TableView1<br />

.Columns.Count = 6<br />

.Columns[0].Width = "100"<br />

.Columns[1].Width = "110"<br />

.Columns[2].Width = "75"<br />

.Columns[3].Width = "220"<br />

.Columns[4].Width = "100"<br />

.Columns[5].Width = "100"<br />

END WITH<br />

END<br />

SUB atur1()<br />

WITH TableView2<br />

.Columns.Count = 6<br />

.Columns[0].Width = "100"<br />

.Columns[1].Width = "110"<br />

.Columns[2].Width = "75"<br />

.Columns[3].Width = "220"<br />

.Columns[4].Width = "100"<br />

.Columns[5].Width = "100"<br />

END WITH<br />

END<br />

PUBLIC SUB ToolButton1_Click()<br />

ME.Close<br />

END<br />

PUBLIC SUB form_Close()<br />

IF Exist(flname) THEN KILL flname<br />

END<br />

PUBLIC SUB ToolButton2_Click()<br />

WITH TableView2<br />

.Rows.Count = 0<br />

.Columns.Count = 6<br />

.Columns[0].Text = "ID Transaksi"<br />

.Columns[1].Text = "Jenis Transaksi"<br />

.Columns[2].Text = "Tanggal"<br />

.Columns[3].Text = "Uraian"<br />

.Columns[4].Text = "Debit"<br />

.Columns[5].Text = "Kredit"<br />

END WITH


mdlkoneksi.isi(TableView2, "SELECT a.id_transaksi, b.nama, a.tanggal,<br />

a.uraian, a.debit, a.kredit FROM data_keuangan a, type_transaksi b where<br />

a.id_transaksi = '" & ComboBox1.Text & "' and b.id = '" & ComboBox1.Text & "'")<br />

atur1()<br />

END<br />

PUBLIC SUB TotalDebit()<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(debit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

TextBox2.Text = .rs!"sum(debit)"<br />

END WITH<br />

END<br />

PUBLIC SUB TotalKredit()<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(kredit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

TextBox4.Text = .rs!"sum(kredit)"<br />

END WITH<br />

END<br />

PUBLIC SUB TotalKas()<br />

WITH mdlkoneksi<br />

.konekdb()<br />

sql = "select sum(kredit) - sum(debit) from data_keuangan"<br />

.rs = .koneksi.Exec(sql)<br />

TextBox3.Text = .rs!"sum(kredit) - sum(debit)"<br />

END WITH<br />

END<br />

A ‐ 28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!