diff --git a/WebContent/html/webpages/administration/adminThings.jsp b/WebContent/html/webpages/administration/adminThings.jsp
new file mode 100644
index 0000000..587e09a
--- /dev/null
+++ b/WebContent/html/webpages/administration/adminThings.jsp
@@ -0,0 +1,75 @@
+
+
+<%@ page import = "database.*,entities.*" %>
+<%@ page import = "java.util.Random" %>
+<%@ page import = "database.*" %>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ page import = "java.sql.*" %>
+<%@ page import = "java.security.MessageDigest" %>
+<%@ page import = "java.security.NoSuchAlgorithmException" %>
+
+
+
+
+
+
+
+ ×
+
Input new admin information
+
+
+
+
+
+
+
+ ×
+
Enter the SSO of the admin to be deleted
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%
+ Admin[] admins = AdminQuery.getAllAdmin();
+ String adminString = Admin.arrayToString(admins);
+ adminString = adminString.replace("'", "\\'");
+%>
+
+
\ No newline at end of file
diff --git a/src/database/AdminQuery.java b/src/database/AdminQuery.java
new file mode 100644
index 0000000..3d9f38f
--- /dev/null
+++ b/src/database/AdminQuery.java
@@ -0,0 +1,152 @@
+package database;
+
+import java.sql.*;
+
+import entities.Admin;
+import entities.User;
+
+public class AdminQuery {
+
+ private static String database = "jdbc:mysql://us-cdbr-iron-east-04.cleardb.net/ad_15a989204c2ff8a?user=b372dfe7409692&password=74f6e317";
+ private static String user = "b372dfe7409692";
+ private static String password = "74f6e317";
+
+ /*public static void initializeEmployee(int id) throws ClassNotFoundException, SQLException
+ {
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ stmt.executeUpdate("INSERT INTO employee (Employee_ID) VALUES ("+id+");");
+ stmt.close();
+ connection.close();
+ }*/
+
+ /*public static void updateEmployee(int id, String name, Boolean finger) throws ClassNotFoundException, SQLException
+ {
+ System.out.println("Updating admin "+id+": "+name+" "+finger);
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ String query = "";
+ query+="UPDATE employee SET ";
+ query+="Name='"+name;
+ query+="UPDATE admin SET";
+ query+="', Finger Print="+finger;
+ query+="' WHERE Employee_ID="+id;
+ System.out.println(query);
+ stmt.executeUpdate(query);
+ stmt.close();
+ connection.close();
+ }*/
+
+ /*public static void updateEmployee(int id, String name, int icon, String phone, String email) throws ClassNotFoundException, SQLException
+ {
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ System.out.println("Updating employee "+id+": "+name+".\nPhone: "+phone+", icon: "+icon+", email: "+email);
+ String query = "";
+ query+="UPDATE employee SET ";
+ query+="Name='"+name;
+ query+="', Phone_Number='"+phone;
+ query+="', Email ='"+email;
+ query+="', Img_Index="+icon;
+ query+=" WHERE Employee_ID="+id;
+ System.out.println(query);
+ stmt.executeUpdate(query);
+ stmt.close();
+ connection.close();
+ }*/
+
+
+ public static Admin[] getAllAdmin() throws SQLException, ClassNotFoundException, InterruptedException{
+ //database connect
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+
+ for(;;){
+ try{
+ stmt = connection.createStatement();
+ break;
+ }
+ catch(SQLException e){
+ Thread.sleep(1);
+ }
+ }
+
+
+ ResultSet resultSetAd = stmt.executeQuery("SELECT Admin_ID, Finger_Registered_Flag, employee.Name, employee.Location_ID FROM admin INNER JOIN employee ON admin.Admin_ID=employee.Employee_ID");
+ int counter = 0;
+
+ resultSetAd.last();
+ int rows = resultSetAd.getRow();
+ resultSetAd.beforeFirst();
+
+ //Covers amount of rows, and 6 attributes (indices 0-5)
+ Admin[] admin = new Admin[rows];
+
+ //iterate result set
+ while(resultSetAd.next()){
+ admin[counter] = new Admin(resultSetAd.getInt("Admin_ID"),0,resultSetAd.getString("Name"),"","",0,0,resultSetAd.getInt("Finger_Registered_Flag"),0);
+
+ counter++;
+ }
+
+
+ stmt.close();
+ connection.close();
+ return admin;
+ }
+
+
+ public static void removeAdmin(int id) throws ClassNotFoundException, SQLException
+ {
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ stmt.executeUpdate("DELETE FROM admin WHERE Admin_ID = id");
+ stmt.close();
+ connection.close();
+ }
+
+ public static void addAdmin(int id, String password) throws ClassNotFoundException, SQLException
+ {
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ stmt.executeUpdate("INSERT INTO employee (Admin_ID, Password) values("+id+", "+password+")");
+ stmt.close();
+ connection.close();
+ }
+
+ public static boolean fingerCheck(int id) throws ClassNotFoundException, SQLException
+ {
+ System.getenv("VCAP_SERVICES");
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection(database, user, password);
+ Statement stmt = connection.createStatement();
+ ResultSet finger = stmt.executeQuery("SELECT Finger_Registered_Flag FROM admin WHERE Admin_ID = id");
+ finger.next();
+ int flag = finger.getInt("Finger_Registered_Flag");
+ if(flag == 0)
+ {
+ removeAdmin(id);
+ }
+ else
+ {
+ System.out.println("Cut off their fingers first");
+ }
+
+ stmt.close();
+ connection.close();
+ return flag==1;
+
+ }
+}
\ No newline at end of file