unit zdk_2;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    ed_tgl: TEdit;
    BitBtn1: TBitBtn;
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Image6: TImage;
    Image7: TImage;
    Image8: TImage;
    Image9: TImage;
    Image10: TImage;
    Image11: TImage;
    Image12: TImage;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
var
  tgl : TDate;
  thn : string;
begin
   DateSeparator :='-';
   ShortDateFormat := 'dd/MM/yyyy';

   Image1.Visible := False;  Image2.Visible := False;   Image3.Visible := False;
   Image4.Visible := False;  Image5.Visible := False;   Image6.Visible := False;
   Image7.Visible := False;  Image8.Visible := False;   Image9.Visible := False;
   Image10.Visible := False; Image11.Visible := False;  Image12.Visible := False;

   tgl := StrToDate(ed_tgl.Text);
   thn := IntToStr(YearOf(Tgl));

   If (tgl >= StrToDate('21-01-'+thn)) and
      (tgl <= StrToDate('19-02-'+thn)) then begin
     Image1.Visible := True;
   end
   else

   If (tgl >= StrToDate('20-02-'+thn)) and
      (tgl <= StrToDate('20-03-'+thn)) then begin
     Image2.Visible := True;
   end
   else

   If (tgl >= StrToDate('21-03-'+thn)) and
      (tgl <= StrToDate('19-04-'+thn)) then begin
     Image3.Visible := True;
   end
   else

   If (tgl >= StrToDate('20-04-'+thn)) and
      (tgl <= StrToDate('20-05-'+thn)) then begin
     Image4.Visible := True;
   end
   else


   If (tgl >= StrToDate('21-05-'+thn)) and
      (tgl <= StrToDate('21-06-'+thn)) then begin
     Image5.Visible := True;
   end
   else

   If (tgl >= StrToDate('22-06-'+thn)) and
      (tgl <= StrToDate('22-07-'+thn)) then begin
     Image6.Visible := True;
   end
   else

   If (tgl >= StrToDate('23-07-'+thn)) and
      (tgl <= StrToDate('23-08-'+thn)) then begin
     Image7.Visible := True;
   end
   else
   If (tgl >= StrToDate('24-08-'+thn)) and
      (tgl <= StrToDate('22-09-'+thn)) then begin
     Image8.Visible := True;
   end
   else
   If (tgl >= StrToDate('23-09-'+thn)) and
      (tgl <= StrToDate('23-10-'+thn)) then begin
     Image9.Visible := True;
   end
   else

   If (tgl >= StrToDate('24-10-'+thn)) and
      (tgl <= StrToDate('22-11-'+thn)) then begin
     Image10.Visible := True;
   end
   else

   If (tgl >= StrToDate('23-11-'+thn)) and
      (tgl <= StrToDate('21-12-'+thn)) then begin
     Image11.Visible := True;
   end
   else

   If (tgl >= StrToDate('22-12-'+thn)) and
      (tgl <= StrToDate('20-01-'+thn)) then begin
     Image12.Visible := True;
   end;

end;

end.
