You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
273 lines
9.2 KiB
273 lines
9.2 KiB
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
|
|
pageEncoding="ISO-8859-1"%>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<link href="${pageContext.request.contextPath}/CSS/style.css" rel="stylesheet" type="text/css" >
|
|
|
|
<title>team</title>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
|
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
var ln = '${team1Stats.size()}';
|
|
//color other team points
|
|
var tradeProjSel = $("td[name='tradeProjSel']");
|
|
var actualProj = $("[name='actualProj']");
|
|
var cat = $("[name='cat']");
|
|
var z = 0;
|
|
for (x=0;x<$(tradeProjSel).size();x++){
|
|
if(z==$(cat).size()){z=0;}
|
|
if($(cat).eq(z).text() == "RK-P"){
|
|
var n = ""+(parseFloat($(tradeProjSel).eq(x).text()) - parseFloat($(actualProj).eq(z).text()));
|
|
if(n>0){
|
|
$(tradeProjSel).eq(x).addClass("positive");
|
|
$(tradeProjSel).eq(x-1).addClass("positive");
|
|
}else if(n==0){
|
|
$(tradeProjSel).eq(x).addClass("neutral");
|
|
$(tradeProjSel).eq(x-1).addClass("neutral");
|
|
}else{
|
|
$(tradeProjSel).eq(x).addClass("negative");
|
|
$(tradeProjSel).eq(x-1).addClass("negative");
|
|
}
|
|
}
|
|
if(z > ln+2){
|
|
var n = ""+(parseFloat($(tradeProjSel).eq(x).text()) - parseFloat($(actualProj).eq(z).text()));
|
|
if(n>0){
|
|
$(tradeProjSel).eq(x).addClass("positive");
|
|
}else if(n==0){
|
|
$(tradeProjSel).eq(x).addClass("neutral");
|
|
}else{
|
|
$(tradeProjSel).eq(x).addClass("negative");
|
|
}
|
|
}
|
|
z+=1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sort = $("[title='filter']");
|
|
$(sort).each(function(col) {
|
|
$(this).hover(
|
|
function() { $(this).addClass('focus'); },
|
|
function() { $(this).removeClass('focus'); }
|
|
);
|
|
|
|
if($(this).text()=="RK-P"){
|
|
$(this).addClass('desc selected');
|
|
};
|
|
|
|
$(this).click(function() {
|
|
if ($(this).is('.desc')) {
|
|
$(this).removeClass('desc');
|
|
$(this).addClass('asc selected');
|
|
sortOrder = 1;
|
|
}
|
|
else {
|
|
$(this).addClass('desc selected');
|
|
$(this).removeClass('asc');
|
|
sortOrder = -1;
|
|
}
|
|
$(this).siblings().removeClass('asc selected');
|
|
$(this).siblings().removeClass('desc selected');
|
|
|
|
var arrData = $('table').find("tr[name='lignesResults']");
|
|
/* var arrData = $('table').find('tbody:nth-of-type(2) > tr').get(); */
|
|
|
|
arrData.sort(function(a, b) {
|
|
var val1 = $(a).children('td').eq(col).text().replace("+","").toUpperCase();
|
|
var val2 = $(b).children('td').eq(col).text().replace("+","").toUpperCase();
|
|
if($.isNumeric(val1) && $.isNumeric(val2))
|
|
return sortOrder == 1 ? val1-val2 : val2-val1;
|
|
else
|
|
return (val1 < val2) ? -sortOrder : (val1 > val2) ? sortOrder : 0;
|
|
});
|
|
|
|
|
|
$.each(arrData, function(index, row) {
|
|
$('tbody:nth-of-type(3)').append(row);
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<c:set var="mainFA" value="${requestScope.mainFA}" />
|
|
<c:set var="stats" value="${requestScope.statBase}" />
|
|
<c:set var="team1" value="${requestScope.team1}" />
|
|
<c:set var="team1Stats" value="${requestScope.team1Stats}" />
|
|
<c:set var="otherTeamStats" value="${requestScope.otherTeamStats}" />
|
|
<c:set var="nbTeam" value="${requestScope.nbTeam}" />
|
|
|
|
<table class="tableTrade">
|
|
<thead>
|
|
<tr class="Header">
|
|
<th colspan="2" ><c:out value="TEAM" /></th>
|
|
<th name="actualRK"><c:out value="Proj RK" /></th>
|
|
<th name="actualPTS"><c:out value="Proj PTS" /></th>
|
|
</tr>
|
|
</thead>
|
|
<tr class="ligneHead">
|
|
<th colspan="2"><c:out value="${team1.name}" /></th>
|
|
<th name="actualRK"><fmt:formatNumber pattern="0.#" value="${team1.projRK}" /></th>
|
|
<th name="actualPTS"><fmt:formatNumber pattern="0.#" value="${team1.projTot}" /></th>
|
|
</tr>
|
|
|
|
<thead>
|
|
<tr class="Header">
|
|
<th><c:out value="Player RK" /></th>
|
|
<th align="left"><c:out value="Player" /></th>
|
|
<th ><c:out value="Pot RK" /></th>
|
|
<th ><c:out value="Pot PTS" /></th>
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody >
|
|
<c:forEach var="player" items= "${players}" varStatus="i">
|
|
<tr name="lignesPlayer" class="tab" id="${i.index}" onclick="return callfilterResults(this);">
|
|
<td align="center"><fmt:formatNumber pattern="0.#" value="${player.interRK}" /></td>
|
|
<td align="left" name ="player"><c:out value="${player.nom}" /></td>
|
|
<td name="potRKcell" ><fmt:formatNumber pattern="0.#" value="${player.potRK}" /></td>
|
|
<td name="potPTScell" ><fmt:formatNumber pattern="0.#" value="${player.potPoint}" /></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</tbody>
|
|
</table>
|
|
|
|
<input type="text" id="myInput" onkeyup="filterName()" placeholder="Search for names..">
|
|
|
|
</div>
|
|
|
|
<div id="fa_div" style="display: inline-block;vertical-align:top">
|
|
|
|
<table class="tableTrade">
|
|
<thead >
|
|
<!---------------------- TAB HEADER------------------------------->
|
|
<tr class="Header" >
|
|
<th name="statTab" colspan="${fn:length(team1Stats)+1}"><c:out value="Waiver impact" /></th>
|
|
<th name="teamTab" colspan="${nbTeam - 1}"><c:out value="Impact on other teams" /></th>
|
|
</tr>
|
|
<!----------------------------------------- STATS CAT ---------------->
|
|
<tr name="headers" class="Header" >
|
|
<th align="left" ><c:out value="Drop" /></th>
|
|
<th ><c:out value="Pot RK" /></th>
|
|
<c:forEach var="stat" items= "${stats}" >
|
|
<c:if test="${!fn:contains(stat.name,'/')}">
|
|
<th ><c:out value="${fn:replace(stat.name,'Team ','')}" /></th>
|
|
</c:if>
|
|
</c:forEach>
|
|
</tr>
|
|
</thead>
|
|
<!------------------------------- LIGNE ACTUAL STATS PROJECTION-->
|
|
<tbody >
|
|
<tr name="headers" class="ligneHead" >
|
|
<c:forEach var="stat" items= "${team1Stats}" varStatus="i">
|
|
<c:if test="${i.first}">
|
|
<th name="actualPlayers">Actual Projection</th>
|
|
<th name="actualProj"><fmt:formatNumber pattern="0.#" value="${team1projectedRK}" /></th>
|
|
<th name="actualProj"><fmt:formatNumber pattern="0.#" value="${team1projTot}" /></th>
|
|
</c:if>
|
|
<c:if test="${!fn:contains(stat.name,'/')}">
|
|
<th name="actualProj"><c:out value="${stat.valProjection}" /></th>
|
|
</c:if>
|
|
</c:forEach>
|
|
|
|
<c:forEach var="stat" items= "${otherTeamStats}" >
|
|
<th name="actualProj"><c:out value="${stat}" /></th>
|
|
</c:forEach>
|
|
</tr>
|
|
|
|
<!-- LIGNE WITH FA STATS PROJECTION-->
|
|
<tr name="headers" class="ligneHead" >
|
|
<c:forEach var="stat" items= "${stats}" varStatus="i">
|
|
<c:if test="${stat.name == 'RK-P'}">
|
|
<th name="tradePlayers" >Proj with FA</th>
|
|
<th name="tradeProj"><c:out value="--" /></th>
|
|
</c:if>
|
|
|
|
<c:if test="${!stat.name.contains('/')}">
|
|
<th name="tradeProj"><c:out value="--" /></th>
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
</tr>
|
|
|
|
<!------------- LIGNE DIFFERENCES ----->
|
|
<tr name="headers" class="ligneHead" >
|
|
<c:forEach var="stat" items= "${stats}" varStatus="i">
|
|
<c:if test="${stat.name == 'RK-P'}">
|
|
<th >Difference</th>
|
|
<th id="diff" name="diff"><c:out value="--" /></th>
|
|
</c:if>
|
|
|
|
<c:if test="${!stat.name.contains('/')}">
|
|
<th id="diff" name="diff"><c:out value="--" /></th>
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<thead >
|
|
<!----------------------------------------- STATS CAT ---------------->
|
|
<tr name="headers" class="Header" >
|
|
<th align="left" title="filter"><c:out value="Waiver" /></th>
|
|
<th name="cat" title="filter"><c:out value="Pot RK" /></th>
|
|
<c:forEach var="stat" items= "${stats}" >
|
|
<c:if test="${!fn:contains(stat.name,'/')}">
|
|
<th name="cat" title="filter"><c:out value="${fn:replace(stat.name,'Team ','')}" /></th>
|
|
</c:if>
|
|
</c:forEach>
|
|
</tr>
|
|
</thead>
|
|
<!------------------------ START RESULT TAB-------------------------------->
|
|
|
|
<tbody id="tTrade" style="overflow-y: scroll;overflow-x: hidden;" >
|
|
<c:forEach var="fa" items= "${mainFA}" >
|
|
|
|
<tr name="lignesResults" class="tab" id="${i.index}" onclick="return listDiff(this);">
|
|
|
|
<c:forEach var="stat" items= "${fa}" varStatus="i" >
|
|
|
|
<c:if test="${i.first}">
|
|
<td align="left" name="get"><c:out value="${stat.player}" /></td>
|
|
<td name="tradeProjSel"><fmt:formatNumber pattern="0.#" value="${stat.projectedRK}" /></td>
|
|
</c:if>
|
|
<c:if test="${!fn:contains(stat.name,'/')}">
|
|
<c:if test="${!fn:contains(stat.name,'%')}">
|
|
<td name="tradeProjSel" align="center"><fmt:formatNumber pattern="0.#" value="${stat.valProjection}" /></td>
|
|
</c:if>
|
|
<c:if test="${fn:contains(stat.name,'%')}">
|
|
<td name="tradeProjSel" align="center"><fmt:formatNumber pattern="0.00" value="${stat.valProjection}" /></td>
|
|
</c:if>
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
|
|
</tr>
|
|
|
|
</c:forEach>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|