From 49107d0b05ae077a1fd5cb2703248fada8235e13 Mon Sep 17 00:00:00 2001
From: Bennett <mwb9@fa20-cs427-144.cs.illinois.edu>
Date: Tue, 1 Dec 2020 12:42:15 -0600
Subject: [PATCH] [Front End] created all dropdowns with proper enumerations
 for Roles and Transaction Types; added function buttons

---
 .../auth/admin/viewTransactionLogs.jsp        | 125 +++++++++---------
 1 file changed, 62 insertions(+), 63 deletions(-)

diff --git a/iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp b/iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
index d2ad609..007408a 100644
--- a/iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
+++ b/iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
@@ -10,6 +10,10 @@
 <%@page import="edu.ncsu.csc.itrust.beans.TransactionBean"%>
 <%@page import="edu.ncsu.csc.itrust.beans.TransactionWithRoleBean"%>
 <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
+<%@page import="edu.ncsu.csc.itrust.enums.TransactionType"%>
+<%@page import="edu.ncsu.csc.itrust.enums.Role"%>
+
+
 
 
 <%@include file="/global.jsp" %>
@@ -75,66 +79,7 @@ String view = request.getParameter("viewSelect");
 	<tr>
 		<th colspan="4">View Transaction Logs</th>
 	</tr>
-	<tr class="subHeader">
-    		<td>Patients:</td>
-    		<td>
-    			<select name="patients" style="font-size:10" >
-    			<%
-                    if (patients != null && !patients.equalsIgnoreCase("")) {
-                     if (patients.equalsIgnoreCase("All Patients")) {
-                %>
-                		<option selected="selected" value="All Patients"> All Patients </option>
-                		<option value="My Patients"> My Patients </option>
-                <%
-                     } else if (patients.equalsIgnoreCase("My Patients")) {
-                %>
-                        <option value="All Patients"> All Patients </option>
-                        <option selected="selected" value="My Patients"> My Patients </option>
-                <%
-                        }
-                     } else {
-                %>
-                       <option value="All Patients"> All Patients </option>
-                       <option value="My Patients"> My Patients </option>
-                </select>
-                <%
-                    }
-                %>
-    		</td>
-    		<td>Gender:</td>
-    		<td>
-    			<select name="gender" style="font-size:10" >
-    			<%
-                    if (gender != null && !gender.equalsIgnoreCase("")) {
-                	    if (gender.equalsIgnoreCase("All")) {
-                %>
-                		<option selected="selected" value="All"> All </option>
-                		<option value="Male"> Male </option>
-                		<option value="Female"> Female </option>
-                	<%
-                    	} else if(gender.equalsIgnoreCase("Male")){
-                    %>
-                        <option value="All"> All </option>
-                        <option selected="selected" value="Male"> Male </option>
-                        <option value="Female"> Female </option>
-                    <%
-                        } else if(gender.equalsIgnoreCase("Female")){
-                    %>
-                        <option value="All"> All </option>
-                        <option value="Male"> Male </option>
-                        <option selected="selected" value="Female"> Female </option>
-                    <%
-                            }
-                        } else {
-                    %>
-                        <option value="All"> All </option>
-                        <option value="Male"> Male </option>
-                        <option value="Female"> Female </option>
-                </select>
-                <% } %>
-    		</td>
-    	</tr>
-	<tr class="subHeader">
+    	<tr class="subHeader">
 		<td>Start Date:</td>
 		<td>
 			<input name="startDate" value="<%= StringEscapeUtils.escapeHtml("" + (startDate)) %>" size="10">
@@ -146,9 +91,63 @@ String view = request.getParameter("viewSelect");
             <input type=button value="Select Date" onclick="displayDatePicker('endDate');">
 		</td>
 	</tr>
-	<tr>
-		<td colspan="4" style="text-align: center;"><input type="submit" id="view_report" value="View Report"></td>
-	</tr>
+	
+	<tr class="subHeader">
+    		<td>Main Role:</td>
+    		<td>
+    			<select name="mainRole" style="font-size:10" >
+                    <option value="All"> All</option>
+    			   <%
+                    for(Role type : Role.values()){
+                        %><option value=type.getUserRolesString()><%=type.getUserRolesString()%></option><%
+                        
+                    }
+                    %>
+                
+                </select>
+    		</td>
+    		<td>Secondary Role:</td>
+    		<td>
+    			<select name="secondRole" style="font-size:10" >
+                    <option value="All"> All</option>
+    			<%
+                    for(Role type : Role.values()){
+                        %><option value=type.getUserRolesString()><%=type.getUserRolesString()%></option><%
+                        
+                    }
+                    %>
+                     
+                </select>
+               
+            
+    	</tr>
+        <tr class="subHeader">
+        </td>    
+                <td colspan="2" style="text-align: left;">Transaction Type:</td>
+                <td>
+                <select name="transactionType" style="font-size:10" >
+                    <option value="All"> All</option>
+                    <%
+                    for(TransactionType type : TransactionType.values()){
+                        %><option value=type.name()><%=type.name()%></option><%
+                        
+                    }
+                    %>
+                    </select>
+               
+    		    </td>
+                <td>
+                </td>
+        </tr>
+        <tr>
+		    <td colspan="1" style="text-align: center;"><input type="submit" id="view_report" value="View Report"></td>
+            <td colspan="1" style="text-align: center;"><input type="submit" id="view_graph" value="Summarize"></td>
+            <td> </td>
+            <td colspan="1" style="text-align: center;"><input type="submit" id="view_reset" value="Reset"></td>
+            
+	    </tr>
+        
+
 </table>
 
 </form>
-- 
GitLab