Anda di halaman 1dari 123

LAPORAN AKHIR

PRAKTIKUM PEMROGRAMAN KOMPUTER

Untuk Memenuhi Syarat Nilai Mata Kuliah Praktikum Pemrograman Dasar


Komputer

Oleh:
ANTAKSI YUDI RACHMANTO
NIM : 2015080330

PROGRAM STUDI TEKNIK INDUSTRI


FAKULTAS TEKNIK
UNIVERSITAS PAMULANG
TANGERANG SELATAN
2016

LEMBAR PENGESAHAN
PRAKTEK PEMROGRAMAN KOMPUTER

UNIVERSITAS PAMULANG
FAKULTAS TEKNIK INDUSTRI
Tangerang Selatan, 11 Juni 2016
Nama Mahasiswa

Antaksi Yudi Rachmanto


NIM : 2015080330

Mengetahui,
Dosen Pembimbing

Aceng Abdul Hamid, S.T.,M.M.


NIDN : 0409028801
i

MOTTO

Kesuksesan hanya dapat diraih dengan segala upaya dan usaha yang disertai
dengan doa, karena seusungguhnya nasib seseorang manusia tidak akan
berubah dengan sendirinya tanpa adanya usaha. Mengerjakan hal yang
bermanfaat untuk diri sendiri dan orang lain, karena hidup hanyalah sekali.
Ingat hanya pada Allah apapun dan di manapun kita berada kepada Dia-lah
tempat meminta dan memohon.

ii

FORM HASIL NILAI PRAKTIKUM


TUGAS PEMROGRAMAN KOMPUTER

UNIVERSITAS PAMULANG
FAKULTAS TEKNIK INDUSTRI
No
.
1

Modul I

Ada

Tidak

Modul II

Ada

Tidak

Modul III

Ada

Tidak

Modul IV

Ada

Tidak

Modul V

Ada

Tidak

Modul VI

Ada

Tidak

Ada

Tidak

Ada

Tidak

Tugas

Nilai

Tugas Besar
1
8 Tugas Besar
2
Tangerang Selatan, 11 juni 2016

Fisik

Keterangan

Nama Mahasiswa

Antaksi Yudi Rachmanto


NIM : 2015080330

iii

KATA PENGANTAR

Puji syukur kehadirat Tuhan Yang Maha Esa atas segala RahmatNYA sehingga Praktikum
Pemrograman Komputer ini dapat tersusun tepat pada waktunya. Tidak lupa kami juga
mengucapkan banyak terimakasih atas bantuan dari pihak yang telah berkontribusi dengan
memberikan sumbangan baik materi program maupun pikirannya.
Dan harapan saya semoga Praktikum Pemrograman Komputer ini dapat menambah
pengetahuan dan pengalaman bagi para pembaca. Untuk kedepannya dapat memperbaiki bentuk
maupun menambah isi dari program yang saya buat agar menjadi lebih baik lagi.
Karena keterbatasan pengetahuan dan pengalaman saya. Saya yakin masih banyak
kekurangan dalam prkatikum pemrograman ini,. Oleh karena itu saya sangat mengharapkan
saran dan kritik yang membangun dari pembaca demi kesempurnaan tugas praktikum komputer
ini.

Tangerang Selatan, 11 Juni 2016


Penyusun

Antaksi Yudi Rachmanto

iv

DAFTAR ISI

Lembar Pengesahan .............................................................

Motto ............

ii

Nilai Praktikum ... iii


Kata Pengantar .

iv

Daftar Isi ..

BAB I TUGAS PRAKTIKUM KOMPUTER ................. vi


Tugas Praktikum Modul I
Tugas Praktikum Modul II ..
Tugas Praktikum Modul III .
Tugas Praktikum Modul IV ............
Tugas Praktikum Modul V .............
Tugas Praktikum Modul VI
Tugas Besar 1 Praktikum ...
Tugas Besar 2 Praktikum ...
BAB II PENUTUP
Kesan dan Saran .

vii

TUGAS PRAKTIKUM
KOMPUTER
MODUL I VI
BORLAND DELPHI 7

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL I
PENDAHULUAN

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

: Aceng Abdul Hamid, S.T., M.M.

A. Gambar Aplikasi

B. Ketentuan :
-

Pada saat ditekan tombol Paket I makan akan muncul tulisan


- Pada kolom Menu akan muncul tulisan AYAM BAKAR + NASI PUTIH + CAH
KANGKUNG + ES TEH

Pada kolom Harga akan muncul tulisan 'Rp 28.000,00

Pada saat ditekan tombol Paket II makan akan muncul tulisan


- Pada kolom Menu akan muncul tulisan 'AYAM GORENG + NASI PUTIH +
SAYUR ASEM + ES TEH'

Pada kolom Harga akan muncul tulisan 'Rp 25.000,00

Pada saat ditekan tombol Paket III makan akan muncul tulisan
- Pada kolom Menu akan muncul tulisan AYAM BAKAR PENYET + NASI PUTIH
+ CAH KANGKUNG + ES JERUK

Pada kolom Harga akan muncul tulisan 'Rp 33.000,00

Pada saat ditekan tombol Paket IV makan akan muncul tulisan


- Pada kolom Menu akan muncul tulisan AYAM GORENG PENYET + NASI
PUTIH + SAYUR ASEM + ES JERUK

Pada kolom Harga akan muncul tulisan 'Rp 30.000,00

Pada saat ditekan tombol bersih maka yang terjadi adalah pada kolom Menu dan
Harga akan kosong

C. KODE PERINTAH
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;

Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.Text:='AYAM BAKAR + NASI PUTIH + CAH KANGKUNG + ES TEH';
edit2.Text:='Rp 28.000,00';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin

edit1.Text:='AYAM GORENG + NASI PUTIH + SAYUR ASEM + ES TEH';


edit2.Text:='Rp 25.000,00';
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
edit1.Text:='AYAM BAKAR PENYET + NASI PUTIH + CAH KANGKUNG + ES JERUK';
edit2.Text:='Rp 33.000,00';
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
edit1.Text:='AYAM GORENG PENYET + NASI PUTIH + SAYUR ASEM + ES JERUK';
EDIT2.Text:='Rp 30.000,00';
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
edit1.Text:=' ';
edit2.Text:=' ';
end;
end.

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL II

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

: Aceng Abdul Hamid, S.T., M.M.

1. Program If - Then
A. Gambar Aplikasi 1

B1. Ketentuan
-

Jika pada tombol Cek Nilai kita klik, maka pada kolom Jumlah Nilai ; Nilai Akhir
dan Keterangan akan muncul Hasil dan Grade secara otomatis.
Apabila pada tombol Bersih kita klik, maka akan mengosongkan kolom-kolom yang
ada

C1. Kode Perintah


unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label11: TLabel;
Edit6: TEdit;

Edit7: TEdit;
Label12: TLabel;

procedure Button1Click(Sender: TObject);


procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);


Var
i,j,k,l,m, n: real ;
a : real ;
nilai_angka : integer;
hasil:string;
nilai:integer;
begin
i:=StrtoInt(edit1.Text);
j:=StrtoInt(edit2.Text);
k:=StrtoInt(edit3.Text);
l:=StrtoInt(edit4.Text);

m:=(i+j+k+l);
edit5.Text :=floattostr (m);
n:=m/4;
edit6.Text:=floattostr (n);
nilai_angka := StrtoInt (Edit6.Text );
if (nilai_angka>=85) and (nilai_angka<=100) then
Showmessage ('Nilai Anda A') else
if (nilai_angka>=75) and (nilai_angka<85) then
Showmessage ('Nilai Anda B') else
if (nilai_angka>=65) and (nilai_angka<75) then
Showmessage ('Nilai Anda C') else
if (nilai_angka>=55) and (nilai_angka<65) then
Showmessage ('Nilai Anda D')
else Showmessage ('Nilai Anda E');
begin
nilai:=strtoint(edit6.text);
if
nilai<60 then
hasil:='Tidak Lulus'
else
hasil:='Lulus';
edit7.Text:=hasil;
end;
end;

procedure TForm1.Button2Click(Sender: TObject);


begin

edit1.Text:=' ';
edit2.Text:=' ';
edit3.Text:=' ';
edit4.Text:=' ';
edit5.Text:=' ';
edit6.Text:=' ';
edit7.Text:=' ';
end;
end.

2. Program Case Of
A. Gambar Aplikasi

B. Ketentuan
-

JIka pada kolom karakter kita isi karakter (missal = huruf a) maka pada kolom
Jenis akan muncul keterangan secara otomatis ketika kita mengklik tombol OK
Jika kita klik tombol Bersih maka pada kolom Karakter dan Jenis akan kosong
kembali dan bisa di input kembali.
Jika kita klik tombol keluar maka akan keluar dari aplikasi tersebut dan muncul
pernyataan Apa Anda Yakin Ingin Keluar ?

C. Kode Aplikasi
unit Unit2_2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);


var
kar : char;
jenis : string;
begin
kar := Edit1.text[1];
Case kar of
'a','e','o','u','i','A','I','U','E','O' :
Jenis := 'Vokal';
'b'..'d', 'f'..'h','j'..'n','p'..'t','v'..'z','B'..'D', 'F'..'H','J'..'N','P'..'T','V'..'Z' :
Jenis := 'Konsonan';
'0'..'9' :
Jenis := 'Angka'
else
Jenis := 'Tidak terdefinisi'

end;
Edit2.Text := jenis
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text := '';
Edit2.Text :='';
Edit1.SetFocus;
end;

procedure TForm1.Button3Click(Sender: TObject);


begin
if
(messagedlg ('Apa Anda Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL III

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

: Aceng Abdul Hamid, S.T., M.M.

1. Program For to Do /For Downto Do


A. Gambar Aplikasi

B. Ketentuan
-

Jika anda ingin mengetahui nilai angka yang bersarang pada program perulangan, hanya
perlu mengklik tombol RadioButton For To Do/ For Downto Do. Maka akan muncul
tulisan Angka Nominal Yang Bersarang pada Memo1.
Klik tombol Button1 Clear untuk membersihkan semua kolom, dan bisa untuk
menginput kembali angka yang ingin dimasukkan.

C. Kode Aplikasi
unit Unit3_1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button1: TButton;
Image1: TImage;
Image2: TImage;
Memo1: TMemo;
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.RadioButton1Click(Sender: TObject);
var
angka_awal,angka_akhir,hasil_perulangan:integer;
begin
angka_awal:=StrtoInt(edit1.Text);
angka_akhir:=StrtoInt(edit2.Text);
for hasil_perulangan:=angka_awal to angka_akhir do

begin
memo1.Lines.Add(InttoStr(hasil_perulangan));
end;
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
var
angka_awal,angka_akhir,hasil_perulangan:integer;
begin
angka_awal:=StrtoInt(edit1.Text);
angka_akhir:=StrtoInt(edit2.Text);
for hasil_perulangan:=angka_awal downto angka_akhir do
begin
memo1.Lines.Add(inttostr(hasil_perulangan));
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.Text :=' ';
edit2.Text :=' ';
memo1.Text :=' ';
edit1.SetFocus;
end;
end.

2. Program While Repeat


A. Gambar Aplikasi

B. Ketentuan
-

Jika anda ingin mengetahui nilai angka yang bersarang pada program perulangan, hanya
perlu mengklik tombol Button1(For To Do); Button2(While Do) dan Button3 (Repeat
Until). Maka akan muncul tulisan Angka Nominal Yang Bersarang pada Memo1.
Klik tombol Button4 Clear untuk membersihkan semua kolom, dan bisa untuk
menginput kembali angka yang ingin dimasukkan.
Klik tombol Button5 Close jika anda ingin keluar dari aplikasi.

C. Kode Aplikasi
unit Unit3_3;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Memo1: TMemo;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);

procedure Button5Click(Sender: TObject);


private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);


var
x,y:integer;
z:integer;
begin
x:=StrtoInt(edit1.Text);
y:=StrtoInt(edit2.Text);
for z:=x to y do
begin
if z mod 2=1 then
memo1.Lines.Add(InttoStr(z) +' Bilangan Ganjil')
else
memo1.Lines.Add(InttoStr(z) +' Bilangan Genap');
end;
end;

procedure TForm1.Button2Click(Sender: TObject);


var
x:integer;
begin
memo1.Clear;
x:=1;
while x <=StrtoInt(edit2.Text)do
begin
if x mod 2=1 then
memo1.Lines.Add(InttoStr (x*x*x))
else
memo1.Lines.Add(InttoStr(x*x));
x:=x+1;
end;
end;

procedure TForm1.Button3Click(Sender: TObject);


Var
i:double;
begin
memo1.Clear;
i:=1;
repeat
i:=i+1;
memo1.Lines.Add(FloattoStr(i));
until

1=20;
end;

procedure TForm1.Button4Click(Sender: TObject);


begin
edit1.Text:=' ';
edit2.Text:=' ';
memo1.Text :=' ';
edit1.SetFocus;
end;

procedure TForm1.Button5Click(Sender: TObject);


begin
close
end;
end.

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL IV

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

1. Program Function
A. Gambar Aplikasi

: Aceng Abdul Hamid, S.T., M.M.

B. Ketentuan
-

Jika anda ingin menghitung berapa harga BBM dengan menggunakan Function yang
ada pada aplikasi Program SPBU. Anda hanya perlu memasukkan angka pada kolom
edit1Liter dan pilih CheckBox Premium/Pertamax
Jika sudah memasukkan nilai angka yang ingin di hitung dengan menggunakan function
anda tinggal klik tombol button1 Proses maka akan muncul nilai pada kolom edit2
harga.
Jika kita klik button2 Clear maka pada kolom edit1 dan edit2 akan kosong kembali dan
dapat menginput angka yang kita inginkan.
Jika kita klik button3 Exit maka anda akan keluar dari program penghitungan BBM
Program SPBU

C. Kode Aplikasi
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;

type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Edit1: TEdit;
TFarhanna_2A: TButton;
Label2: TLabel;
Edit2: TEdit;

Button2: TButton;
Button3: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
Image1: TImage;
procedure TFarhanna_2AClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
function Premium(X:integer):Currency;
function Pertamax(y:integer):Currency;

implementation

{$R *.dfm}

function Pertamax(y: integer): Currency;


begin
if y=0 then
pertamax:=0

else
pertamax:=y*10000;
end;

function Premium(X: integer): Currency;


begin
if x=0 then
premium:=0
else
premium:=x*6500;
end;

procedure TForm1.TFarhanna_2AClick(Sender: TObject);


var
liter:integer;
begin
Liter:= StrToInt(Edit1.Text);
if CheckBox1.Checked=true then
Edit2.Text:=CurrToStr(premium(liter));
if CheckBox2.Checked=true then
Edit2.Text:=CurrToStr(pertamax(liter));
{Pemanggilan Function Pertamax}
end;

procedure TForm1.Button2Click(Sender: TObject);


begin
begin

Edit1.Text:='';
Edit2.Text:='';
end;
end;

procedure TForm1.Button3Click(Sender: TObject);


begin
close;
end;
end.

2. Program Procedure
A. Gambar Aplikasi

B. Ketentuan
-

Jika anda ingin menghitung sebuah Volume Balok dengan program penghitungan Volume
Balok dengan menggunakan Procedure yang ada pada aplikasi Menghitung Volume
Balok. Anda hanya perlu memasukkan angka pada kolom edit1 Panjang; edit2
Lebar dan edit3 Tinggi
Jika sudah memasukkan nilai angka yang ingin di hitung dengan menggunakan
procedure, anda tinggal klik tombol button1 Hitung maka akan muncul nilai pada
Label1 Hasil
Jika kita klik button2 Input Ulang maka pada kolom edit1; edit2 dan edit3 akan kosong
dan dapat menginput angka yang kita inginkan kembali.
Jika kita klik button3 Selesai maka anda akan keluar dari program Menghitung
Volume Balok

C. Kode Aplikasi
unit PRJECT4_2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;

type
TAntaksi_3b = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edpanjang: TEdit;
edlebar: TEdit;
edtinggi: TEdit;
hasil: TLabel;
btok: TButton;
btlagi: TButton;
btselesai: TButton;
Image1: TImage;
procedure btokClick(Sender: TObject);
procedure btlagiClick(Sender: TObject);
procedure btselesaiClick(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
procedure Bersihlayar;
end;
var
Antaksi_3b: TAntaksi_3b;

implementation
{$R *.dfm}

procedure TAntaksi_3b.Bersihlayar;
begin
edpanjang.Text:='';
edlebar.Text:='';
edtinggi.Text:='';
edpanjang.SetFocus;
end;

function Volume(x,y,z:real):real;
begin
Volume:=x*y*z;
end;

procedure TAntaksi_3b.btokClick(Sender: TObject);


var p,l,t,V:real;

begin
p:=StrToFloat(edpanjang.Text) ;
l:=StrToFloat(edlebar.Text) ;
t:=StrToFloat(edtinggi.Text) ;
V:= Volume(p,l,t);
hasil.Caption :='VOLUMENYA ADALAH : '+ FloatToStr(v)+'';
end;

procedure TAntaksi_3b.btlagiClick(Sender: TObject);


begin
Bersihlayar;
end;

procedure TAntaksi_3b.btselesaiClick(Sender: TObject);


begin
close;
end;
end.

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL V

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

A. Gambar Aplikasi

: Aceng Abdul Hamid, S.T., M.M.

B. Ketentuan
-

Masuk ke menu Login untuk masuk login agar bisa masuk ke menu berikutnya / form
berikutnya. Jika anda benar, maka anda akan masuk ke menu aplikasi Toko Buku
Barokah.
Jika anda salah maka akan muncul MessageBox Maaf password anda salah.
Klik kotak edit1 untuk mengisi harga satuan, setelah itu isi bilangan pada kotak edit2
serta isi nominal harga yang dibayarkan pada kotak edit3.
Jika sudah klik tombol button 2 Hitung untuk mengetahui total bayar dan kembalian
pada label1 dan label2.

C. Kode Aplikasi

Pada Form 1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation

uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if ( edit1.text='admin') and (edit2.text='admin')then
begin
form2.show;
form1.Hide;
end
else
begin
messagedlg('maaf password anda salah!!!!',mtinformation,[mbok],0);
edit1.Clear;
edit1.setfocus;
edit2.Clear;
edit2.setfocus;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;

type
TForm2 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
edtharga: TEdit;
edtjumlah: TEdit;
edtpembayaran: TEdit;
Label2: TLabel;
Label3: TLabel;
GroupBox1: TGroupBox;
Label4: TLabel;
Label5: TLabel;
lbltotal: TLabel;
lblkembalian: TLabel;
GroupBox2: TGroupBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Image1: TImage;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button2Click(Sender: TObject);
var
harga,pembayaran,kembali,total: real;
jumlah: integer;
begin
if((edtHarga.Text ='') or (edtJumlah.Text ='') or (edtPembayaran.Text ='')) then
begin
messageDlg('Ada yang belum terisi, cek kembali...',mtError,[mbOk],0);
edtHarga.SetFocus ;
exit;
end;

harga:= StrToFloat(edtHarga.Text );
jumlah:= StrToInt(edtJumlah.Text);
pembayaran:= StrToFloat(edtPembayaran.Text);
total:=harga*jumlah;
kembali:=pembayaran-total;
lbltotal.caption := FormatFloat('Rp #,###,#0.00',total);
lblkembalian.Caption := FormatFloat('RP #,###,#0.00',kembali);
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
Application.Terminate ;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
edtHarga.Text :=' ';
edtJumlah.Text :=' ';
edtpembayaran.Text :=' ';
edtHarga.SetFocus;
end;
end.

TUGAS PRAKTIKUM PEMROGRAMAN KOMPUTER


MODUL VI

Nama/NIM Praktikan : Antaksi Yudi Rachmanto/2015080330


Nama Dosen

A. Gambar Aplikasi

: Aceng Abdul Hamid, S.T., M.M.

B. Ketentuan
-

Masuk ke menu Login untuk masuk login agar bisa masuk ke menu berikutnya / form
berikutnya. Jika anda benar, maka anda akan masuk ke menu aplikasi Toko Buku
Barokah.
Jika anda salah maka akan muncul MessageBox Maaf password anda salah.
Klik kotak edit1 untuk mengisi harga, setelah itu isi bilangan pada kotak edit3.
Kemudian anda pilih RadioButton1 / RadioButton2 / RadioButton3 untuk Type
Mobil, karena itu akan menentukan masing masing klasifikasi harga dari tiap type
mobil.
Kemudian anda pilih CheckBox1 / CheckBox2 / CheckBox3 / CheckBox4 untuk
Fasilitas Mobil, karena itu akan menentukan masing masing klasifikasi harga dari tiap
aksesoris tambahan.
Klik button2 Hitung jika anda ingin mengetahui hasil dari total harga.
Klik button1 Clear jika anda ingin mengulang penginputan harga.
Klik button3 Keluar jika anda ingin keluar dari aplikasi penjualan Antakasi
Mobilindo

C. Kode Aplikasi

Pada Form 1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private

{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if ( edit1.text='admin') and (edit2.text='admin')then
begin
form2.show;
form1.Hide;
end
else
begin
messagedlg('maaf password anda salah!!!!',mtinformation,[mbok],0);
edit1.Clear;
edit1.setfocus;
edit2.Clear;
edit2.setfocus;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm2 = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
GroupBox2: TGroupBox;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
GroupBox3: TGroupBox;
Label4: TLabel;
Label5: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Image1: TImage;
procedure GroupBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure GroupBox2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public

{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.GroupBox1Click(Sender: TObject);
begin
EDIT1.Text := '157000000';
EDIT3.Text := '5';
EDIT1.Text := '198000000';
EDIT3.Text := '10';
EDIT1.Text := '135000000';
EDIT3.Text := '25';
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
EDIT1.Clear;
EDIT2.Clear;
EDIT4.Clear;
EDIT5.Clear;
EDIT3.Clear;
end;
procedure TForm2.Button2Click(Sender: TObject);
VAR f1, f2,f3,f4, ft:integer;
begin
if checkbox1.Checked = true then
f1:=5000000 else f1:=0;
if checkbox2.Checked = true then
f2:=2000000 else f2:=0;
if checkbox3.Checked = true then
f3:=750000 else f3:=0;
if checkbox4.Checked = true then
f4:=500000 else f4:=0;
//menghitung fasilitas tambahan
ft := f1+f2+f3+f4;
edit4.text := inttostr(ft);
//menghitung diskon

edit2.Text := currtostr (strtocurr(edit1.Text) * (strtoint(edit3.text) /100));


//menghitung total harga
edit5.text := inttostr (strtoint(edit1.Text) - strtoint(edit2.Text) + strtoint(edit4.Text));

end;
procedure TForm2.GroupBox2Click(Sender: TObject);
VAR f1, f2,f3,f4, ft:integer;
begin
if checkbox1.Checked = true then
f1:=5000000 else f1:=0;
if checkbox2.Checked = true then
f2:=4500000 else f2:=0;
if checkbox3.Checked = true then
f3:=3500000 else f3:=0;
if checkbox4.Checked = true then
f4:=1500000 else f4:=0;
//menghitung fasilitas tambahan
ft := f1+f2+f3+f4;
edit1.text := inttostr(ft);
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
close ;
end;
end.

TUGAS BESAR I
PRAKTIKUM PEMROGRAMAN KOMPUTER

Disusun Oleh :
Antaksi Yudi Rachmanto
NIM : 2015080330

PROGRAM STUDI TEKNIK INDUSTRI


FAKULTAS TEKNIK
UNIVERSITAS PAMULANG
TANGERANG SELATAN
Jl. Surya Kencana No. 1 Pamulang Tangerang Selatan
Telp./Fax : (021) 741 2566 7470 98

LATAR BELAKANG

Penghitungan Volume dan Luas suatu bangunan atau bidang merupakan suatu
program yang dibutuhkan untuk keperluan penghitungan oleh sebagian orang yang
bergelut dibidang desain dan renovasi suatu bangunan
Dengan adanya program ini diharapkan dapat memudahkan penghitungan para
arsitektur atau teknik sipil.

A. GAMBAR APLIKASI

Password Benar

Password Salah

B. Ketentuan Program
-

Masuk ke menu login agar bisa masuk ke menu berikutnya, jika anda benar maka akan
masuk ke menu berikutnya penghitungan Volume dan Luas
Jika salah maka akan muncul pesan Maaf password anda salah
Ketika anda masuk ke menu berikutnya, silahkan anda pilih salah satu button (mengenai
penghitungan Volume dan Luas)
Jika anda klik menu keluar, maka anda akan keluar dari aplikasi tersebut.

C. Kode Aplikasi

Pada Form 1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation

uses Unit2;
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if ( edit1.text='admin') and (edit2.text='admin')then
begin
form2.show;
form1.Hide;
end
else
begin
messagedlg('maaf password anda salah!!!!',mtinformation,[mbok],0);
edit1.Clear;
edit1.setfocus;
edit2.Clear;
edit2.setfocus;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls, jpeg;
type
TForm2 = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;

Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
BitBtn2: TBitBtn;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit3, Unit4, Unit5, Unit6, Unit7, Unit8;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
Form3.show;
form2.Hide;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
Form4.show;
form2.Hide;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
Form5.show;
form2.Hide;

end;
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
Form6.show;
form2.Hide;
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
Form7.show;
form2.Hide;
end;
procedure TForm2.Button6Click(Sender: TObject);
begin
Form8.show;
form2.Hide;
end;
end.

Pada Form 3
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls, jpeg;
type
TForm3 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
Edit1: TEdit;

Label2: TLabel;
Label3: TLabel;
Edit3: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
nilai1,nilai2,hasil:real;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
nilai1:=StrToFloat(edit1.Text);
nilai2:=StrToFloat (edit2.Text);
hasil:=0.5*nilai1*sqr(nilai2);
edit3.Text:=FloatToStr(hasil);
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
end;
procedure TForm3.BitBtn1Click(Sender: TObject);
begin

Form2.show;
Form3.Hide;
end;
procedure TForm3.BitBtn2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 4
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm4 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Panel4: TPanel;
Label3: TLabel;
Edit3: TEdit;
Button2: TButton;
GroupBox1: TGroupBox;
Button3: TButton;
Button4: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
var a,t,l:real;
begin
a:=StrToFloat(edit1.Text);
t:=StrToFloat(edit2.Text);
l:=0.5*a*t;
edit3.Text:=FloatTostr(l);
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
Form2.show;
form4.Hide;
end;

procedure TForm4.Button4Click(Sender: TObject);


begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.
Pada Form 5

unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ImgList, ExtCtrls;
type
TForm5 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
GroupBox1: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Button1: TButton;
Panel1: TPanel;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
uses Unit2;
{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);


var
p,l,t,luas,vol:real;
begin
p:=StrToFloat(edit1.Text);
l:=StrToFloat(edit1.Text);
l:=StrToFloat(edit1.Text);
vol:=p*l*t;
luas:=(2*p*t)+(2*p*l)+(2*t*l);
edit4.Text:=FloatTostr(vol);
edit5.Text:=FloatTostr(luas);
end;
procedure TForm5.Button4Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
end;
procedure TForm5.Button2Click(Sender: TObject);
begin
Form2.show;
form5.Hide
end;
procedure TForm5.Button3Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 6

unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls;
type
TForm6 = class(TForm)
Label1: TLabel;
GroupBox1: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
GroupBox2: TGroupBox;
Label4: TLabel;
Label5: TLabel;
Edit4: TEdit;
Edit3: TEdit;
GroupBox3: TGroupBox;
Button1: TButton;
Button2: TButton;
Image1: TImage;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
uses Unit2;
{$R *.dfm}

procedure TForm6.BitBtn1Click(Sender: TObject);


var
T,R,L,V:real;
begin
T:=StrToFloat(edit1.Text);
R:=StrToFloat(edit2.Text);
v:=(22/7)*r*r*t;
L:=2*(22/7)*r*(R+T);
edit3.Text:=FloattoStr(V);
edit4.Text:=FloattoStr(L);
end;
procedure TForm6.BitBtn2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
end;
procedure TForm6.Button1Click(Sender: TObject);
begin
Form2.show;
form6.Hide;
end;
procedure TForm6.Button2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 7

unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ExtCtrls, StdCtrls, jpeg;
type
TForm7 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
GroupBox1: TGroupBox;
Button1: TButton;
Button2: TButton;
Label5: TLabel;
Label6: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Panel1: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form7: TForm7;
implementation
uses Unit2;
{$R *.dfm}

procedure TForm7.Button1Click(Sender: TObject);


VAR
t,r,s,v,l:real;
begin
t:=StrToFloat(edit1.Text);
r:=StrToFloat(edit2.Text);
s:=StrToFloat(edit3.Text);
v:=(1/3)*3.14*r*r*t;
l:=3.14*r*(r+s);
edit4.Text:=FloatTostr(V);
edit5.Text:=FloatTostr(l);
end;
procedure TForm7.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
end;
procedure TForm7.BitBtn1Click(Sender: TObject);
begin
Form2.show;
form7.Hide;
end;
procedure TForm7.BitBtn2Click(Sender: TObject);
begin
if
(messagedlg ('Apa Ada Yakin Ingin Keluar ?',mtconfirmation,
[mbyes,mbno],0)=mryes)then
application.Terminate;
end;
end.

Pada Form 8

unit Unit8;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm8 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form8: TForm8;
implementation
{$R *.dfm}
end.

TUGAS BESAR II
PRAKTIKUM PEMROGRAMAN KOMPUTER

Disusun Oleh :
Antaksi Yudi Rachmanto
NIM : 2015080330

PROGRAM STUDI TEKNIK INDUSTRI


FAKULTAS TEKNIK
UNIVERSITAS PAMULANG
TANGERANG SELATAN
Jl. Surya Kencana No. 1 Pamulang Tangerang Selatan
Telp./Fax : (021) 741 2566 7470 98

LATAR BELAKANG

Salah satu masalah dalam sebuah perusahaan atau instansi pemerintahan adalah bahwa
adanya pegawai / karyawan atau anggota instansi tersebut yang nakal. Sehingga mengakibatkan
perusahaan atau instansi tersebut merugi atau tidak maksimal dalam produksinya.
Program aplikasi jadwal absensi ini dimaksudkan untuk melihat adanya tindak kecurangan
dari pegawai / karyawan atau anggota dari instansi tersebut. Sehingga Instansi tersebut dapat
memberikan sebuah tindakan berupa sanksi yang dapat memberikan efek jera pada pelaku
kecurangan tersebut.

A. Gambar Aplikasi I

Ketentuan
-

Untuk memasuki aplikasi absensi, diharuskan login terlebih dahulu.


Jika Password benar, anda akan masuk ke menu absen
Jika Password salah, maka akan muncul showmessage Password Salah

B. Gambar Aplikasi II

Ketentuan
-

Jika berhasil masuk ke menu absen, anda akan bisa memilih pada radiobutton masuk /
Pulang / Izin / Cuti

C. Gambar Aplikasi III

Ketentuan
-

Anda bisa menambahkan data pegawai


Jika anda klik entry pegawai, maka akan muncul form baru untuk pengisian data pegawai
baru
Klik simpan jika anda ingin menyimpan data tersebut di database.
Klik keluar jika anda telah selesai mengisi data pegawai baru.

D. Gambar Aplikasi IV

Ketentuan
-

Jika anda ingin melihat data pegawai, anda hanya perlu mengklik Menu kemudian pilih
Data Pegawai.
Setelah itu akan muncul form baru yang berisikan data pegawai.

E. Gambar Aplikasi V

Ketentuan
-

Jika anda ingin melihat laporan dari tiap pegawai, anda hanya perlu mengklik Laporan
dan kemudian pilih absensi untuk melihat absen pegawai
Kemudian muncul Form baru tentang laporan absensi pegawai
Dan jika anda ingin melihat lebih detail absensi pegawai, anda hanya perlu mengklik
Prewiew. Sehingga muncul Form tentang absen pegawai.

F. Kode Aplikasi

Pada Unit Login


unit ULogin;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;
type
TFLogin = class(TForm)
pnl1: TPanel;
grp1: TGroupBox;
Label1: TLabel;

Label2: TLabel;
EdNIK: TEdit;
EdPass: TEdit;
BitLogin: TButton;
BitClose: TButton;
ADOLogin: TADOQuery;
ADOKaryawan: TADOQuery;
shp1: TShape;
procedure BitCloseClick(Sender: TObject);
procedure BitLoginClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure EdNIKKeyPress(Sender: TObject; var Key: Char);
procedure EdPassKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
NIK,PASS:string;
end;
var
FLogin: TFLogin;
implementation
uses UDModule, UFormUtama;
{$R *.dfm}
procedure TFLogin.BitCloseClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TFLogin.BitLoginClick(Sender: TObject);
begin
ADOKaryawan.Close;
ADOKaryawan.SQL.Clear;
ADOKaryawan.SQL.Add('select Nik,Password from tbl_Karyawan where
nik="'+EdNIK.Text+'"');
ADOKaryawan.Open;
if not ADOKaryawan.Eof then
begin
NIK:=ADOKaryawan.Fieldbyname('NIK').Value;
PASS:= ADOKaryawan.Fieldbyname('Password').Value;
if EdPass.Text<>PASS then
MessageDlg('Password salah !!',mtError,[mbOK],0)
else

begin
futama.Show;
hide
end
end
else
MessageDlg('Data Tidak ditemukan !!',mtError,[mbOK],0)
end;
procedure TFLogin.FormShow(Sender: TObject);
begin
EdNIK.Text:='';
EdPass.Text:='';
end;
procedure TFLogin.EdNIKKeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
EdPass.SetFocus;
end;
procedure TFLogin.EdPassKeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
BitLogin.SetFocus;
end;
end.

Pada Unit Absen


unit UAbsen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons, Grids, DBGrids, DB, ADODB,
jpeg, Mask, DBCtrls;
type
TFAbsen = class(TForm)
Timer1: TTimer;
ADOTampil: TADOQuery;
ADOKaryawan: TADOQuery;

DataSource1: TDataSource;
ADOKaryawanNIK: TWideStringField;
ADOKaryawanNama: TWideStringField;
ADOKaryawanJenisKelamin: TWideStringField;
ADOKaryawanTempat_Lahir: TWideStringField;
ADOKaryawanTanggal_Lahir: TDateTimeField;
ADOKaryawanAlamat: TWideStringField;
ADOKaryawanNoTelepon: TWideStringField;
ADOKaryawanStatus: TBooleanField;
ADOSimpan: TADOQuery;
ADOCari: TADOQuery;
Panel2: TPanel;
Panel1: TPanel;
Shape1: TShape;
Label7: TLabel;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
RBMasuk: TRadioButton;
RBPulang: TRadioButton;
RBCuti: TRadioButton;
RBIzin: TRadioButton;
DBGrid1: TDBGrid;
BitKeluar: TBitBtn;
shp1: TShape;
btn1: TSpeedButton;
btn2: TSpeedButton;
Label3: TLabel;
ADO_proses: TADOQuery;
ADO_prosesNIK: TWideStringField;
ADO_prosesTanggalAbsen: TDateTimeField;
ADO_prosesMasuk: TDateTimeField;
ADO_prosesPulang: TDateTimeField;
ADO_prosesIzin: TSmallintField;
ADO_prosesCuti: TSmallintField;
ADO_prosesKeterangan: TWideStringField;
ADO_prosesFlag: TWideStringField;
ADO_prosesNama: TStringField;
ADO_open: TADOQuery;
ADOTampilNama: TStringField;
ADOTampilNIK: TWideStringField;
ADOTampilTanggalAbsen: TDateTimeField;
ADOTampilMasuk: TDateTimeField;
ADOTampilPulang: TDateTimeField;
ADOTampilIzin: TSmallintField;
ADOTampilCuti: TSmallintField;

ADOTampilKeterangan: TWideStringField;
ADOTampilFlag: TWideStringField;
ADO_openNIK: TWideStringField;
ADO_openNama_Karyawan: TWideStringField;
ADO_openMasuk: TWideStringField;
ADO_openPulang: TWideStringField;
ADO_openIzin: TWideStringField;
ADO_openCuti: TWideStringField;
ADO_openKeterangan: TWideStringField;
CEKLIST: TCheckBox;
EdCatatan: TDBEdit;
ADO_openFlag: TWideStringField;
ADOShow: TADOTable;
ADOShowNIK: TWideStringField;
ADOShowNama_Karyawan: TWideStringField;
ADOShowMasuk: TWideStringField;
ADOShowPulang: TWideStringField;
ADOShowIzin: TWideStringField;
ADOShowCuti: TWideStringField;
ADOShowKeterangan: TWideStringField;
ADOShowFLAG: TWideStringField;
Label5: TLabel;
DTTanggal: TDateTimePicker;
Label1: TLabel;
Shape5: TShape;
Shape6: TShape;
Label2: TLabel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Label4: TLabel;
Label6: TLabel;
Shape7: TShape;
Panel6: TPanel;
procedure Timer1Timer(Sender: TObject);
procedure BitKeluarClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure DTTanggalChange(Sender: TObject);
procedure DTTanggalCloseUp(Sender: TObject);
procedure RBIzinClick(Sender: TObject);
procedure RBCutiClick(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure DBGrid1ColExit(Sender: TObject);

procedure DBGrid1CellClick(Column: TColumn);


procedure CEKLISTMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure RBPulangClick(Sender: TObject);
procedure EdCatatanKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
procedure TampilkanAbsen;
PROCEDURE ABSENMASUK;
PROCEDURE ABSENIZIN;
PROCEDURE ABSENCUTI;
PROCEDURE ABSENPULANG;
public
{ Public declarations }
end;
var
FAbsen: TFAbsen;
Keterangan:string;
implementation
uses UDModule,UListKaryawan, UMenu, UFormUtama, ULogin;
{$R *.dfm}
procedure FocusCell(const DBGrid : TDBGrid;const column : integer) ; overload;
begin
with TStringGrid(DBGrid) do
begin
Col := column;
SetFocus;
end;
end;
//(Masuk pagi, masuk siang, izin, cuti , dan dinas luar)
Procedure TFAbsen.TampilkanAbsen;
var
kolom_header, kolom_value,keterangan : string;
kode_karyawan,nama_karyawan,Masuk,Pulang,Izin,Cuti:string;
begin
kolom_header := '[FLAG] TEXT(2),[NIK] TEXT(15), [Nama_Karyawan] TEXT(50),
[Masuk] TEXT(6),[Pulang] TEXT(6),[Izin] TEXT(6),[Cuti] TEXT(6),[Keterangan]
TEXT(100)';
with ADOTampil do begin
close;
sql.Clear;
sql.Add('DROP table tbl_tempABS');
execSQL;

sql.Clear;
sql.Add('create table [tbl_tempABS] (' + kolom_header + ')');
execSQL;
end;
with ADOKaryawan do begin
close;
sql.Clear;
sql.Add('select*from tbl_karyawan where NIK="'+Flogin.NIK+'"');
execSQL;
with ADO_proses do begin
close;
sql.Clear;
sql.Add('select * from TBL_ABSEN WHERE NIK="'+Flogin.NIK+'" and
tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',DTTanggal.DateTime)+'#');
open;
end;
kode_karyawan := ADOKaryawanNIK.Value;
nama_karyawan := ADOKaryawanNama.Value;
Masuk := FormatDateTime('HH:mm',ADO_prosesMasuk.Value);
Pulang := FormatDateTime('HH:mm',ADO_prosesPulang.Value);
Izin := IntToStr(ADO_prosesIzin.Value);
Cuti := IntToStr(ADO_prosesCuti.Value);
keterangan := ADO_prosesKeterangan.Value;
if not ADO_proses.eof then
begin
kolom_value := '"1","'+kode_karyawan+ '", "' +nama_karyawan + '","'+Masuk+
'","'+Pulang+ '","'+Izin+ '","'+Cuti+ '","'+Keterangan+ '"';
with ADO_open do begin
close;
sql.Clear;
sql.Add('insert into tbl_tempABS values('+ kolom_value+ ')');
execSQL;
end;
end else
Begin
kolom_value := '"'+kode_karyawan+ '", "' +nama_karyawan + '"';
with ADO_open do begin
close;
sql.Clear;
sql.Add('insert into tbl_tempABS (NIK,Nama_Karyawan) values('+
kolom_value+ ')');

execSQL;
end;
End;
end;
with ADOShow do
begin
Close;
TableName:='tbl_tempABS';
Open;
end;
end;
Procedure TFAbsen.ABSENMASUK;
BEGIN
if FormatDateTime('HH:HH',now)>'08:00' then
keterangan:='Terlambat';
ADOSIMPAN.Close;
ADOSIMPAN.SQL.Clear;
ADOSIMPAN.SQL.Add('INSERT INTO TBL_ABSEN VALUES
("'+FLogin.NIK+'","'+FormatDateTime('dd-MM-yyyy',DTTanggal.Date)+'",'+
'"'+FormatDateTime('HH:mm',now)
+'",0,0,0,"'+Keterangan+'","'+FormatDateTime('HH:mm',now)+'")');
ADOSIMPAN.ExecSQL;
ADOShow.Edit;
ADOShowFLAG.Value:='1';
ADOShowMasuk.Value:=FormatDateTime('HH:mm',Now);
ADOShowKeterangan.Value:=Keterangan;
ADOShow.Post;
END;
Procedure TFAbsen.ABSENIZIN;
BEGIN
ADOSIMPAN.Close;
ADOSIMPAN.SQL.Clear;
ADOSIMPAN.SQL.Add('INSERT INTO TBL_ABSEN VALUES
("'+FLogin.NIK+'","'+FormatDateTime('dd-MM-yyyy',DTTanggal.Date)+'",'+
'"00:00","00:00",1,0,"","Izin")');
ADOSIMPAN.ExecSQL;
ADOShow.Edit;
ADOShowIzin.Value:='1';
ADOShow.Post;
END;
Procedure TFAbsen.ABSENCUTI;
BEGIN

ADOSIMPAN.Close;
ADOSIMPAN.SQL.Clear;
ADOSIMPAN.SQL.Add('INSERT INTO TBL_ABSEN VALUES
("'+FLogin.NIK+'","'+FormatDateTime('dd-MM-yyyy',DTTanggal.Date)+'",'+
'"00:00","00:00",0,1,"","Cuti")');
ADOSIMPAN.ExecSQL;
ADOShow.Edit;
ADOShowCuti.Value:='1';
ADOShow.Post;
END;
Procedure TFAbsen.ABSENPULANG;
BEGIN
ADOCari.Close;
ADOCari.SQL.Clear;
ADOCari.SQL.Add('select nik,pulang from tbl_absen where nik ="'+Flogin.NIK+'" and
tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',now)+'#');
ADOCari.Open;
if (ADOCari.FieldByName('Pulang').IsNull) or
(ADOCari.FieldByName('Pulang').Value='00:00') then
Begin
ADOSimpan.Close;
ADOSimpan.SQL.Clear;
ADOSimpan.SQL.Add('UPDATE tbl_absen SET
Pulang="'+FormatDateTime('HH:mm',now)+'" where NIK="'+Flogin.NIK+'" and
tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',now)+'#');
ADOSimpan.ExecSQL;
ADOShow.Edit;
ADOShowPulang.Value:=FormatDateTime('HH:mm',Now);
ADOShow.Post;
end
END;
procedure TFAbsen.Timer1Timer(Sender: TObject);
var jam, menit, detik,Ms:word;
begin
Label6.Caption:=FormatDateTime('dddd',now);
//atur saja tiap wilayah beda 1 jam
DecodeTime(now, jam, menit, detik,Ms);
Label7.Caption:=inttostr(jam)+':'+inttostr(menit)+':'+inttostr(detik);
Label1.Caption:=inttostr(jam+1)+':'+inttostr(menit)+':'+inttostr(detik);
Label2.Caption:=inttostr(jam+2)+':'+inttostr(menit)+':'+inttostr(detik);
end;
procedure TFAbsen.BitKeluarClick(Sender: TObject);

begin
fAbsen.Close;
fUtama.Show;
end;
procedure TFAbsen.FormShow(Sender: TObject);
begin
DTTanggal.Date:=now;
TampilkanAbsen;
ShowScrollBar(DBGrid1.Handle, SB_VERT, False);
RBMasuk.Checked:=true;
Label3.Visible:=False;
EdCatatan.Text:='';
FocusCell(DBGrid1,0);
end;
procedure TFAbsen.DTTanggalChange(Sender: TObject);
begin
TampilkanAbsen;
end;
procedure TFAbsen.DTTanggalCloseUp(Sender: TObject);
begin
if DTTanggal.DateTime>date then
begin
DTTanggal.Date:=now;
RBMasuk.Enabled:=true;
RBPulang.Enabled:=true;
RBIzin.Enabled:=true;
RBCuti.Enabled:=true;
RBMasuk.SetFocus;
TampilkanAbsen;
Label3.Visible:=False;
end
else
begin
RBMasuk.Enabled:=False;
RBPulang.Enabled:=False;
RBIzin.Enabled:=true;
RBCuti.Enabled:=true;
Label3.Visible:=True;
RBIzin.SetFocus;
end
end;
procedure TFAbsen.RBIzinClick(Sender: TObject);

begin
CEKLIST.Checked:=False;
end;
procedure TFAbsen.RBCutiClick(Sender: TObject);
begin
CEKLIST.Checked:=False;
end;
procedure TFAbsen.btn2Click(Sender: TObject);
begin
ShowScrollBar(DBGrid1.Handle, SB_VERT, False);
end;
procedure TFAbsen.btn1Click(Sender: TObject);
begin
ShowScrollBar(DBGrid1.Handle, SB_VERT, True);
end;
procedure TFAbsen.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
grid : TDBGrid;
maskValue,JAM,Kosong : String;
aRect : TRect;
begin
maskValue := 'Ya';
JAM := '';
Kosong := '';
aRect := Rect;
grid := sender as TDBGrid;
if column.FieldName = 'Masuk' then
begin
if (ADOShowMasuk.Value='00:00') or (ADOShowMasuk.Value='0:00') or
(ADOShowMasuk.Value='') then
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(JAM), Length(JAM), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end
end;
if column.FieldName = 'Pulang' then
begin

if (ADOShowPulang.Value='00:00') or (ADOShowPulang.Value='0:00') or
(ADOShowPulang.Value='') then
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(JAM), Length(JAM), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end
end;
if column.FieldName = 'Izin' then
begin
if ADOShowIzin.Value='1' then
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(maskValue), Length(maskValue), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end else
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(Kosong), Length(Kosong), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end
end;
if column.FieldName = 'Cuti' then
begin
if ADOShowCuti.Value='1' then
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(maskValue), Length(maskValue), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end else
begin
grid.Canvas.FillRect(Rect);
DrawText(grid.Canvas.Handle, PChar(Kosong), Length(Kosong), aRect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end
end;
if (gdFocused in State) then
begin
BEGIN
if (Column.Field.FieldName = 'FLAG') then
with CEKLIST do begin
Left := Rect.Left + DBGrid1.Left + 9;
Top := Rect.Top + DBGrid1.top + 2;

Height := Rect.Bottom - Rect.Top;


Visible := True;
end;
if (Column.Field.FieldName = 'Keterangan') then
with EdCatatan do begin
Left := Rect.Left + DBGrid1.Left + 1;
Top := Rect.Top + DBGrid1.Top+2;
Width := Rect.Right - Rect.Left + 2;
Height := Rect.Bottom - Rect.Top;
end;
END;
end;
end;
procedure TFAbsen.DBGrid1ColExit(Sender: TObject);
begin
EdCatatan.Visible := False;
end;
procedure TFAbsen.DBGrid1CellClick(Column: TColumn);
begin
if (DBGrid1.SelectedField.FieldName = 'Keterangan') then
begin
EdCatatan.Visible := True;
EdCatatan.SetFocus
end;
if (DBGrid1.SelectedField.FieldName = 'FLAG') then
begin
CEKLIST.Visible := True;
CEKLIST.SetFocus
end
end;
procedure TFAbsen.CEKLISTMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ADOKaryawan.Close;
ADOKaryawan.SQL.Clear;
ADOKaryawan.SQL.Add('select * from TBL_KARYAwan where
NIK="'+FLogin.NIK+'" and status=True');
ADOKaryawan.Open;

IF NOT ADOKaryawan.Eof THEN


BEGIN
If RBMasuk.Checked=TRUE Then
Begin
ADOCari.Close;
ADOCari.SQL.Clear;
ADOCari.SQL.Add('select * from TBL_ABSEN WHERE NIK="'+FLogin.NIK+'"
and tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',now)+'#');
ADOCari.Open;
IF NOT ADOCari.Eof THEN
BEGIN
MessageDlg('ANDA SUDAH ABSEN HARI INI !!',mtInformation,[mbOK],0);
CEKLIST.Checked:=true;
END
ELSE
ABSENMASUK;
End;
If RBPulang.Checked=TRUE Then
Begin
ADOCari.Close;
ADOCari.SQL.Clear;
ADOCari.SQL.Add('select * from tbl_absen WHERE NIK="'+Flogin.NIK+'" and
tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',now)+'#');
ADOCari.Open;
IF NOT ADOCari.Eof THEN
begin
ABSENPULANG
end
ELSE
begin
MessageDlg('ANDA BELUM ABSEN, SILAHKAN ABSEN DULU !!',mtError,
[mbOK],0);
CEKLIST.Checked:=False;
end
End
ELSE
If RBIzin.Checked=TRUE Then
Begin
ADOCari.Close;
ADOCari.SQL.Clear;
ADOCari.SQL.Add('select * from TBL_ABSEN WHERE NIK="'+FLogin.NIK+'"
and tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',DTTanggal.DateTime)+'#');
ADOCari.Open;
IF NOT ADOCari.Eof THEN
BEGIN

MessageDlg('ANDA SUDAH ABSEN HARI INI!!',mtInformation,[mbOK],0);


CEKLIST.Checked:=True;
END
ELSE
ABSENIZIN;
End
ELSE
If RBCuti.Checked=TRUE Then
Begin
ADOCari.Close;
ADOCari.SQL.Clear;
ADOCari.SQL.Add('select * from TBL_ABSEN WHERE NIK="'+FLogin.NIK+'"
and tanggalabsen=#'+FormatDateTime('yyyy-MM-dd',DTTanggal.DateTime)+'#');
ADOCari.Open;
IF NOT ADOCari.Eof THEN
BEGIN
MessageDlg('ANDA SUDAH ABSEN HARI INI!!',mtInformation,[mbOK],0);
CEKLIST.Checked:=True;
END
ELSE
ABSENCUTI;
End;
END
ELSE
MessageDlg('STATUS ANDA SUDAH TIDAK AKTIF !!',mtError,[mbOK],0)
end;
procedure TFAbsen.RBPulangClick(Sender: TObject);
begin
CEKLIST.Checked:=False;
end;
procedure TFAbsen.EdCatatanKeyPress(Sender: TObject; var Key: Char);
begin
if key=char(13) then
begin
BEGIN
ADOSimpan.Close;
ADOSimpan.SQL.Clear;
ADOSimpan.SQL.Add('UPDATE tbl_absen SET keterangan="'+EdCatatan.Text+'"
WHERE nik="'+Flogin.NIK+'" and tanggalABSEN=#'+FormatDateTime('yyyy-MMdd',DTTanggal.Date)+'#');
ADOSimpan.ExecSQL;
ADOShow.Edit;

ADOShowKeterangan.Value:=EdCatatan.Text;
ADOShow.Post;
FocusCell(DBGrid1,1);
EdCatatan.Visible := False;
END
end
end;
end.

Pada Unit Module


interface
uses
SysUtils, Classes, DB, ADODB;
type
TDModule = class(TDataModule)
conKoneksi: TADOConnection;
private
{ Private declarations }
public
{ Public declarations }
end;
var
DModule: TDModule;
implementation
{$R *.dfm}
end.

Pada Form Utama


unit UFormUtama;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, jpeg, ExtCtrls, StdCtrls, ComCtrls;

type
TfUtama = class(TForm)
MainMenu1: TMainMenu;
ABSEN1: TMenuItem;
formMenu: TMenuItem;
KELUAR1: TMenuItem;
Keluar2: TMenuItem;
EntryPegawai1: TMenuItem;
Laporan1: TMenuItem;
Absensi1: TMenuItem;
N1: TMenuItem;
N3: TMenuItem;
stat1: TStatusBar;
procedure formMenuClick(Sender: TObject);
procedure Keluar2Click(Sender: TObject);
procedure KELUAR1Click(Sender: TObject);
procedure EntryPegawai1Click(Sender: TObject);
procedure Absensi1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fUtama: TfUtama;
implementation
uses UAbsen, UListKaryawan, Unit1, UMenu;
{$R *.dfm}
procedure TfUtama.formMenuClick(Sender: TObject);
begin
fabsen.show;
end;
procedure TfUtama.Keluar2Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TfUtama.KELUAR1Click(Sender: TObject);

begin
FListKaryawan.Label2.Caption:='Karyawan';
FListKaryawan.ShowModal;
end;
procedure TfUtama.EntryPegawai1Click(Sender: TObject);
begin
Fkaryawan.ShowModal
end;
procedure TfUtama.Absensi1Click(Sender: TObject);
begin
FLapABSEN.ShowModal;
end;
procedure TfUtama.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Application.Terminate;
end;
end.

Pada Unit Laporan Absen


unit ULapAbsen1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QuickRpt, ExtCtrls, QRCtrls;
type
TFREPAbsen1 = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
SummaryBand1: TQRBand;
QRLabel1: TQRLabel;
QRDBText1: TQRDBText;
QRDBText3: TQRDBText;
QRDBText7: TQRDBText;
QRLabel3: TQRLabel;
QRLabel7: TQRLabel;
QRDBText2: TQRDBText;
QRShape1: TQRShape;

QRShape3: TQRShape;
QRShape4: TQRShape;
QRLabel8: TQRLabel;
QRLabel11: TQRLabel;
PageFooterBand1: TQRBand;
QRSysData1: TQRSysData;
QRLabel10: TQRLabel;
QRLabel12: TQRLabel;
QRLabel2: TQRLabel;
QRSysData2: TQRSysData;
QRDBText4: TQRDBText;
QRLabel4: TQRLabel;
QRShape2: TQRShape;
QRShape5: TQRShape;
QRExpr1: TQRExpr;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel9: TQRLabel;
QRExpr2: TQRExpr;
QRShape6: TQRShape;
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QRDBText4Print(sender: TObject; var Value: String);
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FREPAbsen1: TFREPAbsen1;
implementation
uses UMenu;
{$R *.dfm}
procedure TFREPAbsen1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
QRLabel11.Caption:='Periode :'+FormatDateTime('dd-MMyyyy',FLapABSEN.TDTTanggalAwal.Date)+ ' s/d '+FormatDateTime('dd-MMyyyy',FLapABSEN.TDTTanggalAkhir.Date);
end;

procedure TFREPAbsen1.QRDBText4Print(sender: TObject; var Value: String);


begin
Value:=FormatDateTime('dddd',FLapABSEN.ADOProsesTanggalAbsen.Value)
end;
procedure TFREPAbsen1.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
if FLapABSEN.ADOProses.FieldByName('FLAG').Value='Izin' then
QRDBText3.Font.Color :=clBlue else
if FLapABSEN.ADOProses.FieldByName('FLAG').Value='Cuti' then
QRDBText3.Font.Color :=clRed else
if FLapABSEN.ADOProses.FieldByName('FLAG').Value='Dinas' then
QRDBText3.Font.Color :=clYellow
else
QRDBText3.Font.Color :=clBlack;
if FormatDateTime('dddd',FLapABSEN.ADOProsesTanggalAbsen.Value)='Minggu' then
QRDBText4.Font.Color :=clRed
else
QRDBText4.Font.Color :=clBlack;
end;
end.

Pada Unit List Karyaawan


unit UListKaryawan;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DB, ADODB, Grids, DBGrids, StdCtrls, Buttons, DBCtrls;
type
TFListKaryawan = class(TForm)
pDataKaryawan: TPanel;
DBGrid1: TDBGrid;
ADOList: TADOQuery;
DataSource1: TDataSource;
Label1: TLabel;
BitCari: TBitBtn;
BitKeluar: TBitBtn;

Label2: TLabel;
BitTampil: TBitBtn;
EdCari: TEdit;
CBFilter: TComboBox;
ADOListNIK: TWideStringField;
ADOListNama: TWideStringField;
ADOListJenisKelamin: TWideStringField;
ADOListTempat_Lahir: TWideStringField;
ADOListTanggal_Lahir: TDateTimeField;
ADOListAlamat: TWideStringField;
ADOListNoTelepon: TWideStringField;
ADOListStatus: TBooleanField;
ADOListPassword: TWideStringField;
DCHKStatus: TDBCheckBox;
procedure FormShow(Sender: TObject);
procedure BitCariClick(Sender: TObject);
procedure BitKeluarClick(Sender: TObject);
procedure DBGrid1DblClick(Sender: TObject);
procedure BitTampilClick(Sender: TObject);
procedure EdCariKeyPress(Sender: TObject; var Key: Char);
procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure DBGrid1ColExit(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure TampilkanKaryawan;
public
{ Public declarations }
end;
var
FListKaryawan: TFListKaryawan;
implementation
uses UDModule,UAbsen,Unit1,umenu;
{$R *.dfm}
procedure TFListKaryawan.TampilkanKaryawan ;
begin
ADOList.Close;
ADOList.SQL.Clear;
ADOList.SQL.Add('select * from tbl_Karyawan order by nama');
ADOList.Open;
end;
procedure TFListKaryawan.FormShow(Sender: TObject);

begin
EdCari.Text:='';
CBFilter.ItemIndex:=1;
BitTampil.SetFocus;
ADOList.Close;
ADOList.SQL.Clear;
ADOList.SQL.Add('select top 5 * from tbl_Karyawan rand order by nama');
ADOList.Open;
end;
procedure TFListKaryawan.BitCariClick(Sender: TObject);
begin
ADOList.Close;
ADOList.SQL.Clear;
ADOList.SQL.Add('select*from tbl_karyawan where '+CBFilter.Text+' like
"%'+EdCari.Text+'%" ');
ADOList.Open;
end;
procedure TFListKaryawan.BitKeluarClick(Sender: TObject);
begin
close
end;
procedure TFListKaryawan.DBGrid1DblClick(Sender: TObject);
begin
if Label2.Caption='Laporan' then
Begin
if ADOList.IsEmpty then
else
begin
FLapABSEN.EdID.Text:=ADOListNIK.Value;
FLapABSEN.EdNama.Text:=ADOListNama.Value;
if ADOListStatus.Value=True then
FLapABSEN.LabelStatus.Caption:='Active'
else
FLapABSEN.LabelStatus.Caption:='Not Active';
close
end
End
Else
BEGIN
if ADOList.IsEmpty then
else
begin

FKaryawan.Edit1.Text:=ADOListNIK.Value;
FKaryawan.Edit2.Text:=ADOListNama.Value;
FKaryawan.ComboBox1.Text:=ADOListJenisKelamin.Value;
FKaryawan.Edit3.Text:=ADOListTempat_Lahir.Value;
FKaryawan.DateTimePicker1.date:=ADOListTanggal_Lahir.AsDateTime;
FKaryawan.ShowModal
end
END
end;
procedure TFListKaryawan.BitTampilClick(Sender: TObject);
begin
TampilkanKaryawan;
EdCari.Text:='';
CBFilter.ItemIndex:=1
end;
procedure TFListKaryawan.EdCariKeyPress(Sender: TObject; var Key: Char);
begin
if key=char(13) then
Begin
ADOList.Close;
ADOList.SQL.Clear;
ADOList.SQL.Add('select*from tbl_karyawan where '+CBFilter.Text+' like
"%'+EdCari.Text+'%" ');
ADOList.Open;
End
end;
procedure TFListKaryawan.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
const IsChecked : array[Boolean] of Integer =
(DFCS_BUTTONCHECK, DFCS_BUTTONCHECK or DFCS_CHECKED);
var
DrawState: Integer;
DrawRect: TRect;
begin
if (gdFocused in State) then
begin
if (Column.Field.FieldName = DCHKStatus.DataField) then
begin
DCHKStatus.Left := Rect.Left + DBGrid1.Left + 2;
DCHKStatus.Top := Rect.Top + DBGrid1.top + 2;
DCHKStatus.Width := Rect.Right - Rect.Left;

DCHKStatus.Height := Rect.Bottom - Rect.Top;


DCHKStatus.Visible := True;
end
end
else
begin
if (Column.Field.FieldName = DCHKStatus.DataField) then
begin
DrawRect:=Rect;
InflateRect(DrawRect,-1,-1);
DrawState := ISChecked[Column.Field.AsBoolean];
DBGrid1.Canvas.FillRect(Rect);
DrawFrameControl(DBGrid1.Canvas.Handle, DrawRect,
DFC_BUTTON, DrawState);
end;
end;
end;
procedure TFListKaryawan.DBGrid1ColExit(Sender: TObject);
begin
if DBGrid1.SelectedField.FieldName = DCHKStatus.DataField then
DCHKStatus.Visible := False
end;
procedure TFListKaryawan.FormCreate(Sender: TObject);
begin
DCHKStatus.Visible := False;
end;
end.

Pada Unit Menu


unit UMenu;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, Buttons, DB, ADODB, Grids, DBGrids;
type
TFLapABSEN = class(TForm)

pnl1: TPanel;
Label5: TLabel;
shp1: TShape;
shp2: TShape;
Label3: TLabel;
TDTTanggalAwal: TDateTimePicker;
TDTTanggalAkhir: TDateTimePicker;
BitProses: TBitBtn;
BitKeluar: TBitBtn;
ADOKaryawan: TADOQuery;
ADOKaryawanNIK: TWideStringField;
ADOKaryawanNama: TWideStringField;
ADOKaryawanJenisKelamin: TWideStringField;
ADOKaryawanTempat_Lahir: TWideStringField;
ADOKaryawanTanggal_Lahir: TDateTimeField;
ADOKaryawanAlamat: TWideStringField;
ADOKaryawanNoTelepon: TWideStringField;
ADOKaryawanStatus: TBooleanField;
ADOProses: TADOQuery;
ADOProsesNamakaryawan: TStringField;
Panel1: TPanel;
RBPerson: TRadioButton;
RBALL: TRadioButton;
Label4: TLabel;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label8: TLabel;
EdID: TEdit;
BitButtonBitCari: TBitBtn;
EdNama: TEdit;
LabelStatus: TLabel;
mysql_proses: TADOQuery;
mysql_open: TADOQuery;
mysql_tampil: TADOQuery;
Label6: TLabel;
ADOIZIN: TADOQuery;
ADOCUTI: TADOQuery;
ADODINAS: TADOQuery;
GroupBox2: TGroupBox;
RBModel1: TRadioButton;
RBModel2: TRadioButton;
ADOProsesNIK: TWideStringField;
ADOProsesTanggalAbsen: TDateTimeField;
ADOProsesMasuk: TDateTimeField;
ADOProsesPulang: TDateTimeField;

ADOProsesIzin: TSmallintField;
ADOProsesCuti: TSmallintField;
ADOProsesKeterangan: TWideStringField;
ADOProsesFlag: TWideStringField;
procedure BitKeluarClick(Sender: TObject);
procedure EdIDKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
procedure BitButtonBitCariClick(Sender: TObject);
procedure BitProsesClick(Sender: TObject);
procedure TDTTanggalAwalChange(Sender: TObject);
procedure RBPersonClick(Sender: TObject);
procedure RBALLClick(Sender: TObject);
private
{ Private declarations }
PROCEDURE TAMPILKANABSENSI;
public
{ Public declarations }
end;
var
FLapABSEN: TFLapABSEN;
CariField:Tfield;
implementation
uses UDModule,UAbsen,Unit1,UListKaryawan, DateUtils, ULapAbsen1,
URepAbsenALL,
URepAbsenALL2;
{$R *.dfm}
PROCEDURE TFLapABSEN.TAMPILKANABSENSI;
var
tgl_1, tgl_x, i : integer;
tahun, bulan, hari, thn, bln, hr :word;
kolom_header, kolom_value : string;
kode_karyawan, nama_karyawan:string;
no,IZIN,CUTI : integer;
BEGIN
Application.ProcessMessages;
decodedate(now, tahun, bulan, hari);
decodedate(TDTTanggalAwal.Date,thn,bln,hr);
tgl_1 := 1;
tgl_x := daysinmonth(TDTTanggalAwal.Date);
//membuah header kolom pada tabel
kolom_header := '[No] TEXT(5), [Nama_Karyawan] TEXT(50),[IZIN] TEXT(5),[CUTI]
TEXT(5),';
for i:=tgl_1 to tgl_x do

begin
kolom_header := kolom_header + '[hari_' + inttostr(i) + '] TEXT (10)';
if i <> tgl_x then
kolom_header := kolom_header + ',';
end;
if tgl_x=31 then
begin
FRepAbsenALL.QRDBText32.DataField:='hari_31';
FRepAbsenALL.QRDBText32.DataSet:=FLapABSEN.mysql_tampil;
end else
begin
FRepAbsenALL.QRDBText32.DataField:='';
FRepAbsenALL.QRDBText32.DataSet:=nil;
FRepAbsenALL2.SP31.Brush.Color :=clGreen;
end;
//hapus dan menyisipkan table temp di database dengan rincian kolom sesuai variabel
kolom_header
with mysql_proses do begin
close;
sql.Clear;
sql.Add('DROP table tbl_temp [IF EXISTS]');
execSQL;
sql.Clear;
sql.Add('create table [tbl_temp] (' + kolom_header + ')');
execSQL;
end;
//rekapitulasi data dan penyisipan ke tabel temp
with mysql_open do begin
close;
sql.Clear;
sql.Add('select * from tbl_karyawan order by Nama');
open;
no := 0;
first;
while not eof do begin
no := no + 1;
kode_karyawan := fieldbyname('NIK').AsString;
nama_karyawan := fieldbyname('Nama').AsString;
with ADOIZIN do // hitung jummlah Izin
begin
close;

sql.Clear;
sql.Add('select sum(izin) as JIzin from tbl_absen where
month(TanggalAbsen)="'+FormatDateTime('MM',TDTTanggalAwal.Date)+'" and
year(TanggalAbsen)="'+FormatDateTime('yyyy',TDTTanggalAwal.Date)+'" and
NIK="'+kode_karyawan+'"');
open;
end;
IZIN:=ADOIZIN.FIELDBYNAME('JIZIN').AsInteger;
with ADOCUTI do // hitung jummlah CUTI
begin
close;
sql.Clear;
sql.Add('select sum(CUTI) as JCUTI from tbl_absen where
month(TanggalAbsen)="'+FormatDateTime('MM',TDTTanggalAwal.Date)+'" and
year(TanggalAbsen)="'+FormatDateTime('yyyy',TDTTanggalAwal.Date)+'" and
NIK="'+kode_karyawan+'"');
open;
end;
CUTI:=ADOCUTI.FIELDBYNAME('JCUTI').AsInteger;
kolom_value := '"'+inttostr(no) + '", "' +nama_karyawan + '","'+inttostr(IZIN) +
'","'+inttostr(CUTI) + '",';
for i:= tgl_1 to tgl_x do begin
with mysql_proses do begin
close;
sql.Clear;
sql.Add('select * from tbl_absen where NIK="'+kode_karyawan+'" and
year(TanggalAbsen)="'+inttostr(thn)+'" and month(TanggalAbsen)="'+inttostr(bln)+'"
and day(TanggalAbsen)="'+inttostr(i)+'"');
open;
kolom_value := kolom_value + '"' + fieldbyname('flag').AsString + '"';
if i <> tgl_x then
kolom_value := kolom_value +',';
end;
end;
with mysql_proses do begin
close;
sql.Clear;
sql.Add('insert into tbl_temp values('+ kolom_value+ ')');
execSQL;

end;
next;
end;
end;
//open data rekap
with mysql_tampil do
begin
close;
sql.Clear;
sql.Add('select * from tbl_temp order by Nama_Karyawan');
open;
end;
FLapABSEN.mysql_tampil.FindField('hari_31');
if Assigned(FLapABSEN.mysql_tampil.FindField('hari_31')) then
BEGIN
FRepAbsenALL.QRLabel35.Enabled:=TRUE;
FRepAbsenALL.QRDBText32.Enabled:=TRUE;
FRepAbsenALL2.QRLabel35.Enabled:=TRUE;
FRepAbsenALL2.SP31.Enabled:=TRUE;
END
ELSE
BEGIN
FRepAbsenALL.QRLabel35.Enabled:=FALSE;
FRepAbsenALL.QRDBText32.Enabled:=FALSE;
FRepAbsenALL2.QRLabel35.Enabled:=FALSE;
FRepAbsenALL2.SP31.Enabled:=FALSE;
END
END;
procedure TFLapABSEN.BitKeluarClick(Sender: TObject);
begin
close
end;
procedure TFLapABSEN.EdIDKeyPress(Sender: TObject; var Key: Char);
begin
if key=char(13) then
begin
ADOKaryawan.Close;
ADOKaryawan.SQL.Clear;
ADOKaryawan.SQL.Add('select * from tbl_Karyawan where Nik="'+EdID.Text+'"');
ADOKaryawan.Open;
if not ADOKaryawan.Eof then

begin
EdID.Text:=ADOKaryawanNIK.Value;
EdNama.Text:=ADOKaryawanNama.Value;
BitProses.SetFocus;
if ADOKaryawanStatus.Value=True then
LabelStatus.Caption:='Active'
else
LabelStatus.Caption:='Not Active'
end
else
begin
MessageDlg('Maaf. Data Tidak Ditemukan',mtError,[mbOK],0);
EdID.SetFocus;
end
end
end;
procedure TFLapABSEN.FormShow(Sender: TObject);
begin
EdID.Text:='';
EdNama.Text:='';
LabelStatus.Caption:='-';
TDTTanggalAwal.Date:=StartOfTheMonth(now);
TDTTanggalAkhir.Date:=now;
RBPerson.Checked:=True;
RBPersonClick(sender);
end;
procedure TFLapABSEN.BitButtonBitCariClick(Sender: TObject);
begin
FListKaryawan.Label2.Caption:='Laporan';
FListKaryawan.ShowModal;
end;
procedure TFLapABSEN.BitProsesClick(Sender: TObject);
begin
Label6.Visible:=True;
Cursor:=crSQLWait;
IF RBPerson.Checked=True THEN
BEGIN
Cursor:=crSQLWait;
ADOProses.Close;
ADOProses.SQL.Clear;
ADOProses.SQL.Add('select * from TBL_ABSEN WHERE NIK="'+EdID.Text+'" and
tanggalabsen>=#'+FormatDateTime('yyyy-MM-dd',TDTTanggalAwal.Date)+'# and

tanggalabsen<=#'+FormatDateTime('yyyy-MM-dd',TDTTanggalAkhir.Date)+'# order by
tanggalabsen');
ADOProses.Open;
if not ADOProses.Eof then
begin
fREPabsen1.QuickRep1.Preview;
Cursor:=crDefault;
Label6.Visible:=FALSE;
end
else
begin
MessageDlg('Data Tidak Ditemukan',mtError,[mbOK],0);
Label6.Visible:=FALSE;
end
END ELSE
IF RBALL.Checked=True THEN
BEGIN
try
Cursor:=crSQLWait;
TAMPILKANABSENSI;
Cursor:=crDefault;
if RBModel1.Checked=true then
begin
FRepAbsenALL.QuickRep1.Prepare;
FRepAbsenALL.QuickRep1.Preview;
end else
if RBModel2.Checked=true then
begin
FRepAbsenALL2.QuickRep1.Prepare;
FRepAbsenALL2.QuickRep1.Preview;
end;
Label6.Visible:=FALSE;
except
end;
END
end;
procedure TFLapABSEN.TDTTanggalAwalChange(Sender: TObject);
begin
TDTTanggalAkhir.Date:=EndOfTheMonth(TDTTanggalAwal.Date)
end;
procedure TFLapABSEN.RBPersonClick(Sender: TObject);
begin

GroupBox1.Enabled:=True;
TDTTanggalAkhir.Visible:=True;
Label3.Visible:=True;
TDTTanggalAwal.Format:='dd MMMM yyyy';
EdID.SetFocus;
RBModel1.Checked:=False;
RBModel2.Checked:=False;
GroupBox2.Enabled:=False;
end;
procedure TFLapABSEN.RBALLClick(Sender: TObject);
begin
GroupBox1.Enabled:=False;
TDTTanggalAkhir.Visible:=False;
Label3.Visible:=False;
TDTTanggalAwal.Format:='MMMM yyyy';
GroupBox2.Enabled:=True;
RBModel1.Checked:=True;
end;
end.

Pada Unit Entry Data


unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, Grids, DBGrids, DB, StdCtrls, ExtCtrls, ComCtrls, ADODB,
ExtDlgs, jpeg,
Buttons;
type
TFKaryawan = class(TForm)
ADOTable1: TADOTable;
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit1: TEdit;

Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
ComboBox1: TComboBox;
DateTimePicker1: TDateTimePicker;
Memo1: TMemo;
Panel3: TPanel;
BitTambah: TButton;
BitEdit: TButton;
BitKeluar: TButton;
BitHapus: TButton;
ADOQuery1: TADOQuery;
ADOQuery1NIK: TWideStringField;
ADOQuery1Nama: TWideStringField;
ADOQuery1JenisKelamin: TWideStringField;
ADOQuery1Tempat_Lahir: TWideStringField;
ADOQuery1Tanggal_Lahir: TDateTimeField;
ADOQuery1Alamat: TWideStringField;
ADOQuery1NoTelepon: TWideStringField;
ADOQuery1Foto: TWideStringField;
Label8: TLabel;
CHStatus: TCheckBox;
btnAuto: TSpeedButton;
procedure BitKeluarClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BitTambahClick(Sender: TObject);
procedure BitEditClick(Sender: TObject);
procedure BitHapusClick(Sender: TObject);
procedure btnAutoClick(Sender: TObject);
private
{ Private declarations }
procedure bersih;
public
{ Public declarations }
end;
var
FKaryawan: TFKaryawan;
IsSimpan:Boolean;
implementation
uses UDModule,UAbsen, UListKaryawan;
{$R *.dfm}
procedure TFKaryawan.bersih;
begin
Edit1.Text:='';

Edit2.Text:='';
Edit3.Text:='';
Edit4.Text:='';
ComboBox1.Text:='';
DateTimePicker1.DateTime:=now;
Memo1.Text:='';
end;
procedure TFKaryawan.BitKeluarClick(Sender: TObject);
begin
if BitTambah.Caption='Simpan' then
MessageDlg('Data Belum Disimpan !!',mtError,[mbOK],0)
else
Close
end;
procedure TFKaryawan.FormShow(Sender: TObject);
begin
Panel1.Enabled:=false;
end;
procedure TFKaryawan.BitTambahClick(Sender: TObject);
var Vstatus:string;
begin
if BitTambah.Caption ='Tambah' then
Begin
IsSimpan:=True;
Panel1.Enabled:=true;
bersih;
Edit1.SetFocus;
BitTambah.Caption :='Simpan';
BitEdit.Caption:='Batal';
BitHapus.Enabled:=false;
end
else
BEGIN
if IsSimpan=true then
begin
if (Edit1.Text='') or (Edit2.Text='') then
MessageDlg('Tidak Boleh Kosong!!',mtError,[mbOK],0)
else // silahkan tambahkan sendiri pencarian untuk validasi NIK
BEGIN
ADOTable1.Open;
ADOTable1.Append;
ADOTable1.FieldByName('NIK').AsString:=Edit1.Text;
ADOTable1.FieldByName('Nama').AsString:=Edit2.Text;

ADOTable1.FieldByName('JenisKelamin').AsString:=ComboBox1.Text;
ADOTable1.FieldByName('Tempat_Lahir').AsString:=Edit3.Text;
ADOTable1.FieldByName('Tanggal_Lahir').AsDateTime:=DateTimePicker1.Date;
ADOTable1.FieldByName('Alamat').AsString:=Memo1.Text;
ADOTable1.FieldByName('NoTelepon').AsString:=Edit4.Text;
ADOTable1.FieldByName('status').AsBoolean:=CHStatus.Checked;
ADOTable1.FieldByName('password').AsString:='123456';
ADOTable1.Post;
Panel1.Enabled:=false;
BitTambah.Caption :='Tambah';
BitEdit.Caption:='Edit';
BitHapus.Enabled:=True;
ADOTable1.Close;
MessageDlg('Data Sudah Disimpan !!',mtInformation,[mbOK],0);
END
end
else
begin
if CHStatus.Checked=true then
begin
vstatus:='True'
end
else
begin
vstatus:='False'
end;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('update tbl_karyawan set nama="'+Edit2.Text+'",'+
'JenisKelamin="'+ComboBox1.Text+'",'+
'Tempat_LAHIR="'+Edit3.Text+'",'+
'Tanggal_Lahir="'+DateToStr(DateTimePicker1.Date)+'",'+
'Alamat="'+Memo1.Text+'",'+
'Notelepon="'+Edit4.Text+'",'+
'status='+Vstatus+''+
' where nik="'+Edit1.Text+'"');
ADOQuery1.ExecSQL;
Panel1.Enabled:=false;
BitTambah.Caption :='Tambah';
BitEdit.Caption:='Edit';
BitHapus.Enabled:=True;
ADOTable1.Close;
MessageDlg('Data Sudah Diedit !!',mtInformation,[mbOK],0);
FListKaryawan.BitTampilClick(sender)

end
END
end;
procedure TFKaryawan.BitEditClick(Sender: TObject);
begin
if BitEdit.Caption='Batal' then
begin
bersih;
Panel1.Enabled:=false;
BitTambah.Caption :='Tambah';
BitEdit.Caption:='Edit';
BitHapus.Enabled:=True;
end
else
if Edit1.Text='' then
MessageDlg('Pastikan Data yang akan DiEdit!!',mtInformation,[mbOK],0)
else
begin
IsSimpan:=false;
Panel1.Enabled:=true;
Edit2.SetFocus;
BitTambah.Caption :='Simpan';
BitEdit.Caption:='Batal';
BitHapus.Enabled:=false;
end
end;
procedure TFKaryawan.BitHapusClick(Sender: TObject);
begin
if Edit1.Text='' then
MessageDlg('Pastikan Data yang akan Dihapus!!',mtInformation,[mbOK],0)
else
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('delete from data where nik="'+Edit1.Text+'"');
ADOQuery1.ExecSQL;
bersih;
DateTimePicker1.DateTime:=now;
Panel1.Enabled:=false;

BitTambah.Caption :='Tambah';
BitEdit.Caption:='Edit';
BitHapus.Enabled:=True;
MessageDlg('Data Sudah Dihapus!!',mtInformation,[mbOK],0)
end
end;
procedure TFKaryawan.btnAutoClick(Sender: TObject);
begin
Edit1.Text:='K-'+FormatDateTime('YYMMddHHmmss',now);
end;
end.

Unit Report Absen 1


unit URepAbsenALL;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TFRepAbsenALL = class(TForm)
QuickRep1: TQuickRep;
QRGroup1: TQRGroup;
QRShape2: TQRShape;
QRExpr1: TQRExpr;
QRDBText8: TQRDBText;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRDBText11: TQRDBText;
QRDBText12: TQRDBText;
QRDBText13: TQRDBText;
QRDBText14: TQRDBText;
QRDBText15: TQRDBText;

QRDBText16: TQRDBText;
QRDBText17: TQRDBText;
QRDBText18: TQRDBText;
QRDBText19: TQRDBText;
QRDBText20: TQRDBText;
QRDBText21: TQRDBText;
QRDBText22: TQRDBText;
QRDBText23: TQRDBText;
QRDBText24: TQRDBText;
QRDBText25: TQRDBText;
QRDBText26: TQRDBText;
QRDBText27: TQRDBText;
QRDBText28: TQRDBText;
QRDBText29: TQRDBText;
QRDBText30: TQRDBText;
QRDBText31: TQRDBText;
QRDBText32: TQRDBText;
ColumnHeaderBand1: TQRBand;
QRShape1: TQRShape;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel23: TQRLabel;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel31: TQRLabel;

QRLabel32: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRShape3: TQRShape;
QRLabel36: TQRLabel;
QRLabel37: TQRLabel;
QRShape4: TQRShape;
PageHeaderBand1: TQRBand;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
QRLabel12: TQRLabel;
QRSysData1: TQRSysData;
QRLabel1: TQRLabel;
SummaryBand1: TQRBand;
QRLabel38: TQRLabel;
QRLabel39: TQRLabel;
PageFooterBand1: TQRBand;
QRSysData2: TQRSysData;
QRLabel40: TQRLabel;
QRDBText33: TQRDBText;
QRDBText34: TQRDBText;
QRDBText35: TQRDBText;
QRDBText36: TQRDBText;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
QRLabel44: TQRLabel;
QRLabel45: TQRLabel;
QRShape8: TQRShape;
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FRepAbsenALL: TFRepAbsenALL;
implementation
USES UMenu;
{$R *.dfm}

procedure TFRepAbsenALL.QuickRep1BeforePrint(Sender: TCustomQuickRep;


var PrintReport: Boolean);
begin
QRLabel10.Caption:=FormatDateTime('mmmm
YYYY',FLapAbsen.TDTTanggalAwal.Date);
end;
end.

Unit Report All 2


unit URepAbsenALL2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TFRepAbsenALL2 = class(TForm)
QuickRep1: TQuickRep;
DetailBand1: TQRBand;
SP1: TQRShape;
ColumnHeaderBand1: TQRBand;
QRShape1: TQRShape;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel23: TQRLabel;

QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel31: TQRLabel;
QRLabel32: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRShape3: TQRShape;
QRLabel36: TQRLabel;
QRLabel37: TQRLabel;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
QRLabel44: TQRLabel;
PageHeaderBand1: TQRBand;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
QRLabel12: TQRLabel;
QRSysData1: TQRSysData;
QRLabel1: TQRLabel;
QRLabel40: TQRLabel;
SummaryBand1: TQRBand;
QRLabel45: TQRLabel;
PageFooterBand1: TQRBand;
QRSysData2: TQRSysData;
QRDBText35: TQRDBText;
QRDBText33: TQRDBText;
QRLabel46: TQRLabel;
QRShape2: TQRShape;
SP2: TQRShape;
SP3: TQRShape;
SP4: TQRShape;
SP5: TQRShape;
SP6: TQRShape;
SP7: TQRShape;
SP8: TQRShape;
SP9: TQRShape;
SP10: TQRShape;
SP11: TQRShape;

SP12: TQRShape;
SP13: TQRShape;
SP14: TQRShape;
SP15: TQRShape;
SP16: TQRShape;
SP17: TQRShape;
SP18: TQRShape;
SP19: TQRShape;
SP20: TQRShape;
SP21: TQRShape;
SP22: TQRShape;
SP23: TQRShape;
SP24: TQRShape;
SP25: TQRShape;
SP26: TQRShape;
SP27: TQRShape;
SP28: TQRShape;
SP29: TQRShape;
SP30: TQRShape;
SP31: TQRShape;
QRDBText1: TQRDBText;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRLabel47: TQRLabel;
QRLabel48: TQRLabel;
QRLabel49: TQRLabel;
QRShape12: TQRShape;
QRLabel51: TQRLabel;
QRDBText2: TQRDBText;
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FRepAbsenALL2: TFRepAbsenALL2;
implementation
uses UMenu;

{$R *.dfm}
procedure TFRepAbsenALL2.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
FLapABSEN.mysql_tampil.FindField('hari_31');
if Assigned(FLapABSEN.mysql_tampil.FindField('hari_31')) then
BEGIN
if FLapABSEN.mysql_tampil.FieldByName('hari_31').Value='Izin' then
SP31.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_31').Value='Cuti' then
SP31.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_31').Value='Dinas' then
SP31.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_31').Value='' then
SP31.Brush.Color :=clWhite else
SP31.Brush.Color :=clGreen;
END ELSE
BEGIN
SP31.Brush.Color :=clWhite;
END;
if FLapABSEN.mysql_tampil.FieldByName('hari_1').Value='Izin' then
SP1.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_1').Value='Cuti' then
SP1.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_1').Value='Dinas' then
SP1.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_1').Value='' then
SP1.Brush.Color :=clWhite else
SP1.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_2').Value='Izin' then
SP2.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_2').Value='Cuti' then
SP2.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_2').Value='Dinas' then
SP2.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_2').Value='' then
SP2.Brush.Color :=clWhite else
SP2.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_3').Value='Izin' then
SP3.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_3').Value='Cuti' then
SP3.Brush.Color :=clRed else

if FLapABSEN.mysql_tampil.FieldByName('hari_3').Value='Dinas' then
SP3.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_3').Value='' then
SP3.Brush.Color :=clWhite else
SP3.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_4').Value='Izin' then
SP4.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_4').Value='Cuti' then
SP4.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_4').Value='Dinas' then
SP4.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_4').Value='' then
SP4.Brush.Color :=clWhite else
SP4.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_5').Value='Izin' then
SP5.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_5').Value='Cuti' then
SP5.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_5').Value='Dinas' then
SP5.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_5').Value='' then
SP5.Brush.Color :=clWhite else
SP5.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_6').Value='Izin' then
SP6.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_6').Value='Cuti' then
SP6.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_6').Value='Dinas' then
SP6.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_6').Value='' then
SP6.Brush.Color :=clWhite else
SP6.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_7').Value='Izin' then
SP7.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_7').Value='Cuti' then
SP7.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_7').Value='Dinas' then
SP7.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_7').Value='' then
SP7.Brush.Color :=clWhite else
SP7.Brush.Color :=clGreen;

if FLapABSEN.mysql_tampil.FieldByName('hari_8').Value='Izin' then
SP8.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_8').Value='Cuti' then
SP8.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_8').Value='Dinas' then
SP8.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_8').Value='' then
SP8.Brush.Color :=clWhite else
SP8.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_9').Value='Izin' then
SP9.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_9').Value='Cuti' then
SP9.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_9').Value='Dinas' then
SP9.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_9').Value='' then
SP9.Brush.Color :=clWhite else
SP9.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_10').Value='Izin' then
SP10.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_10').Value='Cuti' then
SP10.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_10').Value='Dinas' then
SP10.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_10').Value='' then
SP10.Brush.Color :=clWhite else
SP10.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_11').Value='Izin' then
SP11.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_11').Value='Cuti' then
SP11.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_11').Value='Dinas' then
SP11.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_11').Value='' then
SP11.Brush.Color :=clWhite else
SP11.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_12').Value='Izin' then
SP12.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_12').Value='Cuti' then
SP12.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_12').Value='Dinas' then
SP12.Brush.Color :=clYellow else

if FLapABSEN.mysql_tampil.FieldByName('hari_12').Value='' then
SP12.Brush.Color :=clWhite else
SP12.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_13').Value='Izin' then
SP13.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_13').Value='Cuti' then
SP13.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_13').Value='Dinas' then
SP13.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_13').Value='' then
SP13.Brush.Color :=clWhite else
SP13.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_14').Value='Izin' then
SP14.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_14').Value='Cuti' then
SP14.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_14').Value='Dinas' then
SP14.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_14').Value='' then
SP14.Brush.Color :=clWhite else
SP14.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_15').Value='Izin' then
SP15.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_15').Value='Cuti' then
SP15.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_15').Value='Dinas' then
SP15.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_15').Value='' then
SP15.Brush.Color :=clWhite else
SP15.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_16').Value='Izin' then
SP16.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_16').Value='Cuti' then
SP16.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_16').Value='Dinas' then
SP16.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_16').Value='' then
SP16.Brush.Color :=clWhite else
SP16.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_17').Value='Izin' then
SP17.Brush.Color :=clBlue else

if FLapABSEN.mysql_tampil.FieldByName('hari_17').Value='Cuti' then
SP17.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_17').Value='Dinas' then
SP17.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_17').Value='' then
SP17.Brush.Color :=clWhite else
SP17.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_18').Value='Izin' then
SP18.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_18').Value='Cuti' then
SP18.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_18').Value='Dinas' then
SP18.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_18').Value='' then
SP18.Brush.Color :=clWhite else
SP18.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_19').Value='Izin' then
SP19.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_19').Value='Cuti' then
SP19.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_19').Value='Dinas' then
SP19.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_19').Value='' then
SP19.Brush.Color :=clWhite else
SP19.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_20').Value='Izin' then
SP20.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_20').Value='Cuti' then
SP20.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_20').Value='Dinas' then
SP20.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_20').Value='' then
SP20.Brush.Color :=clWhite else
SP20.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_21').Value='Izin' then
SP21.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_21').Value='Cuti' then
SP21.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_21').Value='Dinas' then
SP21.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_21').Value='' then
SP21.Brush.Color :=clWhite else

SP21.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_22').Value='Izin' then
SP22.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_22').Value='Cuti' then
SP22.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_22').Value='Dinas' then
SP22.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_22').Value='' then
SP22.Brush.Color :=clWhite else
SP22.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_23').Value='Izin' then
SP23.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_23').Value='Cuti' then
SP23.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_23').Value='Dinas' then
SP23.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_23').Value='' then
SP23.Brush.Color :=clWhite else
SP23.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_24').Value='Izin' then
SP24.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_24').Value='Cuti' then
SP24.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_24').Value='Dinas' then
SP24.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_24').Value='' then
SP24.Brush.Color :=clWhite else
SP24.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_25').Value='Izin' then
SP25.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_25').Value='Cuti' then
SP25.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_25').Value='Dinas' then
SP25.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_25').Value='' then
SP25.Brush.Color :=clWhite else
SP25.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_26').Value='Izin' then
SP26.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_26').Value='Cuti' then
SP26.Brush.Color :=clRed else

if FLapABSEN.mysql_tampil.FieldByName('hari_26').Value='Dinas' then
SP26.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_26').Value='' then
SP26.Brush.Color :=clWhite else
SP26.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_27').Value='Izin' then
SP27.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_27').Value='Cuti' then
SP27.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_27').Value='Dinas' then
SP27.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_27').Value='' then
SP27.Brush.Color :=clWhite else
SP27.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_28').Value='Izin' then
SP28.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_28').Value='Cuti' then
SP28.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_28').Value='Dinas' then
SP28.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_28').Value='' then
SP28.Brush.Color :=clWhite else
SP28.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_29').Value='Izin' then
SP29.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_29').Value='Cuti' then
SP29.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_29').Value='Dinas' then
SP29.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_29').Value='' then
SP29.Brush.Color :=clWhite else
SP29.Brush.Color :=clGreen;
if FLapABSEN.mysql_tampil.FieldByName('hari_30').Value='Izin' then
SP30.Brush.Color :=clBlue else
if FLapABSEN.mysql_tampil.FieldByName('hari_30').Value='Cuti' then
SP30.Brush.Color :=clRed else
if FLapABSEN.mysql_tampil.FieldByName('hari_30').Value='Dinas' then
SP30.Brush.Color :=clYellow else
if FLapABSEN.mysql_tampil.FieldByName('hari_30').Value='' then
SP30.Brush.Color :=clWhite else
SP30.Brush.Color :=clGreen;

end;
procedure TFRepAbsenALL2.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
QRLabel10.Caption:=FormatDateTime('mmmm
YYYY',FLapAbsen.TDTTanggalAwal.Date);
end;
end.

BAB II
PENUTUP
KESAN
Semoga ilmu yang saya dapat dari praktikum pembuatan program komputer ini bisa
berguna dan bermanfaat.

SARAN
Bila ada saya minta ditambah fitur-fitur yang lebih canggih pada pelajaran komputer,
agar kita bisa menambah wawasan