listing program delphi data base (gina pradina irawan)

29
DELPHI (Database) Listing Program Aplikasi Data Nilai Mahasiswa dan Aplikasi Data Identitas Mahasiswa Diajukan untuk memenuhi tugas individu pada mata kuliah Program Komputer Dosen: Drs. Deddy Sofyan, M.Pd. Oleh: GINA PRADINA IRAWAN 09512001 Kelas/Semester: 2 C/4

Upload: gina-pradina-irawan

Post on 10-Mar-2015

674 views

Category:

Documents


1 download

DESCRIPTION

Diajukan untuk memenuhi tugas individu mata kuliah Program Komputer.Berisi listing program database program identitas mahasiswa dan data nilai mahasiswa.

TRANSCRIPT

Page 1: Listing Program Delphi Data Base (Gina Pradina Irawan)

DELPHI (Database)

Listing Program

Aplikasi Data Nilai Mahasiswa dan Aplikasi Data Identitas Mahasiswa

Diajukan untuk memenuhi tugas individu pada mata kuliah Program Komputer

Dosen: Drs. Deddy Sofyan, M.Pd.

Oleh:

GINA PRADINA IRAWAN

09512001

Kelas/Semester: 2 C/4

JURUSAN PENDIDIKAN MATEMATIKA S-1

SEKOLAH TINGGI KEGURUAN DAN ILMU PENDIDIKAN

STKIP- GARUT

2011

Page 2: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Home

unit U_Home;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, jpeg, ExtCtrls, StdCtrls, Buttons, Menus;

type

TForm1 = class(TForm)

Image1: TImage;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

procedure BitBtn1Click(Sender: TObject);

Page 3: Listing Program Delphi Data Base (Gina Pradina Irawan)

procedure BitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

uses U_Login;

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

if messagedlg('Anda Ingin Keluar dari Aplikasi ini?',mtconfirmation,

[mbYes,mbNo],0)=mrYes then

begin

application.Terminate;

end;

end;

procedure TForm1.BitBtn2Click(Sender: TObject);

begin

Form3.show;

end;

end.

Page 4: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Login

unit U_Login;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, jpeg, ExtCtrls, StdCtrls, ComCtrls, Buttons;

type

TForm3 = class(TForm)

Label2: TLabel;

Page 5: Listing Program Delphi Data Base (Gina Pradina Irawan)

Label3: TLabel;

Euser: TEdit;

Epass: TEdit;

Image1: TImage;

Image2: TImage;

Image3: TImage;

BitBtn1: TBitBtn;

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

{ Public declarations }

end;

var

Form3: TForm3;

time,i:integer;

implementation

uses U_Nilai, U_Data, U_Home, Unit7;

{$R *.dfm}

procedure TForm3.BitBtn1Click(Sender: TObject);

begin

Page 6: Listing Program Delphi Data Base (Gina Pradina Irawan)

if (Euser.Text='pradina') and (Epass.text='pradina') then

begin

messagedlg('PASSWORD ANDA BENAR'+chr(10)+chr(13)+'SILAHKAN

LANJUTKAN',mtinformation,[mbok],0);

form7.Visible:=true;

end

else

begin

messagedlg('PASSWORD ANDA SALAH'+chr(10)+chr(13)+'COBA ANDA

ULANGI',mtinformation,[mbok],0);

Euser.Clear;

Euser.setfocus;

end;

end;

end.

Page 7: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Loading

unit Unit7;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ComCtrls, ExtCtrls;

type

TForm7 = class(TForm)

Timer1: TTimer;

ProgressBar1: TProgressBar;

Label1: TLabel;

procedure Timer1Timer(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

Page 8: Listing Program Delphi Data Base (Gina Pradina Irawan)

var

Form7: TForm7;

implementation

uses U_Data, U_Login;

{$R *.dfm}

procedure TForm7.Timer1Timer(Sender: TObject);

begin

if form7.Visible = true then

ProgressBar1.Position:= ProgressBar1.Position+15;

if ProgressBar1.Position = 100 then

begin

form4.Visible:= true;

form7.Hide;

form3.Hide;

end;

end;

end.

Page 9: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Help (about me)

unit U_Help;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, jpeg, ExtCtrls, StdCtrls, Buttons;

Page 10: Listing Program Delphi Data Base (Gina Pradina Irawan)

type

TForm5 = class(TForm)

Image1: TImage;

Image2: TImage;

Image3: TImage;

BitBtn1: TBitBtn;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

Label11: TLabel;

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

implementation

{$R *.dfm}

Page 11: Listing Program Delphi Data Base (Gina Pradina Irawan)

procedure TForm5.BitBtn1Click(Sender: TObject);

begin

close;

end;

end.

Page 12: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Data

unit U_Data;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, jpeg, ExtCtrls, StdCtrls, Buttons;

type

TForm4 = class(TForm)

Image1: TImage;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

Page 13: Listing Program Delphi Data Base (Gina Pradina Irawan)

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

Label1: TLabel;

Timer1: TTimer;

Label2: TLabel;

Label3: TLabel;

procedure BitBtn3Click(Sender: TObject);

procedure BitBtn2Click(Sender: TObject);

procedure BitBtn4Click(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

procedure Timer1Timer(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

implementation

uses U_Nilai, U_Help, Unit6, U_Home;

{$R *.dfm}

procedure TForm4.BitBtn3Click(Sender: TObject);

begin

Form1.Show;

end;

Page 14: Listing Program Delphi Data Base (Gina Pradina Irawan)

procedure TForm4.BitBtn2Click(Sender: TObject);

begin

Form2.show;

end;

procedure TForm4.BitBtn4Click(Sender: TObject);

begin

Form5.show;

end;

procedure TForm4.BitBtn1Click(Sender: TObject);

begin

form6.show;

end;

procedure TForm4.Timer1Timer(Sender: TObject);

begin

label2.Caption:=datetostr(now);

label3.Caption:=timetostr(now);

if label1.left=500 then

label1.Left:=-300;

label1.Left:=label1.Left + 5;

end;

end.

Page 15: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Identitas Mahasiswa

unit Unit6;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Buttons, DB, DBTables, ExtCtrls, DBCtrls, Grids,

DBGrids, ComCtrls;

type

TForm6 = class(TForm)

Page 16: Listing Program Delphi Data Base (Gina Pradina Irawan)

Label1: TLabel;

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Edit1: TEdit;

Edit3: TEdit;

Edit4: TEdit;

dsdata: TDataSource;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

tbdata: TTable;

Edit2: TEdit;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

BitBtn3: TBitBtn;

ComboBox1: TComboBox;

DateTimePicker1: TDateTimePicker;

procedure BitBtn3Click(Sender: TObject);

procedure BitBtn2Click(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

procedure FormCreate(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

Page 17: Listing Program Delphi Data Base (Gina Pradina Irawan)

var

Form6: TForm6;

implementation

{$R *.dfm}

procedure TForm6.BitBtn3Click(Sender: TObject);

begin

close;

end;

procedure TForm6.BitBtn2Click(Sender: TObject);

begin

edit1.Clear;

edit2.Clear;

edit3.Clear;

edit4.Clear;

combobox1.Text:=' ';

edit1.SetFocus;

end;

procedure TForm6.BitBtn1Click(Sender: TObject);

begin

tbdata.Append;

tbdata['Nim']:=edit1.Text;

tbdata['Nama']:=edit2.Text;

tbdata['Jenis_kelamin']:=combobox1.Text;

tbdata['Tanggal_lahir']:=datetimepicker1.date;

tbdata['Alamat']:=edit3.Text;

tbdata['No_kontak']:=edit4.Text;

Page 18: Listing Program Delphi Data Base (Gina Pradina Irawan)

end;

procedure TForm6.FormCreate(Sender: TObject);

begin

combobox1.Items.add('Laki-Laki');

combobox1.Items.add('Perempuan');

end;

end.

Page 19: Listing Program Delphi Data Base (Gina Pradina Irawan)

Form Daftar Nilai Mahasiswa

unit U_Nilai;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Grids, StdCtrls, Buttons, DB, XPMan, ADODB, DBTables, DBGrids,

ExtCtrls, DBCtrls;

type

TForm2 = class(TForm)

Label1: TLabel;

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Page 20: Listing Program Delphi Data Base (Gina Pradina Irawan)

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Edit1: TEdit;

Edit2: TEdit;

ComboBox1: TComboBox;

Edit3: TEdit;

Edit4: TEdit;

Edit5: TEdit;

Edit6: TEdit;

GroupBox2: TGroupBox;

Label9: TLabel;

Label10: TLabel;

Label11: TLabel;

Label12: TLabel;

Edit7: TEdit;

Edit8: TEdit;

Edit9: TEdit;

Edit10: TEdit;

BitBtn1: TBitBtn;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

BitBtn2: TBitBtn;

tbmhs: TTable;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

dsmhs: TDataSource;

procedure BitBtn4Click(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

procedure BitBtn3Click(Sender: TObject);

Page 21: Listing Program Delphi Data Base (Gina Pradina Irawan)

procedure FormCreate(Sender: TObject);

procedure BitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

JENIS:STRING;

implementation

{$R *.dfm}

procedure TForm2.BitBtn4Click(Sender: TObject);

begin

close;

end;

procedure TForm2.BitBtn1Click(Sender: TObject);

var

a,b,c,d,e:real;

begin

edit7.Text:=edit2.Text;

a:=strtofloat(edit3.Text);

b:=strtofloat(edit4.Text);

c:=strtofloat(edit5.Text);

d:=strtofloat(edit6.Text);

e:=(10/100*a)+(20/100*b)+(30/100*c)+(40/100*d);

Page 22: Listing Program Delphi Data Base (Gina Pradina Irawan)

edit8.Text:=floattostr(e);

if e>=80 then

begin

edit9.Text:='A';

edit10.Text:='Istimewa';

end

else if e>=70 then

begin

edit9.Text:='B';

edit10.Text:='Memuaskan';

end

else if e>=60 then

begin

edit9.Text:='C';

edit10.Text:='Cukup';

end

else if e>=50 then

begin

edit9.Text:='D';

edit10.Text:='Kurang';

end

else if e<50 then

begin

edit9.Text:='E';

edit10.Text:='Gagal';

end;

end;

procedure TForm2.BitBtn3Click(Sender: TObject);

begin

Page 23: Listing Program Delphi Data Base (Gina Pradina Irawan)

edit1.clear;

edit2.clear;

edit3.clear;

edit4.clear;

edit5.clear;

edit6.clear;

edit7.clear;

edit8.clear;

edit9.clear;

edit10.clear;

combobox1.text:='';

edit1.SetFocus;

BitBtn2.Enabled:=true;

end;

procedure TForm2.FormCreate(Sender: TObject);

begin

combobox1.Items.add('Laki-Laki');

combobox1.Items.add('Perempuan');

begin

edit1.Text:='';

edit3.Text:='';

edit4.Text:='';

edit5.Text:='';

edit6.Text:='';

edit7.Text:='';

edit8.Text:='';

edit9.Text:='';

edit10.Text:='';

end;

end;

Page 24: Listing Program Delphi Data Base (Gina Pradina Irawan)

procedure TForm2.BitBtn2Click(Sender: TObject);

begin

tbmhs.Append;

tbmhs['Nim']:=edit1.Text;

tbmhs['Nama']:=edit2.Text;

tbmhs['jenis_kelamin']:=combobox1.Text;

tbmhs['Nilai_absen']:=edit3.Text;

tbmhs['Nilai_tugas']:=edit4.Text;

tbmhs['Nilai_uts']:=edit5.Text;

tbmhs['Nilai_uas']:=edit6.Text;

tbmhs['Nilai_akhir']:=edit8.Text;

tbmhs['Huruf_mutu']:=edit9.Text;

tbmhs['Keterangan']:=edit10.Text;

tbmhs.Post;

end;

end.