Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs427fa20team22
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
htmoss2
cs427fa20team22
Commits
f356e6a4
Commit
f356e6a4
authored
4 years ago
by
Moss
Browse files
Options
Downloads
Patches
Plain Diff
[frontend] fixed reset button to work now
parent
234f3ee1
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
UC39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
+82
-78
82 additions, 78 deletions
iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
with
82 additions
and
78 deletions
iTrust/WebRoot/auth/admin/viewTransactionLogs.jsp
+
82
−
78
View file @
f356e6a4
...
...
@@ -103,100 +103,104 @@ String view = request.getParameter("viewSelect");
<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>
<td
colspan=
"1"
style=
"text-align: center;"
><button><a
href=
"viewTransactionLogs.jsp?reset=true"
style=
"text-decoration:none; padding: 0.4em;color:black;"
>
Reset
</a></button></td>
</tr>
</table>
</form>
<br
/>
<%
<%
if
(
view
!=
null
)
{
%>
String
resetCheck
=
null
;
if
(
request
.
getParameter
(
"reset"
)!=
null
){
resetCheck
=
request
.
getParameter
(
"reset"
);
}
<table
border=
1
align=
"center"
>
<%
if
(
view
!=
null
&&
resetCheck
!=
"true"
)
{
%>
<table
border=
1
align=
"center"
>
<%
List
<
TransactionWithRoleBean
>
list
=
DAOFactory
.
getProductionInstance
().
getTransactionDAO
().
getAllTransactionsWithRoles
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
);
Date
convertedSimpleDate
=
null
;
Date
startSimpleDate
=
null
;
Date
endSimpleDate
=
null
;
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
);
}
else
{
startSimpleDate
=
sdf
.
parse
(
"01/01/2000"
);
}
if
(
endDate
!=
""
){
endSimpleDate
=
sdf
.
parse
(
endDate
);
}
else
{
endSimpleDate
=
sdf
.
parse
(
formatted
);
}
if
(
startDate
!=
""
){
startSimpleDate
=
sdf
.
parse
(
startDate
);
}
else
{
startSimpleDate
=
sdf
.
parse
(
"01/01/2000"
);
}
if
(
endDate
!=
""
){
endSimpleDate
=
sdf
.
parse
(
endDate
);
}
else
{
endSimpleDate
=
sdf
.
parse
(
formatted
);
}
boolean
dateFormatError
=
false
;
String
regex
=
"^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$"
;
boolean
result
=
(
startDate
.
matches
(
regex
)||
startDate
.
equals
(
""
))
&&
(
endDate
.
matches
(
regex
)||
endDate
.
equals
(
""
));
if
(!
result
)
{
dateFormatError
=
true
;
%>
<span
class=
"iTrustError"
>
ERROR: Date must by in the format: MM/dd/yyyy
</span>
<%
}
else
if
(
endSimpleDate
.
before
(
startSimpleDate
)){
dateFormatError
=
true
;
%>
<span
class=
"iTrustError"
>
ERROR: End Date cannot be before Start Date
</span>
<%
}
boolean
dateFormatError
=
false
;
String
regex
=
"^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$"
;
boolean
result
=
(
startDate
.
matches
(
regex
)||
startDate
.
equals
(
""
))
&&
(
endDate
.
matches
(
regex
)||
endDate
.
equals
(
""
));
if
(!
result
)
{
dateFormatError
=
true
;
%>
<span
class=
"iTrustError"
>
ERROR: Date must by in the format: MM/dd/yyyy
</span>
<%
}
else
if
(
endSimpleDate
.
before
(
startSimpleDate
)){
dateFormatError
=
true
;
%>
<span
class=
"iTrustError"
>
ERROR: End Date cannot be before Start Date
</span>
<%
}
int
countEntries
=
0
;
if
(!
dateFormatError
){
%>
<tr>
<th>
Main Role
</th>
<th>
Secondary Role
</th>
<th>
Type
</th>
<th>
Extra Info
</th>
<th>
Time Logged
</th>
</tr>
<%
for
(
TransactionWithRoleBean
t
:
list
)
{
convertedSimpleDate
=
sdf
.
parse
(
StringEscapeUtils
.
escapeHtml
(
""
+
(
t
.
getConvertedDate
())));
int
countEntries
=
0
;
if
(!
dateFormatError
){
%>
<tr>
<th>
Main Role
</th>
<th>
Secondary Role
</th>
<th>
Type
</th>
<th>
Extra Info
</th>
<th>
Time Logged
</th>
</tr>
<%
for
(
TransactionWithRoleBean
t
:
list
)
{
convertedSimpleDate
=
sdf
.
parse
(
StringEscapeUtils
.
escapeHtml
(
""
+
(
t
.
getConvertedDate
())));
if
(
StringEscapeUtils
.
escapeHtml
(
""
+
(
t
.
getMainRole
())).
equals
(
StringEscapeUtils
.
escapeHtml
(
mainRole
))
||
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
((
convertedSimpleDate
.
before
(
endSimpleDate
)
||
convertedSimpleDate
.
equals
(
endSimpleDate
))
&&
(
convertedSimpleDate
.
after
(
startSimpleDate
)
||
convertedSimpleDate
.
equals
(
startSimpleDate
))){
countEntries
++;
%>
<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>
<%
if
(
StringEscapeUtils
.
escapeHtml
(
""
+
(
t
.
getMainRole
())).
equals
(
StringEscapeUtils
.
escapeHtml
(
mainRole
))
||
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
((
convertedSimpleDate
.
before
(
endSimpleDate
)
||
convertedSimpleDate
.
equals
(
endSimpleDate
))
&&
(
convertedSimpleDate
.
after
(
startSimpleDate
)
||
convertedSimpleDate
.
equals
(
startSimpleDate
))){
countEntries
++;
%>
<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>
<%
}
}
}
}
}
}
if
(
countEntries
==
0
){
%>
<tr
id=
"resultRow"
>
<td
style=
"color:red;"
id=
"noResults"
colspan=
"5"
>
There are no results for the criteria specified
</td>
</tr>
<%
if
(
countEntries
==
0
){
%>
<tr
id=
"resultRow"
>
<td
style=
"color:red;"
id=
"noResults"
colspan=
"5"
>
There are no results for the criteria specified
</td>
</tr>
<%
}
}
}
%>
</table>
%>
</table>
<%
}
%>
<br
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment