Sie sind auf Seite 1von 116

Project Report

On
EMPLOYEE MOVEMENT MONITORING SYSTEM

IN

HINDUSTAN AERONAUTICS LIMITED (LUCKNOW DIVISION)

Submitted by: SANJEEV MISHRA B.Tech, 6th semester


Regn No.0811012026

ITER, Bhubaneswar

CERTIFICATE

ACKNOWLEDGEMENT
I would like to express my gratitude to all those who gave me the opportunity to complete this project. I want to thank Hindustan Aeronautics Limited for giving me the permission to commence this project in the first instance and to do the necessary research work. I would take this opportunity as a proud privilege to express my deep sense of gratitude to Sri A N Tripathy, Deputy General Manager (SUKHOI-30). I am deeply indebted to Sri Sachin Goel, Senior Manager (IT), HAL Lucknow whose valuable guidance and suggestions was available throughout the dissertation work. I would place on record that the guidance and kind co-operation available throughout the project have been precious to me without which it would not have been possible for me to complete the project work within given period.

Date:01/07/2011 Place: Lucknow

(SANJEEV MISHRA)

DECLARATION

I hereby declare that this project titled EMPLOYEE MOVEMENT MONITORING SYSTEM submitted by me is an outcome of my own efforts and is an original one.

Date:01/07/2011 Place: Lucknow

SANJEEV MISHRA

INDEX

CONTENTS

INTRODUCTION COMPANY PROFILE OBJECTIVE METHODOLOGY REQUIREMENT ANALYSIS THEORY CODING DATABASE DESIGN SCREENSHOTS CONCLUSION

BIBLOGRAPHY

INTRODUCTION

INTRODUCTION
It is increasingly true and relevant to be able to track and locate employees, staff or key personnel. Locating a senior official, doctor or other professional must at times be facilitated in a rapid frame of time due to a serious and pending circumstance. Whether the person is in a hallway, or a room or outdoors, it is important to know where they are. The office timing is from 8:30 a.m. to 3:30 p.m. Employees are swiping in at 8:30 a.m. and out at 5:30 p.m.; and in between these timings they are regularly going out for personal work, etc. There is a staff movement register placed at the reception but very few employees are marking an entry. Also, it could be modified easily. So, there is a need for a system where every movement of the staff outside the organization could be recorded with the following information: P B number. Name, HOD, designation, grade and department. Time in and Time out. Reason. Photo.

Unauthorized movement of a particular employee can be tracked and alerted accordingly


.

COMPANY PROFILE

Hindustan Aeronautics Limited (HAL) came into existence on 1st October 1964. The Company was formed by the merger of Hindustan Aircraft Limited with Aeronautics India Limited and Aircraft Manufacturing Depot, Kanpur. The Company traces its roots to the pioneering efforts of an industrialist with extraordinary vision, the late SETH WALCHAND HIRACHAND, who set up Hindustan Aircraft Limited at Bangalore in association with the erstwhile princely State of Mysore in December 1940. The Government of India became a shareholder in March 1941 and took over the Management in 1942. Today, HAL has 19 Production Units and 9 Research and Design Centre in 7 locations in India. The Company has an impressive product track record - 12 types of aircraft manufactured with in-house R & D and 14 types produced under license. HAL has manufactured over 3550

aircraft, 3600 engines and overhauled over 8150 aircraft and 27300 engines. HAL has been successful in numerous R & D programs developed for both Defense and Civil Aviation sectors. HAL has made substantial progress in its current projects: DHRUV, which is Advanced Light Helicopter (ALH). TEJAS - Light Combat Aircraft (LCA). Intermediate Jet Trainer (IJT). Various military and civil upgrades. Light Combat Helicopter (LCA). Su-30MKI
It

has played a significant role for India's space programs by participating in the manufacture of structures for Satellite Launch Vehicles like:

PSLV (Polar Satellite Launch Vehicle). GSLV (Geo-synchronous Satellite Launch Vehicle). IRS (Indian Remote Satellite). INSAT (Indian National Satellite).

It has several facilities throughout India including Nasik, Korwa, Kanpur, Koraput, Lucknow, Bangalore and Hyderabad.German engineer Kurt Tank designed the HF-24 Marut fighter-bomber, the first fighter aircraft made in India. Hindustan Aeronautics has a long history of collaboration with several other international and domestic aerospace agencies such as the Airbus Industries, Boeing, Sukhoi Aviation Corporation, Israel Aircraft Industries, Mikoyan-Gurevich (now Mikoyan), BAE Systems, Rolls-Royce plc, Dassault Aviation, Dornier Flugzeugwerke, Aeronautical Development Agency and Indian Space Research Organization.

HAL PRODUCTS

LIGHT COMBAT AIRCRAFT (TEJAS)

HELICOPTER (DHRUV)

SUKHOI

AERO ENGINES OF RUSSIAN ORIGIN

HAL SERVICES

HAL DIVISIONS

OBJECTIVE

To record movement of employees and staff outside factory within working hours, excluding lunch hour.

To Design a user-friendly software for use by the Security Department.

To track frequent movement of an employee, so that it could be reported to higher management.

To design a software to record and store the time-in, time-out and all other information of employees in a secured database. To design simple and organized software free from errors and having minimum scope for manipulation. To serve as a better alternative than traditional register attendance system placed at security gates.

METHODOLOGY

M A I N

A D M I N G A T E

M A T E R I A L G A T

G A T E

LAN

There are 3 gates for entering the factory: Main gate. Admin gate. Material gate. Each gate would be having a security guard operating a system that is connected in LAN or WAN. Any employee going outside the gate during working hours would have to tell his/her P.B. number to the security guard. The operator would enter the P.B. number in the specified area inside the software. After entering the P.B. number, photograph of the employee would be displayed along with other details. The security guard would verify the person. After confirming his/her identity, the security guard would give him a receipt of the TIME-OUT i.e. the MOVEMENT SLIP. The time-out would automatically be saved in the database.

When the employee enters the factory after completing his work through any gate, he shows his MOVEMENT SLIP to the security guard, or tells his P.B. number for verification. The security guard verifies whether the person has already entered the factory or has come now. If the employee had entered earlier, then his TIME-OUT would be displayed in the software. Otherwise, the employee would be entered as late-coming and salary would be deducted from the frequency of late-coming entries accordingly. The software is so designed that it would display all information like photo, department, name, time-in, time-out, etc. by entering the P.B. number only; thus preventing the system from manipulation.

REQUIREMENT ANALYSIS

HARDWARE REQUIREMENT

Hardware configuration of the system is: Intel Core2 Duo CPU.

Operating system-Microsoft Windows XP.

1.99 GHz, 2.99 GB of RAM.

Hard disk drive capacity-83.2 GB, free space-61 GB.

Screen resolution-1024 by 768 pixels..

SOFTWARE REQUIREMENT

Apache Tomcat 6.0(Web server).

Jre6 and JDK.

Notepad ++.

Oracle 11g (For Online mode).

Ms-access (For Offline mode).

THEORY

HTML

HTML, which stands for Hypertext Markup Language, is the predominant markup language for web pages. HTML is the basic building-blocks of web pages. HTML is written in the form of HTML elements consisting of tags, enclosed in angle brackets (like <html>), within the web page content. The purpose of a web browser is to read HTML documents and compose them into visual or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. HTML documents are composed entirely of HTML elements that, in their most general form have three components: a pair of tags, a "start tag" and "end tag"; some attributes within the start tag; and finally, any textual and graphical content between the start and end tags, perhaps including other nested elements. The HTML element is everything between and including the start and end tags. The general form of an HTML element is therefore: <tag attribute1="value1" attribute2="value2">content</tag>. Some HTML elements are defined as empty elements and take the form <tag attribute1="value1" attribute2="value2" >. Empty elements may enclose no content. The name of an HTML element is the name used in the tags. Note that the end tag's name is preceded by a slash character, "/", and that in empty elements the slash does not appear. If attributes are not mentioned, default values are used in each case. Usually the title should be included in the head, for example: <head> <title>The title</title> </head>

Headings: HTML headings are defined with the <h1> to <h6> tags: <h1>Heading1</h1> <h2>Heading2</h2> <h3>Heading3</h3> <h4>Heading4</h4> <h5>Heading5</h5> <h6>Heading6</h6> Paragraphs: <p>Paragraph 1</p> <p>Paragraph 2</p> Line breaks: <br>. The difference between <br> and <p> is that 'br' breaks a line without altering the semantic structure of the page, whereas 'p' sections the page into paragraph. 'br' is an empty element in that, while it may have attributes, it can take no content and it does not have to have an end tag. <p> This <br> is a paragraph <br> with <br> line breaks</p> HTML documents can be delivered by the same means as any other computer file. However, they are most often delivered either by HTTP from a web server or by email.

ORACLE

The Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system (ORDBMS). The Oracle DBMS can store and execute stored procedures and functions within it. PL/SQL or the object-oriented language Java can invoke such code objects and/or provide the programming structures for writing them. The Oracle RDBMS stores data logically in the form of table spaces and physically in the form of data files. Users of the Oracle databases refer to the server-side memory-structure as the SGA (System Global Area). The SGA typically holds cache information such as data-buffers, SQL commands, and user information. In addition to storage, the database consists of online redo logs (or logs), which hold transactional history. Processes can in turn archive the online redo logs into archive logs (offline redo logs), which provide the basis (if necessary) for data recovery and for some forms of data replication. Oracle database management tracks its computer data storage with the help of information stored in the SYSTEM table space. The SYSTEMtablespace contains the data dictionaryand often (by default) indexes and clusters. A data dictionary consists of a special collection of tables that contains information about all user-objects in the database. Oracle database conventions refer to defined groups of object ownership (generally associated with a "username") as schemas. Most Oracle database installations traditionally came with a default schema called SCOTT. After the installation process has set up the sample tables, the user can log into the database with the username Scott and the password tiger. The name of the SCOTT schema originated with Bruce Scott, one of the first employees at Oracle (then Software Development Laboratories), who had a cat named Tiger.

JSP

Java Server Pages (JSP) is a Java technology that helps software developers serve dynamically generated web pages based on HTML, XML, or other document types. To deploy and run, the Apache Tomcat Server is used. It is an open source servlet container.JSP pages are loaded in the server and are operated from a structured special installed Java server packet called a Java EE Web Application. JSP allows Java code and certain pre-defined actions to be interleaved with static web markup content, with the resulting page being compiled and executed on the server to deliver an HTML or XML document. JSP syntax is a fluid mix of two basic content forms: scriptlet elements and markup. Markup is typically standard HTML or XML, while scriptlet elements are delimited blocks of Java code which may be intermixed with the markup.

SQL
SQL often referred to as Structured Query Language, is a database computer declarative language designed for managing data in relational database management systems (RDBMS). Its scope includes data insert, query, update and delete, schema creation and modification, and data access control. It is most widely used database language. The SQL language is sub-divided into several language elements, including:

Clauses. Expressions Predicates. Queries. Statements. Insignificant whitespace. The most common operation in SQL is the query, which is performed with the declarative SELECT statement. SELECT retrieves data from one or more tables, or expressions. The Data Manipulation Language (DML) is the subset of SQL used to add, update and delete data. The Data Definition Language (DDL) manages table and index structure. The Data Control Language (DCL) authorizes users and groups of users to access and manipulate data. SQL is designed for a specific purpose: to query data contained in a relational database. SQL is a set-based, declarative query language, not an imperative language such as C or BASIC.

MS ACCESS
Microsoft Office Access, previously known as Microsoft Access, is a relational database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately. Access stores data in its own format based on the Access Jet Database Engine. It can also import or link directly to data stored in other applications and databases. Microsoft Access is used to make databases. An all-Access solution may have Microsoft Access Forms and Reports managing Microsoft Access tables. However, Microsoft Access may be used only as the 'front-end', using another product for the 'back-end' tables, such as Microsoft SQL Server and non-Microsoft products such as Oracle and Sybase. Access tables support a variety of standard field types, indices, and referential integrity. Access also includes a query interface, forms to display and enter data, and reports for printing. The underlying Jet database, which contains these objects, is multiuser-aware and handles record-locking and referential integrity including cascading updates and deletes. Database solutions created entirely in Microsoft Access are well suited for individual and workgroup use across a network. The original concept of Access was for end users to be able to "access" data from any source. Other uses include: the import and export of data to many formats including Excel, Outlook, ASCII, FoxPro, SQL Server, Oracle, ODBC, etc.

APACHE TOMCAT
Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is an open source servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the Java Server Pages (JSP) specifications from Sun Microsystems, and provides a HTTP web server environment for Java code to run. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files. Tomcat should is not the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Tomcat version 4.x was released with Catalina (a servlet container), Coyote (an HTTP connector) and Jasper (a JSP engine). Tomcat version 5.x had following features:

Implements the Servlet 2.4 and JSP 2.0 specifications. Reduced garbage collection, improved performance and scalability. Native Windows and UNIX wrappers for platform integration. Faster JSP parsing.

Nowadays, Tomcat 7.0.16 is the latest version. Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.

JDBC
Java Data Base Connectivity, commonly referred to as JDBC, is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any ODBC-accessible data source in the JVM host environment. JDBC allows multiple implementations to exist and be used by the same application. The API provides a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager. The Driver Manager is used as a connection factory for creating JDBC connections. JDBC connections support creating and executing statements. These may be update statements such as SQL's CREATE, INSERT, UPDATE and DELETE, or they may be query statements such as SELECT. Additionally, stored procedures may be invoked through a JDBC connection. JDBC represents statements using one of the following classes: Statement the statement is sent to the database server each and every time. PreparedStatement the statement is cached and then the execution path is pre determined on the database server allowing it to be executed multiple times in an efficient manner. CallableStatement used for executing stored procedures on the database. The method Class.forName (String) is used to load the JDBC driver class.

JDBC drivers are client-side adapters (installed on the client machine, not on the server) that convert requests from Java programs to a protocol that the DBMS can understand.

SOURCE CODE

checkUser.jsp
<%@ page language = "java" session = "true" %> <jsp:useBean id="myBean" class="gatePass.Login" scope="page"/> <% String pUSERID = request.getParameter("userID"); String pPASSWD = request.getParameter("pwd"); String pRemem = request.getParameter("remem");

String[] res = new String[2]; try { res=myBean.validateUser(pUSERID,pPASSWD); out.println(res[0]); if (res[0] != null ) { session.setAttribute("userType",res[0]);; session.setAttribute("userId",pUSERID); session.setAttribute("gate",res[1]);

if (pRemem != null && pRemem.equals("on")) { Cookie c1 = new Cookie("uid",pUSERID); Cookie c2 = new Cookie("pwd",pPASSWD); c1.setMaxAge(100000); c2.setMaxAge(100000); response.addCookie(c1); response.addCookie(c2); } out.println("ok");

response.sendRedirect("home.jsp"); } else response.sendRedirect("index.jsp"); } catch(Exception ee) { out.println(ee); } finally{ try{ myBean.closeConnection(); } catch (Exception ex){ out.println(ex); } } %>

EmpInfoEntry.jsp

<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> </head> <body> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main">

<%@ include file="leftBar.jsp"%> <div id="Mid"> <center> <h1> <font color="#60ae80">Add New EmpInfo</font> </h1> </center> <form name="inputForm" action="saveEmpInfo.jsp" method="get" >

<table id="rounded-corner" align="center">

<tr> <td>Pbno</td><td><input type=text name="pbno"></td> </tr> <td>Name</td><td><input type=text name="name"></td>

</tr> <td>Dept</td><td><input type=text name="dept"></td> </tr> <td>Desig</td><td><input type=text name="desig"></td> </tr> <td>Grade</td><td><input type=text name="grade"></td> </tr> <td>HOD</td><td><input type=text name="hOD"></td> </tr>

<tr> <td colspan=2><input type=submit name='subBtn' value="Submit"></td> </tr> </table> </form> </div> <%@ include file="rightBar.jsp"%> </div> </div> <br> <br> </body>

EmpInfoShow.jsp

<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> </head> <body> <jsp:useBean id="obj" class="gatePass.EmpInfo" scope="request" /> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main"> <%@ include file="leftBar.jsp"%> <div id="Mid"> <% String pbno; String name; String dept; String desig; String grade; String hOD;

%>

<table id="box-table-a"> <tr> <th>Pbno</th> <th>Name</th> <th>Dept</th> <th>Desig</th> <th>Grade</th> <th>HOD</th>

</tr> <% ResultSet rs = obj.search();

while (rs.next()) { pbno = rs.getString(1); name = rs.getString(2); dept = rs.getString(3); desig = rs.getString(4); grade = rs.getString(5); hOD = rs.getString(6);

%> <tr> <td><%=pbno%></td> <td><%=name%></td> <td><%=dept%></td> <td><%=desig%></td> <td><%=grade%></td> <td><%=hOD%></td>

</tr>

<% } rs.close(); obj.closeConnection(); %>

</table> </div>

<%@ include file="rightBar.jsp"%> </div> <%@ include file="footerBar.jsp"%> </div> </body> </html>

EmpInfoUpd.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> <script> function getInfo(e) { if (e.keyCode == 13) { a = document.getElementById("pbno").value; window.location.href="EmpInfoUpd.jsp?pbno=" + a; } } function update() { document.forms[0].submit(); } </script> </head> <body> <jsp:useBean id="obj" class="gatePass.EmpInfo" scope="request" /> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main"> <%@ include file="leftBar.jsp"%> <div id="Mid">

<% String Pbno = request.getParameter("pbno"); obj = obj.search(Pbno); %> <form name="searchForm" action='EmpInfoUpdate.jsp' method="get" > <table id="rounded-corner" border="0" align="center"> <tr> <td> Pbno </td> <td> <input type="text" name="pbno" value="<%=obj.getPbno()%>" onKeyPress="getInfo(event)"> </td> <td rowspan="4"> <img alt="" src='/photographs/<%=obj.getPbno()+".jpg"%>' style="height: 167px; width: 173px" /> </td> </tr> <td> Name </td> <td class="style1"> <input type="text" name="name" value="<%=obj.getName()%>"> </td> </tr> <td> Dept </td> <td class="style1"> <input type="text" name="dept" value="<%=obj.getDept()%>"> </td> </tr>

<td> Desig </td> <td class="style1"> <input type="text" name="desig" value="<%=obj.getDesig()%>"> </td> </tr> <td> Grade </td> <td class="style1"> <input type="text" name="grade" value="<%=obj.getGrade()%>"> </td> <td> &nbsp; </td> </tr> <td> HOD </td> <td class="style1"> <input type="text" name="HOD" value="<%=obj.getHOD()%>"> </td> <td> &nbsp; </td> </tr> <tr> <td colspan="2"> <input type="button" name='subBtn' value="Submit" onClick="update()" > </td>

<td> &nbsp; </td> </tr> </table>

</form> <% obj.closeConnection(); %>

</table> </div>

<%@ include file="rightBar.jsp"%> </div> <%@ include file="footerBar.jsp"%> </div> </body> </html>

EmpInfoUpdate.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <jsp:useBean id="obj" class="gatePass.EmpInfo" scope="request" /> <jsp:setProperty name="obj" property="*"/> <% //************* Getting Parameters ******** String pbno = request.getParameter("pbno"); String name = request.getParameter("name"); String dept = request.getParameter("dept"); String desig = request.getParameter("desig"); String grade = request.getParameter("grade"); String hOD = request.getParameter("hOD");

//************ End of Getting Parameters ********

boolean result = obj.update();

if (result) out.println("Information Updated Successfully!<br> <a href='javascript:window.history.back()'> Back</a>"); else out.println("Error! Information could not be Updated."); %> </body> </html>

footerBar.jsp
<div id="Footer">

</div>

headerBar.jsp
<div id="Header"> <% /* if (session.getAttribute("userId") != null) { out.println("Hello " + session.getAttribute("userId")); //out.println("<a href=logout.jsp> logout </a>"); } else out.println("Invalid Session"); */ %>

<center> <img alt="" src="images/NameBanner.jpg" width="100%" height="118"> </center> </div>

Index.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> </head> <body> <jsp:useBean id="obj" class="gatePass.EmpInfo" scope="request" /> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main"> <%@ include file="leftBar.jsp"%> <div id="Mid"> <%

String pbno; String name; String dept; String desig; String grade; String hOD; %>

<table id="box-table-a"> <tr>

<th>Pbno</th> <th>Name</th> <th>Dept</th> <th>Desig</th> <th>Grade</th> <th>HOD</th>

</tr> <% ResultSet rs = obj.search();

while (rs.next()) { pbno = rs.getString(1); name = rs.getString(2); dept = rs.getString(3); desig = rs.getString(4); grade = rs.getString(5); hOD = rs.getString(6);

%> <tr> <td><%=pbno%></td> <td><%=name%></td> <td><%=dept%></td> <td><%=desig%></td> <td><%=grade%></td> <td><%=hOD%></td>

</tr>

<% } rs.close(); obj.closeConnection(); %>

</table> </div>

<%@ include file="rightBar.jsp"%> </div> <%@ include file="footerBar.jsp"%> </div> </body> </html>

leftBar.jsp
<div id="Left"> <table id="leftMenu"> <tr> <th> Choose Action </th> <tr> <tr> <td> <a href=EmpInfoEntry.jsp> Emp Info Entry </a> </td>

</tr>

<tr> <td> <a href=EmpInfoUpd.jsp> Emp Info Update </a> </td> </tr> <tr> <td> <a href=EmpInfoShow.jsp> Employees List </a> </td> </tr> <tr> <td> <a href=MovementUpdForm.jsp> Movement Entry</a> </td> </tr> <tr> <td> <a href=logout.jsp> Logout </a> </td> </tr>

</table>

</div>

logout.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>logout</title> <% session.invalidate(); %> </head> <body> <center> <br/><br/><br/><br/><font size="5"><strong><font color="#99d0c8"> You have been successfully logged out<br><br></font></strong></font> <img src="images/thank-you.jpg"><br><br><br> <a href="/"> Login In Again </a> </center> </body> </html>

MovementUpdate.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <jsp:useBean id="obj" class="gatePass.Movement" scope="request" /> <jsp:setProperty name="obj" property="*"/> <% //************* Getting Parameters ******** String pbno = request.getParameter("pbno"); String name = request.getParameter("name"); String dept = request.getParameter("dept"); String desig = request.getParameter("desig"); String grade = request.getParameter("grade"); String hOD = request.getParameter("hOD"); String gateNo = request.getParameter("gateNo"); String punchedBy = request.getParameter("punchedBy");

//************ End of Getting Parameters ********

boolean result = obj.update();

if (result) out.println("Information Updated Successfully!<br> <a href='javascript:window.history.back()'> Back</a>"); else out.println("Error! Information could not be Updated."); %> </body> </html>

MovementUpdForm.jsp
<%@ page language="java" import="java.sql.*,java.text.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> <script> function getInfo(e) { if (e.keyCode == 13) { a = document.getElementById("pbno").value; window.location.href="MovementUpdForm.jsp?pbno=" + a; } } function update() { document.forms[0].submit(); } </script> </head> <body>

<jsp:useBean id="obj" class="gatePass.Movement" scope="request" /> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main"> <%@ include file="leftBar.jsp"%>

<div id="Mid"> <% SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); String pbno = request.getParameter("pbno"); obj = obj.search(pbno); %> <form name="searchForm" action="MovementUpdate.jsp" method="get" > <table id="rounded-corner" style="margin-top:0px" border=0 align="center"> <tr> <td>Pbno</td><td><input type=text name="pbno" value="<%=obj.getPbno()%>" onKeyPress="getInfo(event)"></td> <td valign=top rowspan="10"> <img alt="" src='/photographs/<%=obj.getPbno()+".jpg"%>' style="height: 167px; width: 173px" /> </td> </tr><tr> <td>Name</td><td><input type=text readonly name="name" value="<%=obj.getName()%>"></td> </tr><tr> <td>Dept</td><td><input type=text readonly name="dept" value="<%=obj.getDept()%>"></td> </tr><tr> <td>Desig</td><td><input type=text readonly name="desig" value="<%=obj.getDesig()%>"></td> </tr><tr> <td>Grade</td><td><input type=text readonly name="grade" value="<%=obj.getGrade()%>"></td> </tr><tr> <td>HOD</td><td><input type=text readonly name="hOD" value="<%=obj.getHOD()%>"></td> </tr><tr> <td>TimeOut</td><td><input type=text readonly name="timeOut1" value="<%=sdf.format(obj.getTimeOut())%>"></td> </tr><tr> <td>GateNo</td><td><input type=text readonly name="gateNo" value="<%=obj.getGateNo()%>"></td>

</tr><tr> <td>PunchedBy</td><td><input type=text readonly name="punchedBy" value="<%=obj.getPunchedBy()%>"></td> </tr> <tr> <td colspan=2><input type=button name='subBtn' onClick="update()" value="Update"></td> </tr>

</table>

</form> <% obj.closeConnection(); %>

</table> </div>

<%@ include file="rightBar.jsp"%> </div> <%@ include file="footerBar.jsp"%> </div> </body> </html>

MovementShow.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="/css/home.css" type="text/css"></link> <link rel="stylesheet" href="/css/tablesStyle.css" type="text/css"></link> </head> <body> <jsp:useBean id="obj" class="gatePass.Movement" scope="request" /> <div id="wr"> <%@ include file="headerBar.jsp"%> <div id="Main"> <%@ include file="leftBar.jsp"%> <div id="Mid"> <% int transID; String pbno; String name; String dept; String desig; String grade; String hOD; Date timeOut; Date timeIn; String gateNo; String punchedBy;

%>

<table id="box-table-b"> <tr> <th>Pbno</th> <th>Name</th> <th>Dept</th> <th>Desig</th> <th>Grade</th> <th>HOD</th> <th>TimeOut</th> <th>TimeIn</th> <th>GateNo</th>

</tr> <% ResultSet rs = obj.search();

while (rs.next()) {

transID = rs.getInt(1); pbno = rs.getString(2); name = rs.getString(3); dept = rs.getString(4); desig = rs.getString(5); grade = rs.getString(6); hOD = rs.getString(7); timeOut = rs.getDate(8); timeIn = rs.getDate(9); gateNo = rs.getString(10); punchedBy = rs.getString(11);

%>

<tr>

<td><%=pbno%></td> <td><%=name%></td> <td><%=dept%></td> <td><%=desig%></td> <td><%=grade%></td> <td><%=hOD%></td> <td><%=timeOut%></td> <td><%=timeIn%></td> <td><%=gateNo%></td>

</tr>

<% } rs.close(); obj.closeConnection(); %>

</table> </div>

<%@ include file="rightBar.jsp"%> </div> <%@ include file="footerBar.jsp"%> </div> </body> </html>

rightBar.jsp
<div id="Right">

</div>

saveEmpInfo.jsp
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <jsp:useBean id="obj" class="gatePass.EmpInfo" scope="request" /> <jsp:setProperty name="obj" property="*"/> <% //************* Getting Parameters ******** String pbno = request.getParameter("pbno"); String name = request.getParameter("name"); String dept = request.getParameter("dept"); String desig = request.getParameter("desig"); String grade = request.getParameter("grade"); String hOD = request.getParameter("hOD");

//************ End of Getting Parameters ******** //boolean result = obj.addNew(pbno,name,dept,desig,grade,hOD); boolean result = obj.addNew(); if (result) out.println("Information Saved Successfully!<br> <a href='javascript:window.history.back()'> Back</a>");

else out.println("Error! Information could not be saved."); %> </body> </html>

GatePass
EmpInfo.java
package gatePass; import java.sql.*; import java.text.*; public class EmpInfo { Connection cn=null; String pbno=""; String name=""; String dept=""; String desig=""; String grade=""; String HOD="";

public String getPbno(){ return pbno; } public String getName(){ return name; } public String getDept(){ return dept; } public String getDesig(){ return desig; }

public String getGrade(){ return grade; } public String getHOD(){ return HOD; }

public void setPbno(String pPbno){ this.pbno = pPbno; } public void setName(String pName){ this.name = pName; } public void setDept(String pDept){ this.dept = pDept; } public void setDesig(String pDesig){ this.desig = pDesig; } public void setGrade(String pGrade){ this.grade = pGrade; } public void setHOD(String pHOD){ this.HOD = pHOD; }

public EmpInfo() throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\\gatePass.mdb"); //cn = DriverManager.getConnection("jdbc:odbc:gatePass"); //Class.forName("oracle.jdbc.driver.OracleDriver"); //cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL","scott","tiger");

public boolean addNew() { PreparedStatement ps=null; int n=0; try { ps = cn.prepareStatement("Insert Into EmpInfo(Pbno,Name,Dept,Desig,Grade,HOD) Values (?,?,?,?,?,?)");

ps.setString(1,pbno); ps.setString(2,name); ps.setString(3,dept); ps.setString(4,desig); ps.setString(5,grade); ps.setString(6,HOD);

n = ps.executeUpdate(); ps.close(); } catch(Exception ex) { } if (n==1 )

return true; else return false; } public boolean update() { PreparedStatement ps=null; int n=0; try { ps = cn.prepareStatement("Update EmpInfo Set Pbno=?,Name=?,Dept=?,Desig=?,Grade=?,HOD=? Where Pbno=?");

ps.setString(1,pbno); ps.setString(2,name); ps.setString(3,dept); ps.setString(4,desig); ps.setString(5,grade); ps.setString(6,HOD);

ps.setString(7,pbno); n = ps.executeUpdate(); ps.close(); } catch(Exception ex){ } if (n==1 ) return true; else return false; }

public boolean delete(String pPbno) { PreparedStatement ps=null; int n=0; try { ps = cn.prepareStatement("Delete From EmpInfo Where Pbno=?"); ps.setString(1,pPbno); n = ps.executeUpdate(); ps.close(); } catch(Exception ex){ } if (n==1 ) return true; else return false; }

public ResultSet search() { PreparedStatement ps=null; try { ps = cn.prepareStatement("select * from EmpInfo"); ResultSet rs = ps.executeQuery(); return rs; } catch(Exception ex){ return null; } } public EmpInfo search(String pPbno) throws Exception {

PreparedStatement ps=null; EmpInfo empInfo = new EmpInfo(); try { ps = cn.prepareStatement("select * from EmpInfo where Pbno=?"); ps.setString(1,pPbno); ResultSet rs = ps.executeQuery(); if (rs.next()) { empInfo.pbno = rs.getString(1); empInfo.name = rs.getString(2); empInfo.dept = rs.getString(3); empInfo.desig = rs.getString(4); empInfo.grade = rs.getString(5); empInfo.HOD = rs.getString(6);

} return empInfo; } catch(Exception ex){ return null; }

} public void closeConnection() throws Exception { if (cn != null ) cn.close(); } private java.sql.Date string2Date(String strDate) throws Exception

{ DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); if (strDate != null ) { java.util.Date dt = df.parse(strDate); java.sql.Date sd = new java.sql.Date(dt.getTime()); return sd; } else { return null; }

Movement.java
package gatePass; import java.sql.*; import java.text.*; public class Movement { Connection cn=null; int transID; String pbno=""; String name=""; String dept=""; String desig=""; String grade=""; String HOD=""; Date timeOut; Date timeIn=null; String gateNo=""; String punchedBy="";

public int getTransID(){ return transID; } public String getPbno(){ return pbno; } public String getName(){ return name; } public String getDept(){ return dept;

} public String getDesig(){ return desig; } public String getGrade(){ return grade; } public String getHOD(){ return HOD; } public Date getTimeOut(){ java.util.Date d = new java.util.Date(); timeOut = new Date(d.getTime()); return timeOut; } public Date getTimeIn(){ return timeIn; } public String getGateNo(){ return gateNo; } public String getPunchedBy(){ return punchedBy; }

public void setTransID(int pTransID){ this.transID = pTransID; } public void setPbno(String pPbno){ this.pbno = pPbno;

} public void setName(String pName){ this.name = pName; } public void setDept(String pDept){ this.dept = pDept; } public void setDesig(String pDesig){ this.desig = pDesig; } public void setGrade(String pGrade){ this.grade = pGrade; } public void setHOD(String pHOD){ this.HOD = pHOD; } public void setTimeOut(Date pTimeOut){ this.timeOut = pTimeOut; } public void setTimeIn(Date pTimeIn){ this.timeIn = pTimeIn; } public void setGateNo(String pGateNo){ this.gateNo = pGateNo; } public void setPunchedBy(String pPunchedBy){ this.punchedBy = pPunchedBy; }

public Movement() throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\\gatePass.mdb"); //cn = DriverManager.getConnection("jdbc:odbc:gatePass"); //Class.forName("oracle.jdbc.driver.OracleDriver"); //cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL","scott","tiger");

public boolean addNew() { PreparedStatement ps=null; int n=0; try { java.util.Date d = new java.util.Date(); ps = cn.prepareStatement("Insert Into Movement(Pbno,Name,Dept,Desig,Grade,HOD,TimeOut,GateNo,PunchedBy) Values (?,?,?,?,?,?,?,?,?,?,?)");

ps.setString(2,pbno); ps.setString(3,name); ps.setString(4,dept); ps.setString(5,desig); ps.setString(6,grade); ps.setString(7,HOD); ps.setDate(8,new Date(d.getTime())); ps.setString(10,gateNo); ps.setString(11,punchedBy);

n = ps.executeUpdate(); ps.close(); } catch(Exception ex) { } if (n==1 ) return true; else return false; } public boolean update() { PreparedStatement ps=null; int n=0; try { ps = cn.prepareStatement("Update Movement Set TransID=?,Pbno=?,Name=?,Dept=?,Desig=?,Grade=?,HOD=?,TimeOut=?,TimeIn=?,GateNo=?,PunchedBy=? Where TransID=?");

ps.setInt(1,transID); ps.setString(2,pbno); ps.setString(3,name); ps.setString(4,dept); ps.setString(5,desig); ps.setString(6,grade); ps.setString(7,HOD); ps.setDate(8,timeOut); ps.setDate(9,timeIn); ps.setString(10,gateNo); ps.setString(11,punchedBy);

ps.setInt(12,transID); n = ps.executeUpdate(); ps.close(); } catch(Exception ex){ } if (n==1 ) return true; else return false; }

public boolean delete(int pTransID) { PreparedStatement ps=null; int n=0; try { ps = cn.prepareStatement("Delete From Movement Where TransID=?"); ps.setInt(1,pTransID); n = ps.executeUpdate(); ps.close(); } catch(Exception ex){ } if (n==1 ) return true; else return false; }

public ResultSet search() { PreparedStatement ps=null; try { ps = cn.prepareStatement("select * from Movement"); ResultSet rs = ps.executeQuery(); return rs; } catch(Exception ex){ return null; } } public Movement search(String pPbno) throws Exception { PreparedStatement ps=null; Movement movement = new Movement(); try {

ps = cn.prepareStatement("select * from EmpInfo where Pbno=?"); ps.setString(1,pPbno); ResultSet rs = ps.executeQuery(); if (rs.next()) { movement.pbno = rs.getString(1); movement.name = rs.getString(2); movement.dept = rs.getString(3); movement.desig = rs.getString(4); movement.grade = rs.getString(5); movement.HOD = rs.getString(6); } return movement;

} catch(Exception ex){ return null; } } public void closeConnection() throws Exception { if (cn != null ) cn.close(); } private java.sql.Date string2Date(String strDate) throws Exception { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); if (strDate != null ) { java.util.Date dt = df.parse(strDate); java.sql.Date sd = new java.sql.Date(dt.getTime()); return sd; } else { return null; }

Run.java
import gatePass.*; class run { public static void main(String[] aa) throws Exception { Movement a = new Movement(); a.show(); } }

Login.java
package gatePass; import java.sql.*; import java.text.*; public class Login{ PreparedStatement ps=null; ResultSet rs=null; Connection cn=null;

public Login() throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\\gatePass.mdb"); //cn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=webapps\\database\\IMAS.mdb"); /*cn = DriverManager.getConnection("jdbc:odbc:Driver={Oracle in OraDb10g_home1};Server=localhost;database=orcl;uid=scott;pwd=tiger");*/

} public boolean addNewUser(String USERID,String NAME,String PASSWD,String DEPT) throws Exception { ps = cn.prepareStatement("insert into LOGIN_INFO(USERID,NAME,PASSWD,USER_TYPE,DEPT) values (?,?,?,?,?)"); ps.setString(1,USERID);

ps.setString(2,NAME); ps.setString(3,PASSWD); ps.setString(4,DEPT); ps.setString(5,DEPT);

int n = ps.executeUpdate(); if (n==1 ) return true; else return false; } public boolean updateLoginInfo(String USERID,String PASSWD,String SECURITY_QUES,String SECURITY_ANS,String USER_TYPE,String USER_STATUS) throws Exception { ps = cn.prepareStatement("update LOGIN_INFO set USERID = ?,PASSWD = ?,SECURITY_QUES = ?,SECURITY_ANS = ?,USER_TYPE = ?,USER_STATUS = ? where USERID= ?"); ps.setString(1,USERID); ps.setString(2,PASSWD); ps.setString(3,SECURITY_QUES); ps.setString(4,SECURITY_ANS); ps.setString(5,USER_TYPE); ps.setString(6,USER_STATUS); ps.setString(7,USERID); int n = ps.executeUpdate(); if (n==1 ) return true; else return false; } public boolean deleteUser(String USERID) throws Exception { ps = cn.prepareStatement("delete from LOGIN_INFO where USERID=?"); ps.setString(1,USERID); int n = ps.executeUpdate();

if (n==1 ) return true; else return false; } public ResultSet searchUser() throws Exception { ps = cn.prepareStatement("select userid,user_type,user_status from LOGIN_INFO"); rs = ps.executeQuery(); return rs; } public String[] validateUser(String USERID,String PWD) throws Exception { ps = cn.prepareStatement("select user_Type,gate from LOGIN_INFO where USERID= ? and Passwd=?"); ps.setString(1,USERID); ps.setString(2,PWD); String[] res = new String[2]; rs = ps.executeQuery(); if (rs.next()) { res[0] = rs.getString(1); res[1] = rs.getString(2); return res; } else return null; } public String getSecurityQues(String USERID) throws Exception { ps = cn.prepareStatement("select * from LOGIN_INFO where USERID= ?"); ps.setString(1,USERID); rs = ps.executeQuery(); if (rs.next()) {

return rs.getString("SECURITY_QUES"); } else return null; }

public String getUserType(String USERID) throws Exception { PreparedStatement ps1 = cn.prepareStatement("select user_type from LOGIN_INFO where USERID= ?"); ps1.setString(1,USERID); String res =""; ResultSet rs1 = ps1.executeQuery(); String utype=""; if (rs1.next()) { res =rs1.getString("user_type"); rs1.close(); ps1.close(); return res;

} else { if (rs1 != null ) rs1.close(); if (ps1 != null ) ps1.close(); return null; } }

public boolean validateSecurityAns(String USERID,String ANS) throws Exception { ps = cn.prepareStatement("select * from LOGIN_INFO where USERID= ? and SECURITY_ANS=?"); ps.setString(1,USERID);

ps.setString(2,ANS); rs = ps.executeQuery(); if (rs.next()) return true; else return false; }

public boolean changePasswd(String USERID,String NEW_PASSWD) throws Exception { ps = cn.prepareStatement("update LOGIN_INFO set PASSWD = ? where USERID= ?"); ps.setString(1,NEW_PASSWD); ps.setString(2,USERID); int n = ps.executeUpdate(); if (n==1 ) return true; else return false; }

public boolean blockUser(String USERID) throws Exception { ps = cn.prepareStatement("update LOGIN_INFO set USER_STATUS = 'B' where USERID= ?"); ps.setString(1,USERID); int n = ps.executeUpdate(); if (n==1 ) return true; else return false; }

public void closeConnection() throws Exception {

if (rs != null ) rs.close(); if (ps != null ) ps.close(); if (cn != null ) cn.close(); } public java.sql.Date string2Date(String strDate) throws Exception { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); java.util.Date dt = df.parse(strDate); java.sql.Date sd = new java.sql.Date(dt.getTime()); return sd; } }

DATABASE DESIGN

Table Designs for the Gate-pass System is given below:

Table: EMP Info

Sl No. 1 2 3 4 5 6

Field Name Pbno Name Dept Desig Grade HOD

Field Size 10 20 20 20 5 20

Field Type varchar varchar varchar varchar varchar varchar

Table: Log-in Info

SlNo. 1 2 3

Field Name UserID Passwd UserType

Field Size 20 10 20

Field Type varchar varchar varchar

Table: Movement

SlNo. 1 2 3 4 5 6 7 8 9 10 11

Field Name TransID Pbno Name Dept Desig Grade HOD TimeOut TimeIn GateNo PunchedBy

Field Size

Field Type integer

10 20 20 20 5 20

varchar varchar varchar varchar varchar varchar Date Date

10 20

varchar varchar

SCREENSHOTS

CONCLUSION

The Computerized Time Attendance system is an electronic attendance system in which every employee makes their attendance in computer rather than using attendance book. The conventional method of register attendance system is outdated and prone to manipulation. It is very complex too. It becomes difficult to organize the attendance report of every employee and track the frequent absence of employees from factory. Therefore, there was a need to design a software that would be free from misuse and manipulation. It would thus, enhance the productivity of the company. It would definitely serve as a better tool than the conventional register attendance system. It is a simple and efficient tool that could be handled even by a security guard. It could also be used as a standard tool for recording employee information. This information could be easily modified and updated by the administration, thus making it a secured and standard place for storing employee details. This software could also be used by higher management as an effective tool for sorting out names of employees who frequently stay out of the factory during working hours. This would definitely save a lot of time and would be far simpler to use, store and maintain.

BIBLOGRAPHY

Wikipedia.

HAL official website- www.hal-india.com.

www.Scribd.com.

Das könnte Ihnen auch gefallen