Pertemuan 3

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Pertemuan 3 as PDF for free.

More details

  • Words: 780
  • Pages: 8
Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1 Buat Form dari Project Manager melalui Tab Documents Pilih Form Klik New => New Form Lalu pada Klik kanan pada form pilih data Envirotment pilih data Pegawai Lalu di Add lalu di close Kita memutuskan hubungan table dengan form dengan cara : Pilih smua textbox dengan tekan shift lalu Cari pada properties Control source klik kanan reset to default Maka setiap textbox akan control source akan None Setting textbox lamakerja pada properties pilih Value=0 < ini dibuat agar dilisting tidak perlu menggunakan rumus Val untuk tipe data yang numerik > Buat Fuul programming Klik 2 kali pada form maka list code siap diketik Pilih form1 yang baru kita buat Pilih procedure Load Set default to c:\sore\ka5e\11079999 Select pegawai Pilih procedure UnLoad Use Pilih procedure Active WITH THISFORM .txtnip.enabled=.f. .txtnama.enabled=.f. .txttgllahir.enabled=.f. .txtkota.enabled=.f. .txttelp.enabled=.f. .txtlamakerja.enabled=.f. ENDWITH

Buat 4 command button Top,Back,Next,Last Command Top GO TOP WITH THISFORM SELECT PEGAWAI .txtnip.value=nip .txtnama.value=nama .txttgllahir.value=tgllahir .txtkota.value=kota .txttelp.value=telp .txtlamakerja.value=lamakerja ENDWITH

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1

Command Back Skip-1 WITH THISFORM SELECT PEGAWAI .txtnip.value=nip .txtnama.value=nama .txttgllahir.value=tgllahir .txtkota.value=kota .txttelp.value=telp .txtlamakerja.value=lamakerja ENDWITH Command next skip WITH THISFORM SELECT PEGAWAI .txtnip.value=nip .txtnama.value=nama .txttgllahir.value=tgllahir .txtkota.value=kota .txttelp.value=telp .txtlamakerja.value=lamakerja ENDWITH Command Last GO bottom WITH THISFORM SELECT PEGAWAI .txtnip.value=nip .txtnama.value=nama .txttgllahir.value=tgllahir .txtkota.value=kota .txttelp.value=telp .txtlamakerja.value=lamakerja ENDWITH

\

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1 Buka table gaji modifikasi field nya dengan klik table Gaji klik Modify Letakkan posisi dibawah tglslip lalu klik insert Tambahkan field jabatan dan posisi

Klik table Gaji kita isi record nya seperti ini

Untuk mengisi Posisi lihat dari huruf sebelah kiri Jabatan Jika DR = DIREKTUR GAPOK = 800000 Jika ST = STAFF GAPOK = 500000 Jika AC = ACCOUNTING GAPOK = 650000 Jika MR = MARKETING GAPOK = 450000

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1 REPLACE ALL posisi WITH IIF(LEFT(jabatan,2)="DR","DIREKTUR",IIF(LEFT(jabatan,2)="AC", "ACCOUNTING",IIF(LEFT(jabatan,2)="ST","STAFF","MARKETING"))) REPLACE ALL gapok WITH IIF(LEFT(jabatan,2)="DR",800000,IIF(LEFT(jabatan,2)="AC",650000,IIF( LEFT(jabatan,2)="ST",500000,4500000)))

Untuk mengisi tunjangan REPLACE ALL gaji.tunj WITH Gaji.gapok*10/100 Untuk mengisi Potongan lihat jabatan ditengah Jika 20 maka 20% dari gapok Jika 15 maka 15% dari gapok Jika 10 maka 10% dari gapok Jika 5 maka 5% dari gapok Untuk mengisi Lembur lihat jabatan ditengah Jika 05 maka 5 * 5000 Jika 10 maka 10 * 5000 Jika 15 maka 15 * 5000 Jika 20 maka 20 * 5000

REPLACE ALL pot WITH IIF(SUBSTR(jabatan,3,2)="20",20/100*GAPOK,IIF(SUBSTR(jabatan,3,2)="15", 15/100*GAPOK,IIF(SUBSTR(jabatan,3,2)="10",10/100*GAPOK,5/100*gapok))) REPLACE ALL lembur WITH IIF(SUBSTR(jabatan,5,2)="05",5*5000,IIF(SUBSTR(jabatan,5,2)="10", 10*5000,IIF(SUBSTR(jabatan,5,2)="15",15*500,20*5000))) REPLACE ALL bonus WITH IIF(RIGHT(jabatan,2)="MJ","MEJA",IIF(RIGHT(jabatan,2)="BK","BUKU",IIF( RIGHT(jabatan,2)="PY","PAYUNG","JAM"))) REPLACE ALL gaji.gaber WITH Gaji.gapok+ Gaji.tunj- Gaji.pot+ Gaji.lembur

Hasil Table Gaji

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1 Buat Form dari table Gaji

Boleh ambil data dari table Gaji melalui data envirotment namun seperti biasa putuskan hubungan dengan table dengan cara klik kanan pada Envirotment pilih Control source pilih reset to default sehingga semua berubah menjadi => None Agar dalam penulisan listing tidak menggunakan atribut Val maka dalam properties untuk yang tipenya angka di setting properties Value=0 Untuk combo box klik kanan pilih Builder,

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1

Listing ComboBox Procedure Click IF thisform.combo2.Text ="DR" THEN thisform.txtPosisi.VALUE ="DIREKTUR" ELSE IF thisform.combo2.Text ="AC" THEN thisform.txtPosisi.Value ="ACCOUNTING" ELSE IF thisform.combo2.Text ="MR" THEN thisform.txtPosisi.Value ="MARKETING" ELSE IF thisform.combo2.Text ="ST" THEN thisform.txtPosisi.Value ="STAFF" ELSE thisform.txtPosisi.Value ="SALAH" ENDIF ENDIF ENDIF ENDIF

Listing Form Procedure Active

thisform.txtTglslip.Value =DATE()

Listing Txtposisi Procedure LostFocus

IF THISFORM.TXtPosisi.Value ="DIREKTUR" THISFORM.TXTGapok.Value =800000 THISFORM.TXTTunj.Value =10/100* THISFORM.TXTGapok.Value THISFORM.TXTPot.Value = 100000 THISFORM.TXTPPH.Value = 5/100 * THISFORM.TXtGapok.Value THISFORM.TXtGaber.Value =THISFORM.TXTGapok.Value+THISFORM.TXTTunj.Value+THISFORM.TXTPPH.ValueTHISFORM.TXTPot.Value ELSE IF THISFORM.TXtPosisi.Value ="STAFF" THISFORM.TXTGapok.Value =500000 THISFORM.TXTTunj.Value =10/100* THISFORM.TXTGapok.Value THISFORM.TXTPot.Value = 100000 THISFORM.TXTPPH.Value = 5/100 * THISFORM.TXtGapok.Value THISFORM.TXtGaber.Value =THISFORM.TXTGapok.Value+THISFORM.TXTTunj.Value+THISFORM.TXTPPH.ValueTHISFORM.TXTPot.Value ELSE IF THISFORM.TXtPosisi.Value ="MARKETING" THISFORM.TXTGapok.Value =450000 THISFORM.TXTTunj.Value =10/100* THISFORM.TXTGapok.Value THISFORM.TXTPot.Value = 100000 THISFORM.TXTPPH.Value = 5/100 * THISFORM.TXtGapok.Value THISFORM.TXtGaber.Value =THISFORM.TXTGapok.Value+THISFORM.TXTTunj.Value+THISFORM.TXTPPH.ValueTHISFORM.TXTPot.Value

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1 ELSE IF THISFORM.TXtPosisi.Value ="ACCOUNTING" THISFORM.TXTGapok.Value =650000 THISFORM.TXTTunj.Value =10/100* THISFORM.TXTGapok.Value THISFORM.TXTPot.Value = 100000 THISFORM.TXTPPH.Value = 5/100 * THISFORM.TXtGapok.Value THISFORM.TXtGaber.Value =THISFORM.TXTGapok.Value+THISFORM.TXTTunj.Value+THISFORM.TXTPPH.ValueTHISFORM.TXTPot.Value ELSE THISFORM.TXTGapok.Value =0 THISFORM.TXTTunj.Value =10/100* THISFORM.TXTGapok.Value THISFORM.TXTPot.Value =100000 THISFORM.TXTPPH.Value = 5/100 * THISFORM.TXtGapok.Value THISFORM.TXtGaber.Value =THISFORM.TXTGapok.Value+THISFORM.TXTTunj.Value+THISFORM.TXTPPH.ValueTHISFORM.TXTPot.Value ENDIF ENDIF ENDIF ENDIF

Listing CommandExit Procedure Click pesan=MESSAGEBOX("Mau Tutup?",32+4,"pesan") IF pesan=6 then thisform.Release endif

Listing CommandBersih Procedure Click thisform.txtNoslip.Value ="" thisform.txttglslip.Value ="" thisform.txtNoslip.Value ="" thisform.combo2.value ="" thisform.txtposisi.Value ="" thisform.txtgapok.Value =0 thisform.txttunj.Value =0 thisform.txtpot.Value =0 thisform.txtPPH.Value =0 thisform.txtGaber.Value =0

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Materi Foxpro Pertemuan 3-4 Lab H- I Malam Fatmawati A1

FOXPRO 9.0 LAB H- I FMA @ SIA OKTOBER 2009

Related Documents

Pertemuan - 3
June 2020 14
Pertemuan -3
April 2020 15
Pertemuan 3
June 2020 6
Msdm - Pertemuan 3
June 2020 10
Pertemuan 3&4.docx
December 2019 20
Pertemuan 3.docx
June 2020 6