Kamis, 19 April 2012

TAMPILAN DAN LISTING PRA UTS_3

Sub aktif()
tidp.Enabled = True
tnapem.Enabled = True
cjetik.Enabled = True
ctujuan.Enabled = True
cwaktu.Enabled = True
tjumbel.Enabled = True
tubay.Enabled = True
End Sub
Sub nonaktif()
tidp.Enabled = False
tnapem.Enabled = False
cjetik.Enabled = False
ctujuan.Enabled = False
tjumbel.Enabled = False
tubay.Enabled = False
tnapet.Enabled = False
lrute.Enabled = False
cwaktu.Enabled = False
tharga.Enabled = False
ttotbay.Enabled = False
tukem.Enabled = False
ttgl.Enabled = False
End Sub
Sub bersih()
tidp.Text = ""
tnapem.Text = ""
cjetik.Text = ""
ctujuan.Text = ""
tjumbel.Text = ""
tubay.Text = ""
tnapet.Text = ""
lrute.Clear
cwaktu.Text = ""
tharga.Text = ""
ttotbay.Text = ""
tukem.Text = ""
ttgl.Text = ""

End Sub

Private Sub cisi_Click()
aktif
bersih
tidp.SetFocus
cisi.Enabled = False
ckeluar.Enabled = True
cpesan.Enabled = True

End Sub


Private Sub ckeluar_Click()
Unload Me
End Sub

Private Sub cpesan_Click()
If cpesan.Enabled = True Then
MsgBox "MakaCihhhhh!!!!!", vbOKOnly
Call Form_Activate
Else
Unload Me
End If

End Sub

Private Sub ctujuan_Click()

If cjetik.Text = "Eksekutif" Then
  If ctujuan.Text = "Solo" Then
lrute.Clear
lrute.AddItem "Salatiga-Kartosuro-Tirtonadi-Sumber-Karanganyar"
tharga.Text = 200000
  ElseIf ctujuan.Text = "Surabaya" Then
lrute.Clear
lrute.AddItem "Surabaya-Kediri-Ngawi-Nganjuk-Madiun"
tharga.Text = 300000
  ElseIf ctujuan.Text = "Bandung" Then
lrute.Clear
lrute.AddItem "Purwakarta-Padalarang-Cicaheum-Leuwipanjang"
tharga.Text = 100000
  ElseIf ctujuan.Text = "Cirebon" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Kuningan-Subang"
tharga.Text = 110000
  ElseIf ctujuan.Text = "Semarang" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Tegal-Brebes-Demak-Semarang"
tharga.Text = 200000
  ElseIf ctujuan.Text = "Purwokerto" Then
lrute.Clear
lrute.AddItem "Nagrek-Malambong-Tasik-Banjar-Cilacap-Purwokerto"
tharga.Text = 200000
  End If
ElseIf cjetik.Text = "Ekonomi AC" Then
  If ctujuan.Text = "Solo" Then
lrute.Clear
lrute.AddItem "Salatiga-Kartosuro-Tirtonadi-Sumber-Karanganyar"
tharga.Text = 180000
  ElseIf ctujuan.Text = "Surabaya" Then
lrute.Clear
lrute.AddItem "Surabaya-Kediri-Ngawi-Nganjuk-Madiun"
tharga.Text = 270000
  ElseIf ctujuan.Text = "Bandung" Then
lrute.Clear
lrute.AddItem "Purwakarta-Padalarang-Cicaheum-Leuwipanjang"
tharga.Text = 70000
  ElseIf ctujuan.Text = "Cirebon" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Kuningan-Subang"
tharga.Text = 90000
  ElseIf ctujuan.Text = "Semarang" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Tegal-Brebes-Demak-Semarang"
tharga.Text = 170000
  ElseIf ctujuan.Text = "Purwokerto" Then
lrute.Clear
lrute.AddItem "Nagrek-Malambong-Tasik-Banjar-Cilacap-Purwokerto"
tharga.Text = 170000
  End If
Else
  If ctujuan.Text = "Solo" Then
lrute.Clear
lrute.AddItem "Salatiga-Kartosuro-Tirtonadi-Sumber-Karanganyar"
tharga.Text = 150000
  ElseIf ctujuan.Text = "Surabaya" Then
lrute.Clear
lrute.AddItem "Surabaya-Kediri-Ngawi-Nganjuk-Madiun"
tharga.Text = 250000
  ElseIf ctujuan.Text = "Bandung" Then
lrute.Clear
lrute.AddItem "Purwakarta-Padalarang-Cicaheum-Leuwipanjang"
tharga.Text = 50000
  ElseIf ctujuan.Text = "Cirebon" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Kuningan-Subang"
tharga.Text = 70000
  ElseIf ctujuan.Text = "Semarang" Then
lrute.Clear
lrute.AddItem "Indramayu-Cirebon-Tegal-Brebes-Demak-Semarang"
tharga.Text = 150000
  ElseIf ctujuan.Text = "Purwokerto" Then
lrute.Clear
lrute.AddItem "Nagrek-Malambong-Tasik-Banjar-Cilacap-Purwokerto"
tharga.Text = 150000
  End If
End If
End Sub

Private Sub Form_Activate()
bersih
nonaktif
ttgl.Text = Date
cjetik.AddItem "Eksekutif"
cjetik.AddItem "Ekonomi AC"
cjetik.AddItem "Ekonomi non AC"
ctujuan.AddItem "Solo"
ctujuan.AddItem "Surabaya"
ctujuan.AddItem "Bandung"
ctujuan.AddItem "Cirebon"
ctujuan.AddItem "Semarang"
ctujuan.AddItem "Purwokerto"
cwaktu.AddItem "07.00 wib"
cwaktu.AddItem "10.00 wib"
cwaktu.AddItem "13.00 wib"
cwaktu.AddItem "16.00 wib"
cwaktu.AddItem "19.00 wib"
cwaktu.AddItem "22.00 wib"
cisi.Enabled = True
ckeluar.Enabled = False
cpesan.Enabled = False
End Sub




Private Sub tidp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  If tidp.Text = "080901" Then
tnapet.Text = "Jarwo"
ElseIf tidp.Text = "080902" Then
tnapet.Text = "Rudi"
ElseIf tidp.Text = "080903" Then
tnapet.Text = "Alex"
ElseIf tidp.Text = "080904" Then
tnapet.Text = "Marwan"
ElseIf tidp.Text = "080905" Then
tnapet.Text = "Darmo"
End If
tnapem.SetFocus
End If
End Sub

Private Sub tjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ttotbay.Text = Val(tharga.Text) * Val(tjumbel.Text)
tubay.SetFocus
End If
End Sub


Private Sub tubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Val(tubay.Text) < Val(ttotbay.Text) Then
MsgBox "Duit Elo Kurang Rp." & (Val(ttotbay.Text) - Val(tubay.Text)) & "," & "Masukin nominal lagi yaaa!!!", vbOKOnly + vbInformation, "informasi"
tubay.Text = ""
tubay.SetFocus
tukem = ""
Else
tukem.Text = Val(tubay.Text) - Val(ttotbay.Text)
End If
cisi.Enabled = True
ckeluar.Enabled = False
End If
If Not (KeyAscii <= Asc("9") And KeyAscii >= Asc("0") Or KeyAscii = vbKeyBack) Then
KeyAscii = 0
End If
End Sub

TAMPILAN DAN LISTING PRA UTS_2

Private Sub ckode_Click()
If ckode.Text = "SU01" Then
tjenis.Text = "Suite"
ElseIf ckode.Text = "BS01" Then
tjenis.Text = "Business"
Else
tjenis.Text = "President"
End If
End Sub

Sub aktif()
tnama.Enabled = True
ckode.Enabled = True
opt1.Enabled = True
opt2.Enabled = True
opt3.Enabled = True
tlama.Enabled = True
tubay.Enabled = True
End Sub

Sub nonaktif()
tnama.Enabled = False
ttgl.Enabled = False
ckode.Enabled = False
tjenis.Enabled = False
opt1.Enabled = False
opt2.Enabled = False
opt3.Enabled = False
tharga.Enabled = False
tlama.Enabled = False
ttotal.Enabled = False
tubay.Enabled = False
tukem.Enabled = False
End Sub

Sub bersih()
tnama.Text = ""
ckode.Text = ""
tjenis.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
tharga.Text = ""
tlama.Text = ""
ttotal.Text = ""
tubay.Text = ""
tukem.Text = ""
End Sub

Private Sub cisidata_Click()
bersih
aktif
ckode.Text = "-Pilih-"
tnama.SetFocus
End Sub

Private Sub ckeluar_Click()
X = MsgBox("TutupForm?", vbYesNo + vbQuestion, "Konfirmasi")
If X = vbYes Then
Unload Me
End If
End Sub

Private Sub Form_Activate()
bersih
nonaktif
ttgl.Text = Date
ckode.AddItem "SU01"
ckode.AddItem "BS01"
ckode.AddItem "PR01"
cisidata.Enabled = True
ckeluar.Enabled = True
End Sub


Private Sub opt1_Click()
If opt1.Value = True Then
If tjenis.Text = "Suite" Then
tharga.Text = 300000
ElseIf tjenis.Text = "Business" Then
tharga.Text = 400000
Else
tharga.Text = 500000
End If
Else
tharga.Text = 0
End If
tlama.SetFocus
End Sub

Private Sub opt2_Click()
If opt2.Value = True Then
If tjenis.Text = "Suite" Then
tharga.Text = 500000
ElseIf tjenis.Text = "Business" Then
tharga.Text = 600000
Else
tharga.Text = 700000
End If
Else
tharga.Text = 0
End If
tlama.SetFocus
End Sub

Private Sub opt3_Click()
If opt3.Value = True Then
If tjenis.Text = "Suite" Then
tharga.Text = 800000
ElseIf tjenis.Text = "Business" Then
tharga.Text = 900000
Else
tharga.Text = 1000000
End If
Else
tharga.Text = 0
End If
tlama.SetFocus
End Sub


Private Sub tlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ttotal.Text = Val(tharga.Text) * Val(tlama.Text)
tubay.SetFocus
End If
End Sub

Private Sub tubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = Val(ttotal.Text) - Val(tubay.Text)
If tubay.Text < ttotal.Text Then
MsgBox "Uang Anda Kurang RP." & Val(ttotal.Text) - Val(tubay.Text) & " Input Uang Kembali", vbOKOnly, "Warning!"
tubay.Text = ""
tubay.SetFocus
Else
tukem.Text = Val(tubay.Text) - Val(ttotal.Text)
End If
End If
End Sub

TAMPILAN DAN LISTING PRA UTS_1

Private Sub cgol_Click()
If cgol.Text = "I" Then
tjab.Text = "Paintry"
tgapok = 1000000
ttunjab = 200000
ttrans = 0
ElseIf cgol.Text = "II" Then
tjab.Text = "Staff"
tgapok = 1750000
ttunjab = 300000
ttrans = 200000
ElseIf cgol.Text = "III" Then
tjab.Text = "Supervisor"
tgapok = 2250000
ttunjab = 500000
ttrans = 300000
ElseIf cgol.Text = "IV" Then
tjab.Text = "Manager"
tgapok = 5000000
ttunjab = 700000
ttrans = 500000
Else
tjab.Text = "Direktur"
tgapok = 10000000
ttunjab = 1000000
ttrans = 1000000
End If
End Sub

Private Sub clagi_Click()
aktif
bersih
tnip.SetFocus
clagi.Enabled = True
cluar.Enabled = True
End Sub

Private Sub cluar_Click()
Unload Me
End Sub

Private Sub Form_Activate()
aktif
bersih
tnip.SetFocus
ttgl.Text = Date
cgol.AddItem "I"
cgol.AddItem "II"
cgol.AddItem "III"
cgol.AddItem "IV"
cgol.AddItem "V"
clagi.Enabled = True
cluar.Enabled = True
End Sub




Sub aktif()
tnip.Enabled = True
tnama.Enabled = True
cgol.Enabled = True
opt1.Enabled = True
opt2.Enabled = True
opt3.Enabled = True
End Sub
Sub nonaktif()
tnip.Enabled = False
tnama.Enabled = False
cgol.Enabled = False
opt1.Enabled = False
opt2.Enabled = False
opt3.Enabled = False
tjab.Enabled = False
tgapok.Enabled = False
ttunjab.Enabled = False
ttrans.Enabled = False
ttunstat.Enabled = False
tgator.Enabled = False
tpph.Enabled = False
tgaber.Enabled = False
ttgl.Enabled = False
End Sub
Sub bersih()
tnip.Text = ""
tnama.Text = ""
cgol.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
tjab.Text = ""
tgapok.Text = ""
ttunjab.Text = ""
ttrans.Text = ""
ttunstat.Text = ""
tgator.Text = ""
tpph.Text = ""
tgaber.Text = ""

End Sub




Private Sub opt1_Click()
If opt1.Value = True Then
ttunstat.Text = 300000
tgator.Text = Val(tgapok.Text) + Val(ttunjab.Text) + Val(ttrans.Text) + Val(ttunstat.Text)
tpph = 0.1 * Val(tgator.Text)
tgaber.Text = Val(tgator.Text) - Val(tpph.Text)
End If
End Sub

Private Sub opt2_Click()
If opt2.Value = True Then
ttunstat.Text = 0
tgator.Text = Val(tgapok.Text) + Val(ttunjab.Text) + Val(ttrans.Text) + Val(ttunstat.Text)
tpph = 0.1 * Val(tgator.Text)
tgaber.Text = Val(tgator.Text) - Val(tpph.Text)
End If
End Sub

Private Sub opt3_Click()
If opt3.Value = True Then
ttunstat.Text = 100000
tgator.Text = Val(tgapok.Text) + Val(ttunjab.Text) + Val(ttrans.Text) + Val(ttunstat.Text)
tpph = 0.1 * Val(tgator.Text)
tgaber.Text = Val(tgator.Text) - Val(tpph.Text)
End If
End Sub