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