<%@ page import="java.util.Iterator, java.util.Set, java.util.Collection" %> <%@ page import="java.lang.reflect.Array" %> <%@ page import="ysl.util.Log, ysl.buslog.orgs.LeaguePlayAttr" %> <%@ page import="ysl.util.Utils, ysl.util.StaticData, ysl.ui.SelectList" %> <%@ page import="ysl.util.Log, ysl.util.Money, ysl.util.ServletUtils" %> <%@ page import="ysl.util.Term" %> <%@ page import="ysl.buslog.users.Role, ysl.buslog.users.UserRole, ysl.buslog.users.User" %> <%@ page import="ysl.buslog.competitions.Division, ysl.buslog.competitions.Season, ysl.buslog.competitions.Competition" %> <%@ page import="ysl.buslog.refs.GameOfficial, ysl.buslog.refs.OfficialPay" %> <%@ include file="TestSessionFragment.jsp" %> <% int roleId = currentUserRole.getRoleId(); League league = currentUserRole.getEntity().getLeague(); int compId = ServletUtils.getInt(request, "compId", 0); int fromCompId = ServletUtils.getInt(request, "fromCompId", 0); int seasonId = ServletUtils.getInt(request, "seasonId", 0); int fromSeasonId = ServletUtils.getInt(request, "fromSeasonId", 0); Season season = Season.getInstance(seasonId); Competition comp = null; if (compId > 0) { comp = Competition.getInstance(compId); season = comp.getSeason(); seasonId = season.getId(); } Season fromSeason = Season.getInstance(fromSeasonId); Competition fromComp = null; if (fromCompId > 0) { fromComp = Competition.getInstance(fromCompId); fromSeason = fromComp.getSeason(); fromSeasonId = fromSeason.getId(); } if (fromSeason == null) { fromSeason = season; fromSeasonId = seasonId; } SelectList compsSL = null; SelectList seasonsSL = new SelectList(league.getSeasons()); if (fromSeason != null) { compsSL = new SelectList(fromSeason.getRealCompetitions()); } int leagueId = league == null ? 0 : league.getId(); Iterator playAttrs = LeaguePlayAttr.getPlayAttrMatrix(leagueId).iterator(); String offStr = Term.getTerm(Term.OFFICIAL, league); String off1Str = Term.getTerm(Term.OFFICIAL1, league); String off2Str = Term.getTerm(Term.OFFICIAL2, league); String off3Str = Term.getTerm(Term.OFFICIAL3, league); String venueStr = Term.getTerm(Term.VENUE, league); String importFor = "Importing " + (compId == 0 ? "Default " : "") + "Payments for " + season + (compId == OfficialPay.TRAVELING_ID ? " Traveling Games" : comp != null ? " " + comp : ""); String pageTitle = "Import " + Term.capitalizeTerm(offStr) + " Payments"; %> <%@ include file="header.jsp" %>
Import <%= Term.capitalizeTerm(offStr) %> Payments
<%= league %>
<%@ include file="ShowStatusMessageFragment.jsp" %>
<% if (compsSL != null) { %> <% } %>
Choose the Season and Competition
to Import Payments from:
Season:
Competition:
<% if (playAttrs != null) { %>
<% int charCols = 0; if (league.showGender()) { out.println(" "); charCols++; } if (league.showAge()) { out.println(" "); charCols++; } if (league.showClass()) { out.println(" "); charCols++; } %> <%= (Utils.hasData(off2Str) ? "" : "") %> <%= (Utils.hasData(off3Str) ? "" : "") %> <% Money refPay = null; Money ar1Pay = null; Money ar2Pay = null; int row=0; while (playAttrs.hasNext()) { Object ids = playAttrs.next(); String attrStr = null; if (ids != null) { int age = Array.getInt(ids, LeaguePlayAttr.AGE - 1); int gender = Array.getInt(ids, LeaguePlayAttr.GENDER - 1); int classId = Array.getInt(ids, LeaguePlayAttr.CLASS - 1); refPay = OfficialPay.getLeagueCompetitionPay(leagueId, fromSeasonId, fromCompId, gender, age, classId, GameOfficial.CENTER_REF); ar1Pay = OfficialPay.getLeagueCompetitionPay(leagueId, fromSeasonId, fromCompId, gender, age, classId, GameOfficial.AR1); ar2Pay = OfficialPay.getLeagueCompetitionPay(leagueId, fromSeasonId, fromCompId, gender, age, classId, GameOfficial.AR2); if(row%2==0) out.println(""); else out.println(""); if (league.showGender()) { attrStr = StaticData.getString(StaticData.GENDERS, gender); out.println(""); } if (league.showAge()) { attrStr = StaticData.getString(StaticData.AGE_GROUPS, age); out.println(""); } if (league.showClass()) { attrStr = StaticData.getString(StaticData.PLAY_CLASSES, classId); out.println(""); } %> <%= (Utils.hasData(off2Str) ? "" : "") %> <%= (Utils.hasData(off3Str) ? "" : "") %> <% row++; } // end if ids != null } // end while playAttrs.hasNext() %> <% out.println("
<%= importFor %>
GenderAge GroupClass<%= Term.capitalizeTerm(off1Str) %> Pay" + Term.capitalizeTerm(off2Str) + " Pay" + Term.capitalizeTerm(off3Str) + " Pay
 " + (attrStr == null ? "Default" : attrStr) + " " + (attrStr == null ? "Default" : attrStr) + " " + (attrStr == null ? "Default" : attrStr) + "<%= refPay %>" + ar1Pay + "" + ar2Pay + "

"); } // end if playAttrs != null %>
User Home