2017-05-26 18:49:27 -04:00
|
|
|
<script>
|
2017-11-19 01:44:11 -05:00
|
|
|
var curFrom = 0;
|
2017-05-26 18:49:27 -04:00
|
|
|
|
2017-11-19 01:44:11 -05:00
|
|
|
function getNextPage() {
|
|
|
|
curFrom += 15;
|
|
|
|
return curFrom;
|
|
|
|
}
|
2017-05-26 18:49:27 -04:00
|
|
|
|
2017-11-19 01:44:11 -05:00
|
|
|
function getPrevPage() {
|
|
|
|
if ((curFrom - 15) >= 0) {
|
|
|
|
curFrom -= 15;
|
|
|
|
return (curFrom);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
curFrom = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2017-05-26 18:49:27 -04:00
|
|
|
|
2017-11-19 01:44:11 -05:00
|
|
|
function getPenalties(from) {
|
|
|
|
$("#penaltyList").html("");
|
|
|
|
$(".loader").fadeIn();
|
|
|
|
$.getJSON("/_penalties?from=" + from, function (result) {
|
|
|
|
$.each(result, function (i, penalty) {
|
|
|
|
$("#penaltyList").append(
|
|
|
|
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
2017-05-26 18:49:27 -04:00
|
|
|
<div class=\"penaltyName tableCell\"><a href=\"/players?id="+ penalty['playerID'] + "\">" + penalty['playerName'] + "</a></div> \
|
|
|
|
<div class=\"penaltyType tableCell\">"+ getColorForLevel(penalty['penaltyType'], penalty['penaltyType']) + "</div> \
|
|
|
|
<div class=\"penaltyReason tableCell\">"+ penalty['penaltyReason'] + "</div> \
|
|
|
|
<div class=\"penaltyOrigin tableCell\">"+ getColorForLevel(penalty['adminLevel'], penalty['adminName']) + "</div> \
|
2017-08-23 18:29:48 -04:00
|
|
|
<div class=\"penaltyTime tableCell\">"+ penalty['penaltyTime'] + "</div> \
|
2017-09-27 16:07:43 -04:00
|
|
|
<div class=\" penaltyRemaining tableCell\">" + penalty['Expires'] + "</div> \
|
2017-05-26 18:49:27 -04:00
|
|
|
</div>"
|
2017-11-19 01:44:11 -05:00
|
|
|
)
|
|
|
|
});
|
2017-05-26 18:49:27 -04:00
|
|
|
|
2017-11-19 01:44:11 -05:00
|
|
|
}).done(function (data) { $(".loader").fadeOut(); });
|
|
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
|
|
getPenalties(0);
|
|
|
|
});
|
2017-05-26 18:49:27 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="penaltyHeader table">
|
2017-11-19 01:44:11 -05:00
|
|
|
<div class="penaltyName tableCell">Name</div>
|
|
|
|
<div class="penaltyType tableCell">Type</div>
|
|
|
|
<div class="penaltyReason tableCell">Reason</div>
|
|
|
|
<div class="penaltyOrigin tableCell">Admin</div>
|
|
|
|
<div class="penaltyTime tableCell">Time</div>
|
|
|
|
<div class="penaltyRemaining tableCell">Remaining</div>
|
2017-05-26 18:49:27 -04:00
|
|
|
</div>
|
|
|
|
<div id="penaltyList">
|
|
|
|
</div>
|
|
|
|
<hr />
|
2017-11-19 01:44:11 -05:00
|
|
|
<div id="paginationButtons" class="table">
|
2017-05-26 18:49:27 -04:00
|
|
|
<div id="previousPage" class="tableCell"><a href=# onclick="getPenalties(getPrevPage())"><<</a></div>
|
|
|
|
<div id="nextPage" class="tableCell"><a href=# onclick="getPenalties(getNextPage())">>></a></div>
|
2017-11-19 01:44:11 -05:00
|
|
|
</div>
|