This commit is contained in:
louiscklaw
2025-02-01 01:58:47 +08:00
parent b3da7aaef5
commit 04dbefcbaf
1259 changed files with 280657 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<%--
Document : 404error
Created on : 2019/12/14, 下午 02:05:51
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page isErrorPage="true"%>
<!DOCTYPE html>
<html>
<head>
<title>Error page</title>
<meta charset="utf-8">
<link href="<%= request.getContextPath() %>/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row ">
<div class="col-12">
<div class="error-template" style="margin-top: 200px">
<h1> Oops!</h1>
<h2>404 Not Found</h2>
<div class="error-details">
Sorry, an error has occured, Requested page not found!
</div>
<div class="error-actions">
<br>
<button onclick="history.back()" class="btn btn-primary btn-lg">
<span class="glyphicon glyphicon-home"></span>
Back to Home
</button>
</div>
</div>
</div>
</div>
</div>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
<tlib-version>1.0</tlib-version>
<short-name>nav</short-name>
<uri>/WEB-INF/tlds/nav-taglib.tld</uri>
<tag>
<name>showNav</name>
<tag-class>system.tag.NavTag</tag-class>
<body-content>empty</body-content>
<attribute>
<name>role</name>
<required>true</required>
<type>java.lang.String</type>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>active</name>
<required>true</required>
<type>java.lang.String</type>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<context-param>
<param-name>dbUrl</param-name>
<param-value>jdbc:mysql://localhost:3306/itp4511assignemnt</param-value>
</context-param>
<context-param>
<param-name>dbUser</param-name>
<param-value>root</param-value>
</context-param>
<context-param>
<param-name>dbPassword</param-name>
<param-value></param-value>
</context-param>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<servlet>
<servlet-name>IndexController</servlet-name>
<servlet-class>system.servlet.IndexController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>IndexController</servlet-name>
<url-pattern>/index</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/error</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorHandler</location>
</error-page>
</web-app>

View File

@@ -0,0 +1,85 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="attendance" />
</div>
<div class="col-lg-9">
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Class</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col"> </th>
<th scope="col">Head</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
out.print("<tr data-href=\"attendance?class=" + classVal.getClassName() + "\">");
out.print("<td colspan=2>" + classVal.getClassName() + "</td>");
out.print("<td>" + classVal.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
})
});
</script>
</body>
</html>

View File

@@ -0,0 +1,176 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="system.bean.ClassBean, system.bean.AttendBean, java.util.ArrayList, java.util.Date, java.text.SimpleDateFormat"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<%!
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
%>
<%
String urlForm = "attendance?";
String urlDate = request.getParameter("date");
String urlClass = request.getParameter("class");
if (urlDate != null) {
urlForm += ("date=" + urlDate + "&");
}
if (urlDate != null) {
urlForm += ("class=" + urlClass);
}
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="attendance" />
</div>
<div class="col-lg-9">
<%
if (request.getAttribute("message") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show' role='alert'>");
out.print("<strong>Attendance Saved</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Select Date</h5>
</div>
<form action="attendance" method="GET">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<select class="form-control" name="class">
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
if (request.getParameter("class").equals(classVal.getClassName())) {
out.print("<option value='" + classVal.getClassName() + "' selected>" + classVal.getClassName() + "</option>");
} else {
out.print("<option value='" + classVal.getClassName() + "'>" + classVal.getClassName() + "</option>");
}
}
%>
</select>
</div>
<div class="form-group">
<label>Select Date</label>
<div class="input-group date">
<input type="text" class="form-control" id="datepicker" name="date" value="<%= request.getParameter("date") == null ? formatter.format(date) : request.getParameter("date")%>">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
</div>
<br>
<a href="attendance">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
<button type="submit" class="btn btn-primary right">Submit</button>
</div>
</form>
</div>
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Attend List</h5>
</div>
<form action="<%= urlForm%>" method="POST">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Attend</th>
<th scope="col">Student ID</th>
<th scope="col">Student Name</th>
<th scope="col">Gender</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="studentAttendList" scope="request" class="java.util.ArrayList<system.bean.AttendBean>"/>
<%
for (AttendBean student : studentAttendList) {
out.print("<tr>");
out.print("<td>");
out.print("<input type='checkbox' name='attend' value='" + student.getStBean().getId() + "'");
if (student.isAttend()) {
out.print(" checked>");
} else {
out.print(" >");
}
out.print("</td>");
out.print("<td>" + student.getStBean().getId() + "</td>");
out.print("<td>" + student.getStBean().getName() + "</td>");
out.print("<td>" + student.getStBean().getGender() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
<button type="submit" class="btn btn-primary float-right">Save</button>
<br><br>
<input type="hidden" name="action" value="save">
<input type="hidden" name="class" id="attendDate" value="<%= request.getParameter("class")%>">
<input type="hidden" name="date" id="class" value=" <%= request.getParameter("date") == null ? formatter.format(date) : request.getParameter("date")%>">
</div>
</form>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-datepicker.min.js"></script>
<script>
$(document).ready(function () {
$('#datepicker').datepicker({
format: "yyyy-mm-dd",
daysOfWeekDisabled: "0,6",
daysOfWeekHighlighted: "1,2,3,4,5",
todayHighlight: true
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,140 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.SearchBean"%>
<%@page import="system.bean.LectureBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, system.bean.TeacherBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="class" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Class List</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("deleteMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Class #" + request.getAttribute("deleteMes") + " Deleted </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("saveMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Class #" + request.getAttribute("saveMes") + " Saved </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("addMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong> Class Added</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<div class="format-table">
<form action="class" method="POST" class="format">
<button type="submit" class="btn btn-primary">Create Class</button>
<input type="hidden" name="action" value="addPage">
</form>
<form class="form-inline float-right" action="class" method="POST">
<div class="form-group mb-2">
<font>Search: </font>
</div>
<div class="form-group mx-sm-3 mb-2">
<label class="sr-only">Password</label>
<input list="searchlist" type="text" class="form-control" name="searchVal" id="searchVal" placeholder="Search...">
<datalist id="searchlist">
<jsp:useBean scope="request" id="searchList" class="java.util.ArrayList<system.bean.SearchBean>"/>
<%
for (SearchBean search : searchList) {
out.print("<option label='" + search.getKeyword() + "' value='" + search.getKeyword() + "' />");
}
%>
</datalist>
</div>
<button type="submit" class="btn btn-dark mb-2">Search</button>
<input type="hidden" name="action" value="search">
</form>
<div class="table-responsive">
<table class="table">
<thead class="thead-dark">
<tr>
<th>Class</th>
<th>Head Teacher</th>
<th>Year</th>
<th>Action</th>
</tr>
</thead>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean cl : classList) {
out.print("<tr>");
out.print("<td>" + cl.getClassName() + "</td>");
out.print("<td>" + cl.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("<td>" + cl.getYear() + "</td>");
out.print("<td>");
out.print("<a href='class?id=" + cl.getId() + "'><button type='button' class='btn btn-info tableBtn'><i class='material-icons'>edit</i></button></a> ");
out.print("<a href='class?id=" + cl.getId() + "&action=delete'><button type='button' class='btn btn-danger tableBtn'><i class='material-icons'>delete</i></button></a>");
out.print("</td>");
}
if(request.getAttribute("search") == null){
out.print("</table>");
}else{
out.print("</table>");
out.print("<a href=\"class\"><button class=\"btn btn-secondary\">Show All</button></a>");
}
%>
</div>
</div>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,139 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.ClassYearBean"%>
<%@page import="system.bean.TeacherBean"%>
<%@page import="system.bean.LectureDayBean"%>
<%@page import="system.bean.LectureTimeBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="class" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Add Student Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("dupMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>The Class Name is created</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<jsp:useBean id="classYearList" scope="request" class="ArrayList<system.bean.ClassYearBean>" />
<jsp:useBean id="teacherList" scope="request" class="ArrayList<system.bean.TeacherBean>" />
<form action="class" method="POST">
<table class="table">
<tr>
<th>Class Name</th>
<td><input type="text" name="class" class="form-control" value="<%= request.getAttribute("className") != null ? request.getAttribute("className") : ""%>" required></td>
</tr>
<tr>
<th>Teacher</th>
<td>
<select name="teacherId" class="form-control" required="">
<%
if (request.getAttribute("teacherId") != null) {
for (TeacherBean teacher : teacherList) {
if (teacher.getId().equals(request.getAttribute("teacherId"))) {
out.print("<option value='" + teacher.getId() + "' selected>" + teacher.getTeacherFormalName() + "</option>");
} else {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
} else {
for (TeacherBean teacher : teacherList) {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Year</th>
<td>
<select name="yearId" class="form-control" required>
<%
if (request.getAttribute("yearId") != null) {
for (ClassYearBean year : classYearList) {
if (year.getId().equals(request.getAttribute("yearId"))) {
out.print("<option value='" + year.getId() + "' selected>" + year.getYear() + "</option>");
} else {
out.print("<option value='" + year.getId() + "'>" + year.getYear() + "</option>");
}
}
} else {
for (ClassYearBean year : classYearList) {
out.print("<option value='" + year.getId() + "'>" + year.getYear() + "</option>");
}
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Add Lecture</button>
<input type="hidden" name="action" value="add">
</form>
</div>
</div>
<a href="class">
<button class="btn btn-secondary">
Back
</button>
</a>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,149 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.ClassYearBean"%>
<%@page import="system.bean.TeacherBean"%>
<%@page import="system.bean.LectureDayBean"%>
<%@page import="system.bean.LectureTimeBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="class" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("dupMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>The Class Name is Created</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<jsp:useBean id="classBean" scope="request" class="system.bean.ClassBean" />
<jsp:useBean id="classYearList" scope="request" class="ArrayList<system.bean.ClassYearBean>" />
<jsp:useBean id="teacherList" scope="request" class="ArrayList<system.bean.TeacherBean>" />
<form action="class?id=<%= request.getParameter("id") %>" method="POST">
<table class="table">
<tr>
<th>Class Name</th>
<td><input type="text" name="class" class="form-control" value="<%= request.getAttribute("className") != null ? request.getAttribute("className") : classBean.getClassName()%>" required></td>
</tr>
<tr>
<th>Teacher</th>
<td>
<select name="teacherId" class="form-control" required="">
<%
if (request.getAttribute("teacherId") != null) {
for (TeacherBean teacher : teacherList) {
if (teacher.getId().equals(request.getAttribute("teacherId"))) {
out.print("<option value='" + teacher.getId() + "' selected>" + teacher.getTeacherFormalName() + "</option>");
} else {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
} else {
out.print("<option value='" + classBean.getTeacherBean().getId() + "' selected>" + classBean.getTeacherBean().getTeacherFormalName() + "</option>");
for (TeacherBean teacher : teacherList) {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Year</th>
<td>
<select name="yearId" class="form-control" required>
<% if (request.getAttribute("yearId") != null) {
for (ClassYearBean year : classYearList) {
if (year.getId().equals(request.getAttribute("yearId"))) {
out.print("<option value='" + year.getId() + "' selected>" + year.getYear() + "</option>");
} else {
out.print("<option value='" + year.getId() + "'>" + year.getYear() + "</option>");
}
}
} else {
for (ClassYearBean year : classYearList) {
if (classBean.getYear().equals(year.getYear())) {
out.print("<option value='" + year.getId() + "' selected>" + year.getYear() + "</option>");
} else {
out.print("<option value='" + year.getId() + "'>" + year.getYear() + "</option>");
}
}
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Save Lecture</button>
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%= request.getParameter("id")%>"
</form>
</div>
</div>
<a href="class">
<button class="btn btn-secondary">
Back
</button>
</a>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,155 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.SearchBean, system.bean.StudentBean, system.bean.ClassBean, system.bean.TeacherBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="ClassReg" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Student Registered Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("deletenMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Student #" + request.getAttribute("deletenMes") + " Class Deleted </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("saveMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Student Class #" + request.getAttribute("saveMes") + " Saved </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("addMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong> Added the student to Class #" + request.getAttribute("addMes") + "</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<div class="format-table">
<form action="classReg" method="POST" class="format">
<button type="submit" class="btn btn-primary">Add Student to Class</button>
<input type="hidden" name="action" value="addPage">
</form>
<button type="button" class="btn btn-info tableBtn" id="btnExportExcel"><i class="material-icons">save_alt</i></button>
<form class="form-inline float-right" action="classReg" method="POST">
<div class="form-group mb-2">
<font>Search: </font>
</div>
<div class="form-group mx-sm-3 mb-2">
<label class="sr-only">Password</label>
<input list="searchlist" type="text" class="form-control" name="searchVal" id="searchVal" placeholder="Search...">
<datalist id="searchlist">
<jsp:useBean scope="request" id="searchList" class="java.util.ArrayList<system.bean.SearchBean>"/>
<%
for (SearchBean search : searchList) {
out.print("<option label='" + search.getKeyword() + "' value='" + search.getKeyword() + "' />");
}
%>
</datalist>
</div>
<button type="submit" class="btn btn-dark mb-2">Search</button>
<input type="hidden" name="action" value="search">
</form>
<table class="table exportExcel">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Student Name</th>
<th>Class</th>
<th>Head Teacher</th>
<th>Action</th>
</tr>
</thead>
<jsp:useBean id="studentClassList" scope="request" class="java.util.ArrayList<system.bean.StudentBean>"/>
<%
if (studentClassList.size() > 0) {
for (StudentBean student : studentClassList) {
out.print("<tr>");
out.print("<td><a href='user?role=Student&searchVal=" + student.getId() + "&action=search'>" + student.getId() + "</a></td>");
out.print("<td>" + student.getName() + "</td>");
out.print("<td>" + student.getClassName().getClassName() + "</td>");
out.print("<td><a href='user?role=Teacher&searchVal=" + student.getClassName().getTeacherBean().getId() + "&action=search'>" + student.getClassName().getTeacherBean().getTeacherFormalName() + "</a></td>");
out.print("<td>");
out.print("<a href='classReg?id=" + student.getStudentClassid() + "'><button type='button' class='btn btn-info tableBtn'><i class='material-icons'>edit</i></button></a> ");
out.print("<a href='classReg?id=" + student.getStudentClassid() + "&action=delete'><button type='button' class='btn btn-danger tableBtn'><i class='material-icons'>delete</i></button></a>");
out.print("</td>");
out.print("</tr>");
}
out.print("</table>");
if (request.getAttribute("searchHis") != null) {
out.print("<br><br><br><br><br>");
out.print("<a href='classReg'><button type='button' class='btn btn-secondary'>Show All</button></a>");
}
} else {
out.print("<tr>");
out.print("<td colspon=5>Not Match Result</td>");
out.print("</tr>");
out.print("</table>");
out.print("<br><br><br><br><br>");
out.print("<a href='classReg'><button type='button' class='btn btn-secondary'>Show All</button></a>");
}
%>
</div>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "Class_Report.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,105 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="ClassReg" />
</div>
<jsp:useBean id="studnetIdList" scope="request" class="ArrayList<system.bean.StudentBean>"/>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Add Student Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("studnetIdList") != null && studnetIdList.size() < 1) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>No student need to class sign up</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<jsp:useBean id="classList" scope="request" class="ArrayList<system.bean.ClassBean>"/>
<form action="classReg" method="POST">
<table class="table">
<tr>
<th>Student ID</th>
<td>
<select name="id">
<%
for (StudentBean stBean : studnetIdList) {
out.print("<option value='" + stBean.getId() + "'>" + stBean.getId() + "</option>");
}
%>
</select>
</td>
</tr>
<tr>
<th>Class</th>
<td>
<select name="className">
<%
for (ClassBean classBean : classList) {
out.print("<option value='" + classBean.getClassName() + "'>" + classBean.getClassName() + "</option>");
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary" <% if (studnetIdList.size() < 1) {
out.print("disabled");
}%>>Saved</button>
<input type="hidden" name="action" value="add">
</form>
</div>
</div>
<a href="classReg"><button type="button" class="btn btn-secondary">Back</button></a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,105 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="ClassReg" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Class</h5>
</div>
<div class="card-body">
<br>
<jsp:useBean id="studentDetials" scope="request" class="system.bean.StudentBean"/>
<jsp:useBean id="classList" scope="request" class="ArrayList<system.bean.ClassBean>"/>
<form action="classReg" method="POST">
<table class="table">
<tr>
<th>Student Class ID</th>
<td>${studentClassID}</td>
</tr>
<tr>
<th>Student Name</th>
<td><jsp:getProperty name="studenBean" property="name"/></td>
</tr>
<tr>
<th>Student ID</th>
<td><jsp:getProperty name="studenBean" property="id"/></td>
</tr>
<tr>
<th>Gender</th>
<td><jsp:getProperty name="studenBean" property="gender"/></td>
</tr>
<tr>
<th>Birthday</th>
<td><jsp:getProperty name="studenBean" property="birthday"/></td>
</tr>
<tr>
<th>Class</th>
<td>
<select name="className">
<%
for (ClassBean classBean : classList) {
out.print("<option value='" + classBean.getClassName() + "'>" + classBean.getClassName() + "</option>");
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Saved</button>
<input type="hidden" name="id" value="${studentClassID}">
<input type="hidden" name="action" value="save">
</form>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>>
</body>
</html>

View File

@@ -0,0 +1,140 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<div class="list-group">
<a href="dashboard" class="list-group-item main-color-bg-nav">
<i class="material-icons">dashboard</i>
<span>Dashboard</span>
</a>
<a href="lecture" class="list-group-item main-color-bg-nav">
<i class="material-icons">view_module</i>
<span>Lecture</span>
</a>
<a href="class" class="list-group-item active">
<i class="material-icons">class</i><span> Class</span>
</a>
<a href="user?role=Student" class="list-group-item">
<i class="material-icons">library_books</i><span> Student</span>
</a>
<a href="user?role=Teacher" class="list-group-item">
<i class="material-icons">supervisor_account</i><span> Teacher</span>
</a>
<a href="user?role=Admin" class="list-group-item">
<i class="material-icons">vpn_key</i><span> Admin</span>
</a>
<a href="schedule" class="list-group-item">
<i class="material-icons">schedule</i><span> Schedule</span>
</a>
<a href="attendance" class="list-group-item">
<i class="material-icons">check_box</i
><span> Attendace</span>
</a>
<a href="report" class="list-group-item">
<i class="material-icons">insert_drive_file</i>
<span> Reports</span>
</a>
<a href="../login?action=logout" class="list-group-item text-right">
<span> Logout</span>
</a>
</div>
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Class</h5>
</div>
<div class="card-body">
<br>
<jsp:useBean id="studentDetials" scope="request" class="system.bean.StudentBean"/>
<jsp:useBean id="classList" scope="request" class="ArrayList<system.bean.ClassBean>"/>
<form action="class" method="POST">
<table class="table">
<tr>
<th>Student Class ID</th>
<td>${studentClassID}</td>
</tr>
<tr>
<th>Student Name</th>
<td><jsp:getProperty name="studenBean" property="name"/></td>
</tr>
<tr>
<th>Student ID</th>
<td><jsp:getProperty name="studenBean" property="id"/></td>
</tr>
<tr>
<th>Gender</th>
<td><jsp:getProperty name="studenBean" property="gender"/></td>
</tr>
<tr>
<th>Birthday</th>
<td><jsp:getProperty name="studenBean" property="birthday"/></td>
</tr>
<tr>
<th>Class</th>
<td>
<select name="className">
<%
for (ClassBean classBean : classList) {
out.print("<option value='" + classBean.getClassName() + "'>" + classBean.getClassName() + "</option>");
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Saved</button>
<input type="hidden" name="id" value="${studentClassID}">
<input type="hidden" name="action" value="save">
</form>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>>
</body>
</html>

View File

@@ -0,0 +1,71 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.LectureBean, system.bean.LectureDayBean, system.bean.LectureTimeBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="dashboard" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Overview</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2><i class="material-icons">library_books</i> ${courseCount}</h2>
<h4>Lecture</h4>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2> <i class="material-icons">school</i> ${studentCount}</h2>
<h4>Student</h4>
</div>
</div>
</div>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,147 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.SearchBean"%>
<%@page import="system.bean.LectureBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, system.bean.TeacherBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="lecture" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Lecture</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("deleteMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Lecture #" + request.getAttribute("deleteMes") + " Deleted </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("saveMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Lecture #" + request.getAttribute("saveMes") + " Saved </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
} else if (request.getAttribute("addMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong> Lecture Added</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<div class="format-table">
<form action="lecture" method="POST" class="format">
<button type="submit" class="btn btn-primary">Create Lecture</button>
<input type="hidden" name="action" value="addPage">
</form>
<form class="form-inline float-right" action="lecture" method="POST">
<div class="form-group mb-2">
<font>Search: </font>
</div>
<div class="form-group mx-sm-3 mb-2">
<label class="sr-only">Password</label>
<input list="searchlist" type="text" class="form-control" name="searchVal" id="searchVal" placeholder="Search...">
<datalist id="searchlist">
<jsp:useBean scope="request" id="searchList" class="java.util.ArrayList<system.bean.SearchBean>"/>
<%
for (SearchBean search : searchList) {
out.print("<option label='" + search.getKeyword() + "' value='" + search.getKeyword() + "' />");
}
%>
</datalist>
</div>
<button type="submit" class="btn btn-dark mb-2">Search</button>
<input type="hidden" name="action" value="search">
</form>
<div class="table-responsive">
<table class="table">
<thead class="thead-dark">
<tr>
<th>Lecture</th>
<th>Description</th>
<th>Time</th>
<th>Class</th>
<th>Day</th>
<th>Action</th>
</tr>
</thead>
<jsp:useBean id="lectureList" scope="request" class="java.util.ArrayList<system.bean.LectureBean>"/>
<% if (lectureList.size() == 0) {
out.print("<tr>");
out.print("<td colspon=5>Not Match Result</td>");
out.print("</tr>");
} else {
for (LectureBean lecture : lectureList) {
out.print("<tr>");
out.print("<td>" + lecture.getLecture() + "</td>");
out.print("<td>" + lecture.getDescription() + "</td>");
out.print("<td>" + lecture.getTime().getStartTime() + " - " + lecture.getTime().getEndTime() + "</td>");
out.print("<td>" + lecture.getClassName() + "</td>");
out.print("<td>" + lecture.getDay().getDay() + "</td>");
out.print("<td><a href='lecture?id=" + lecture.getId() + "'><button type='button' class='btn btn-info tableBtn'><i class='material-icons'>edit</i></button></a>");
out.print("<a href='lecture?id=" + lecture.getId() + "&action=delete'><button type='button' class='btn btn-danger tableBtn'><i class='material-icons'>delete</i></button></a>");
out.print("</td></tr>");
}
}
out.print("</table>");
if (lectureList.size() == 0) {
out.print("<br><br><br><br><br>");
out.print("<a href='lecture'><button type='button' class='btn btn-secondary'>Show All</button></a>");
}
%>
</table>
</div>
</div>
</div>
</div>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,193 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.TeacherBean"%>
<%@page import="system.bean.LectureDayBean"%>
<%@page import="system.bean.LectureTimeBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="lecture" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("dupMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>Teacher must attend other class</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<jsp:useBean id="classList" scope="request" class="ArrayList<system.bean.ClassBean>"/>
<jsp:useBean id="dayList" scope="request" class="ArrayList<system.bean.LectureDayBean>"/>
<jsp:useBean id="timeList" scope="request" class="ArrayList<system.bean.LectureTimeBean>" />
<jsp:useBean id="teacherList" scope="request" class="ArrayList<system.bean.TeacherBean>" />
<form action="lecture" method="POST">
<table class="table">
<tr>
<th>Lecture ID</th>
<td>The Lecutre ID will Auto generate</td>
</tr>
<tr>
<th>Lecture</th>
<td><input type="text" name="lecture" class="form-control" value="<%= request.getAttribute("lecture") != null ? request.getAttribute("lecture") : ""%>" required></td>
</tr>
<tr>
<th>Description</th>
<td><textarea class="form-control" name="description"><%= request.getAttribute("description") != null ? request.getAttribute("description") : ""%></textarea></td>
</tr>
<tr>
<th>Class</th>
<td>
<select name="className" required>
<%
if (request.getAttribute("className") != null) {
for (ClassBean className : classList) {
if (className.getId().equals(request.getAttribute("className"))) {
out.print("<option value='" + className.getId() + "' selected>" + className.getClassName() + "</option>");
} else {
out.print("<option value='" + className.getId() + "'>" + className.getClassName() + "</option>");
}
}
} else {
for (ClassBean className : classList) {
out.print("<option value='" + className.getId() + "'>" + className.getClassName() + "</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Time</th>
<td>
<select name="time" required>
<% if (request.getAttribute("time") != null) {
for (LectureTimeBean time : timeList) {
if (time.getId().equals(request.getAttribute("time"))) {
out.print("<option value='" + time.getId() + "' selected>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
} else {
out.print("<option value='" + time.getId() + "'>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
}
}
} else {
for (LectureTimeBean time : timeList) {
out.print("<option value='" + time.getId() + "'>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Day</th>
<td>
<select name="day" required>
<% if (request.getAttribute("day") != null) {
for (LectureDayBean day : dayList) {
if (day.getId().equals(request.getAttribute("day"))) {
out.print("<option value='" + day.getId() + "' selected>" + day.getDay() + "</option>");
} else {
out.print("<option value='" + day.getId() + "'>" + day.getDay() + "</option>");
}
}
} else {
for (LectureDayBean day : dayList) {
out.print("<option value='" + day.getId() + "'>" + day.getDay() + "</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Teacher</th>
<td>
<select name="teacher" required>
<%
out.print("<option value=''> </option>");
if (request.getAttribute("teacher") != null) {
for (TeacherBean teacher : teacherList) {
if (teacher.getId().equals(request.getAttribute("teacher"))) {
out.print("<option value='" + teacher.getId() + "' selected>" + teacher.getTeacherFormalName() + "</option>");
} else {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
} else {
for (TeacherBean teacher : teacherList) {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Add Lecture</button>
<input type="hidden" name="action" value="add">
</form>
</div>
</div>
<a href="lecture">
<button type="lecture" class="btn btn-secondary">
Back
</button>
</a>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,211 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="system.bean.TeacherBean"%>
<%@page import="system.bean.LectureDayBean"%>
<%@page import="system.bean.LectureTimeBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="lecture" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Class</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("dupMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>Teacher must attend other class</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<jsp:useBean id="lectureBean" scope="request" class="system.bean.LectureBean"/>
<jsp:useBean id="classList" scope="request" class="ArrayList<system.bean.ClassBean>"/>
<jsp:useBean id="dayList" scope="request" class="ArrayList<system.bean.LectureDayBean>"/>
<jsp:useBean id="timeList" scope="request" class="ArrayList<system.bean.LectureTimeBean>" />
<jsp:useBean id="teacherList" scope="request" class="ArrayList<system.bean.TeacherBean>" />
<form action="lecture?id=<%= request.getParameter("id")%>" method="POST">
<table class="table">
<tr>
<th>Lecture ID</th>
<td>${lectureId}</td>
</tr>
<tr>
<th>Lecture</th>
<td><input type="text" name="lecture" class="form-control" value="<%= request.getAttribute("lecture") != null ? request.getAttribute("lecture") : lectureBean.getLecture()%>" required></td>
</tr>
<tr>
<th>Description</th>
<td><textarea class="form-control" name="description"><%= request.getAttribute("description") != null ? request.getAttribute("description") : lectureBean.getDescription()%></textarea></td>
</tr>
<tr>
<th>Class</th>
<td>
<select name="className" required>
<%
if (request.getAttribute("className") != null) {
for (ClassBean className : classList) {
if (className.getId().equals(request.getAttribute("className"))) {
out.print("<option value='" + className.getId() + "' selected>" + className.getClassName() + "</option>");
} else {
out.print("<option value='" + className.getId() + "'>" + className.getClassName() + "</option>");
}
}
} else {
for (ClassBean className : classList) {
if (className.getClassName().equals(lectureBean.getClassName())) {
out.print("<option value='" + className.getId() + "' selected>" + className.getClassName() + "</option>");
} else {
out.print("<option value='" + className.getId() + "'>" + className.getClassName() + "</option>");
}
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Time</th>
<td>
<select name="time" required>
<%
if (request.getAttribute("time") != null) {
for (LectureTimeBean time : timeList) {
if (time.getId().equals(request.getAttribute("time"))) {
out.print("<option value='" + time.getId() + "' selected>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
} else {
out.print("<option value='" + time.getId() + "'>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
}
}
} else {
for (LectureTimeBean time : timeList) {
if (time.getStartTime().equals(lectureBean.getTime().getStartTime()) && time.getEndTime().equals(lectureBean.getTime().getEndTime())) {
out.print("<option value='" + time.getId() + "' selected>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
} else {
out.print("<option value='" + time.getId() + "'>" + time.getStartTime() + "-" + time.getEndTime() + "</option>");
}
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Day</th>
<td>
<select name="day" required>
<%
if (request.getAttribute("day") != null) {
for (LectureDayBean day : dayList) {
if (day.getId().equals(request.getAttribute("day"))) {
out.print("<option value='" + day.getId() + "' selected>" + day.getDay() + "</option>");
} else {
out.print("<option value='" + day.getId() + "'>" + day.getDay() + "</option>");
}
}
} else {
for (LectureDayBean day : dayList) {
if (day.getDay().equals(lectureBean.getDay().getDay())) {
out.print("<option value='" + day.getId() + "' selected>" + day.getDay() + "</option>");
} else {
out.print("<option value='" + day.getId() + "'>" + day.getDay() + "</option>");
}
}
}
%>
</select>
</td>
</tr>
<tr>
<th>Teacher</th>
<td>
<select name="teacher" >
<%
out.print("<option value=''> </option>");
if (request.getAttribute("teacher") != null) {
for (TeacherBean teacher : teacherList) {
if (teacher.getId().equals(request.getAttribute("teacher"))) {
out.print("<option value='" + teacher.getId() + "' selected>" + teacher.getTeacherFormalName() + "</option>");
} else {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
} else {
for (TeacherBean teacher : teacherList) {
if (teacher.getId().equals(lectureBean.getTeacherId())) {
out.print("<option value='" + teacher.getId() + "' selected>" + teacher.getTeacherFormalName() + "</option>");
} else {
out.print("<option value='" + teacher.getId() + "'>" + teacher.getTeacherFormalName() + "</option>");
}
}
}
%>
</select>
</td>
</tr>
</table>
<button type="submit" class="btn btn-primary">Saved</button>
<input type="hidden" name="id" value="${lectureId}">
<input type="hidden" name="action" value="save">
</form>
</div>
</div>
<a href="lecture">
<button type="lecture" class="btn btn-secondary">
Back
</button>
</a>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.ClassBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="report" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Select Class to Generate Report </h5>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col"> </th>
<th scope="col">Head</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
out.print("<tr data-href=\"report?class=" + classVal.getClassName() + "\">");
out.print("<td colspan=2>" + classVal.getClassName() + "</td>");
out.print("<td>" + classVal.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
})
});
</script>
</body>
</html>

View File

@@ -0,0 +1,257 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="java.util.Calendar"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.ClassBean, system.bean.SemesterBean, system.bean.StudentBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<%
String urlStudent = "report?";
if (request.getParameter("class") != null) {
urlStudent += "class=" + request.getParameter("class") + "&";
}
if (request.getParameter("year") != null) {
urlStudent += "year=" + request.getParameter("year") + "&";
} else {
urlStudent += "year=" + Calendar.getInstance().get(Calendar.YEAR) + "&";
}
if (request.getParameter("term") != null) {
urlStudent += "term=" + request.getParameter("term") + "&";
} else {
urlStudent += "term=1&";
}
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="report" />
</div>
<div class="col-lg-9">
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Select Class to Generate Report</h5>
</div>
<form action="report" method="GET">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<select class="form-control" name="class">
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<% for (ClassBean classVal : classList) {
if (request.getParameter("class").equals(classVal.getClassName())) {
out.print("<option value='" + classVal.getClassName() + "' selected>" + classVal.getClassName() + "</option>");
} else {
out.print("<option value='" + classVal.getClassName() + "'>" + classVal.getClassName() + "</option>");
}
}
%>
</select>
</div>
<div class="form-group">
<label>Year</label>
<select class="form-control" name="year">
<jsp:useBean id="yearList" scope="request" class="java.util.ArrayList<system.bean.SemesterBean>"/>
<%
int counter = 1;
for (SemesterBean year : yearList) {
if (counter == 1) {
out.print("<option value='" + year.getYear() + "' selected>" + year.getYear() + "</option>");
} else {
out.print("<option value='" + year.getYear() + "'>" + year.getYear() + "</option>");
}
counter++;
}
%>
</select>
</div>
<div class="form-group">
<label>Term</label>
<select class="form-control" name="term">
<jsp:useBean id="termList" scope="request" class="java.util.ArrayList<system.bean.SemesterBean>"/>
<%
int count = 1;
for (SemesterBean term : termList) {
if (count == 1) {
out.print("<option value='" + term.getTerm() + "' selected>" + term.getTerm() + " term</option>");
} else {
out.print("<option value='" + term.getTerm() + "'>" + term.getTerm() + " term</option>");
}
count++;
}
%>
</select>
</div>
<br>
<input type="hidden" name="report" id="report" value="">
<button type="button" id="btnGenReport" class="btn btn-primary right">Generate</button>
<button type="button" id="btnGenLowReport" class="btn btn-danger">Generate Low Attendance</button>
</div>
</form>
</div>
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title"> Report </h5>
</div>
<div class="card-body">
<canvas id="reportChart" width="50px"></canvas>
Average Attendance (%): ${attendAVG}
</div>
</div>
<!-- Website Overview -->
<div class="card">
<div class="card-body">
<button type="button" id="btnExportExcel" class="btn btn-outline-info">Export Attendance Data to Excel</button>
<br><br>
<div class="form-group">
<table class="table table-hover exportExcel">
<thead>
<tr>
<th scope="col">Student ID</th>
<th scope="col">Student Name</th>
<th scope="col">Attend Rate</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="studentAttendList" scope="request" class="java.util.ArrayList<system.bean.StudentBean>"/>
<%
for (StudentBean student : studentAttendList) {
out.print("<tr data-href='" + urlStudent + "studentId=" + student.getId() + "'>");
out.print("<td>" + student.getId() + "</td>");
out.print("<td>" + student.getName() + "</td>");
out.print("<td>" + student.getAttendRate() + " %</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
<a href="report">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
</div>
</div>
</section>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
});
$("#btnGenReport").click(function(){
$("form").submit();
});
$("#btnGenLowReport").click(function(){
$("#report").val("low");
$("form").submit();
});
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "<%= request.getParameter("studentId") + "_Report"%>.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
</script>
<script>
let reportChart = document.getElementById('reportChart').getContext('2d');
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontSize = 18;
Chart.defaults.global.defaultFontColor = 'black';
let massPopChart = new Chart(reportChart, {
type: 'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data: {
<%
if(request.getParameter("report") != null && request.getParameter("report").equals("low"))
out.print("labels: ['Student < 39%','Student 40-49%', 'Student 50-60%']");
else
out.print("labels: ['Student < 60%', 'Student >=60%']");
%>,
datasets: [{
label: 'Population',
data: [
<%
if(request.getParameter("report") != null && request.getParameter("report").equals("low"))
out.print(request.getAttribute("numberOfStudentLowAtt") + ", " + request.getAttribute("numberOfStudentDanger") + ", " + request.getAttribute("numberOfStudentWarning"));
else
out.print(request.getAttribute("numberOfStudentNotMeetTar") + ", " + request.getAttribute("numberOfStudentMeetTar"));
%>
],
//backgroundColor:'green',
backgroundColor: [
'rgba(236, 107, 86, 0.6)',
'rgba(71, 179, 156, 0.9)',
'rgba(88,80,141,0.8)'
],
borderWidth: 1,
borderColor: '#777',
hoverBorderWidth: 3,
hoverBorderColor: '#000'
}]
},
options: {
title: {
display: true,
text: 'Meet the Attendance Target',
fontSize: 20
},
legend: {
display: true,
position: 'right',
labels: {
fontColor: '#000'
}
},
layout: {
padding: {
left: 30,
right: 0,
bottom: 0,
top: 0
}
},
tooltips: {
enabled: true
}
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,191 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.AttendBean, system.bean.StudentBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="report" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Student Report</h5>
</div>
<div class="card-body">
<button type="button" id="btnExportExcel" class="btn btn-outline-info">Export Attendance Data to Excel</button>
<br><br>
<jsp:useBean id="studentDetials" scope="request" class="system.bean.StudentBean"/>
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">Student ID:</th>
<td><jsp:getProperty name="studentDetials" property="id"/></td>
</tr>
<tr>
<th scope="row">Student Name:</th>
<td><jsp:getProperty name="studentDetials" property="name"/></td>
</tr>
<tr>
<th scope="row">Gender :</th>
<td><jsp:getProperty name="studentDetials" property="gender"/></td>
</tr>
<tr>
<th scope="row">Student Email:</th>
<td><jsp:getProperty name="studentDetials" property="email"/></td>
</tr>
<tr>
<th scope="row">Birthday:</th>
<td><jsp:getProperty name="studentDetials" property="birthday"/></td>
</tr>
</tbody>
</table>
<div class="card">
<div class="card-body">
<canvas id="reportChart" width="50px"></canvas>
<table>
<tr>
<td>Total Present Day: </td>
<td> ${totalAttendDay}</td>
</tr>
<tr>
<td>Present Day: </td>
<td> ${presentDay}</td>
</tr>
<tr>
<td>Absent: </td>
<td> ${absDay}</td>
</tr>
</table>
</div>
</div>
<table class="table table-hover exportExcel">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Date</th>
<th>Attend</th>
</tr>
</thead>
<%
int id = 1;
for (AttendBean attend : studentDetials.getAttendList()) {
out.print("<tr>");
out.print("<td>" + (id++) + "</td>");
out.print("<td>" + attend.getDate() + "</td>");
if (attend.isAttend()) {
out.print("<td><a href='#' class='badge badge-success'>Present</a></td>");
} else {
out.print("<td><a href='#' class='badge badge-danger'>Absent</a></td>");
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
<a href="report?class=<%= request.getParameter("class")%>&year=<%= request.getParameter("year")%>&term=<%= request.getParameter("term")%>">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script>
$(document).ready(function () {
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "<%= request.getParameter("studentId") + "_Report"%>.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
let reportChart = document.getElementById('reportChart').getContext('2d');
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontSize = 18;
Chart.defaults.global.defaultFontColor = 'black';
let massPopChart = new Chart(reportChart, {
type: 'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data: {
labels: ['Present(%)', 'Absent(%)'],
datasets: [{
label: false,
data: [
Math.round(${presentDay/totalAttendDay*100}),
Math.round(${absDay/totalAttendDay*100})
],
//backgroundColor:'green',
backgroundColor: [
'rgba(71, 179, 156, 0.9)',
'rgba(236, 107, 86, 0.6)'
],
borderWidth: 1,
borderColor: '#777',
hoverBorderWidth: 3,
hoverBorderColor: '#000'
}]
},
options: {
title: {
display: true,
text: 'Attendance',
fontSize: 20
},
legend: {
display: true,
position: 'right',
labels: {
fontColor: '#000'
}
},
layout: {
padding: {
left: 20,
right: 0,
bottom: 0,
top: 0
}
},
tooltips: {
enabled: true
}
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,95 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="Schdeule" />
</div>
<div class="col-lg-9">
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Schedule</h5>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Schedule</th>
</tr>
</thead>
<tr data-href="schedule?class=schoolDay">
<td colspon="3">School Day Schedule</td>
</tr>
</table>
<br><br>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col"> </th>
<th scope="col">Head</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
out.print("<tr data-href=\"schedule?class=" + classVal.getId()+ "\">");
out.print("<td colspan=2>" + classVal.getClassName() + "</td>");
out.print("<td>" + classVal.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
})
});
</script>
</body>
</html>

View File

@@ -0,0 +1,123 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.LectureBean, system.bean.LectureDayBean, system.bean.LectureTimeBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="Schdeule" />
</div>
<div class="col-lg-9">
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Schedule</h5>
</div>
<div class="card-body">
<jsp:useBean id="dayList" scope="request" class="java.util.ArrayList<system.bean.LectureDayBean>"/>
<jsp:useBean id="timeList" scope="request" class="java.util.ArrayList<system.bean.LectureTimeBean>"/>
<jsp:useBean id="lectureList" scope="request" class="java.util.ArrayList<system.bean.LectureBean>"/>
<table class="table table-bordered table-hover text-center">
<%
out.print("<tr>");
out.print("<th> Time </th>");
for (LectureDayBean day : dayList) {
out.print("<th>DAY " + day.getDay() + "</th>");
}
String[] schoolDays = {"A", "B", "C", "D", "E", "F"};
out.print("</tr>");
int countDay = dayList.size();
for (LectureTimeBean time : timeList) {
out.print("<tr>");
out.print("<td>" + time.getStartTime() + "-" + time.getEndTime());
int count = 0;
int countPrint = 0;
loopout:
for (String schoolDay : schoolDays) {
boolean printed = false;
System.out.println("TEST---" + schoolDay);
for (LectureBean lecture : lectureList) {
if (lecture.getTime().getStartTime().equals(time.getStartTime()) && lecture.getTime().getEndTime().equals(time.getEndTime())) {
if (lecture.getTime().isFullweek()) {
System.out.println("FullWEEK");
out.print("<td colspan='" + dayList.size() + "'>" + lecture.getLecture() + "</td>");
break loopout;
} else {
System.out.println("Lecture---" + lecture.getDay().getDay());
if (schoolDay.equalsIgnoreCase(lecture.getDay().getDay())) {
System.out.println("printed");
out.print("<td>" + lecture.getLecture() + "</td>");
printed = true;
countPrint++;
}
}
}
count++;
}
if (!printed) {
System.out.println("NOTPrintandPrintTDTD");
out.print("<td></td>");
}
if (lectureList.size() == 0) {
for (int i = dayList.size(); i > 0; i--) {
out.print("<td></td>");
}
}
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
<a href="schedule"><button type="button" class="btn btn-secondary">Back</button></a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,307 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.GregorianCalendar"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.LectureBean, system.bean.LectureDayBean, system.bean.LectureTimeBean, system.bean.SchedulerBean"%>
<!DOCTYPE html>
<%
String[] dayOfweeks = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
String[] months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
String[] schoolDay = {"A", "B", "C", "D", "E", "F"};
GregorianCalendar calendar = new GregorianCalendar(2019, 8, 1);
GregorianCalendar preCalendar = new GregorianCalendar(2019, 7, 1);
SimpleDateFormat dateFormal = new SimpleDateFormat("yyyy-MM-dd");
String event = "";
%>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="Schdeule" />
</div>
<div class="col-lg-9">
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Scheel Calendar List</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("deleteMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Schedule #" + request.getAttribute("deleteMes") + " Deleted </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
if (request.getAttribute("addMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Schedule Added </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
if (request.getAttribute("saveMes") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show formated-table' role='alert'>");
out.print("<strong>Schedule #" + request.getAttribute("saveMes") + " Saved </strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<form action="schedule?class=schoolDay" method="POST" class="format">
<button type="submit" class="btn btn-primary">Add Day</button>
<input type="hidden" name="action" value="addPage">
</form>
<form class="form-inline float-right" action="schedule?class=schoolDay" method="POST">
<div class="form-group mb-2">
<font>Search: </font>
</div>
<div class="form-group mx-sm-3 mb-2">
<input list="searchlist" type="text" class="form-control" name="searchVal" id="searchVal" placeholder="Search...">
</div>
<button type="submit" class="btn btn-dark mb-2">Search</button>
<input type="hidden" name="action" value="search">
</form>
<jsp:useBean id="scheduleAllList" scope="request" class="java.util.ArrayList<system.bean.SchedulerBean>"/>
<table class="table">
<thead class="thead-dark">
<th>Title</th>
<th>Start Date</th>
<th>End Date</th>
<th>Holiday</th>
<th>School Day</th>
<th>Action</th>
</thead>
<%
for (SchedulerBean schedule : scheduleAllList) {
out.print("<tr>");
out.print("<td>" + schedule.getTitle() + "</td>");
out.print("<td>" + schedule.getStart_date() + "</td>");
out.print("<td>" + schedule.getEnd_date() + "</td>");
out.print("<td>" + schedule.isHoliday() + "</td>");
out.print("<td>" + schedule.isSchoolDay() + "</td>");
out.print("<td>");
out.print("<a href='schedule?class=schoolDay&id=" + schedule.getId() + "'><button type='button' class='btn btn-info tableBtn'><i class='material-icons'>edit</i></button></a> ");
out.print("<a href='schedule?class=schoolDay&id=" + schedule.getId() + "&action=delete'><button type='button' class='btn btn-danger tableBtn'><i class='material-icons'>delete</i></button></a>");
out.print("</td>");
out.print("</tr>");
}
%>
</table>
</div>
</div>
<a href="schedule"><button type="button" class="btn btn-secondary">Back</button></a>
<br>
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Scheel Calendar</h5>
</div>
<jsp:useBean id="scheduleList" scope="request" class="java.util.ArrayList<system.bean.SchedulerBean>"/>
<div class="card-body">
<table class="table">
<thead>
<% out.print("<tr>");
out.print("<th>Month</th>");
for (String dayOfweek : dayOfweeks) {
out.print("<th>" + dayOfweek + "</th>");
}
out.print("<th>Events</th>");
out.print("</tr>");
%>
</thead>
<%
out.print("<tr>");
int schoolDayPointer = 0;
int lastCache = 0;
for (int i = 0; i <= months.length; i++) {
int fillError = 0;
if (calendar.get(Calendar.MONTH) == 4 || calendar.get(Calendar.MONTH) == 7) {
fillError = 1;
}
out.print("<td rowspan=\"" + (Calendar.WEEK_OF_MONTH + 1 + fillError) + "\">" + (calendar.get(Calendar.MONTH) + 1) + "</td>");
System.out.println((Calendar.WEEK_OF_MONTH + 1 + fillError) + "testW");
int weekDay = 7;
for (int countDay = calendar.getActualMaximum(calendar.DAY_OF_MONTH); countDay > 0; countDay--) {
boolean hasEventDay = false;
if (schoolDayPointer == schoolDay.length) {
schoolDayPointer = 0;
}
if (weekDay <= 0) {
out.print("<td>" + event + "</td>");
out.print("</tr>");
out.print("<tr>");
weekDay = 7;
event = "";
}
String today = dateFormal.format(calendar.getTime());
System.out.println(today);
for (SchedulerBean schedule : scheduleList) {
if (schedule.getStart_date().equalsIgnoreCase(today)) {
hasEventDay = true;
if (!schedule.getEnd_date().equalsIgnoreCase(schedule.getStart_date())) {
event += schedule.getStart_day_Date() + "." + schedule.getStart_day_Month() + " - " + schedule.getEnd_day_Date() + "." + schedule.getEnd_day_Month() + " " + schedule.getTitle() + "<br>";
System.out.println(schedule.getCountDate());
for (int count = schedule.getCountDate(); count >= 0; count--) {
if (count == 0) {
hasEventDay = false;
}
if (calendar.get(Calendar.DATE) == 1 && lastCache > 0) {
if (lastCache >= 7) {
out.print("<td>" + calendar.get(Calendar.DATE) + "*</td>");
} else {
for (int printCache = lastCache; printCache > 0; printCache--) {
System.out.println("<td></td>");
}
out.print("<td>" + calendar.get(Calendar.DATE) + "*</td>");
weekDay -= lastCache;
}
} else if (calendar.get(Calendar.DAY_OF_WEEK) == 1 || calendar.get(Calendar.DAY_OF_WEEK) == 7) {
out.print("<td>" + calendar.get(Calendar.DATE) + "*</td>");
} else {
if (weekDay == 0) {
out.print("<td>" + event + "</td>");
out.print("</tr>");
out.print("<tr>");
if (schedule.isHoliday() || !schedule.isSchoolDay()) {
out.print("<td>*" + calendar.get(Calendar.DATE) + "*</td>");
} else {
out.print("<td>*" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "^</td>");
schoolDayPointer++;
if (schoolDayPointer == schoolDay.length) {
schoolDayPointer = 0;
}
}
weekDay = 7;
} else {
if (schedule.isHoliday() || !schedule.isSchoolDay()) {
out.print("<td>" + calendar.get(Calendar.DATE) + "*</td>");
} else {
out.print("<td>" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "^</td>");
schoolDayPointer++;
if (schoolDayPointer == schoolDay.length) {
schoolDayPointer = 0;
}
}
}
}
calendar.add(Calendar.DAY_OF_WEEK, 1);
weekDay--;
countDay--;
System.out.println(weekDay + "zz");
System.out.println(calendar.get(Calendar.DATE) + "hlo");
System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
if (weekDay == 0) {
out.print("<td>" + event + "</td>");
out.print("</tr>");
out.print("<tr>");
weekDay = 7;
event = "";
}
}
} else {
if (schedule.isHoliday() || !schedule.isSchoolDay()) {
out.print("<td>" + calendar.get(Calendar.DATE) + "*</td>");
} else {
out.print("<td>" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "^</td>");
schoolDayPointer++;
if (schoolDayPointer == schoolDay.length) {
schoolDayPointer = 0;
}
}
}
event += schedule.getEnd_day_Date() + "." + schedule.getEnd_day_Month() + " " + schedule.getTitle() + "<br>";
System.out.println("TODAY " + today);
}
}
System.out.println(calendar.get(Calendar.DATE) + "weekday");
System.out.println(calendar.get(Calendar.DAY_OF_WEEK) + "week");
System.out.println(hasEventDay);
if (!hasEventDay && calendar.get(Calendar.DATE) == 1 && lastCache >= 7) {
if (hasEventDay == false && (calendar.get(Calendar.DAY_OF_WEEK) == 1 || calendar.get(Calendar.DAY_OF_WEEK) == 7)) {
out.print("<td>" + calendar.get(Calendar.DATE) + "</td>");
} else if (!hasEventDay && calendar.get(Calendar.DAY_OF_WEEK) != 1 && calendar.get(Calendar.DAY_OF_WEEK) != 7) {
out.print("<td>" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "</td>");
schoolDayPointer++;
}
} else if (!hasEventDay && calendar.get(Calendar.DATE) == 1 && lastCache > 0) {
for (int printCache = lastCache; printCache > 0; printCache--) {
out.print("<td></td>");
}
if (hasEventDay == false && (calendar.get(Calendar.DAY_OF_WEEK) == 1 || calendar.get(Calendar.DAY_OF_WEEK) == 7)) {
out.print("<td>" + calendar.get(Calendar.DATE) + "</td>");
} else if (!hasEventDay && calendar.get(Calendar.DAY_OF_WEEK) != 1 && calendar.get(Calendar.DAY_OF_WEEK) != 7) {
out.print("<td>" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "</td>");
schoolDayPointer++;
}
weekDay -= lastCache;
} else if (!hasEventDay && calendar.get(Calendar.DAY_OF_WEEK) != 1 && calendar.get(Calendar.DAY_OF_WEEK) != 7) {
out.print("<td>" + calendar.get(Calendar.DATE) + schoolDay[schoolDayPointer] + "</td>");
schoolDayPointer++;
} else if (hasEventDay == false && (calendar.get(Calendar.DAY_OF_WEEK) == 1 || calendar.get(Calendar.DAY_OF_WEEK) == 7)) {
out.print("<td>" + calendar.get(Calendar.DATE) + "</td>");
}
if (weekDay == 0) {
out.print("<td>" + event + "</td>");
out.print("</tr>");
out.print("<tr>");
}
System.out.println(weekDay);
weekDay--;
if (countDay == 1) {
lastCache = calendar.get(Calendar.DAY_OF_WEEK);
}
calendar.add(Calendar.DAY_OF_WEEK, 1);
}
out.print("</tr>");
}
out.print("</tr>");
%>
</table>
</div>
</div>
<a href="schedule"><button type="button" class="btn btn-secondary">Back</button></a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,131 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
</head>
<%
String role = request.getParameter("role");
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="Schedule" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Information</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("errMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>School Day and Holiday can not checked in same time</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
if (request.getAttribute("notselectMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>The checkbox must select at least one</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<form action="schedule?class=schoolDay" method="POST">
<table class="table">
<tr>
<th>Title</th>
<th><textarea name="title" class="form-control" required><%= request.getAttribute("title") != null ? request.getAttribute("title") : ""%></textarea></th>
</tr>
<tr>
<th>Start Date</th>
<td>
<div class="form-group">
<div class="input-group date">
<input type="date" class="form-control" id="startDatedatepicker" name="startDate" value="<%= request.getAttribute("startDate") != null ? request.getAttribute("startDate") : ""%>" required>
</div>
</div>
</td>
</tr>
<tr>
<th>End Date</th>
<td>
<div class="form-group">
<div class="input-group date">
<input type="date" class="form-control" id="endDatedatepicker" name="endDate" value="<%= request.getAttribute("endDate") != null ? request.getAttribute("endDate") : ""%>" required>
</div>
</div>
</td>
</tr>
<tr>
<th>Holiday</th>
<td><input type='checkbox' class="form-check-input" name="holiday" value="isHoliday"></td>
</tr>
<tr>
<th>School Day</th>
<td><input type="checkbox" class="form-check-input" name="schoolDay" value="isSchoolDay"></td>
</tr>
</table>
<button type="btn" class="btn btn-primary">Add to Schedule</button>
<input type="hidden" name="action" value="add">
</form>
</div>
</div>
<a href="schedule?class=schoolDay"><button type="button" class="btn btn-secondary">Back</button></a>
<!-- Latest Users -->
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-datepicker.min.js"></script>
<script>
$(document).ready(function () {
$('#startDatedatepicker').datepicker({
format: "yyyy-mm-dd",
todayHighlight: true
});
$('#endDatedatepicker').datepicker({
format: "yyyy-mm-dd",
todayHighlight: true
});
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,141 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.StudentBean, system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
</head>
<%
String role = request.getParameter("role");
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Admin" active="Schedule" />
</div>
<jsp:useBean id="scheduleBean" scope="request" class="system.bean.SchedulerBean"/>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Edit Student Information</h5>
</div>
<div class="card-body">
<%
if (request.getAttribute("errMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>School Day and Holiday can not checked in same time</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
if (request.getAttribute("notselectMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>The checkbox must select at least one</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<br>
<form action="schedule?class=schoolDay" method="POST">
<table class="table">
<tr>
<th>Title</th>
<th><textarea name="title" class="form-control" required><%= request.getAttribute("title") != null ? request.getAttribute("title") : scheduleBean.getTitle() %></textarea></th>
</tr>
<tr>
<th>Start Date</th>
<td>
<div class="form-group">
<div class="input-group date">
<input type="date" class="form-control" id="startDatedatepicker" name="startDate" value="<%= request.getAttribute("startDate") != null ? request.getAttribute("startDate") : scheduleBean.getStart_date() %>" required>
</div>
</div>
</td>
</tr>
<tr>
<th>End Date</th>
<td>
<div class="form-group">
<div class="input-group date">
<input type="date" class="form-control" id="endDatedatepicker" name="endDate" value="<%= request.getAttribute("endDate") != null ? request.getAttribute("endDate") : scheduleBean.getEnd_date() %>" required>
</div>
</div>
</td>
</tr>
<%
String holiday ="";
String schoolDay = "";
if(scheduleBean.isHoliday())
holiday = "checked";
if(scheduleBean.isSchoolDay())
schoolDay = "checked";
%>
<tr>
<th>Holiday</th>
<td><input type='checkbox' class="form-check-input" name="holiday" value="isHoliday" <%= holiday %>></td>
</tr>
<tr>
<th>School Day</th>
<td><input type="checkbox" class="form-check-input" name="schoolDay" value="isSchoolDay" <%= schoolDay %>></td>
</tr>
</table>
<button type="btn" class="btn btn-primary">Save Schedule</button>
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%= request.getParameter("id") %>">
</form>
</div>
</div>
<a href="schedule?class=schoolDay"><button type="button" class="btn btn-secondary">Back</button></a>
<!-- Latest Users -->
<a href="schedule?class=schoolDay"><button type="button" class="btn btn-secondary">Back</button></a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-datepicker.min.js"></script>
<script>
$(document).ready(function () {
$('#startDatedatepicker').datepicker({
format: "yyyy-mm-dd",
todayHighlight: true
});
$('#endDatedatepicker').datepicker({
format: "yyyy-mm-dd",
todayHighlight: true
});
$('.alert').alert();
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,355 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : 2019/10/31, 下午 05:12:58
Author : jerrykwok
*/
@font-face {
font-family: Raleway-Regular;
src: url('../fonts/raleway/Raleway-Regular.ttf');
}
@font-face {
font-family: Raleway-Medium;
src: url('../fonts/raleway/Raleway-Medium.ttf');
}
@font-face {
font-family: Raleway-SemiBold;
src: url('../fonts/raleway/Raleway-SemiBold.ttf');
}
@font-face {
font-family: Raleway-Bold;
src: url('../fonts/raleway/Raleway-Bold.ttf');
}
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body, html {
height: 100%;
font-family: Raleway-Regular, sans-serif;
}
a {
font-family: Raleway-Regular;
font-size: 14px;
line-height: 1.7;
color: #666666;
margin: 0px;
transition: all 0.4s;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
}
a:focus {
outline: none !important;
}
a:hover {
text-decoration: none;
color: black;
}
h1,h2,h3,h4,h5,h6 {
margin: 0px;
}
p {
font-family: Raleway-Regular;
font-size: 14px;
line-height: 1.7;
color: #666666;
margin: 0px;
}
ul, li {
margin: 0px;
list-style-type: none;
}
input {
outline: none;
border: none;
}
textarea {
outline: none;
border: none;
}
textarea:focus, input:focus {
border-color: transparent !important;
}
label {
display: block;
margin: 0;
}
button {
outline: none !important;
border: none;
background: transparent;
}
button:hover {
cursor: pointer;
}
.card{
margin-bottom: 20px;
background-color: #fff;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.list-group{
margin-bottom: 20px;
}
.card-header {
padding: 0.85rem 1.25rem 0;
}
iframe {
border: none !important;
}
.material-icons {
font-size: 20px !important;
margin-right: 10px;
}
.container-login {
width: 100%;
min-height: 100vh;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
background-color: #ebebeb;
}
.wrap-login {
width: 560px;
background: #fff;
border-radius: 10px;
position: relative;
padding: 80px;
min-height: 570px;
}
.login-form {
width: 100%;
}
.login-form-title {
font-family: Raleway-Medium;
font-size: 30px;
color: #555555;
line-height: 1.2;
text-transform: uppercase;
text-align: left;
width: 100%;
display: block;
}
.wrap-input-login {
width: 100%;
position: relative;
background-color: #fff;
border: 1px solid #e6e6e6;
border-radius: 2px;
}
.input-login {
font-family: Raleway-Medium;
color: #555555;
line-height: 1.2;
font-size: 18px;
display: block;
width: 100%;
background: transparent;
height: 55px;
padding: 0 25px 0 25px;
}
.container-login-form-btn {
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
}
.login-form-btn {
font-family: Raleway-Bold;
font-size: 16px;
color: #fff;
line-height: 1.2;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
justify-content: center;
align-items: center;
padding: 0 20px;
min-width: 150px;
height: 55px;
background-color: grey;
border-radius: 27px;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
.login-form-btn:hover {
background-color: black;
}
.bs-callout {
padding: 20px;
margin: 30px 0;
border: 1px solid #BEBEBE;
border-left-width: 5px;
border-radius: 0px;
}
.bs-callout h5 {
margin-top: 0;
margin-top: 10px;
}
.bs-callout p:last-child {
margin-bottom: 0;
}
.bs-callout code {
border-radius: 3px;
}
.bs-callout+.bs-callout {
margin-top: -5px;
}
.bs-callout-default {
border-left-color: black;
}
.bs-callout-primary {
border-left-color: gray;
}
.bs-callout-success {
border-left-color: #5cb85c;
}
.bs-callout-danger {
border-left-color: #d9534f;
}
.bs-callout-warning {
border-left-color: #f0ad4e;
}
.bs-callout-info {
border-left-color: #5bc0de;
}
#main{
min-height: 746px;
}
.main-color-bg{
background-color: black !important;
color:#ffffff !important;
}
.list-group a{
font-weight: bold;
}
.header{
background-color: #2D2D2D;
color:#fff;
padding: 20px;
margin-bottom: 15px;
}
.header .userTitle{
margin-top: 10px;
}
.dash-box{
text-align:center;
}
tr[data-href]{
cursor: pointer;
}
.tableBtn {
width: 35px;
height: 35px;
}
.tableBtn i{
margin-left: -5px;
}
.format{
display: inline;
}
.format-table{
margin-top: 50px;
}
footer{
background:#333333;
color:#ffffff;
text-align:center;
padding:30px;
margin-top:30px;
bottom: 0;
width: 100%
}
@media (max-width: 576px) {
.wrap-login {
padding-left: 15px;
padding-right: 15px;
}
}
@media (max-width: 767px) {
#header .userTitle{
margin-top: 0;
}
}
@media (max-width: 990px){
footer{
position: relative;
bottom: 0;
}
#main{
min-height: 760px;
}
}

View File

@@ -0,0 +1,95 @@
Copyright (c) 2010, Matt McInerney (matt@pixelspread.com),
Copyright (c) 2011, Pablo Impallari (www.impallari.com|impallari@gmail.com),
Copyright (c) 2011, Rodrigo Fuenzalida (www.rfuenzalida.com|hello@rfuenzalida.com), with Reserved Font Name Raleway
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -0,0 +1,12 @@
<div class="header">
<div class="container">
<div class="row">
<div class="col-sm-10">
<h3>Class Attendance System</h3>
</div>
<div class="col-sm-2 userTitle text-right">
<h6>Hello, <%= session.getAttribute("username") %></h6>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,61 @@
<%--
Document : index
Created on : 2019/10/31, 下午 04:52:53
Author : jerrykwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container-login">
<div class="wrap-login">
<%
if (request.getAttribute("roleMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("<strong>Error Role!</strong> You should select the role.");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span>");
out.print("</button></div><br>");
}
%>
<form class="login-form" action="/login" method="POST">
<span class="login-form-title">
Account Login
</span>
<p>Please select your role</p>
<div class="loginFormRole mx-auto">
<a href="login?role=Student" class="blockquote text-center">
<div class="bs-callout bs-callout-deflaut rounded">
<h5>Student</h5>
</div>
</a>
<a href="login?role=Teacher" class="blockquote text-center">
<div class="bs-callout bs-callout-primary rounded">
<h5>Teacher</h5>
</div>
</a>
<a href="login?role=Admin" class="blockquote text-center">
<div class="bs-callout bs-callout-info rounded">
<h5>Admin</h5>
</div>
</a>
</div>
</form>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,267 @@
/*
* jQuery table2excel - v1.1.2
* jQuery plugin to export an .xls file in browser from an HTML table
* https://github.com/rainabba/jquery-table2excel
*
* Made by rainabba
* Under MIT License
*/
//table2excel.js
(function ( $, window, document, undefined ) {
var pluginName = "table2excel",
defaults = {
exclude: ".noExl",
name: "Table2Excel",
filename: "table2excel",
fileext: ".xls",
exclude_img: true,
exclude_links: true,
exclude_inputs: true,
preserveColors: false
};
// The actual plugin constructor
function Plugin ( element, options ) {
this.element = element;
// jQuery has an extend method which merges the contents of two or
// more objects, storing the result in the first object. The first object
// is generally empty as we don't want to alter the default options for
// future instances of the plugin
//
this.settings = $.extend( {}, defaults, options );
this._defaults = defaults;
this._name = pluginName;
this.init();
}
Plugin.prototype = {
init: function () {
var e = this;
var utf8Heading = "<meta http-equiv=\"content-type\" content=\"application/vnd.ms-excel; charset=UTF-8\">";
e.template = {
head: "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\">" + utf8Heading + "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>",
sheet: {
head: "<x:ExcelWorksheet><x:Name>",
tail: "</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"
},
mid: "</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body>",
table: {
head: "<table>",
tail: "</table>"
},
foot: "</body></html>"
};
e.tableRows = [];
// Styling variables
var additionalStyles = "";
var compStyle = null;
// get contents of table except for exclude
$(e.element).each( function(i,o) {
var tempRows = "";
$(o).find("tr").not(e.settings.exclude).each(function (i,p) {
// Reset for this row
additionalStyles = "";
// Preserve background and text colors on the row
if(e.settings.preserveColors){
compStyle = getComputedStyle(p);
additionalStyles += (compStyle && compStyle.backgroundColor ? "background-color: " + compStyle.backgroundColor + ";" : "");
additionalStyles += (compStyle && compStyle.color ? "color: " + compStyle.color + ";" : "");
}
// Create HTML for Row
tempRows += "<tr style='" + additionalStyles + "'>";
// Loop through each TH and TD
$(p).find("td,th").not(e.settings.exclude).each(function (i,q) { // p did not exist, I corrected
// Reset for this column
additionalStyles = "";
// Preserve background and text colors on the row
if(e.settings.preserveColors){
compStyle = getComputedStyle(q);
additionalStyles += (compStyle && compStyle.backgroundColor ? "background-color: " + compStyle.backgroundColor + ";" : "");
additionalStyles += (compStyle && compStyle.color ? "color: " + compStyle.color + ";" : "");
}
var rc = {
rows: $(this).attr("rowspan"),
cols: $(this).attr("colspan"),
flag: $(q).find(e.settings.exclude)
};
if( rc.flag.length > 0 ) {
tempRows += "<td> </td>"; // exclude it!!
} else {
tempRows += "<td";
if( rc.rows > 0) {
tempRows += " rowspan='" + rc.rows + "' ";
}
if( rc.cols > 0) {
tempRows += " colspan='" + rc.cols + "' ";
}
if(additionalStyles){
tempRows += " style='" + additionalStyles + "'";
}
tempRows += ">" + $(q).html() + "</td>";
}
});
tempRows += "</tr>";
});
// exclude img tags
if(e.settings.exclude_img) {
tempRows = exclude_img(tempRows);
}
// exclude link tags
if(e.settings.exclude_links) {
tempRows = exclude_links(tempRows);
}
// exclude input tags
if(e.settings.exclude_inputs) {
tempRows = exclude_inputs(tempRows);
}
e.tableRows.push(tempRows);
});
e.tableToExcel(e.tableRows, e.settings.name, e.settings.sheetName);
},
tableToExcel: function (table, name, sheetName) {
var e = this, fullTemplate="", i, link, a;
e.format = function (s, c) {
return s.replace(/{(\w+)}/g, function (m, p) {
return c[p];
});
};
sheetName = typeof sheetName === "undefined" ? "Sheet" : sheetName;
e.ctx = {
worksheet: name || "Worksheet",
table: table,
sheetName: sheetName
};
fullTemplate= e.template.head;
if ( $.isArray(table) ) {
Object.keys(table).forEach(function(i){
//fullTemplate += e.template.sheet.head + "{worksheet" + i + "}" + e.template.sheet.tail;
fullTemplate += e.template.sheet.head + sheetName + i + e.template.sheet.tail;
});
}
fullTemplate += e.template.mid;
if ( $.isArray(table) ) {
Object.keys(table).forEach(function(i){
fullTemplate += e.template.table.head + "{table" + i + "}" + e.template.table.tail;
});
}
fullTemplate += e.template.foot;
for (i in table) {
e.ctx["table" + i] = table[i];
}
delete e.ctx.table;
var isIE = navigator.appVersion.indexOf("MSIE 10") !== -1 || (navigator.userAgent.indexOf("Trident") !== -1 && navigator.userAgent.indexOf("rv:11") !== -1); // this works with IE10 and IE11 both :)
//if (typeof msie !== "undefined" && msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // this works ONLY with IE 11!!!
if (isIE) {
if (typeof Blob !== "undefined") {
//use blobs if we can
fullTemplate = e.format(fullTemplate, e.ctx); // with this, works with IE
fullTemplate = [fullTemplate];
//convert to array
var blob1 = new Blob(fullTemplate, { type: "text/html" });
window.navigator.msSaveBlob(blob1, getFileName(e.settings) );
} else {
//otherwise use the iframe and save
//requires a blank iframe on page called txtArea1
txtArea1.document.open("text/html", "replace");
txtArea1.document.write(e.format(fullTemplate, e.ctx));
txtArea1.document.close();
txtArea1.focus();
sa = txtArea1.document.execCommand("SaveAs", true, getFileName(e.settings) );
}
} else {
var blob = new Blob([e.format(fullTemplate, e.ctx)], {type: "application/vnd.ms-excel"});
window.URL = window.URL || window.webkitURL;
link = window.URL.createObjectURL(blob);
a = document.createElement("a");
a.download = getFileName(e.settings);
a.href = link;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
return true;
}
};
function getFileName(settings) {
return ( settings.filename ? settings.filename : "table2excel" );
}
// Removes all img tags
function exclude_img(string) {
var _patt = /(\s+alt\s*=\s*"([^"]*)"|\s+alt\s*=\s*'([^']*)')/i;
return string.replace(/<img[^>]*>/gi, function myFunction(x){
var res = _patt.exec(x);
if (res !== null && res.length >=2) {
return res[2];
} else {
return "";
}
});
}
// Removes all link tags
function exclude_links(string) {
return string.replace(/<a[^>]*>|<\/a>/gi, "");
}
// Removes input params
function exclude_inputs(string) {
var _patt = /(\s+value\s*=\s*"([^"]*)"|\s+value\s*=\s*'([^']*)')/i;
return string.replace(/<input[^>]*>|<\/input>/gi, function myFunction(x){
var res = _patt.exec(x);
if (res !== null && res.length >=2) {
return res[2];
} else {
return "";
}
});
}
$.fn[ pluginName ] = function ( options ) {
var e = this;
e.each(function() {
if ( !$.data( e, "plugin_" + pluginName ) ) {
$.data( e, "plugin_" + pluginName, new Plugin( this, options ) );
}
});
// chain jQuery functions
return e;
};
})( jQuery, window, document );

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container-login">
<div class="wrap-login">
<%
if (request.getAttribute("loginMes") != null) {
out.print("<div class='alert alert-danger alert-dismissible fade show' role='alert'>");
out.print("Invalid login, please try again");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span>");
out.print("</button></div><br>");
}
%>
<form class="login-form" action="login?role=<%= request.getParameter("role")%>" method="POST">
<span class="login-form-title">
Account Login
</span>
<p><%= request.getParameter("role")%></p>
<br><br>
<span>
Username
</span>
<div class="wrap-input-login">
<input class="input-login" type="text" name="username" value="<%= request.getAttribute("loginMes") != null ? request.getAttribute("loginMes") : ""%>">
</div>
<br><br>
<span>
Password
</span>
<div class="wrap-input-login">
<input class="input-login" type="password" name="pwd" >
</div>
<br><br>
<div class="container-login-form-btn">
<input type="hidden" name="role" value="<%= request.getParameter("role")%>">
<input type="hidden" name="action" value="authenticate">
<button class="login-form-btn" type="submit">
Login
</button>
</div>
</form>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('.alert').alert();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,191 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.AttendBean, system.bean.StudentBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Student Area | Attendance</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Student" active="attendance" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Attendance</h5>
</div>
<div class="card-body">
<button type="button" id="btnExportExcel" class="btn btn-outline-info">Export Attendance Data to Excel</button>
<br><br>
<jsp:useBean id="studentDetials" scope="request" class="system.bean.StudentBean"/>
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">Student ID:</th>
<td><jsp:getProperty name="studentDetials" property="id"/></td>
</tr>
<tr>
<th scope="row">Student Name:</th>
<td><jsp:getProperty name="studentDetials" property="name"/></td>
</tr>
<tr>
<th scope="row">Gender :</th>
<td><jsp:getProperty name="studentDetials" property="gender"/></td>
</tr>
<tr>
<th scope="row">Student Email:</th>
<td><jsp:getProperty name="studentDetials" property="email"/></td>
</tr>
<tr>
<th scope="row">Birthday:</th>
<td><jsp:getProperty name="studentDetials" property="birthday"/></td>
</tr>
</tbody>
</table>
<div class="card">
<div class="card-body">
<canvas id="reportChart" width="50px"></canvas>
<table>
<tr>
<td>Total Present Day: </td>
<td> ${totalAttendDay}</td>
</tr>
<tr>
<td>Present Day: </td>
<td> ${presentDay}</td>
</tr>
<tr>
<td>Absent: </td>
<td> ${absDay}</td>
</tr>
</table>
</div>
</div>
<table class="table table-hover exportExcel">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Date</th>
<th>Attend</th>
</tr>
</thead>
<%
int id = 1;
for (AttendBean attend : studentDetials.getAttendList()) {
out.print("<tr>");
out.print("<td>" + (id++) + "</td>");
out.print("<td>" + attend.getDate() + "</td>");
if (attend.isAttend()) {
out.print("<td><a href='#' class='badge badge-success'>Present</a></td>");
} else {
out.print("<td><a href='#' class='badge badge-danger'>Absent</a></td>");
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
<a href="report?class=<%= request.getParameter("class")%>&year=<%= request.getParameter("year")%>&term=<%= request.getParameter("term")%>">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script>
$(document).ready(function () {
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "Student_Report.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
let reportChart = document.getElementById('reportChart').getContext('2d');
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontSize = 18;
Chart.defaults.global.defaultFontColor = 'black';
let massPopChart = new Chart(reportChart, {
type: 'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data: {
labels: ['Present(%)', 'Absent(%)'],
datasets: [{
label: false,
data: [
Math.round(${presentDay/totalAttendDay*100}),
Math.round(${absDay/totalAttendDay*100})
],
//backgroundColor:'green',
backgroundColor: [
'rgba(71, 179, 156, 0.9)',
'rgba(236, 107, 86, 0.6)'
],
borderWidth: 1,
borderColor: '#777',
hoverBorderWidth: 3,
hoverBorderColor: '#000'
}]
},
options: {
title: {
display: true,
text: 'Attendance',
fontSize: 20
},
legend: {
display: true,
position: 'right',
labels: {
fontColor: '#000'
}
},
layout: {
padding: {
left: 20,
right: 0,
bottom: 0,
top: 0
}
},
tooltips: {
enabled: true
}
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,143 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.LectureBean, system.bean.LectureDayBean, system.bean.LectureTimeBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Student Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<div class="list-group">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Student" active="dashboard" />
</div>
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<%/*
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Overview</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2><i class="material-icons">library_books</i> ${courseCount}</h2>
<h4>Class</h4>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2> <i class="material-icons">school</i> ${studentCount}</h2>
<h4>Student</h4>
</div>
</div>
</div>
</div>
</div>
*/ %>
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Schedule</h5>
</div>
<div class="card-body">
<jsp:useBean id="dayList" scope="request" class="java.util.ArrayList<system.bean.LectureDayBean>"/>
<jsp:useBean id="timeList" scope="request" class="java.util.ArrayList<system.bean.LectureTimeBean>"/>
<jsp:useBean id="lectureList" scope="request" class="java.util.ArrayList<system.bean.LectureBean>"/>
<table class="table table-bordered table-hover text-center">
<%
out.print("<tr>");
out.print("<th> Time </th>");
for (LectureDayBean day : dayList) {
out.print("<th>DAY " + day.getDay() + "</th>");
}
String[] schoolDays = {"A", "B", "C", "D", "E", "F"};
out.print("</tr>");
int countDay = dayList.size();
for (LectureTimeBean time : timeList) {
out.print("<tr>");
out.print("<td>" + time.getStartTime() + "-" + time.getEndTime());
int count = 0;
int countPrint = 0;
loopout:
for (String schoolDay : schoolDays) {
boolean printed = false;
System.out.println("TEST---" + schoolDay);
for (LectureBean lecture : lectureList) {
if (lecture.getTime().getStartTime().equals(time.getStartTime()) && lecture.getTime().getEndTime().equals(time.getEndTime())) {
if (lecture.getTime().isFullweek()) {
System.out.println("FullWEEK");
out.print("<td colspan='" + dayList.size() + "'>" + lecture.getLecture() + "</td>");
break loopout;
} else {
System.out.println("Lecture---" + lecture.getDay().getDay());
if (schoolDay.equalsIgnoreCase(lecture.getDay().getDay())) {
System.out.println("printed");
out.print("<td>" + lecture.getLecture() + "</td>");
printed = true;
countPrint++;
}
}
}
count++;
}
if (!printed) {
System.out.println("NOTPrintandPrintTDTD");
out.print("<td></td>");
}
if (lectureList.size() == 0) {
for (int i = dayList.size(); i > 0; i--) {
out.print("<td></td>");
}
}
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="system.bean.ClassBean, java.util.ArrayList"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Attendance</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="attendance" />
</div>
<div class="col-lg-9">
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Class</h5>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col"> </th>
<th scope="col">Head</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
out.print("<tr data-href=\"attendance?class=" + classVal.getClassName() + "\">");
out.print("<td colspan=2>" + classVal.getClassName() + "</td>");
out.print("<td>" + classVal.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
})
});
</script>
</body>
</html>

View File

@@ -0,0 +1,176 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="system.bean.ClassBean, system.bean.AttendBean, java.util.ArrayList, java.util.Date, java.text.SimpleDateFormat"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Attendance</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<%!
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
%>
<%
String urlForm = "attendance?";
String urlDate = request.getParameter("date");
String urlClass = request.getParameter("class");
if (urlDate != null) {
urlForm += ("date=" + urlDate + "&");
}
if (urlDate != null) {
urlForm += ("class=" + urlClass);
}
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="attendance" />
</div>
<div class="col-lg-9">
<%
if (request.getAttribute("message") != null) {
out.print("<div class='alert alert-success alert-dismissible fade show' role='alert'>");
out.print("<strong>Attendance Saved</strong>");
out.print("<button type='button' class='close' data-dismiss='alert' aria-label='Close'>");
out.print("<span aria-hidden='true'>&times;</span></button></div>");
}
%>
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Select Date</h5>
</div>
<form action="attendance" method="GET">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<select class="form-control" name="class">
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
if (request.getParameter("class").equals(classVal.getClassName())) {
out.print("<option value='" + classVal.getClassName() + "' selected>" + classVal.getClassName() + "</option>");
} else {
out.print("<option value='" + classVal.getClassName() + "'>" + classVal.getClassName() + "</option>");
}
}
%>
</select>
</div>
<div class="form-group">
<label>Select Date</label>
<div class="input-group date">
<input type="text" class="form-control" id="datepicker" name="date" value="<%= request.getParameter("date") == null ? formatter.format(date) : request.getParameter("date")%>">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
</div>
<br>
<a href="attendance">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
<button type="submit" class="btn btn-primary right">Submit</button>
</div>
</form>
</div>
<!-- Main -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Attend List</h5>
</div>
<form action="<%= urlForm%>" method="POST">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Attend</th>
<th scope="col">Student ID</th>
<th scope="col">Student Name</th>
<th scope="col">Gender</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="studentAttendList" scope="request" class="java.util.ArrayList<system.bean.AttendBean>"/>
<%
for (AttendBean student : studentAttendList) {
out.print("<tr>");
out.print("<td>");
out.print("<input type='checkbox' name='attend' value='" + student.getStBean().getId() + "'");
if (student.isAttend()) {
out.print(" checked>");
} else {
out.print(" >");
}
out.print("</td>");
out.print("<td>" + student.getStBean().getId() + "</td>");
out.print("<td>" + student.getStBean().getName() + "</td>");
out.print("<td>" + student.getStBean().getGender() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
<button type="submit" class="btn btn-primary float-right">Save</button>
<br><br>
<input type="hidden" name="action" value="save">
<input type="hidden" name="class" id="attendDate" value="<%= request.getParameter("class")%>">
<input type="hidden" name="date" id="class" value=" <%= request.getParameter("date") == null ? formatter.format(date) : request.getParameter("date")%>">
</div>
</form>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-datepicker.min.js"></script>
<script>
$(document).ready(function () {
$('#datepicker').datepicker({
format: "yyyy-mm-dd",
daysOfWeekDisabled: "0,6",
daysOfWeekHighlighted: "1,2,3,4,5",
todayHighlight: true
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,141 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.LectureBean, system.bean.LectureDayBean, system.bean.LectureTimeBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Dashboard</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="dashboard" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Overview</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2><i class="material-icons">library_books</i> ${courseCount}</h2>
<h4>Lecture</h4>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="card bg-light card-body mb-3 dash-box">
<h2> <i class="material-icons">school</i> ${studentCount}</h2>
<h4>Student</h4>
</div>
</div>
</div>
</div>
</div>
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Schedule</h5>
</div>
<div class="card-body">
<jsp:useBean id="dayList" scope="request" class="java.util.ArrayList<system.bean.LectureDayBean>"/>
<jsp:useBean id="timeList" scope="request" class="java.util.ArrayList<system.bean.LectureTimeBean>"/>
<jsp:useBean id="lectureList" scope="request" class="java.util.ArrayList<system.bean.LectureBean>"/>
<table class="table table-bordered table-hover text-center">
<%
out.print("<tr>");
out.print("<th> Time </th>");
for (LectureDayBean day : dayList) {
out.print("<th>DAY " + day.getDay() + "</th>");
}
String[] schoolDays = {"A", "B", "C", "D", "E", "F"};
out.print("</tr>");
int countDay = dayList.size();
for (LectureTimeBean time : timeList) {
out.print("<tr>");
out.print("<td>" + time.getStartTime() + "-" + time.getEndTime());
int count = 0;
int countPrint = 0;
loopout:
for (String schoolDay : schoolDays) {
boolean printed = false;
System.out.println("TEST---" + schoolDay);
for (LectureBean lecture : lectureList) {
if (lecture.getTime().getStartTime().equals(time.getStartTime()) && lecture.getTime().getEndTime().equals(time.getEndTime())) {
if (lecture.getTime().isFullweek()) {
System.out.println("FullWEEK");
out.print("<td colspan='" + dayList.size() + "'>" + lecture.getLecture() + "</td>");
break loopout;
} else {
System.out.println("Lecture---" + lecture.getDay().getDay());
if (schoolDay.equalsIgnoreCase(lecture.getDay().getDay())) {
System.out.println("printed");
out.print("<td>" + lecture.getLecture() + "</td>");
printed = true;
countPrint++;
}
}
}
count++;
}
if (!printed) {
System.out.println("NOTPrintandPrintTDTD");
out.print("<td></td>");
}
if (lectureList.size() == 0) {
for (int i = dayList.size(); i > 0; i--) {
out.print("<td></td>");
}
}
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,17 @@
<%--
Document : isError
Created on : 2019/12/14, 下午 02:00:01
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>

View File

@@ -0,0 +1,82 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.ClassBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Report</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="report" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">SELECT Class to Generate Report </h5>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col"> </th>
<th scope="col">Head</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<%
for (ClassBean classVal : classList) {
out.print("<tr data-href=\"report?class=" + classVal.getClassName() + "\">");
out.print("<td colspan=2>" + classVal.getClassName() + "</td>");
out.print("<td>" + classVal.getTeacherBean().getTeacherFormalName() + "</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
})
});
</script>
</body>
</html>

View File

@@ -0,0 +1,258 @@
<%--
Document : dashboard
Created on : 2019/11/11, 下午 10:08:39
Author : JerryKwok
--%>
<%@page import="java.util.Calendar"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.ClassBean, system.bean.SemesterBean, system.bean.StudentBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Report</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<%
String urlStudent = "report?";
if (request.getParameter("class") != null) {
urlStudent += "class=" + request.getParameter("class") + "&";
}
if (request.getParameter("year") != null) {
urlStudent += "year=" + request.getParameter("year") + "&";
} else {
urlStudent += "year=" + Calendar.getInstance().get(Calendar.YEAR) + "&";
}
if (request.getParameter("term") != null) {
urlStudent += "term=" + request.getParameter("term") + "&";
} else {
urlStudent += "term=1&";
}
%>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="report" />
</div>
<div class="col-lg-9">
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Select Class to Generate Report</h5>
</div>
<form action="report" method="GET">
<div class="card-body">
<div class="form-group">
<label>Class</label>
<select class="form-control" name="class">
<jsp:useBean id="classList" scope="request" class="java.util.ArrayList<system.bean.ClassBean>"/>
<% for (ClassBean classVal : classList) {
if (request.getParameter("class").equals(classVal.getClassName())) {
out.print("<option value='" + classVal.getClassName() + "' selected>" + classVal.getClassName() + "</option>");
} else {
out.print("<option value='" + classVal.getClassName() + "'>" + classVal.getClassName() + "</option>");
}
}
%>
</select>
</div>
<div class="form-group">
<label>Year</label>
<select class="form-control" name="year">
<jsp:useBean id="yearList" scope="request" class="java.util.ArrayList<system.bean.SemesterBean>"/>
<%
int counter = 1;
for (SemesterBean year : yearList) {
if (counter == 1) {
out.print("<option value='" + year.getYear() + "' selected>" + year.getYear() + "</option>");
} else {
out.print("<option value='" + year.getYear() + "'>" + year.getYear() + "</option>");
}
counter++;
}
%>
</select>
</div>
<div class="form-group">
<label>Term</label>
<select class="form-control" name="term">
<jsp:useBean id="termList" scope="request" class="java.util.ArrayList<system.bean.SemesterBean>"/>
<%
int count = 1;
for (SemesterBean term : termList) {
if (count == 1) {
out.print("<option value='" + term.getTerm() + "' selected>" + term.getTerm() + " term</option>");
} else {
out.print("<option value='" + term.getTerm() + "'>" + term.getTerm() + " term</option>");
}
count++;
}
%>
</select>
</div>
<br>
<input type="hidden" name="report" id="report" value="">
<button type="button" id="btnGenReport" class="btn btn-primary right">Generate</button>
<button type="button" id="btnGenLowReport" class="btn btn-danger">Generate Low Attendance</button>
</div>
</form>
</div>
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title"> Report </h5>
</div>
<div class="card-body">
<canvas id="reportChart" width="50px"></canvas>
Average Attendance (%): ${attendAVG}
</div>
</div>
<!-- Website Overview -->
<div class="card">
<div class="card-body">
<button type="button" id="btnExportExcel" class="btn btn-outline-info">Export Attendance Data to Excel</button>
<br><br>
<div class="form-group">
<table class="table table-hover exportExcel">
<thead>
<tr>
<th scope="col">Student ID</th>
<th scope="col">Student Name</th>
<th scope="col">Attend Rate</th>
</tr>
</thead>
<tbody>
<jsp:useBean id="studentAttendList" scope="request" class="java.util.ArrayList<system.bean.StudentBean>"/>
<%
for (StudentBean student : studentAttendList) {
out.print("<tr data-href='" + urlStudent + "studentId=" + student.getId() + "'>");
out.print("<td>" + student.getId() + "</td>");
out.print("<td>" + student.getName() + "</td>");
out.print("<td>" + student.getAttendRate() + " %</td>");
out.print("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
<a href="report">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
</div>
</div>
</section>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("tr[data-href]").click(function () {
window.location.href = $(this).attr("data-href");
});
$("#btnGenReport").click(function(){
$("form").submit();
});
$("#btnGenLowReport").click(function(){
$("#report").val("low");
$("form").submit();
});
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "<%= request.getParameter("studentId") + "_Report"%>.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
</script>
<script>
let reportChart = document.getElementById('reportChart').getContext('2d');
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontSize = 18;
Chart.defaults.global.defaultFontColor = 'black';
let massPopChart = new Chart(reportChart, {
type: 'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data: {
<%
if(request.getParameter("report") != null && request.getParameter("report").equals("low"))
out.print("labels: ['Student < 39%','Student 40-49%', 'Student 50-60%']");
else
out.print("labels: ['Student < 60%', 'Student >=60%']");
%>,
datasets: [{
label: 'Population',
data: [
<%
if(request.getParameter("report") != null && request.getParameter("report").equals("low"))
out.print(request.getAttribute("numberOfStudentLowAtt") + ", " + request.getAttribute("numberOfStudentDanger") + ", " + request.getAttribute("numberOfStudentWarning"));
else
out.print(request.getAttribute("numberOfStudentNotMeetTar") + ", " + request.getAttribute("numberOfStudentMeetTar"));
%>
],
//backgroundColor:'green',
backgroundColor: [
'rgba(236, 107, 86, 0.6)',
'rgba(71, 179, 156, 0.9)',
'rgba(88,80,141,0.8)'
],
borderWidth: 1,
borderColor: '#777',
hoverBorderWidth: 3,
hoverBorderColor: '#000'
}]
},
options: {
title: {
display: true,
text: 'Meet the Attendance Target',
fontSize: 20
},
legend: {
display: true,
position: 'right',
labels: {
fontColor: '#000'
}
},
layout: {
padding: {
left: 30,
right: 0,
bottom: 0,
top: 0
}
},
tooltips: {
enabled: true
}
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,192 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="system.bean.AttendBean, system.bean.StudentBean"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teacher Area | Report</title>
<!-- Bootstrap core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<section id="main">
<div class="container">
<div class="row">
<div class="col-lg-3">
<%@taglib uri="/WEB-INF/tlds/nav-taglib.tld" prefix="nav" %>
<nav:showNav role="Teacher" active="report" />
</div>
<div class="col-lg-9">
<!-- Website Overview -->
<!-- Latest Users -->
<div class="card">
<div class="card-header main-color-bg">
<h5 class="card-title">Student Report</h5>
</div>
<div class="card-body">
<button type="button" id="btnExportExcel" class="btn btn-outline-info">Export Attendance Data to Excel</button>
<br><br>
<jsp:useBean id="studentDetials" scope="request" class="system.bean.StudentBean"/>
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">Student ID:</th>
<td><jsp:getProperty name="studentDetials" property="id"/></td>
</tr>
<tr>
<th scope="row">Student Name:</th>
<td><jsp:getProperty name="studentDetials" property="name"/></td>
</tr>
<tr>
<th scope="row">Gender :</th>
<td><jsp:getProperty name="studentDetials" property="gender"/></td>
</tr>
<tr>
<th scope="row">Student Email:</th>
<td><jsp:getProperty name="studentDetials" property="email"/></td>
</tr>
<tr>
<th scope="row">Birthday:</th>
<td><jsp:getProperty name="studentDetials" property="birthday"/></td>
</tr>
</tbody>
</table>
<div class="card">
<div class="card-body">
<canvas id="reportChart" width="50px"></canvas>
<table>
<tr>
<td>Total Present Day: </td>
<td> ${totalAttendDay}</td>
</tr>
<tr>
<td>Present Day: </td>
<td> ${presentDay}</td>
</tr>
<tr>
<td>Absent: </td>
<td> ${absDay}</td>
</tr>
</table>
</div>
</div>
<table class="table table-hover exportExcel">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Date</th>
<th>Attend</th>
</tr>
</thead>
<%
int id = 1;
for (AttendBean attend : studentDetials.getAttendList()) {
out.print("<tr>");
out.print("<td>" + (id++) + "</td>");
out.print("<td>" + attend.getDate() + "</td>");
if (attend.isAttend()) {
out.print("<td><a href='#' class='badge badge-success'>Present</a></td>");
} else {
out.print("<td><a href='#' class='badge badge-danger'>Absent</a></td>");
}
out.print("</tr>");
}
%>
</table>
</div>
</div>
<a href="report?class=<%= request.getParameter("class")%>&year=<%= request.getParameter("year")%>&term=<%= request.getParameter("term")%>">
<button type="button" class="btn btn-secondary">
Back
</button>
</a>
</div>
</div>
</div>
</section>
<br><br>
<footer></footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.tableToexcel.js"></script>
<script>
$(document).ready(function () {
$("#btnExportExcel").click(function () {
$(".exportExcel").table2excel({
exclude: ".excludeThisClass",
name: "Worksheet Name",
filename: "<%= request.getParameter("studentId") + "_Report"%>.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
});
let reportChart = document.getElementById('reportChart').getContext('2d');
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontSize = 18;
Chart.defaults.global.defaultFontColor = 'black';
let massPopChart = new Chart(reportChart, {
type: 'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data: {
labels: ['Present(%)', 'Absent(%)'],
datasets: [{
label: false,
data: [
Math.round(${presentDay/totalAttendDay*100}),
Math.round(${absDay/totalAttendDay*100})
],
//backgroundColor:'green',
backgroundColor: [
'rgba(71, 179, 156, 0.9)',
'rgba(236, 107, 86, 0.6)'
],
borderWidth: 1,
borderColor: '#777',
hoverBorderWidth: 3,
hoverBorderColor: '#000'
}]
},
options: {
title: {
display: true,
text: 'Attendance',
fontSize: 20
},
legend: {
display: true,
position: 'right',
labels: {
fontColor: '#000'
}
},
layout: {
padding: {
left: 20,
right: 0,
bottom: 0,
top: 0
}
},
tooltips: {
enabled: true
}
}
});
</script>
</body>
</html>