Skip to content
Snippets Groups Projects
Commit daf40134 authored by Moss's avatar Moss
Browse files

[style] cleaned up file and added id names to table to help with testing

parent fe580422
No related branches found
No related tags found
1 merge request!21UC39
......@@ -17,23 +17,16 @@
<%@page import="edu.ncsu.csc.itrust.enums.TransactionType"%>
<%@page import="edu.ncsu.csc.itrust.enums.Role"%>
<%@include file="/global.jsp" %>
<%
pageTitle = "iTrust - View Transaction Logs";
String view = request.getParameter("viewSelect");
%>
<%@include file="/header.jsp" %>
<%
//get form data
long mid = Long.valueOf(request.getUserPrincipal().getName());
String startDate = request.getParameter("startDate");
String endDate = request.getParameter("endDate");
String mainRole = request.getParameter("mainRole");
......@@ -47,7 +40,6 @@ String view = request.getParameter("viewSelect");
startDate = "01/01/2000";
if (endDate == null)
endDate = formatted;
%>
<br />
<form action="viewTransactionLogs.jsp" method="post" id="formMain">
......@@ -68,67 +60,53 @@ String view = request.getParameter("viewSelect");
<input type=button value="Select Date" onclick="displayDatePicker('endDate');">
</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="<%= StringEscapeUtils.escapeHtml("" + (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="<%= StringEscapeUtils.escapeHtml("" + (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="<%= StringEscapeUtils.escapeHtml("" + (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" onclick="viewSelect='showList'"></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" onclick="window.location.reload();" value="Reset"></td>
</tr>
<td>Main Role:</td>
<td>
<select name="mainRole" style="font-size:10" >
<option value="All"> All</option>
<%
for(Role type : Role.values()){
%><option value="<%= StringEscapeUtils.escapeHtml("" + (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="<%= StringEscapeUtils.escapeHtml("" + (type.getUserRolesString()))%>"><%=type.getUserRolesString()%></option><%
}
%>
</select>
</td>
</tr>
<tr class="subHeader">
<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="<%= StringEscapeUtils.escapeHtml("" + (type.name()))%>"><%=type.name()%>
</option><%
}
%>
</select>
</td>
<td></td>
</tr>
<tr>
<td colspan="1" style="text-align: center;"><input type="submit" id="viewReport" value="View Report" onclick="viewSelect='showList'"></td>
<td colspan="1" style="text-align: center;"><input type="submit" id="viewGraph" value="Summarize"></td>
<td> </td>
<td colspan="1" style="text-align: center;"><input type="submit" id="viewReset" onclick="window.location.reload();" value="Reset"></td>
</tr>
</table>
</form>
<br />
<% if (view != null) { %>
......@@ -145,10 +123,10 @@ String view = request.getParameter("viewSelect");
List<TransactionWithRoleBean> list = DAOFactory.getProductionInstance().getTransactionDAO().getAllTransactionsWithRoles();
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date convertedSimpleDate = null;
Date startSimpleDate = null;
Date endSimpleDate = null;
if(startDate != ""){
startSimpleDate = sdf.parse(startDate);
}
......@@ -164,16 +142,16 @@ String view = request.getParameter("viewSelect");
|| StringEscapeUtils.escapeHtml(mainRole).equals("All")){
if(StringEscapeUtils.escapeHtml("" + (t.getSecondaryRole())).equals(StringEscapeUtils.escapeHtml(secondRole))
|| StringEscapeUtils.escapeHtml(secondRole).equals("All")){
if(StringEscapeUtils.escapeHtml("" + (t.getTransactionType().name())).equals(StringEscapeUtils.escapeHtml(transactionType)) || StringEscapeUtils.escapeHtml(transactionType).equals("All")){
if(StringEscapeUtils.escapeHtml("" + (t.getTransactionType().name())).equals(StringEscapeUtils.escapeHtml (transactionType)) || StringEscapeUtils.escapeHtml(transactionType).equals("All")){
if((convertedSimpleDate.before(endSimpleDate) || convertedSimpleDate.equals(endSimpleDate)) && (convertedSimpleDate.after(startSimpleDate) || convertedSimpleDate.equals(startSimpleDate))){
%>
<tr>
<td><%= StringEscapeUtils.escapeHtml("" + (t.getMainRole())) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + (t.getSecondaryRole())) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + (t.getTransactionType().name())) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + (t.getAddedInfo())) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + (t.getTimeLogged())) %></td>
</tr>
<tr id="resultRow">
<td id="mainTD"><%= StringEscapeUtils.escapeHtml("" + (t.getMainRole())) %></td>
<td id="secondTD"><%= StringEscapeUtils.escapeHtml("" + (t.getSecondaryRole())) %></td>
<td id="typeTD"><%= StringEscapeUtils.escapeHtml("" + (t.getTransactionType().name())) %></td>
<td id="infoTD"><%= StringEscapeUtils.escapeHtml("" + (t.getAddedInfo())) %></td>
<td id="timeTD"><%= StringEscapeUtils.escapeHtml("" + (t.getTimeLogged())) %></td>
</tr>
<%
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment