Call Center Manegment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 92

GOVT.

GIRLS COLLEGE,
KATNI

PROJECT REPORT ON
CALL CENTER MANAGEMENT SYSTEM
FOR THE PARTIAL FULFILLMENT OF

B.COM (COM.APP.)

UNDER THE GUIDANCE OF

DEEP NARAYAN PATEL


SUBMITTED BY
DEEPTI GOUTAM
ROOKSANA BEGUM
ARCHANA SHARMA
SESSION YEAR
JULY 2012-JUNE 2015

GOVT. GIRLS COLLEGE,


KATNI

CERTIFICATE
This is certify that Project Report on
CALL CENTER MANAGEMENT SYSTEM
DEEP NARAYAN PATEL
Submitted by
DEEPTI GOUTAM
ROOKSANA BEGUM
ARCHANA SHARMA
Has completed her Major Project work for
during the academic
Has completed her Major Project work for
during the academic
(Internal Examiner)
(External Examiner)

GOVT. GIRLS COLLEGE, KATNI

CERTIFICATE
This is certify that Project Report on
CALL CENTER MANAGEMENT SYSTEM
DEEP NARAYAN PATEL
Submitted by
DEEPTI GOUTAM
ROOKSANA BEGUM
ARCHANA SHARMA
Has completed her Major Project work
for during the academic year 2014-15 in
the partial fulfillment of the award of
B.COM.VI Semester
(Project Guide)

(H.O.D.)

GOVT. GIRLS COLLEGE, KATNI

ACKNOWLEDGEMENT
CERTIFICATE

We wish
to acknowledgement with deep
gratitude the valuable assistance
received by us from our guide
Mr.DEEP NARAYAN PATEL Who guided
and
encouraged us throughout
the development of this project.
We
also acknowledge our gratitude to

Mrs.

DR.

KIRAN

KHARADI

(H.O.D.). Who helped us in the


satisfactory completion of this
project Finally we specially thank
our parents and the near dear
once who are another of our lives
for
their
support
and
understanding.
DEEPTI

GOUTAM

ROOKSANA BEGUM
ARCHANA SHARMA

ACKNOWLEDGE
MENT CERTIFICATE
Self Certificate
This is to certify that the
dissertation / project report entitled CALL CENTER
MANAGEMENT SYSTEM is done by me is
authentic work carried out for the partial fulfillment
of the requirements for the award of the degree
B.Com. (Computer Application) in computer Science
under the guidance of Mr. DEEP NARAYAN
PATEL .The matter embodied in this project work
has not been submitted earlier for award of any degree
or diploma to the best of my knowledge and belief.

GOUTAM
BEGUM

Signature of the student


DEEPTI
ROOKSANA
ARCHANA SHAR MA

Roll No,
GOVT. GIRLS COLLEGE KATNI

DELARATION
I herby declare that this CALL
CENTER MANAGEMENT SYSTEM has been
developed by me adhering to the conditions laid down
by the Govt.Girls College, Katni under the guidance
of Mr. DEEP NARAYAN PATEL

GOUTAM
BEGUM

DEEPTI
ROOKSANA
ARCHANA SHAR MA

PREFACE
The evolution of electronics computers began in 1940s.
With the coming of the multiprogramming operating systems
in the early 1960s; the usability and efficiency of the
computing machines took a big leap, prices of hardware also
decreased, and awareness of computers increased
substantially since their early days. With the availability of
cheaper and more powerful machines, higher level languages,
and more user friendly operating systems, the applications of
computers grew rapidly
The use of computers is growing very rapidly. Now
computer system are used in such areas as business
applications, scientific work, video games, air-traffic control,
missile control, hospital management, airline reservations and
medical diagnostic equipment, There is probably no discipline
that does not use computer system now even artists, linguists,
and filmmakers use it. With this increased use of computers,
the need for software is increasing dramatically. Furthermore,
the complexity of these systems is also increasing imagine the
complexity of the software for aircraft control or telephone
network-monitoring systems. Actually, the complexity of
applications and the software systems has grown much faster
than our ability to deal with it

INTRODUCTION
Computer is an electronic device, which is used to
compute various big calculations. It is basically a device,
which is used to input data, processes the data and gives the
output as required.
These days computer has become one of the basic
importance of a common man. Each and every thing is getting
computerized, because making use of computer has facilitated
to perform the task quickly and easily, it has also helped to
eliminate certain problems like:1. Efficiency to perform the work has increased to a very great
extent.
2. Results are accurate and reliable as it has a quality of
accuracy. The mistake occurs only on part of the user.
3. Manual work is reduced to a very large extent.
4. Large calculation is possible.
5. Large datas as well as files could be stored in computers.
6. As computers are versatile same computer could be used for
various applications.
7. There in a single PC we can record datas of various fields.
.
Due the above mentioned qualities computers
these days are used in fields like companies, railways,
airways, transportations, share markets and even at home.
Users specific software development is a mode of present
generation computer scientist I have developed project entitled CALL
CENTER MANAGEMENT SYSTEM to manage the information
related to human resources Records of office works. I use MS-Visual basic
as front-end tool and MS-Access as a backend tool. In this project we have
tried to reduce the manual work and improve efficiency. Through this
project we try to reduce the clerical work and provide fast working,
because computer is much faster and correct than human.

NEED AND SCOPE OF THE PROJECT


In the typical manual system records are stored in the files. The
data stores in the files may have some redundancy, inconsistency
and isolation. Diffrent user cannot share data stored in a file. There
is some chance of calculation mistake in manual system.

NEEDS FOR MACHINE BASED SYSTEM:Traditional methods for exploring the volume of
informations are inadequate. One is bulk about
growth rate of information.
Difficult to update the information due to
voluminous increase and rise in the degree of
specialization involved.
Techniques are suggested for applying the
computer in due its advantages of speed, vast
storage capacity and accuracy.
The need for co-operation and resources sharing
and the hope of achieving some saving through
our system.
ADVANTAGES
OF
COMPUTER
BASED
SYSTEM:It offers flexibility.
It speedup the processing and workflow.
Makes
for
greater
accuracy,
efficiency,
consistence and improved work control.
Reduces repetitive clerical work.
Permits erase control, checking and updating.
Permits to improved budget control.

FEATURES OF PROPOSED SYSTEM


In CALL CENTER MANAGEMENT SYSTEMI
am trying to maintain information of to human resources of an
office.
The main feature of the software is:
It is menu driven software in which user can select
option of simple mouse click.
It is based on Graphical User Interface.
It is user friendly software.
It provides password security to prevent unauthorized
access and maintain the integrity and security of
important data/information.
It increases the overall performance of office and helps in
to build better relationship with customer by providing
necessary information.
It reduces the paper work & increases the output.
It reduces the response time & increases the productivity.
It provides various validation checks at the time of
saving data, which maintain the integrity of data stored in
table.
It provides impressive hard copies of various documents.

PROJECT OUTLINE
I develop project entitled a CALL CENTER
MANAGEMENT SYSTEM to maintain information of
human resources.
Presently all the information is maintained manually.
There are following drawbacks of this approach:
1. It is difficult to handle large volume of information.
2. It is difficult to provide up-to-date information,
3. There is a chance of calculation mistake in Bill.
4. It requires more manpower.
5. It is difficult to analyzing data manually.
To overcome these difficulties I develop CCMS as software
and provided the following facilities:
1. In CCMS system I provide options to keep track
information of various classes of entry, new employee,
Members details & pay slip record etc.
2. In CCMS system I provide information about employee
year records details etc.

HARDWARE SPECIFICATION

Physical units of computer system constitute the


computer hardware. When we look at computer system, we
are actually looking at the hardware. The computer is made by
number of sensitive components such as flip-flops, gate,
buses, memory elements etc.
The minimum requirement to run a computer are CPU,
monitor, keyboard, CD drives, Operating system etc. out of all
the requirements except operating system, all are considered
the hardware. The CPU is the heart of the computer. This is
made up of very sensitive components & very complicated
circuitry. Thus the hardware itself is composed of hardware.
COMPUTER SYSTEM
above
PRIMARY STORAGE
:
SECONDARY STORAGE :
Disk
DRIVES
:
INPUT DEVICE
:
OUTPUT DEVICE
:

PC/ AT 486 &


64 MB RAM
20 GB Hard

CD Drives
Keyboard, Mouse
Printer, VDU

Software specification

CALL CENTER MANAGEMENT SYSTEMis being


made using MS-Visual Basic 6.0 as a Front End tool and MS
ACCESS as a back End Tool. The design specification include
the following
1.I have designed data entry screen using Visual
Basic forms.
2.I have included authorization check to ensure
accuracy and reliability of data.
3.I have maintained data tables in MS-ACCESS.
4.I have provided online inquiry and printed report
as per requirement.
SOFTWARE SPECIFICATION is:
FRONT END
MS-VISUAL BASIC 6.0
BACK END
MS-ACCESS
OPERATING SYSTEM
WINDOWS XP

DEVELOPMENT TOOLS SPECIFICATION


WHY VISUAL BASIC

Visual Basic is one of the most popular in the market


today. It is designed to deploy application enterprise and to
scale to nearly any size needed. The ability to develop object
models, database integration, server components and Internet /
Intranet applications provide an extensive range of
capabilities and tools for the developers.
There is Visual basic 6.0 Visual Basic for
applications (VBA), and Visual Basic Script (VB Script),
which can be differentiated by complexity and richness of the
Visual Basic language and development environment.
ADVANTAGES OF VISUAL BASIC:The Visual Basic development is quite user
friendly and aids quick Application
Development.
It provides support for Menu Bars and Screen
Generators, which improve the graphical user
interface of the applications developed in it.
It also provides god error debugging facility
resulting in bug free application
Visual basic provides a report writer facility to
produce quick dynamic reports
It also improves additional controls like check
Boxes

ACCESS TERMINOLOGIES
Access is an object- oriented database management
system, which means the entire database is composed of the
objects with certain characteristic are attributes called properties

that Determine their structure appears and behavior. The major


database objects are tables, queries, forms, report, macros and
modules.
Tables: The tables are the containers for all the data in our
database.
Query: Query is a question you ask to your database. We usually
use a query to extract a specified set of record form one or more
tables.
Forms: Forms are more convenient than a tabular datasheet for
entering and Editing table data especially if a table includes more
data than can fit across the screen and you have to scroll right to
see the rest . a form can display single record At a time .
Report: When you want to print the data, you usually create
report. The repot can be quick and easy dump of the table data.
Pages: the data access page object it is special document
containing data from an access Database designed to be viewed on
the website.
Modules: module is programs written in visual basics, the
programming language used by access 2000.

PROGRAM DEVELOPMENT STRATEGY


Today in the 21th century, one cannot deny the manifold
of a computer. Computer as well all known is a device that
processes pure data gives it instruction in the form of word.
The set of instructions given to a computer is instruction is
termed as software.Software development is divided into

various stages being related cohesively so that inefficiency in


any one stage may result in the total failure in the condition of
the program.
Various stages are as follow:PROBLEM DEFINITION
It is the statement of the problem (task), which is to be
accomplished with the help of computer. It generally starts
when programmer is assigned the task. It includes many
factors such as I/O, time constraints, processing requirements,
accuracy, limitations, memory error handling and interface
with other program.
The Problem in my projects consists of various
validations of date, application number, and registration
number etc of cases.
ANALYSIS
Requirement analysis is done in order to understand the
problem the software system is to solve. The problem could be
automating an existing manual process, developing a new
automated system, or a combination of the two. For large
system that have many features, and that need to perform
meant different task, understanding the requirements of the
system is the major task. The emphasis in requirements
analysis is on identifying what is needed from the system, not
how the system will achieve its goals. The developer has
to develop the system to satisfy the clients need.
Once the problem is analyzed and the essential
understood, the requirements must be specified in the
requirements specification language has to be selected. All the
factors that may affect the design and the proper functioning
of the system should be specified in the requirement
documents. A preliminary user manual that describes the
entire major user interfaces frequently forms a part of the
requirements documents
.
DESIGN
The purpose of the design phase is to plan a solution of
the problem specified by the requirement documents. This
Phase is the first step in moving from the problem domain to

the solutions domain. Starting with what is needed; design


takes us toward how to satisfy the needs. The design affects
the quality of the software; it has major impact on the later
phases, particularly testing and maintenance. The output of this
phase is the design document. This document is similar to a
blue print or a plan for the solution and is used later during
implementation, testing and mainten
CODING
Once the design is complete, most of the major decisions
about the systems have been made. The goal of the coding
phase is to translate the design of the system into code in a
given programming language. For a given design, the aim in
this phase is to implement the design in the best possible
manner
The coding phase affects both testing and maintence
effort. Hence, during coding the focus should be on focus
should be on developing programs that are easy to write.
Simplicity and clarity should be striving for during the coding
phase
TESTING
Testing is the major quality control measure used during
software development. Its basic function is to detect errors in the
software. Testing not only has to uncover errors introduced during
coding, but also erros introduced during the previous phase. Thus, the
goal of testing is to uncover requirements , design and coding errors in
the programs.

DEBUGGING
This stage is the discovery and correction of programming errors
so that it is Ingrid that the program does what the programmer intends to
do and produces the correct result for a set of test data.
The tools that can be used to debug programs:1.Simulators
2.Logic Analyzer

3.Break Point
4.Trace routine
5.Memory Dumps
6.Software interrupts
MAINTENANCE
This stage is the updating and correcting of the
program to account for changing conditions of fields
experience proper testing and documentation should
significantly reduce the frequency and extend of the
required maintenance. The original program may
need change for following reason:1.Newly discovered bugs
2.Specification changes
3.Specification expansion
4.New equipment

PROBLEM FACED
I did a lot of problems while making this project
during these six months. Firstly, I got the problem in getting
certificates and collecting the data for my project. Since I am still
amateur in the field of software Development, I did face a lot of

problems in coding. But all these problems were removed with the
efficient help of our faculty members and friends.
I have also the problem in understanding the terminology used in
CALL CENTER MANAGEMENT SYSTEMI also have
the problem regarding the collection of data, which are necessary
to build our project.
In design phase of system I face lot problems to implement the
logic of software, deciding table structure and applying integrity
constraints.
Report generated by the system as and when needed increase the
flexibility & speed of system.

HOW TO USE PROJECT


I have tried my level best to make this project easy, simple &
descriptive to use. In addition, it has all valid & important as
well . This project is non-computer user, favors graphical user
interface, event driven & is user friendly. For convenience, I have
used various control. Controls such as
1.COMMAND BUTTONS
Which provides the direct access of any activity? Various
command buttons used in this project are-

ADD Use to save records permanently.


UPDATE-use to edit records & save.
SEARCH-use to search any particular record from our database.
1.LABELS & TEXT BOXES
L Able boxes are used to define titles & heading. In front
of each label box a text box is pasted to enter values that are
stored in our database when add command button is activated.
ALL the clearly defend so that non0 computer users can also
handle this project efficiently.
2.DTPICKER
Ticker is a control that provides automatic access of Data & Time
including a library we can use this control, Microsoft windows
common controls-2.6(SP)
3.LISTVIEW
This is another control, which provides convenience
in viewing data in listed form, which is easy to
access. This control can be used by including a
library. Microsoft Windows common controls 6.0(sp3)
4.OPTION BUTTONS
Option buttons provides the facility to select any
one correct option out of various options provided
to the user. This selected option is then stored in
the database.
6. TIMER
Timer is used to set definite time, to view our project attractive.
7. FRAME
Frames are used to put selective controls within a frame. It makes
our form looks attractive & makes easily usable.

SECURITY OF THE SYSTEM


Computer security includes the policies, procedures,
tools and techniques designed to protect companys computer
assets from accidental, intentional or natural disasters including
accidental input or output errors, theft, break-ins, physical damage
and illegal access or manipulation.Computer security is a complex
and pervasive problem that often stumps many organizations,
which struggle to balance proper security against the cost and
inconvenience of providing it. It cannot be achieved through
automation or sophisticated equipment alone; it also required the
active participation of employees with common sense, goods
judgment, and high moral values, because security is ultimately
responsibility of the individual using the computer. Therefore, it is

not surprising that organizations has that promote creativity,


innovation, trust and high ethical standards appear to be more
successful in enforcing computer security that organization with
stifling cultures.
The different types of computer breaches are:1. Accidental Errors.
2. Intentional errors.
3. Cracking Passwords.
4. Breaking into computer hardware.
5. Software Viruses.
6. Natural Disasters.
The major security steps that are used to control these computer
beaches are as follows:-

PHYSICAL SECURITY
Physical security includes protection fronm fire, flood and other
physical damage. To avoid fire smoking is prohibited in computer
room. The must be an arrangement air-conditioner in computer
room to maintain the temperature between 20-30 degree Celsius.
Keep dust and magnetic components away from computer room.
OPERATING SYSTEM LEVEL SECURITY
Operating system must be capable to protect against deliberate
or accidental damage from a defined threat. Operating System
Level Security includes password protection to prevent
unauthorized access to the system
Setup. There must be an anti-virus program must be installed on
our system to detection of virus and repaired it.
DATABASE SECURITY
Database security is the protection of data from loss,
disclosure, modification and destruction. It must insure the
integrity and reliability of database. I have used Oracle as a back

end tool, which prevent unauthorized access of database through


password security features. To access a database user must know
the user name and password. I have also used oracle integrity
constraints to avoid inconsistency in database.
APPLICATION SECURITY
In my application I have included password security to avoid
unauthorized access of the software. I have also included
various data validation checks in my software to ensure the
integrity of data stores in the table.

VALIDATIONS
To debug the errors following options are included in software To avoid the storage to null values in table, all the text box,
combo values were tested first and if they contain null values
error message is generated and avoid inserting such data in table.
To avoid invalid date/month error, we used Dicker tools at the
time of date entry.
To avoid error insert value is too large we set
MAXLENGTH property of text boxes.
To avoid data type mismatch error we first the type of values type in
text box before display it. In case of numeric values text box are
allowed to accept number only.
Coding done in KEYPRESS event of text box which ensure
that the correct data type value entered in text box.
To avoid not enough value error we match the exact number and
type of values with their respective table structure.
If avoid EOF/BOF encounter error I first check weather item is
selected in combo box or not. In cast of not selection of item we

display appropriate error message and avoid searching data based


on combo box value.
I try to type correct table name to avoid error like table not exits.
To avoid width error in data report I keep the font of small size in
large report and also reduce left and right margin of reports.
There is only one-way i.e.-through menu to open any specific
form of the project.
When we perform any specific operation on data through any
command button, the other command buttons that are not suitable
for that operation should be disabled.

System Analysis & Designing


For developing a system it is needed to analyze and create the outline
in order to make the live project. System development has two
components: 1) System analysis System analysis refers to examine
business situation with the intent of improving the system
through better method and procedures.
2) System designing- System designing is the process of
sketching the outline according to the analysis with the help
of different system development tools for example Flowchart,
ER-diagram, Data dictionary.
SDLC (System Development life cycle): - System development life
cycle is a sequence of events carried by the analyst and users to
develop and implement an information system. These activities are
carried out in different stages.
Feasibility Study
Determination of system requirement
Designing of the system
System testing
System implementation

System maintenance
Feasibility Study
The data collection that occurs during
the Initial
Investigation examines system feasibility. There are three tests of
feasibility namely technical, operational and economic.
1. TECHNICAL FEASIBILITY: It involves determining
whether or not a system can actually be constructed to solve
the problem at hand.
Technically the system is feasible due to the following:
The necessary technology exits that is needed for the
system.
The system has technical capacity to hold the required
data. If the system is developed, it can be further
expanded
There is data security in the system.
2. OPERATIONAL FEASIBILTY: Proposed project are
beneficial only if they can be turned into information system that will
meet the organizations operating requirements. Simply stated, this
test of feasibility asks if the system will work when developed and
installed. System is made menu driven. Hence time consumption in
operation
Of the system is less and easy for the and users to operate.
Each and every step in the system is user Friendly hence no
extra computer literacy is required while handling the system.
2. ECONOMICAL FEASIBILITY: All the hardware
and software Facilities as available with the end
user so the cost if hardware and software
implementation is eradicated. The operational
cost is also minimized, as no special computer
training is essential. As the new system does not
demand any Investments for the operation of the

system .The only cost is the development cost,


negligible. As compared to the benefits from the
system. Therefore system is economically
Feasible for end user.
3. Determination of system requirement
After the feasibility study is done a formal acceptance of
the proposed system is taken from user and the feasibility report is
then taken as the bases of next activity.
Determination of the system requirement is involved the
study of current business system to find out how it word and when
improvement have to be done. The requirement is to have a feature
that must be included in a new system which may include the way
processing data producing information controlling the business
activity and supporting the management by collecting the data.
Designing of the system
The design of an information system produces the details
that state how the system will meet the requirements identified
during system analysis.This phase takes the requirements as
agreed and the works which has led up to producing the proposal
and develops the system to the level of detail necessary to prepare
the way for programming. It is concerned with the computer
oriented design of the system-the detail of the input transaction,
detail of printed report , screens and other outputs, the file or
database structure, the contents of record and the efficiency of the
system from a computer processing point of view.
Software Development
The designing specification contains the program
specification and is use by the programmer for the development of
s/w. In this phase the actual coding is done according the design of
the system. Programmers are also responsible for documentation
of the whole system which may also be use to test the program and
carry out maintenance once the application has been installed.
System testing

Once the programs are tested individually the system as the


whole needs to be tested. During testing the system is used
experimentally to ensure that the s/w does not fail. That is it will
run according to its specification and in the way the users expect it
to testing is generally done to maintain the quality insurance which
is the review of s/w products and related documentation for
completeness, correctness, reliability or maintainability.
Testing is done generally in two labels: Unit testing That is testing in individual module.
System testing That is testing of the entire system.

System Implementation
In this stage the system analyst put the new s/w into existence,
which has already been tested. After proper testing and validation the
question arises weather a system
Can be implemented or not which included all those activity in which
the system is converted old sys. To be new sys. The new sys May be
totally new, replacement of an existing manual or automated system
or it may be major modification to an existing system.
System Maintenance
A system should be created whose design is
comprehensive and foresight enough to serve current & project user
needs for several years. The eminence cost and Frequency depends
up on the system designing process. The better the system design
easier it will be to maintain and the system maintenance cast will be
low. The eminence cost will be low. The eminence is the Process,
Which ensures the updated & live project. It is basically of 2 type
eminence & enhance.

FORMS &
CODING

Dim rs As New ADODB.Recordset


Private Sub Form_Activate()
If GetSetting(App.EXEName, "Settings", "UserCaching", "0") = 1
Then
txtName.Text = GetSetting(App.EXEName, "Settings",
"UserName", "")
txtName.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then lbllogin_Click
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload Me
EEnd Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
lbllogin.ForeColor = vbWhite
lblClose.ForeColor = vbWhite
End Sub
Private Sub lblClose_Click ()
End
End Sub
Private Sub lblClose_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
lblClose.FontSize = 8
End Sub
Private Sub lblClose_MouseMove(Button As Integer, Shift As Integer,
X As Single, Y As Single)
lblClose.ForeColor = vbRed
End Sub
Private Sub lblClose_MouseUp(Button As Integer, Shift As Integer, X
As Single, Y As Single)
lblClose.FontSize = 10

End Sub
Private Sub lbllogin_Click()
On Error GoTo Doctor
If rs.State = 1 Then rs.Close
rs.Open "select * from employeemaster where userid='" &
txtName.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rs.Fields("Password") = GenerateCode(txtPassword.Text) Then
SaveSetting App.EXEName, "Settings", "UserName",
txtName.Text
currentUserName = txtName.Text
currentAccessibility = rs.Fields("Accessibility").Value
Unload Me
mdiCENPAP.Show
Else
MsgBox "Password is wrong."
rs.Close
Exit Sub
End If
rs.Close
Doctor:
If Err.Number <> 0 Then
MsgBox "User Name not found in the database"
End If
End Sub
Private Sub lbllogin_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
lbllogin.FontSize = 8
End Sub
Private Sub lbllogin_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
lbllogin.ForeColor = vbGreen
End Sub
Private Sub lbllogin_MouseUp(Button As Integer, Shift As Integer, X
As Single, Y As Single)
lbllogin.FontSize = 10
End Sub

Dim rs As New ADODB.Recordset


Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdLogIn_Click()
On Error GoTo Doctor
Dim rsT As New ADODB.Recordset
rsT.Open "select password from employeemaster where userid='" &
txtUserIDIn.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rsT.Fields(0).Value <> GenerateCode(txtPasswordIn.Text) Then
rsT.Close
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
Exit Sub
End If
rsT.Close
rsT.Open "select count(*) from attendance where UserID='" &
txtUserIDIn & "' and workingdate=#" & Format(lbldate.Caption,
"dd/mm/yyyy") & "# and LogIn=yes"
If rsT.Fields(0).Value > 0 Then
MsgBox "You can't Log In Again."
rsT.Close
Exit Sub
End If
rsT.Close
rs.Open "select * from Attendance", dbConn, adOpenDynamic,
adLockOptimistic
rs.AddNew
rs!workingdate = Format(lbldate.Caption, "dd/mm/yyyy")
rs!userID = txtUserIDIn.Text
rs!logintime = Format(lblTime, "hh:mm:ss")
rs!logouttime = Format("00:00:00", "hh:mm:ss")
rs!login = True
rs!present = True

rs.Update
rs.Close
LoadData
txtUserIDIn.Text = ""
txtPasswordIn.Text = ""
MsgBox "You are successfully Logged In"
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
End If
End Sub
Private Sub cmdLogOut_Click()
On Error GoTo Doctor
Dim rsT As New ADODB.Recordset
rsT.Open "select password from employeemaster where userid='" &
txtUserIDOut.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rsT.Fields(0).Value <> GenerateCode(txtPasswordOut.Text) Then
rsT.Close
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
Exit Sub
End If
rsT.Close
rsT.Open "select * from attendance where UserID='" & txtUserIDOut
& "' and workingdate=#" & Format(lbldate.Caption, "dd/mm/yyyy") &
"# and LogIn=Yes"
If rsT.RecordCount = 0 Then
MsgBox "You can't Log Out Without Logging In."
rsT.Close
Exit Sub
End If
rsT.Close

rs.Open "select * from Attendance where WorkingDate=#" &


Format(lbldate.Caption, "dd/mm/yyyy") & "# and UserID='" &
txtUserIDOut.Text & "' and Login=YES", dbConn, adOpenDynamic,
adLockOptimistic
rs!logouttime = Format(lblTime, "hh:mm:ss")
rs!reasons = cmbReasons.Text
rs!login = False
rs!totalHours = CalculateHours(rs!logintime,
Format(lblTime.Caption, "hh:mm"))
rs.Update
rs.Close
LoadData
txtUserIDOut.Text = ""
txtPasswordOut.Text = ""
MsgBox "You are successfully Logged Out"
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
End If
End Sub
Private Sub Form_Activate()
CenterForm Me
lvwList.ColumnHeaders(1).Width = lvwList.Width * 0.3
lvwList.ColumnHeaders(2).Width = lvwList.Width * 0.3
lvwList.ColumnHeaders(3).Width = lvwList.Width * 0.1
lvwList.ColumnHeaders(4).Width = lvwList.Width * 0.1
lvwList.ColumnHeaders(5).Width = lvwList.Width * 0.2
LoadData
cmbReasons.ListIndex = 0
End Sub
Private Sub lvwList_ColumnClick(ByVal ColumnHeader As
MSComctlLib.ColumnHeader)
SortList lvwList, ColumnHeader
End Sub
Private Sub Timer1_Timer()

lbldate.Caption = Format(Date, "dd/mm/yyyy")


lblTime.Caption = Format(Time, "hh:mm:ss")
End Sub
Private Function CalculateHours(tm1 As Date, tm2 As Date) As Date
Dim i As Double, j As Double
i = Hour(tm2) - Hour(tm1)
j = (Minute(tm2) - Minute(tm1))
If j < 0 Then
i=i-1
j = 60 + j
End If
CalculateHours = Format(i & ":" & j, "hh:mm")
End Function
Private Sub LoadData()
Dim LI As ListItem
Dim rsT As New ADODB.Recordset
If rsT.State = 1 Then rsT.Close
rsT.Open "select
EmployeeName,a.UserID,Logintime,LogOutTime,reasons from
Attendance a,EmployeeMaster b where workingDate=#" &
Format(mdiCENPAP.stBar.Panels(6).Text) & "# And a.userid =
b.userid", dbConn, adOpenDynamic, adLockOptimistic
lvwList.ListItems.Clear
Do Until rsT.EOF
Set LI = lvwList.ListItems.Add(, , Format(rsT.Fields(0).Value,
"dd/mm/yyyy"))
LI.SubItems(1) = rsT.Fields(1).Value
LI.SubItems(2) = rsT.Fields(2).Value
LI.SubItems(3) = IIf(IsNull(rsT.Fields(3).Value), "",
rsT.Fields(3).Value)
LI.SubItems(4) = IIf(IsNull(rsT.Fields(4).Value), "",
rsT.Fields(4).Value)
rsT.MoveNext
Loop
End Sub

Dim editMode As Boolean


Dim rsEmployee As New ADODB.Recordset
Dim fName As String
Private Sub chkUseLocal_Click()
If chkUseLocal.Value = vbChecked Then
txtPermanentAddress.Text = txtLocalAddress.Text
txtPermanentPhone.Text = txtLocalPhone.Text
txtMobile.SetFocus
Else
txtPermanentAddress.Text = ""
txtPermanentPhone.Text = ""
End If
End Sub
Private Sub cmbEmployees_Click()
rsEmployee.MoveFirst
rsEmployee.Move cmbEmployees.ListIndex
LoadData
End Sub
Private Sub cmbNature_Click()
If cmbNature.ListIndex = 0 Then
dtpLDW.Enabled = False
Else
dtpLDW.Enabled = True
End If
End Sub
Private Sub cmdBrowse_Click()
cmd.Filter = "All Bitmap Files(*.bmp)|*.bmp|All JPEG Files(*.jpg)|
*.jpg"
cmd.ShowOpen
fName = cmd.FileName
If Len(Trim(fName)) = 0 Then Exit Sub
txtPhoto.Text = fName
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()

On Error GoTo Doctor


Dim ans As Integer
If cmbEmployees.ListCount <= 0 Then Exit Sub
ans = MsgBox("Do you really want to delete this employee details",
vbYesNo, "Confirm Deletion")
If ans = vbNo Then Exit Sub
rsEmployee.Delete
Reload
MsgBox "User Database Updated Successfully."
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub cmdEdit_Click()
If cmdEdit.Caption = "Add" Then
editMode = False
cmdEdit.Caption = "Edit"
cmdDelete.Enabled = False
cmbEmployees.Visible = False
txtName.Visible = True
Else
editMode = True
cmdEdit.Caption = "Add"
cmdDelete.Enabled = True
cmbEmployees.Visible = True
txtName.Visible = False
End If
End Sub
Private Sub cmdSave_Click()
On Error GoTo Doctor
If cmbEmployees.ListCount <= 0 And editMode Then Exit Sub
If Not CheckUserID(txtUserID.Text) And Not editMode Then
MsgBox "User ID already exist.
" & vbCrLf & "You need to
enter a unique User ID."
txtUserID.SetFocus

Exit Sub
End If
If Not SaveToEmployeeMaster Then
MsgBox "Unable to add new employee details."
Exit Sub
End If
ClearControls Me
Reload
MsgBox "User Database Updated Successfully."
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendFocusToNext
End If
If KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub
Private Function SaveToEmployeeMaster() As Boolean
On Error GoTo Doctor
Dim FSO As FileSystemObject
If Not editMode Then
rsEmployee.AddNew
End If
rsEmployee!EmployeeName.Value = UCase(txtName.Text)
rsEmployee!userID = LCase(txtUserID.Text)
rsEmployee!Password = GenerateCode(LCase(txtPassword.Text))
rsEmployee!DOB = dtpDOB.Value
rsEmployee!DOJ = dtpDOJ.Value
rsEmployee!BloodGroup = UCase(cmbBloodGroup.Text)
rsEmployee!SBU = UCase(cmbSBU.Text)
rsEmployee!level = UCase(Left(cmbLevel.Text, 1))

rsEmployee!Designation = UCase(cmbDesignation.Text)
rsEmployee!Accessibility = UCase(cmbAccess.Text)
rsEmployee!Mobile = txtMobile.Text
rsEmployee!LocalAddress = UCase(txtLocalAddress.Text)
rsEmployee!LocalNo = txtLocalPhone.Text
rsEmployee!PermanentAddress = UCase(txtPermanentAddress.Text)
rsEmployee!PermanentNo = txtPermanentPhone.Text
rsEmployee!EmergencyName = UCase(txtEmergencyName.Text)
rsEmployee!EmergencyNo = txtEmergencyNo.Text
rsEmployee!AppointmentNature = UCase(cmbNature.Text)
If cmbNature.ListIndex <> 0 Then rsEmployee!LDW =
dtpLDW.Value
rsEmployee!BankName = UCase(txtBank.Text)
rsEmployee!Branch = UCase(txtBranch.Text)
rsEmployee!LicenceNo = UCase(txtLicence.Text)
rsEmployee!PANNo = UCase(txtPAN.Text)
rsEmployee!BasicSalary = txtBasic.Text
rsEmployee!HRA = Val(txtHRA.Text)
rsEmployee!CCA = Val(txtCCA.Text)
rsEmployee!whoadded = currentUserName
rsEmployee.Update
Dim dest As String
dest = IIf(Right(App.Path, 1) = "\", App.Path & "images\", App.Path
& "\images\")
Set FSO = New FileSystemObject
FSO.CopyFile txtPhoto.Text, dest & txtUserID.Text & ".jpg"
SaveToEmployeeMaster = True
Exit Function
Doctor:
If Err.Number <> 0 Then
SaveToEmployeeMaster = False
End If
End Function
Private Function CheckUserID(id As String) As Boolean
On Error GoTo Doctor
Dim rs As New ADODB.Recordset

rs.Open "select * from employeemaster where userid='" & id & "'",


dbConn, adOpenDynamic, adLockOptimistic
rs.MoveFirst
CheckUserID = False
Exit Function
Doctor:
If Err.Number <> 0 Then
CheckUserID = True
End If
End Function
Private Sub Form_Load()
Reload
If currentAccessibility = "ADMINISTRATOR" Then
cmdDelete.Enabled = True
cmdEdit.Enabled = True
End If
dtpDOJ.Value = Date
dtpDOB.Value = Date
dtpLDW.Value = Date
End Sub
Private Sub LoadData()
On Error Resume Next
If Not editMode Then Exit Sub
txtName.Text = rsEmployee!EmployeeName.Value
txtUserID.Text = rsEmployee!userID
txtPassword.Text = rsEmployee!Password
dtpDOB.Value = rsEmployee!DOB
dtpDOJ.Value = rsEmployee!DOJ
cmbBloodGroup.Text = rsEmployee!BloodGroup
cmbSBU.Text = rsEmployee!SBU
cmbLevel.Text = rsEmployee!level
cmbDesignation.Text = rsEmployee!Designation
cmbAccess.Text = rsEmployee!Accessibility
txtMobile.Text = rsEmployee!Mobile
txtLocalAddress.Text = rsEmployee!LocalAddress
txtLocalPhone.Text = rsEmployee!LocalNo
txtPermanentAddress.Text = rsEmployee!PermanentAddress

txtPermanentPhone.Text = rsEmployee!PermanentNo
txtEmergencyName.Text = rsEmployee!EmergencyName
txtEmergencyNo.Text = rsEmployee!EmergencyNo
cmbNature.Text = rsEmployee!AppointmentNature
dtpLDW.Value = rsEmployee!LDW
txtBank.Text = rsEmployee!BankName
txtBranch.Text = rsEmployee!Branch
txtLicence.Text = rsEmployee!LicenceNo
txtPAN.Text = rsEmployee!PANNo
txtBasic.Text = rsEmployee!BasicSalary
txtHRA.Text = rsEmployee!HRA
txtCCA.Text = rsEmployee!CCA
End Sub
Private Sub Reload()
On Error GoTo Doctor
If rsEmployee.State = 1 Then rsEmployee.Close
rsEmployee.Open "select * from EmployeeMAster where
whoadded<>'system'", dbConn, adOpenDynamic, adLockOptimistic
cmbEmployees.Clear
Do Until rsEmployee.EOF
cmbEmployees.AddItem
rsEmployee.Fields("EmployeeName").Value
rsEmployee.MoveNext
Loop
If cmbEmployees.ListCount > 0 Then
cmbEmployees.ListIndex = 0
rsEmployee.MoveFirst
End If
loadSBU
loadDesig
cmbLevel.ListIndex = 0
cmbAccess.ListIndex = 0
cmbNature.ListIndex = 0
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"

End If
End Sub
Public Sub SendFocusToNext()
Dim idx As Integer
Dim ctl As Control
idx = Me.ActiveControl.TabIndex
If idx = 10 Or idx = 12 Then Exit Sub
If idx >= 0 And idx < 26 Then
For Each ctl In Me.Controls
If TypeOf ctl Is CommonDialog Then GoTo X
If ctl.TabIndex = idx + 1 Then
If ctl.Enabled = False Then
txtBank.SetFocus
ElseIf TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Or
TypeOf ctl Is Button Or TypeOf ctl Is DTPicker Then
ctl.SetFocus
End If
End If
X:
Next
End If
End Sub
Private Sub loadSBU()
Dim rsT As New ADODB.Recordset
rsT.Open "select distinct SBU from EmployeeMaster where
SBU<>'user' and SBU<>'ADMINISTRATOR'", dbConn,
adOpenDynamic, adLockOptimistic
cmbSBU.Clear
Do Until rsT.EOF
cmbSBU.AddItem rsT.Fields(0).Value
rsT.MoveNext
Loop
rsT.Close
If cmbSBU.ListCount > 0 Then cmbSBU.ListIndex = 0
End Sub
Private Sub loadDesig()
Dim rsT As New ADODB.Recordset

rsT.Open "select distinct Designation from EmployeeMaster where


SBU<>'user' and SBU<>'ADMINISTRATOR'", dbConn,
adOpenDynamic, adLockOptimistic
cmbDesignation.Clear
Do Until rsT.EOF
cmbDesignation.AddItem rsT.Fields(0).Value
rsT.MoveNext
Loop
rsT.Close
If cmbDesignation.ListCount > 0 Then cmbDesignation.ListIndex = 0
End Sub

Dim rs As New ADODB.Recordset


Private Sub cmbOldUser_Click()
rs.MoveFirst
rs.Move cmbOldUser.ListIndex
txtName.Text = rs.Fields("userid").Value
txtPass1.Text = rs.Fields("Password").Value
txtPass2.Text = rs.Fields("Password").Value
txtName.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
Dim ans As Integer
ans = MsgBox("Do you really want to delete this record", vbYesNo,
"Confirm Delete")
If ans = vbNo Then Exit Sub
rs.Delete
LoadData
End Sub
Private Sub cmdSave_Click()
On Error GoTo Doctor
If currentAccessibility <> "ADMINISTRATOR" Then
If cmbOldUser.Text <> currentUserName Then
MsgBox "You can change password of your own only."
Exit Sub
End If
End If
If Not checkEmptyFields(Me) Then
MsgBox "Please enter all the fields properly"
Exit Sub
End If
If Trim(txtPass1.Text) <> Trim(txtPass2.Text) Then
MsgBox "Both the passwords are not matching."
txtPass1.SetFocus

SendKeys "{home}+{end}"
Exit Sub
End If
rs.Fields("UserID").Value = LCase(txtName.Text)
rs.Fields("Password").Value = GenerateCode(LCase(txtPass1.Text))
rs.Update
MsgBox "User Details Altered Successfully"
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Problem to update users database."
End If
End Sub
Private Sub cmdSaveOthers_Click()
If chkCache.Value = vbChecked Then
SaveSetting App.EXEName, "Settings", "UserCaching", "1"
SaveSetting App.EXEName, "Settings", "UserName",
currentUserName
Else
SaveSetting App.EXEName, "Settings", "UserCaching", "0"
SaveSetting App.EXEName, "Settings", "UserName", ""
End If
If chkBypass.Value = vbChecked Then
SaveSetting App.EXEName, "Settings", "Bypass", "1"
Else
SaveSetting App.EXEName, "Settings", "Bypass", "0"
End If
MsgBox "All Settings applied Successfully"
End Sub
Private Sub Form_Activate()
Dim rsT As New ADODB.Recordset
LoadData

rsT.Open "select Accessibility from EmployeeMaster where


UserID='" & currentUserName & "'", dbConn, adOpenDynamic,
adLockOptimistic
If rsT.RecordCount = 0 Then Exit Sub
If rsT.Fields(0).Value <> "ADMINISTRATOR" Then
chkBypass.Enabled = False
chkCache.Enabled = False
End If
rsT.Close
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub
Private Sub Form_Load()
If GetSetting(App.EXEName, "Settings", "UserCaching", "0") = "1"
Then
chkCache.Value = vbChecked
End If
If GetSetting(App.EXEName, "Settings", "Bypass", "0") = "1" Then
chkBypass.Value = vbChecked
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As
Single)
End Sub
Private Sub txtName_GotFocus()
SendKeys "{Home}+{End}"
End Sub
Private Sub txtPass1_GotFocus()
SendKeys "{Home}+{End}"
End Sub
Private Sub txtPass2_GotFocus()

SendKeys "{Home}+{End}"
End Sub
Private Sub LoadData()
If rs.State = 1 Then rs.Close
rs.Open "Select userid,password From EmployeeMaster where
whoadded<>'system'", dbConn, adOpenDynamic, adLockOptimistic
cmbOldUser.Clear
Do Until rs.EOF
cmbOldUser.AddItem rs.Fields(0).Value
rs.MoveNext
Loop
If rs.RecordCount > 0 Then
cmbOldUser.ListIndex = 0
rs.MoveFirst
End If
End Sub

Dim basic As Long, FixTotal As Long


Dim rTotal As Long, dTotal As Long, nTotal As Long
Dim DaysInMonth(1 To 12) As Integer
Dim sundays As Integer
Private Sub cmbEmployeeName_Click()
On Error GoTo Doctor
Dim rs As New ADODB.Recordset
rs.Open "select UserId,LocalAddress,PANNo,BasicSalary,HRA,CCA
from EmployeeMaster where EmployeeName='" &
cmbEmployeeName.Text & "' and whoadded<>'system'", dbConn,
adOpenDynamic, adLockOptimistic
txtUserID.Text = rs!userID
txtAddress.Text = rs!LocalAddress
txtPAN.Text = rs!PANNo
txtBasic.Text = rs!BasicSalary
txtHRA.Text = rs!HRA
txtCCA.Text = rs!CCA
calculateDays
calculateTotal
rs.Close
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub cmdAttendanceDetails_Click()
frmAttendanceSheet.Show
frmAttendanceSheet.cmbEmployees.ListIndex =
FindPos(frmAttendanceSheet.cmbEmployees,
cmbEmployeeName.Text)
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub

Private Sub cmdLoad_Click()


On Error GoTo Doctor
Dim rs As New ADODB.Recordset
rs.Open "select * from SalaryDetails where Month='" &
txtMonth.Text & "/" & txtYear.Text & "' and UserId='" &
txtUserID.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rs.RecordCount <= 0 Then
MsgBox "Record Not Found"
Exit Sub
End If
rs.Close
rs.Open "select * from SalaryDetails where UserID='" &
txtUserID.Text & "' and month='" & txtMonth.Text & "/" & txtYear.Text
& "'", dbConn, adOpenDynamic, adLockOptimistic
txtBasic = rs!basic
txtHRA = rs!HRA
txtCCA = rs!CCA
_Click
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Not TypeOf Me.ActiveControl Is DTPicker Then
Me.ActiveControl.BackColor = vbWhite
SendFocusToNext
End If
If KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub

Private Sub Form_Load()


Dim rsT As New ADODB.Recordset
txtMonth.Text = Month(Date)
rsT.Open "select EmployeeName from EmployeeMaster where
whoadded<>'system'", dbConn, adOpenDynamic, adLockOptimistic
Do Until rsT.EOF
cmbEmployeeName.AddItem rsT.Fields(0).Value
rsT.MoveNext
Loop
If rsT.RecordCount > 0 Then cmbEmployeeName.ListIndex = 0
rsT.Close
txtYear.Text = Year(Date)
DaysInMonth(1) = 31
DaysInMonth(2) = 28
DaysInMonth(3) = 31
DaysInMonth(4) = 30
DaysInMonth(5) = 31
DaysInMonth(6) = 30
DaysInMonth(7) = 31
DaysInMonth(8) = 31
DaysInMonth(9) = 30
DaysInMonth(10) = 31
DaysInMonth(11) = 30
DaysInMonth(12) = 31
lvwDayDetails.ColumnHeaders(2).Width = lvwDayDetails.Width / 4
lvwDayDetails.ColumnHeaders(1).Width = lvwDayDetails.Width lvwDayDetails.ColumnHeaders(2).Width
calculateWorkingDays
End Sub
Private Sub calculateTotal()
On Error GoTo Doctor
If Val(txtTotalDays.Text) = 0 Then
txtNet.Text = 0
Exit Sub

End If
basic = (Val(txtBasic.Text) / 30) * IIf(Val(txtTotalDays.Text) > 30,
30, Val(txtTotalDays.Text))
FixTotal = 0
rTotal = 0
dTotal = 0
nTotal = 0
''''''''''''''''''''' Fixed Total ''''''''''''''''''''''
If Right(txtHRA, 1) = "%" Then
FixTotal = basic + (basic * Val(txtHRA.Text) / 100)
txtHRA.Text = (basic * Val(txtHRA.Text) / 100)
Else
FixTotal = basic + Val(txtHRA.Text)
End If
If Right(txtCCA, 1) = "%" Then
FixTotal = FixTotal + (basic * Val(txtCCA.Text) / 100)
txtCCA.Text = (basic * Val(txtCCA.Text) / 100)
Else
FixTotal = FixTotal + Val(txtCCA.Text)
End If
'''''''''''''''''''''' Riemburhed Total ''''''''''''''''
If Right(txtCA, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtCA.Text) / 100)
txtCA.Text = (basic * Val(txtCA.Text) / 100)
Else
rTotal = rTotal + Val(txtCA.Text)
End If
If Right(txtMedical, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtMedical.Text) / 100)
txtMedical.Text = (basic * Val(txtMedical.Text) / 100)

Else
rTotal = rTotal + Val(txtMedical.Text)
End If
If Right(txtComm, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtComm.Text) / 100)
txtComm.Text = (basic * Val(txtComm.Text) / 100)
Else
rTotal = rTotal + Val(txtComm.Text)
End If
If Right(txtSaleBonus, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtSaleBonus.Text) / 100)
txtSaleBonus.Text = (basic * Val(txtSaleBonus.Text) / 100)
Else
rTotal = rTotal + Val(txtSaleBonus.Text)
End If
If Right(txtOvertime, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtOvertime.Text) / 100)
txtOvertime.Text = (basic * Val(txtOvertime.Text) / 100)
Else
rTotal = rTotal + Val(txtOvertime.Text)
End If
If Right(txtExt, 1) = "%" Then
rTotal = rTotal + (basic * Val(txtExt.Text) / 100)
txtExt.Text = (basic * Val(txtExt.Text) / 100)
Else
rTotal = rTotal + Val(txtExt.Text)
End If
''''''''''''''''''''''''''' Deductions Total '''''''''''''''
If Right(txtIT, 1) = "%" Then
dTotal = dTotal + (basic * Val(txtIT.Text) / 100)
txtIT.Text = (basic * Val(txtIT.Text) / 100)
Else
dTotal = dTotal + Val(txtIT.Text)

End If
If Right(txtPT, 1) = "%" Then
dTotal = dTotal + (basic * Val(txtPT.Text) / 100)
txtPT.Text = (basic * Val(txtPT.Text) / 100)
Else
dTotal = dTotal + Val(txtPT.Text)
End If
If Right(txtLoans, 1) = "%" Then
dTotal = dTotal + (basic * Val(txtLoans.Text) / 100)
txtLoans.Text = (basic * Val(txtLoans.Text) / 100)
Else
dTotal = dTotal + Val(txtLoans.Text)
End If
If Right(txtOthers, 1) = "%" Then
dTotal = dTotal + (basic * Val(txtOthers.Text) / 100)
txtOthers.Text = (basic * Val(txtOthers.Text) / 100)
Else
dTotal = dTotal + Val(txtOthers.Text)
End If
nTotal = (FixTotal + rTotal) - dTotal
txtNet.Text = nTotal
Doctor:
If Err.Number <> 0 Then
MsgBox "Unable to Perform Action"
End If
End Sub
Private Sub txtBasic_LostFocus()
calculateTotal
End Sub
Private Sub txtCA_LostFocus()
calculateTotal
End Sub
Private Sub txtCCA_LostFocus()
calculateTotal
End Sub
Private Sub txtComm_LostFocus()

calculateTotal
End Sub
rs!CCA = Val(txtCCA.Text)
rs!CA = Val(txtCA.Text)
rs!Medical = Val(txtMedical.Text)
rs!Com = Val(txtComm.Text)
rs!SalesBonus = Val(txtSaleBonus.Text)
rs!Overtime = Val(txtOvertime.Text)
rs!Exec = Val(txtExt.Text)
rs!IT = Val(txtIT.Text)
rs!PT = Val(txtPT.Text)
rs!Loans = Val(txtLoans.Text)
rs!Others = Val(txtOthers.Te r
rs!TotalPay = FixTotal + rTotal
rs!NetPay = Val(txtNet.Text)
rs!TotalFixed = FixTotal
rs!TotalRiemburshed = rTotal
rs!TotalDeductions = dTotal
rs!Month = txtMonth.Text & "/" & txtYear.Text
rs!PayDate = Date
rs.Update
rs.Close
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Public Sub SendFocusToNext()
Dim idx As Integer
Dim ctl As Control
idx = Me.ActiveControl.TabIndex
If idx >= 0 And idx < 26 Then
For Each ctl In Me.Controls
If ctl.TabIndex = idx + 1 Then

If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Or


TypeOf ctl Is Button Or TypeOf ctl Is DTPicker Then ctl.SetFocus
If TypeOf ctl Is TextBox Then SendKeys "{home}+{end}"
End If
Next
End If
End Sub
Private Sub ClearFields()
txtCA.Text = 0
txtMedical.Text = 0
txtComm.Text = 0
txtSaleBonus.Text = 0
txtOvertime.Text = 0
txtExt.Text = 0
txtIT.Text = 0
txtPT.Text = 0
txtLoans.Text = 0
txtOthers.Text = 0
End Sub

Dim rs As New ADODB.Recordset


Dim toPrint As Boolean
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdInvert_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = Not lvwList.ListItems(i).Checked
Next
End Sub
Private Sub cmdPrint_Click()
On Error GoTo Doctor
Dim rsTemp As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim LI As ListItem
SetCommand cmd, "delete from tmpPayList"
cmd.Execute
dbConn.BeginTrans
rsTemp.Open "select * from tmpPayList", dbConn, adOpenDynamic,
adLockOptimistic
For i = 1 To lvwList.ListItems.Count
Set LI = lvwList.ListItems(i)
If LI.Checked = True Then
rsTemp.AddNew
rsTemp!EmployeeName = LI.Text
rsTemp!userID = LI.SubItems(1)
rsTemp!basic = LI.SubItems(2)
rsTemp!HRA = LI.SubItems(3)
rsTemp!CCA = LI.SubItems(4)
rsTemp!CA = LI.SubItems(5)
rsTemp!Medical = LI.SubItems(6)
rsTemp!Com = LI.SubItems(7)
rsTemp!SalesBonus = LI.SubItems(8)
rsTemp!Overtime = LI.SubItems(9)
rsTemp!Exec = LI.SubItems(10)
rsTemp!IT = LI.SubItems(11)
rsTemp!PT = LI.SubItems(12)

rsTemp!Loans = LI.SubItems(13)
rsTemp!Others = LI.SubItems(14)
rsTemp!TotalDays = LI.SubItems(15)
rsTemp!NetPay = LI.SubItems(16)
rsTemp!PayDate = LI.SubItems(17)
rsTemp!Month = txtMonth.Text & "/" & txtYear.Text
rsTemp.Update
End If
Next
dbConn.CommitTrans
Set rptPayList.DataSource = rsTemp
rptPayList.Show
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub cmdRefetch_Click()
LoadData txtMonth.Text & "/" & txtYear.Text
End Sub
Private Sub cmdSelectAll_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = True
Next
End Sub
Private Sub cmdSelectNone_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = False
Next
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub

Private Sub Form_Load()


Left = 0
Top = 0
txtMonth.Text = Month(Date)
txtYear.Text = Year(Date)
LoadData txtMonth.Text & "/" & txtYear.Text
End Sub
Private Sub LoadData(mon As String)
On Error GoTo Doctor
Dim LI As ListItem
rs.Open "select * from PaySlip where month='" & txtMonth.Text &
"/" & txtYear.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
lvwList.ListItems.Clear
Do Until rs.EOF
Set LI = lvwList.ListItems.Add(, ,
rs.Fields("EmployeeName").Value)
LI.SubItems(1) = rs!userID
LI.SubItems(2) = FormatNumber(rs!basic, 2, , vbFalse, vbFalse)
LI.SubItems(3) = FormatNumber(rs!HRA, 2, , vbFalse, vbFalse)
LI.SubItems(4) = FormatNumber(rs!CCA, 2, , vbFalse, vbFalse)
LI.SubItems(5) = FormatNumber(rs!CA, 2, , vbFalse, vbFalse)
LI.SubItems(6) = FormatNumber(rs!Medical, 2, , vbFalse,
vbFalse)
LI.SubItems(7) = FormatNumber(rs!Com, 2, , vbFalse, vbFalse)
LI.SubItems(8) = FormatNumber(rs!SalesBonus, 2, , vbFalse,
vbFalse)
LI.SubItems(9) = FormatNumber(rs!Overtime, 2, , vbFalse,
vbFalse)
LI.SubItems(10) = FormatNumber(rs!Exec, 2, , vbFalse, vbFalse)
LI.SubItems(11) = FormatNumber(rs!IT, 2, , vbFalse, vbFalse)
LI.SubItems(12) = FormatNumber(rs!PT, 2, , vbFalse, vbFalse)
LI.SubItems(13) = FormatNumber(rs!Loans, 2, , vbFalse, vbFalse)
LI.SubItems(14) = FormatNumber(rs!Others, 2, , vbFalse, vbFalse)
LI.SubItems(15) = rs!TotalDays
LI.SubItems(16) = FormatNumber(rs!NetPay, 2, , vbFalse,
vbFalse)

LI.SubItems(17) = rs!PayDate
LI.Checked = True
rs.MoveNext
Loop
rs.Close
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub lvwList_ColumnClick(ByVal ColumnHeader As
MSComctlLib.ColumnHeader)
lvwList.SortOrder = IIf(lvwList.SortOrder = lvwDescending,
lvwAscending, lvwDescending)
lvwList.SortKey = ColumnHeader.Index - 1
lvwList.Sorted = True
End Sub
Private Sub lvwList_KeyUp(KeyCode As Integer, Shift As Integer)
Dim LI As ListItem
Set LI = lvwList.SelectedItem
rs.MoveFirst
rs.Move LI.Index - 1
End Sub

Dim rs As New ADODB.Recordset


Dim level As Integer
Dim id As Integer, Index As Integer
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdEdit_Click()
Dim cmd As New ADODB.Command
If cmdEdit.Caption = "&Edit" Then
frmEditTime.txtIn = lvwList.SelectedItem.SubItems(3)
frmEditTime.txtOut = lvwList.SelectedItem.SubItems(4)
If lvwList.SelectedItem.SubItems(4) = "00:00:00" Then
frmEditTime.txtOut.Enabled = False
frmEditTime.Show vbModal
Else
SetCommand cmd, "update Attendance set LogInTime=#" &
Format(lvwList.SelectedItem.SubItems(3), "hh:mm") &
"#,LogOutTime=#" & Format(lvwList.SelectedItem.SubItems(4),
"hh:mm") & "# where id=" & lvwList.SelectedItem.SubItems(5)
cmd.Execute
MsgBox "Success"
cmdEdit.Caption = "&Edit"
End If
frmLoggedIN.lvwList.SetFocus
End Sub
Private Sub cmdPrint_Click()
rptLoggedIn.Sections(2).Controls(5).Caption =
Format(dtpDate.Value, "dd/mm/yyyy")
Set rptLoggedIn.DataSource = rs
rptLoggedIn.Show
End Sub
Private Sub dtpDate_CloseUp()
LoadData
End Sub
Private Sub Form_Load()
dtpDate.Value = Date
level = 1

Index = 1
LoadData
End Sub
Private Sub LoadData()
Dim LI As ListItem
Dim rs1 As New ADODB.Recordset
If level = 1 Then
If rs.State = 1 Then rs.Close
rs.Open "select
workingdate,EmployeeName,a.UserID,Logintime,LogOutTime,ID from
Attendance a,EmployeeMaster b where workingDate=#" &
dtpDate.Value & "# And a.userid = b.userid", dbConn, adOpenDynamic,
adLockOptimistic
lvwList.ListItems.Clear
Do Until rs.EOF
Set LI = lvwList.ListItems.Add(, , Format(rs.Fields(0).Value,
"dd/mm/yyyy"))
LI.SubItems(1) = rs.Fields(1).Value
LI.SubItems(2) = rs.Fields(2).Value
LI.SubItems(3) = rs.Fields(3).Value
LI.SubItems(4) = IIf(IsNull(rs.Fields(4).Value), "00:00:00",
rs.Fields(4).Value)
LI.SubItems(5) = rs.Fields(5).Value
rs.MoveNext
Loop
lvwList.ListItems(Index).Selected = True
ElseIf level = 2 Then
rs1.Open "select
workingdate,EmployeeName,a.UserID,Logintime,LogOutTime,ID from
Attendance a,EmployeeMaster b where workingDate=#" &
dtpDate.Value & "# And a.userid = b.userid and a.id=" & id, dbConn,
adOpenDynamic, adLockOptimistic
lvwList.ListItems.Clear
Set LI = lvwList.ListItems.Add(, , Format(rs1.Fields(0).Value,
"dd/mm/yyyy"))
LI.SubItems(1) = rs1.Fields(1).Value
LI.SubItems(2) = rs1.Fields(2).Value

LI.SubItems(3) = rs1.Fields(3).Value
LI.SubItems(4) = IIf(IsNull(rs1.Fields(4).Value), "00:00:00",
rs1.Fields(4).Value)
LI.SubItems(5) = rs1.Fields(5).Value
rs1.Close
End If
End Sub
Private Sub lvwList_KeyDown(KeyCode As Integer, Shift As Integer)
id = Val(lvwList.SelectedItem.SubItems(5))
If KeyCode = vbKeyReturn And level = 1 Then
level = 2
Index = lvwList.SelectedItem.Index
LoadData
cmdEdit.Enabled = True
dtpDate.Enabled = False
ElseIf KeyCode = vbKeyEscape And level = 2 Then
level = 1
LoadData
cmdEdit.Enabled = False
dtpDate.Enabled = True
End If
End Sub

Dim rs As New ADODB.Recordset


Dim toPrint As Boolean
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdInvert_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = Not lvwList.ListItems(i).Checked
Next
End Sub
Private Sub cmdPrint_Click()
On Error GoTo Doctor
Dim rsTemp As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim LI As ListItem
SetCommand cmd, "delete from TempList"
cmd.Execute
dbConn.BeginTrans
rsTemp.Open "select * from TempList", dbConn, adOpenDynamic,
adLockOptimistic
For i = 1 To lvwList.ListItems.Count
Set LI = lvwList.ListItems(i)
If LI.Checked = True Then
rsTemp.AddNew
rsTemp!EmployeeName = LI.Text
rsTemp!userID = LI.SubItems(1)
rsTemp!DOJ = LI.SubItems(2)
rsTemp!SBU = LI.SubItems(3)
rsTemp!level = LI.SubItems(4)
rsTemp!Accessibility = LI.SubItems(5)
rsTemp!Designation = LI.SubItems(6)
rsTemp!Mobile = LI.SubItems(7)
rsTemp!LocalAddress = LI.SubItems(8)
rsTemp!LocalNo = LI.SubItems(9)
rsTemp.Update
End If
Next

dbConn.CommitTrans
Set rptList.DataSource = rsTemp
rptList.Show
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub cmdSelectAll_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = True
Next
End Sub
Private Sub cmdSelectNone_Click()
For i = 1 To lvwList.ListItems.Count
lvwList.ListItems(i).Checked = False
Next
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub
Private Sub Form_Load()
LoadData
Left = 0
Top = 0
End Sub
Private Sub LoadData()
'On Error GoTo Doctor
Dim LI As ListItem
If rs.State = 1 Then rs.Close
rs.Open "select * from EmployeeMaster where
whoadded<>'system'", dbConn, adOpenDynamic, adLockOptimistic
lvwList.ListItems.Clear
Do Until rs.EOF

Set LI = lvwList.ListItems.Add(, ,
rs.Fields("EmployeeName").Value)
LI.SubItems(1) = rs!userID
LI.SubItems(2) = rs!DOJ
LI.SubItems(3) = rs!SBU
LI.SubItems(4) = rs!level
LI.SubItems(5) = rs!Accessibility
LI.SubItems(6) = rs!Designation
LI.SubItems(7) = rs!Mobile
LI.SubItems(8) = rs!LocalAddress
LI.SubItems(9) = rs!LocalNo
LI.Checked = True
rs.MoveNext
Loop
lvwList_KeyUp vbKeyDown, 0
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "Error To Perform Action", vbCritical, "Error!!!!!!"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
End Sub
Private Sub lvwList_Click()
lvwList_KeyUp vbKeyDown, 0
End Sub
Private Sub lvwList_ColumnClick(ByVal ColumnHeader As
MSComctlLib.ColumnHeader)
lvwList.SortOrder = IIf(lvwList.SortOrder = lvwDescending,
lvwAscending, lvwDescending)
lvwList.SortKey = ColumnHeader.Index - 1
lvwList.Sorted = True
End Sub
Private Sub lvwList_KeyUp(KeyCode As Integer, Shift As Integer)
Dim LI As ListItem
Dim pic As String

Set LI = lvwList.SelectedItem
rs.MoveFirst
rs.Move LI.Index - 1
Dim FSO As New FileSystemObject
pic = IIf(Right(App.Path, 1) = "\", App.Path & "images\", App.Path &
"\images\") & LI.SubItems(1) & ".jpg"
If FSO.FileExists(pic) Then
Image1.Picture = LoadPicture(pic)
Image1.ZOrder vbBringToFront
Else
Image1.Picture = LoadPicture()
Image1.ZOrder vbSendToBack
End If
End Sub

Dim rs As New ADODB.Recordset


Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdLogIn_Click()
On Error GoTo Doctor
Dim rsT As New ADODB.Recordset
rsT.Open "select password from employeemaster where userid='" &
txtUserIDIn.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rsT.Fields(0).Value <> GenerateCode(txtPasswordIn.Text) Then
rsT.Close
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
Exit Sub
End If
rsT.Close
rsT.Open "select count(*) from attendance where UserID='" &
txtUserIDIn & "' and workingdate=#" & Format(lbldate.Caption,
"dd/mm/yyyy") & "# and LogIn=yes"
If rsT.Fields(0).Value > 0 Then
MsgBox "You can't Log In Again."
rsT.Close
Exit Sub
End If
rsT.Close
rs.Open "select * from Attendance", dbConn, adOpenDynamic,
adLockOptimistic
rs.AddNew
rs!workingdate = Format(lbldate.Caption, "dd/mm/yyyy")
rs!userID = txtUserIDIn.Text
rs!logintime = Format(lblTime, "hh:mm:ss")
rs!logouttime = Format("00:00:00", "hh:mm:ss")
rs!login = True
rs!present = True

rs.Update
rs.Close
LoadData
txtUserIDIn.Text = ""
txtPasswordIn.Text = ""
MsgBox "You are successfully Logged In"
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
End If
End Sub
Private Sub cmdLogOut_Click()
On Error GoTo Doctor
Dim rsT As New ADODB.Recordset
rsT.Open "select password from employeemaster where userid='" &
txtUserIDOut.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
If rsT.Fields(0).Value <> GenerateCode(txtPasswordOut.Text) Then
rsT.Close
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
Exit Sub
End If
rsT.Close
rsT.Open "select * from attendance where UserID='" & txtUserIDOut
& "' and workingdate=#" & Format(lbldate.Caption, "dd/mm/yyyy") &
"# and LogIn=Yes"
If rsT.RecordCount = 0 Then
MsgBox "You can't Log Out Without Logging In."
rsT.Close
Exit Sub
End If
rsT.Close

rs.Open "select * from Attendance where WorkingDate=#" &


Format(lbldate.Caption, "dd/mm/yyyy") & "# and UserID='" &
txtUserIDOut.Text & "' and Login=YES", dbConn, adOpenDynamic,
adLockOptimistic
rs!logouttime = Format(lblTime, "hh:mm:ss")
rs!reasons = cmbReasons.Text
rs!login = False
rs!totalHours = CalculateHours(rs!logintime,
Format(lblTime.Caption, "hh:mm"))
rs.Update
rs.Close
LoadData
txtUserIDOut.Text = ""
txtPasswordOut.Text = ""
MsgBox "You are successfully Logged Out"
Exit Sub
Doctor:
If Err.Number <> 0 Then
MsgBox "User Authentication Failed." & vbCrLf & "Inavlid
User!!!!!!!"
End If
End Sub
Private Sub Form_Activate()
CenterForm Me
lvwList.ColumnHeaders(1).Width = lvwList.Width * 0.3
lvwList.ColumnHeaders(2).Width = lvwList.Width * 0.3
lvwList.ColumnHeaders(3).Width = lvwList.Width * 0.1
lvwList.ColumnHeaders(4).Width = lvwList.Width * 0.1
lvwList.ColumnHeaders(5).Width = lvwList.Width * 0.2
LoadData
cmbReasons.ListIndex = 0
End Sub
Private Sub lvwList_ColumnClick(ByVal ColumnHeader As
MSComctlLib.ColumnHeader)
SortList lvwList, ColumnHeader
End Sub
Private Sub Timer1_Timer()

lbldate.Caption = Format(Date, "dd/mm/yyyy")


lblTime.Caption = Format(Time, "hh:mm:ss")
End Sub
Private Function CalculateHours(tm1 As Date, tm2 As Date) As Date
Dim i As Double, j As Double
i = Hour(tm2) - Hour(tm1)
j = (Minute(tm2) - Minute(tm1))
If j < 0 Then
i=i-1
j = 60 + j
End If
CalculateHours = Format(i & ":" & j, "hh:mm")
End Function
Private Sub LoadData()
Dim LI As ListItem
Dim rsT As New ADODB.Recordset
If rsT.State = 1 Then rsT.Close
rsT.Open "select
EmployeeName,a.UserID,Logintime,LogOutTime,reasons from
Attendance a,EmployeeMaster b where workingDate=#" &
Format(mdiCENPAP.stBar.Panels(6).Text) & "# And a.userid =
b.userid", dbConn, adOpenDynamic, adLockOptimistic
lvwList.ListItems.Clear
Do Until rsT.EOF
Set LI = lvwList.ListItems.Add(, , Format(rsT.Fields(0).Value,
"dd/mm/yyyy"))
LI.SubItems(1) = rsT.Fields(1).Value
LI.SubItems(2) = rsT.Fields(2).Value
LI.SubItems(3) = IIf(IsNull(rsT.Fields(3).Value), "",
rsT.Fields(3).Value)
LI.SubItems(4) = IIf(IsNull(rsT.Fields(4).Value), "",
rsT.Fields(4).Value)
rsT.MoveNext
Loop
End Sub

Option Explicit
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Form_Load()
End Sub
Private Sub OKButton_Click()
frmLoggedIN.lvwList.SelectedItem.SubItems(3) = txtIn.Text
frmLoggedIN.lvwList.SelectedItem.SubItems(4) = txtOut.Text
frmLoggedIN.cmdEdit.Caption = "&Save"
Unload Me
End Sub
Private Sub txtIn_GotFocus()
SendKeys "{Home}+{End}"
End Sub
Private Sub txtOut_GotFocus()
SendKeys "{Home}+{End}"
End Sub

Dim rsEmployee As New ADODB.Recordset


Dim LI As ListItem
Dim mode As Integer
Private Sub cmbEmployees_Click()
FillSheet
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdPrint_Click()
Dim cmd As New ADODB.Command
Dim rsT As New ADODB.Recordset
dbConn.BeginTrans
SetCommand cmd, "delete from tmpAttendanceSheet"
cmd.Execute
For i = 1 To lvwList.ListItems.Count - 5
Set LI = lvwList.ListItems(i)
SetCommand cmd, "insert into tmpAttendanceSheet values(#" &
LI.Text & "#,#" & LI.SubItems(1) & "#,#" & LI.SubItems(2) & "#,#" &
LI.SubItems(3) & "#,'" & LI.SubItems(4) & "')"
cmd.Execute
Next
dbConn.CommitTrans
If rsT.State = 1 Then rsT.Close
rsT.Open "select * from tmpAttendanceSheet", dbConn,
adOpenDynamic, adLockOptimistic
Set rptAttendanceSheet.DataSource = rsT
rptAttendanceSheet.Sections(2).Controls(4).Caption =
cmbEmployees.Text
rptAttendanceSheet.Sections(2).Controls(5).Caption = txtMonth.Text
& "/" & txtYear.Text
rptAttendanceSheet.Sections(5).Controls(4).Caption = "Total
Days : " & lvwList.ListItems(lvwList.ListItems.Count 1).SubItems(3)

rptAttendanceSheet.Sections(5).Controls(3).Caption =
"Sundays
: " & lvwList.ListItems(lvwList.ListItems.Count 2).SubItems(3)
rptAttendanceSheet.Sections(5).Controls(2).Caption = "Total Hours
: " & lvwList.ListItems(lvwList.ListItems.Count).SubItems(3)
rptAttendanceSheet.Sections(5).Controls(1).Caption = "Present Days
: " & lvwList.ListItems(lvwList.ListItems.Count - 3).SubItems(3)
rptAttendanceSheet.Show
End Sub
Private Sub Form_Load()
txtMonth.Text = Month(Date)
txtYear.Text = Year(Date)
LoadData
lvwList.ColumnHeaders(1).Width = lvwList.Width * 0.1
lvwList.ColumnHeaders(5).Width = lvwList.Width * 0.45
lvwList.ColumnHeaders(2).Width = lvwList.Width * 0.15
lvwList.ColumnHeaders(3).Width = lvwList.Width * 0.15
lvwList.ColumnHeaders(4).Width = lvwList.Width * 0.15
End Sub
Private Sub LoadData()
If rsEmployee.State = 1 Then rsEmployee.Close
rsEmployee.Open "select * from EmployeeMAster where
whoadded<>'system'", dbConn, adOpenDynamic, adLockOptimistic
cmbEmployees.Clear
Do Until rsEmployee.EOF
cmbEmployees.AddItem
rsEmployee.Fields("EmployeeName").Value
rsEmployee.MoveNext
Loop
If cmbEmployees.ListCount > 0 Then
cmbEmployees.ListIndex = 0
rsEmployee.MoveFirst
End If
End Sub
Private Sub FillSheet()
On Error GoTo Doctor

Dim rs As New ADODB.Recordset, rs1 As New ADODB.Recordset


Dim h As Integer, m As Integer
Dim dh As Integer, dm As Integer, tDays As Integer
Dim UID As String, tHours As String, dHours As String
Dim ds As Integer
rs.Open "select userId from EmployeeMaster where
EmployeeNAme='" & cmbEmployees.Text & "'", dbConn,
adOpenDynamic, adLockOptimistic
UID = rs.Fields(0).Value
rs.Close
rs.Open "select min(day(workingdate)),max(day(workingdate)) from
attendance where UserID='" & UID & "' and month(workingdate)='" &
txtMonth.Text & "'", dbConn, adOpenDynamic, adLockOptimistic
mn = rs.Fields(0).Value
mx = rs.Fields(1).Value
rs.Close
For i = mn To mx
d = DateSerial(Val(txtYear.Text), Val(txtMonth.Text), i)
If Weekday(d) = 1 Then
ds = ds + 1
End If
Next
lvwList.ListItems.Clear
If mode = 0 Then
rs.Open "select
WorkingDate,LoginTime,LogoutTime,TotalHours,Reasons,UserId from
attendance where UserID='" & UID & "' and month(workingDate)=" &
Val(txtMonth.Text) & " and year(workingdate)=" & Val(txtYear.Text) &
" order by workingdate", dbConn, adOpenDynamic, adLockOptimistic
Do Until rs.EOF
UID = rs.Fields(5).Value
Set LI = lvwList.ListItems.Add(, , rs.Fields(0).Value)
For i = 1 To rs.Fields.Count - 2

If rs.Fields(i).Type = adDate Then


LI.SubItems(i) = IIf(IsNull(rs.Fields(i).Value), "00:00:00",
rs.Fields(i).Value)
Else
LI.SubItems(i) = IIf(IsNull(rs.Fields(i).Value), "",
rs.Fields(i).Value)
End If
Next
rs.MoveNext
Loop
rs.Close
rs.Open "select distinct workingdate from attendance where
UserID='" & UID & "' and month(workingdate)=" &
Val(txtMonth.Text) & " and year(workingdate)=" & Val(txtYear.Text) &
" and present=YES group by WorkingDate", dbConn, adOpenDynamic,
adLockOptimistic
tDays = rs.RecordCount
Do Until rs.EOF
rs1.Open "select TotalHours from Attendance where
workingdate=#" & rs.Fields(0).Value & "# and UserID='" & UID & "'",
dbConn, adOpenDynamic, adLockOptimistic
Do Until rs1.EOF
h = h + IIf(IsNull(rs1.Fields(0).Value), 0,
Hour(rs1.Fields(0).Value))
m = m + IIf(IsNull(rs1.Fields(0).Value), 0,
Minute(rs1.Fields(0).Value))
rs1.MoveNext
Loop
rs1.Close
rs.MoveNext
Loop
rs.Close
Else
rs.Open "select distinct workingdate from attendance where
UserID='" & UID & "' and month(workingdate)=" &
Val(txtMonth.Text) & " and year(workingdate)=" & Val(txtYear.Text) &

" and present=yes group by WorkingDate", dbConn, adOpenDynamic,


adLockOptimistic
tDays = rs.RecordCount
Do Until rs.EOF
dh = 0: dm = 0
Set LI = lvwList.ListItems.Add(, , rs.Fields(0).Value)
rs1.Open "select TotalHours from Attendance where
workingdate=#" & rs.Fields(0).Value & "# and UserID='" & UID & "'",
dbConn, adOpenDynamic, adLockOptimistic
Do Until rs1.EOF
dh = dh + IIf(IsNull(rs1.Fields(0).Value), 0,
Hour(rs1.Fields(0).Value))
dm = dm + IIf(IsNull(rs1.Fields(0).Value), 0,
Minute(rs1.Fields(0).Value))
rs1.MoveNext
Loop
If dm >= 60 Then
dh = dh + ((dm - dm Mod 60) / 60)
dm = dm Mod 60
End If
dHours = Format(dh, "00") & ":" & Format(dm, "00")
h = h + dh: m = m + dm
LI.SubItems(3) = dHours
rs1.Close
rs1.Open "select min(LoginTime),Max(LogoutTime) from
Attendance where workingdate=#" & rs.Fields(0).Value & "# and
UserID='" & UID & "'", dbConn, adOpenDynamic, adLockOptimistic
LI.SubItems(1) = rs1.Fields(0).Value
LI.SubItems(2) = IIf(IsNull(rs1.Fields(1).Value), "",
rs1.Fields(1).Value)
rs1.Close
rs.MoveNext
Loop
rs.Close
End If
If m >= 60 Then
h = h + ((m - m Mod 60) / 60)

m = m Mod 60
End If
tHours = Format(h, "00") & ":" & Format(m, "00")
lvwList.ListItems.Add , , ""
Set LI = lvwList.ListItems.Add(, , "")
LI.SubItems(3) = tDays
LI.SubItems(4) = "Total Days Attended"
Set LI = lvwList.ListItems.Add(, , "")
LI.SubItems(3) = ds
LI.SubItems(4) = "Sundays"
Set LI = lvwList.ListItems.Add(, , "")
LI.SubItems(3) = tDays + ds
LI.SubItems(4) = "Total Days"
Set LI = lvwList.ListItems.Add(, , "")
LI.SubItems(3) = tHours
LI.SubItems(4) = "Total Hours Attended"
Exit Sub
Doctor:
If Err.Number = 94 Then
MsgBox "No data for the said month"
Else: Resume Next
End If
End Sub
Private Sub optType_Click(Index As Integer)
mode = Index
FillSheet
End Sub
Private Sub txtMonth_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then LoadData
End Sub
Private Sub txtYear_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then LoadData
End Sub

CONCLUSION
The Project entitled CALL CENTER MANAGEMENT SYSTEM is the 1st
project are attempt by me towards development of any automated system.
I conclude this report with a note of thanks to all those who help me for
successful completion of this project. I have developed his software to the best
of me ability, the time schedule and the resources available to me.
My project CALL CENTER MANAGEMENT SYSTEM works satisfactory
as per need. It fulfill all the major needs of the CALL CENTER MANAGEMENT
SYSTEM

SUGGESTION
As this is my first project work, so I feel it was very difficult for me to
develop software independently. I saw a lot of problem during the past time. To
develop software for a newer one with in the limited period of time is little bit
difficult but also enjoy making the software and learn lot of things.
At the completion period of software I feel that I can did much more like I
could also provide the facility of various appeals and certificates which are
required in the court.
I also havent included the concept of charge anywhere in this project; Due
to lack of time I was unable to gather all essential information for this project,
related to charge. So there is no way to calculate charges in this project.
Most importantly, any provision for back-ups is not available which is an
important and useful part of this project is. Due to unavailability of any back-ups
system we may face many problems, such as if we lost some important
information, then in that case there is no provision to get it back.

LIMITATION
Microsoft window is rapidly becoming the standard operating
environment for Ps and visual basic is the standard programming language for
window. As a result, many employees are demanding that computing student
should be familiar with visual Basic, and increasingly course from national to
degree level are including a visual basic component.
Visual Basic is the language that many developers including
Microsoft themselves are using to write new application software. At the last
count there were over a million visual basic applications in commercial use.
Look closely at any modern window database spreadsheet and word
processing package, whether from Microsoft or other leading software house,
and you will find that its macro language is either a variety of visual basic, or
almost identical to it. For this reason, anyone who wants to become a windows
expert should master a grasp of it.
CERTAIN LIMITATION ARE:1
2
3
4

It does not support multi-user environment.


It does not facilitate multi-level security.
There is no provision for back-ups.
There is not provision for change of financial Year.

BIBLIOGRAPHY

1
2
3
4
5

Mastering IN Visual basic 6.0 (PETER NORTON)


Visual basic super bible (TECHMEDIA PUBLICATION)
Mastering V.B. 6.0 (TECHMEDIA PUBLICATION)
Mastering Visual Basic 6.0 - EVANGELOS PETROUTSOS
Beginners Guide to Visual Basis 6 - REETA SAHOO AND G.B. SAHOO.

You might also like