Cari Blog Ini

Selasa, 30 November 2010

delphi pembelian rumah tunai & kredit







Created with Delphi 7 by Avid/Kira
Form ‘tunai dan kredit’ 
Data module
Database tunai
Database pembeli
Database rumah
Database kredit

Sintak:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    kodep: TEdit;
    nama: TEdit;
    alamat: TEdit;
    telp: TEdit;
    RadioGroup1: TRadioGroup;
    tunai: TGroupBox;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    sisa: TLabel;
    Button1: TButton;
    kodet: TEdit;
    tglt: TDateTimePicker;
    umt: TEdit;
    kredit: TGroupBox;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    cicil: TLabel;
    Button2: TButton;
    kodek: TEdit;
    tglk: TDateTimePicker;
    umk: TEdit;
    lama: TEdit;
    GroupBox2: TGroupBox;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    DBText1: TDBText;
    DBText2: TDBText;
    harga: TDBText;
    DBLookupComboBox1: TDBLookupComboBox;
    proses: TButton;
    exit: TButton;
    procedure prosesClick(Sender: TObject);
    procedure exitClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure RadioGroup1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.prosesClick(Sender: TObject);
begin
   datamodule2.tpembeli.Append;

   DataModule2.tpembeli.FieldByName('kodep').AsString:=kodep.Text;
   DataModule2.tpembeli.FieldByName('nama').AsString:=nama.Text;
   DataModule2.tpembeli.FieldByName('alamat').AsString:=alamat.Text;
   DataModule2.tpembeli.FieldByName('telp').AsString:=telp.Text;
   if RadioGroup1.ItemIndex=0 then
   begin
      DataModule2.ttunai.FieldByName('tgl').AsDateTime:=tglt.Date;
      DataModule2.ttunai.FieldByName('kodep').AsString:=kodep.Text;
      DataModule2.ttunai.FieldByName('um').AsFloat:=strtofloat(umt.text);
   end;
   if RadioGroup1.ItemIndex=1 then
   begin

   end;
   DataModule2.tpembeli.Post;
end;

procedure TForm1.exitClick(Sender: TObject);
begin
   Application.Terminate;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
      sisa.Caption:=floattostr(strtofloat(harga.Caption)-StrToFloat(umt.Text));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
   cicil.Caption:=floattostr((strtofloat(harga.Caption)-StrToFloat(umk.Text))
   /StrToFloat(lama.text));
end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if RadioGroup1.ItemIndex=0 then
   begin
      tunai.Visible:=true;
      kredit.Visible:=false;
   end;
   if RadioGroup1.ItemIndex=1 then
   begin
      kredit.Visible:=true;
      tunai.Visible:=false;
   end
end;

end.

delphi klinik


Created with Delphi 7 by Avid/Kira
Form ‘klinik’

Database pemeriksaan

Sintak:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Grids, DBGrids, DB, DBTables;

type
Tfpemeriksaan = class(TForm)
edno_pasien: TEdit;
ednama: TEdit;
Eddokter: TEdit;
Edtgl_periksa: TEdit;
Edobat: TEdit;
Edbiaya_periksa: TEdit;
tbperiksa: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
btsimpan: TButton;
btbatal: TButton;
btcari: TButton;
btedit: TButton;
bthapus: TButton;
btexit: TButton;
Timer1: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure FormCreate(Sender: TObject);
procedure btsimpanClick(Sender: TObject);
procedure btbatalClick(Sender: TObject);
procedure btcariClick(Sender: TObject);
procedure bteditClick(Sender: TObject);
procedure bthapusClick(Sender: TObject);
procedure btexitClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
fpemeriksaan: Tfpemeriksaan;

implementation

{$R *.dfm}

procedure Tfpemeriksaan.FormCreate(Sender: TObject);
begin
edno_pasien.Text:='';
ednama.Text:='';
edobat.Text:='';
eddokter.Text:='';
edbiaya_periksa.Text:='';
end;

procedure Tfpemeriksaan.btsimpanClick(Sender: TObject);
begin
Tbperiksa.Append;
Tbperiksa['No_pasien']:=edno_pasien.Text;
Tbperiksa['Nama_pasien']:=ednama.Text;
Tbperiksa['Nama_dokter']:=eddokter.Text;
Tbperiksa['Tgl_periksa']:=edtgl_periksa.Text;
Tbperiksa['Obat']:=edobat.Text;
Tbperiksa['Biaya_periksa']:=edbiaya_periksa.Text;
Tbperiksa.Post;
Tbperiksa.ApplyUpdates;
Tbperiksa.Active:=false;
Tbperiksa.Active:=true;
ShowMessage('Data Telah Tersimpan');
FormCreate(sender);
edno_pasien.SetFocus;
end;

procedure Tfpemeriksaan.btbatalClick(Sender: TObject);
begin
FormCreate(sender);
edno_pasien.SetFocus;
end;

procedure Tfpemeriksaan.btcariClick(Sender: TObject);
begin
if Tbperiksa.Locate('No_pasien',edno_pasien.Text,[LocaseInsensitive]) then
begin
edno_pasien.Text:=Tbperiksa['No_pasien'];
ednama.Text:=Tbperiksa['Nama_pasien'];
eddokter.Text:=Tbperiksa['Nama_dokter'];
//edtgl_periksa.Text:=Tbperiksa['Tgl_periksa'];
edobat.Text:=Tbperiksa['Obat'];
edbiaya_periksa.Text:=Tbperiksa['Biaya_periksa'];
end
else
ShowMessage('Data Tidak Ditemukan');
end;

procedure Tfpemeriksaan.bteditClick(Sender: TObject);
begin
Tbperiksa.Edit;
Tbperiksa['No_pasien']:=edno_pasien.Text;
Tbperiksa['Nama_pasien']:=ednama.Text;
Tbperiksa['Nama_dokter']:=eddokter.Text;
//Tbperiksa['Tgl_periksa']:=edtgl_periksa.Text;
Tbperiksa['Obat']:=edobat.Text;
Tbperiksa['Biaya_periksa']:=edbiaya_periksa.Text;
Tbperiksa.Post;
Tbperiksa.ApplyUpdates;
Tbperiksa.Active:=false;
Tbperiksa.Active:=true;
ShowMessage('Data Telah Diubah');
FormCreate(sender);
edno_pasien.SetFocus;
end;

delphi nim calculating

Created with Delphi 7 by Avid/Kira
Nim calculating

Sintak:
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;
Edit1: TEdit;
Edit2: TEdit;
na: TEdit;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
nh: TLabel;
IP: TLabel;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
angka:integer;
bobot:integer;
begin
angka:=strtoint(na.text);
if((angka<=100)and(angka>=85))then
begin
bobot:=4;
nh.caption:='A';
end else
if((angka<=84)and(angka>=70))then
begin
bobot:=3;
nh.caption:='B';
end else
if((angka<=69)and(angka>=55))then
begin
bobot:=2;
nh.caption:='C';
end else
if((angka<=54)and(angka>=40))then
begin
bobot:=1;
nh.caption:='D';
end else
begin
bobot:=0;
nh.caption:='E';
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var bobot:integer;
begin
IP.Caption:=floattostr(strtoint(edit4.text)*bobot);
end;

end.

delphi Simple minimarket accounting

Created with Delphi 7 by Avid/Kira
Simple minimarket accounting

Sintak:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Anggota: TCheckBox;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Button1: TButton;
Edit2: TEdit;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
jnsbrg: TComboBox;
hrgbrg: TEdit;
jmlbeli: TEdit;
Diskon: TLabel;
Bayar: TLabel;
Button2: TButton;
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 tambah, potongan : real;
begin
if anggota.Checked then
tambah:=0.05
else
tambah:=0;

case jnsbrg.ItemIndex of
0 : potongan:=0.05;
1 : potongan:=0.1;
2 : potongan:=0.15;
end;

diskon.Caption:=floattostr((strtofloat(hrgbrg.Text)*
strtofloat(jmlbeli.Text)*potongan)+
(tambah*strtofloat(hrgbrg.Text)*strtofloat(jmlbeli.Text)));
bayar.Caption:=floattostr((strtofloat(hrgbrg.Text)*
StrTofloat(jmlbeli.Text))-
strtofloat(diskon.Caption));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Application.Terminate;
end;

end.

delphi memo


Created with Delphi 7 by Avid/Kira
memo


Sintak:
unit Unit11;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    RadioGroup1: TRadioGroup;
    Memo1: TMemo;
    Label2: TLabel;
    ComboBox1: TComboBox;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure RadioGroup1Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 memo1.lines.add(edit1.text);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 application.Terminate;
end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
 if (radiogroup1.ItemIndex=0) then
      form1.Color:=clnavy;
   if (radiogroup1.ItemIndex=1) then
      form1.Color:=clmoneygreen;
   if (radiogroup1.ItemIndex=2) then
      form1.Color:=clred;
   if (radiogroup1.ItemIndex=3) then
      form1.Color:=clgreen;
   if (radiogroup1.itemindex=4) then
      form1.Color:=clyellow;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
 case combobox1.ItemIndex of
      0 : form1.Font.Color:=clwhite;
      1 : form1.Font.Color:=clblue;
      2 : form1.Font.Color:=clblack;
      3 : form1.Font.Color:=clyellow;
      4 : form1.Font.Color:=clred;
   end;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
 if CheckBox1.Checked then
      if CheckBox2.Checked then
         form1.Font.Style:=[fsitalic,fsbold]
      else
         form1.Font.Style:=[fsitalic]
   else
      if CheckBox2.Checked then
         form1.Font.Style:=[fsbold]
      else
         form1.Font.Style:=[];
end;

end.

delphi calculator

Created with Delphi 7 by Avid/Kira
calculator

Sintak:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Label3: TLabel;
hasil: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
hasil.Caption:=inttostr(strtoint(edit1.text)+strtoint(edit2.Text));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
hasil.Caption:=inttostr(strtoint(edit1.text)*strtoint(edit2.Text));
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
hasil.Caption:=floattostr(strtoint(edit1.text)/strtoint(edit2.Text));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
hasil.Caption:=inttostr(strtoint(edit1.text)-strtoint(edit2.Text));
end;

end.

delphi Animasi 3 ball move


Created with Delphi 7 by Avid/Kira
Animasi 3 ball move


Sintak:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    procedure Timer1Timer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  atas, bawah, kiri, kanan, at, bu, kr, kn, a, b, k, r:integer;
implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
{shape1}
if (atas=1) then
shape1.top:=shape1.Top-1;
if (bawah=1) then
shape1.Top:=shape1.Top+1;
if (kanan=1) then
shape1.left:=shape1.Left+1;
if (kiri=1) then
shape1.Left:=shape1.Left-1;
if (shape1.left>390) then
begin
kiri:=1;
kanan:=0;
end;
if (shape1.left<=0) then
begin
kanan:=1;
kiri:=0;
end;
if (shape1.top<=0) then
begin
atas:=0;
bawah:=1;
end;
if (shape1.top>370) then
begin
atas:=1;
bawah:=0;
end;
{shape2}
if (at=1) then
shape2.Top:=shape2.Top-1;
if (bu=1) then
shape2.Top:=shape2.Top+1;
if (kn=1) then
shape2.Left:=shape2.Left+1;
if (kr=1) then
shape2.Left:=shape2.Left-1;
if (shape2.left>390) then
begin
kr:=1;
kn:=0;
end;
if (shape2.left<=0) then
begin
kn:=1;
kr:=0;
end;
if (shape2.top<=0) then
begin
at:=0;
bu:=1;
end;
if (shape2.top>370) then
begin
at:=1;
bu:=0;
end;
{shape3}
if (a=1) then
shape3.Top:=shape3.Top-1;
if (b=1) then
shape3.Top:=shape3.Top+1;
if (k=1) then
shape3.Left:=shape3.Left+1;
if (r=1) then
shape3.Left:=shape3.Left-1;
if (shape3.left>390) then
begin
r:=1;
k:=0;
end;
if (shape3.left<=0) then
begin
k:=1;
r:=0;
end;
if (shape3.top<=0) then
begin
a:=0;
b:=1;
end;
if (shape3.top>370) then
begin
a:=1;
b:=0;
end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
application.Terminate;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
timer1.Enabled:=true;
{shape1}
kanan:=1;bawah:=1;
{shape2}
kr:=1;at:=1;
{shape3}
k:=1;a:=1;
end;

end.

delphi Animasi 2 ball move


Created with Delphi 7 by Avid/Kira
Animasi 2 ball move


Sintak:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Shape1: TShape;
    Shape2: TShape;
    Button1: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  atas, bawah, kiri, kanan, at, bu, kr, kn:integer;
implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
{shape1}
if (atas=1) then
shape1.top:=shape1.Top-1;
if (bawah=1) then
shape1.Top:=shape1.Top+1;
if (kanan=1) then
shape1.left:=shape1.Left+1;
if (kiri=1) then
shape1.Left:=shape1.Left-1;
if (shape1.left>390) then
begin
kiri:=1;
kanan:=0;
end;
if (shape1.left<=0) then
begin
kanan:=1;
kiri:=0;
end;
if (shape1.top<=0) then
begin
atas:=0;
bawah:=1;
end;
if (shape1.top>370) then
begin
atas:=1;
bawah:=0;
end;
{shape2}
if (at=1) then
shape2.Top:=shape2.Top-1;
if (bu=1) then
shape2.Top:=shape2.Top+1;
if (kn=1) then
shape2.Left:=shape2.Left+1;
if (kr=1) then
shape2.Left:=shape2.Left-1;
if (shape2.left>390) then
begin
kr:=1;
kn:=0;
end;
if (shape2.left<=0) then
begin
kn:=1;
kr:=0;
end;
if (shape2.top<=0) then
begin
at:=0;
bu:=1;
end;
if (shape2.top>370) then
begin
at:=1;
bu:=0;
end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
application.Terminate;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
timer1.Enabled:=true;
{shape1}
kanan:=1;bawah:=1;
{shape2}
kr:=1;at:=1;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
application.terminate;
end;

end.

delphi Animasi ball move and stop

Created with Delphi 7 by Avid/Kira
Animasi ball move and stop

Sintak:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Shape1: TShape;
Timer1: TTimer;
Button1: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (shape1.Top<=300) and (shape1.Left< (Form1.Width - shape1.Width)) then
begin
shape1.Top:=shape1.Top+5;
shape1.Left:=shape1.left+5;
timer1.Enabled:=true;
end
else
timer1.Enabled:=false;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
application.Terminate;
end;

end.