Solved

basic clock in and out application

Posted on 2004-04-12
7
141 Views
Last Modified: 2010-04-05
hi
i would like to build a simple clock in clock out application with users that will help me keep
track of them and stored in access database.

 i can show couple of images of how that would look like

but basically

a form where you could type in your user name and will be checked with the access database

then a small form appears with 2 butons

Clock In Clock Out

and that save in the database the clock in time date and the user

and if clock out that would shift end   time and data and user would be saved into the database

thank you

if you guys want to see the images post your e-mail and i will send it to you

just to get a better look at what i am asking for

thank you
0
Comment
Question by:emailworks
  • 2
7 Comments
 
LVL 17

Expert Comment

by:mokule
Comment Utility
Hi
In my member profile You've got my e-mail. Send me Your images.
0
 
LVL 17

Accepted Solution

by:
mokule earned 190 total points
Comment Utility
Hi
I've got images.
Not look at them yet
This is quick example, on one Form.

unit Main;

interface

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

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    laTime: TLabel;
    Timer1: TTimer;
    btnClockIn: TButton;
    btnClockOut: TButton;
    edUser: TEdit;
    edPswd: TEdit;
    btnLogin: TButton;
    Label2: TLabel;
    Label3: TLabel;
    btnCancel: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure btnClockInClick(Sender: TObject);
    procedure btnClockOutClick(Sender: TObject);
    procedure btnLoginClick(Sender: TObject);
    procedure edUserChange(Sender: TObject);
    procedure btnCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var
  str: string;
begin
  str := TimeToStr(Now);
  if str <> laTime.Caption then
    laTime.Caption := str;
end;

procedure TForm1.btnClockInClick(Sender: TObject);
begin
// Your ClockIn procedure
//  ClockIn(edUser.Text,laTime.Caption);
  Panel3.Enabled := False;
  Panel3.Visible := False;
  edUser.Text := '';
  edPswd.Text := '';
end;

procedure TForm1.btnClockOutClick(Sender: TObject);
begin
//  ClockOut(edUser.Text,laTime.Caption);
  Panel3.Enabled := False;
  Panel3.Visible := False;
  edUser.Text := '';
  edPswd.Text := '';
end;

procedure TForm1.btnLoginClick(Sender: TObject);
begin
  if (Length(edUser.Text) > 0) and (Length(edPswd.Text) > 0) then
    begin
//    if VerifyUser then  // Your user verification
      begin
      Panel3.Enabled := True;
      Panel3.Visible := True;
      end;
    end;
end;

procedure TForm1.edUserChange(Sender: TObject);
begin
  if (Length(edUser.Text) > 0) and (Length(edPswd.Text) > 0) then
    btnLogin.Enabled := True
  else
    btnLogin.Enabled := False
end;

procedure TForm1.btnCancelClick(Sender: TObject);
begin
  Panel3.Enabled := False;
  Panel3.Visible := False;
end;

end.


{dfm}

object Form1: TForm1
  Left = 217
  Top = 115
  BorderIcons = [biSystemMenu, biMinimize]
  BorderStyle = bsDialog
  Caption = 'Simple Clock In Out'
  ClientHeight = 268
  ClientWidth = 307
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 8
    Top = 8
    Width = 289
    Height = 73
    TabOrder = 0
    object laTime: TLabel
      Left = 32
      Top = 8
      Width = 225
      Height = 48
      Alignment = taCenter
      AutoSize = False
      Caption = 'laTime'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -48
      Font.Name = 'Arial'
      Font.Style = []
      ParentFont = False
    end
  end
  object Panel2: TPanel
    Left = 8
    Top = 96
    Width = 289
    Height = 89
    TabOrder = 1
    object Label2: TLabel
      Left = 16
      Top = 8
      Width = 22
      Height = 13
      Caption = 'User'
    end
    object Label3: TLabel
      Left = 160
      Top = 8
      Width = 46
      Height = 13
      Caption = 'Password'
    end
    object edUser: TEdit
      Left = 16
      Top = 24
      Width = 113
      Height = 21
      TabOrder = 0
      OnChange = edUserChange
    end
    object edPswd: TEdit
      Left = 160
      Top = 24
      Width = 113
      Height = 21
      PasswordChar = '*'
      TabOrder = 1
      OnChange = edUserChange
    end
    object btnLogin: TButton
      Left = 107
      Top = 56
      Width = 75
      Height = 25
      Caption = 'Login'
      Enabled = False
      TabOrder = 2
      OnClick = btnLoginClick
    end
  end
  object Panel3: TPanel
    Left = 8
    Top = 200
    Width = 289
    Height = 57
    Enabled = False
    TabOrder = 2
    Visible = False
    object btnClockIn: TButton
      Left = 8
      Top = 16
      Width = 75
      Height = 25
      Caption = 'Clock In'
      TabOrder = 0
      OnClick = btnClockInClick
    end
    object btnClockOut: TButton
      Left = 104
      Top = 16
      Width = 75
      Height = 25
      Caption = 'Clock Out'
      TabOrder = 1
      OnClick = btnClockOutClick
    end
    object btnCancel: TButton
      Left = 200
      Top = 16
      Width = 75
      Height = 25
      Caption = 'Cancel'
      TabOrder = 2
      OnClick = btnCancelClick
    end
  end
  object Timer1: TTimer
    Interval = 200
    OnTimer = Timer1Timer
    Left = 216
    Top = 40
  end
end
0
 

Expert Comment

by:efryer
Comment Utility
Emailworks,

I have just finished an application in delphi that does almost exactly what you are after

Features :
Access database backend (ADO) - Access chosen so that administrator can do their own specialised reports
Drop down user login (makes it easier for user to get name right)
Login with password (makes sure that another user cannot clock another in/out)
Main page just has users name displayed with Current time and Date, daily log of login or logout, two buttons for time on and time off
Admin section - Add/remove users, change users passwords, run a time report between two dates etc

Flow of the application for the user is

1) Login
2) clockin or clockout (button is greyed out dependent on their last action)
3) Close application

Is that the sort of thing you were after???

Regards

Bob
0
 

Author Comment

by:emailworks
Comment Utility
yeah
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now