payRollEntry.jsp
<%--Called from the Main menu. Displays a list of all the employees in the company so they can be selected for payroll --%>
payroll
<%@ page import= "java.sql.*" %> <%@ page import= "java.util.*" %> <%@ page import= "java.io.*" %> <%@ page import= "com.*" %> <%@ page import= "com.ConnectionPool2" %> <% Connection connection = ConnectionPool2.getConnection(); String company = (String)session.getAttribute("company"); String query = "select FirstName,Surname, NIC, MonthWeek from perse3 where CompanyName like '"+company+"'AND employed = 1"; Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery( query ); %>
Tick the employees who are to be payrolled
First Name
Surname
NIC number
Monthly
or
weekly
<% while( resultSet.next()) { //Because data can only be removed from a resultSet one time only and the NIC varible //is used twice it placed in a String Varible. %>
<%= resultSet.getString(1)%>
<%= resultSet.getString(2)%>
<%String NIC = resultSet.getString(3);%>
<%= NIC %>
<%= resultSet.getString(4) %>
>
<% } %>
Enter The Period