Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

basic clock in and out application

Posted on 2004-04-12
7
Medium Priority
?
160 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
ID: 10807011
Hi
In my member profile You've got my e-mail. Send me Your images.
0
 
LVL 17

Accepted Solution

by:
mokule earned 760 total points
ID: 10807281
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
ID: 10819377
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
ID: 10819811
yeah
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

926 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