Пример #1
0
    public static function userSched()
    {
        global $lng, $coach, $settings, $leagues, $divisions, $tours;
        if (!is_object($coach)) {
            status(false, "You must be logged in to schedule games");
            return;
        }
        if (isset($_POST['creategame'])) {
            // Test input
            $trid = (int) $_POST['trid'];
            $round = (int) $_POST['round'];
            $own_team = (int) $_POST['own_team'];
            $errmsg = '';
            // Logged in coach has access to the tour?
            if (!in_array($trid, array_keys($tours))) {
                $errmsg = 'You do not have access to the tournament ' . $tours[$trid]['tname'];
            }
            // Is the team is really owned by the logged in coach?
            if ($coach->coach_id != get_alt_col('teams', 'team_id', $own_team, 'owned_by_coach_id')) {
                $errmsg = 'The team ' . get_alt_col('teams', 'team_id', $own_team, 'name') . ' is not owned by you';
            }
            // Create match
            if (!$errmsg) {
                list($exitStatus, $mid) = Match::create(array('team1_id' => $own_team, 'team2_id' => get_alt_col('teams', 'name', $_POST['opposing_team_autocomplete'], 'team_id'), 'round' => $round, 'f_tour_id' => $trid));
                $backFromMatchLink = Mobile::isMobile() ? "index.php?mobile=1" : "index.php?section=matches&type=report&mid={$mid}";
                status(!$exitStatus, $exitStatus ? Match::$T_CREATE_ERROR_MSGS[$exitStatus] : "<a href='{$backFromMatchLink}'>Click here</a> to open the match report");
                if (!$exitStatus) {
                    echo "<br>";
                }
            } else {
                status(false, $errmsg);
            }
        }
        $trid = isset($_GET['trid']) && is_numeric($_GET['trid']) ? (int) $_GET['trid'] : 0;
        $lid = $trid ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : false;
        $lname = $lid ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : '- N/A -';
        $did = $trid && get_alt_col('leagues', 'lid', $lid, 'tie_teams') == 1 ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $dname = $did ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $_DISABLED = !$trid ? 'DISABLED' : '';
        #print_r(array($trid, $lid, $lname, $did));
        title($lng->getTrn('menu/matches_menu/usersched'));
        $LOCK_FORMS = false;
        ?>
    <div class='boxCommon'>
        <h3 class='boxTitle<?php 
        echo T_HTMLBOX_MATCH;
        ?>
'><?php 
        echo $lng->getTrn('menu/matches_menu/usersched');
        ?>
</h3>
        <div class='boxBody'>
            <form method="POST" id="usersched">
                <?php 
        echo "In tournament ";
        echo HTMLOUT::nodeList(T_NODE_TOURNAMENT, 'trid', array(T_NODE_TOURNAMENT => array('locked' => 0, 'type' => TT_FFA, 'allow_sched' => 1)), array(), array('sel_id' => $trid, 'extra_tags' => array('onChange="document.location.href = \'' . getFormAction('?section=matches&type=usersched') . '&trid=\' + $(this).val();"'), 'init_option' => '<option value="0">- ' . $lng->getTrn('matches/usersched/selecttour') . " -</option>\n"));
        echo ' as ';
        echo '<select name="round" id="round" ' . $_DISABLED . '>';
        $T_ROUNDS = Match::getRounds();
        foreach ($T_ROUNDS as $r => $d) {
            echo "<option value='{$r}' " . ($r == 1 ? 'SELECTED' : '') . ">" . $d . "</option>\n";
        }
        ?>
                </select>
                <br><br>
                Your team
                <?php 
        $teams = array();
        foreach ($coach->getTeams($lid, $did, array('sortby' => 'team_id DESC')) as $t) {
            if (!$t->rdy || $t->is_retired) {
                continue;
            }
            $teams[] = $t;
        }
        ?>
                <select name='own_team' id='own_team' <?php 
        echo $_DISABLED;
        ?>
>
                    <?php 
        echo "<optgroup class='leagues' label='{$lname}'>\n";
        if ($dname) {
            echo "<optgroup class='divisions' label='&nbsp;&nbsp;{$dname}'>\n";
        }
        foreach ($teams as $t) {
            echo "<option style='background-color: white; margin-left: -1em;' value='{$t->team_id}'>&nbsp;&nbsp;&nbsp;{$t->name}</option>\n";
        }
        ?>
                </select>
                &nbsp;
                VS.
                <input type="text" id='opposing_team_autoselect' name="opposing_team_autocomplete" size="30" maxlength="50" <?php 
        echo $_DISABLED;
        ?>
>
                <script>
                    $(document).ready(function(){
                        var options, b;

                        options = {
                            minChars:2,
                            serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_TEAM;
        ?>
&trid=<?php 
        echo $trid;
        ?>
',
                        };
                        b = $('#opposing_team_autoselect').autocomplete(options);
                    });
                </script>
                <br><br><br>
                <input type="submit" name="creategame" value="<?php 
        echo $lng->getTrn('menu/matches_menu/usersched');
        ?>
" <?php 
        if (empty($teams) || $_DISABLED) {
            echo 'DISABLED';
        }
        ?>
>
                
                <?php 
        if (Mobile::isMobile()) {
            echo '<a href="' . getFormAction('') . '">' . $lng->getTrn('common/back') . '</a>';
        }
        ?>
            </form>
        </div>
    </div>
    <?php 
    }
Пример #2
0
}
if ($tier == '') {
    $tier = 'Dungeon_1';
}
// Class Selection
$class = "";
if (isset($_REQUEST["classfilter"])) {
    $class = $_REQUEST["classfilter"];
}
// Create the Selection Form
// First get the sets
$all_sets = array_keys($roster->locale->act['ItemSets_Set']);
sort($all_sets);
$form = '';
$form .= '<table cellpadding="0" cellspacing="0" class="membersList">';
$form .= '<form method="GET" name="myform" action="' . getFormAction() . '">';
$form .= '<input type="hidden" name="p" value="realm-ItemSets" />';
$form .= '<input type="hidden" name="realm" value="' . $roster->data['region'] . '-' . $roster->data['server'] . '" />';
$form .= '<tr><th class="membersRow1">Tier:</th>';
$form .= '<td class="membersRow1">';
$form .= '<select name="tierselect" size="1" onchange="window.location.href=this.options[this.selectedIndex].value">';
for ($i = 0; $i < sizeof($all_sets); $i++) {
    if ($tier == $all_sets[$i]) {
        $is_selected = 'selected';
    } else {
        $is_selected = '';
    }
    $form .= '<option value="' . makelink('realm-ItemSets&amp;classfilter=' . $class . '&amp;tierselect=' . $all_sets[$i], true) . '" ' . $is_selected . '>' . $roster->locale->act[$all_sets[$i]] . '</option>';
}
$form .= '</select></td>';
// Then get the class names
Пример #3
0
    public static function sec_mobile_main()
    {
        global $coach, $lng, $T_INJS;
        $teams = $coach->getTeams();
        $selectedTeamId = Mobile_HTMLOUT::getSelectedTeamId();
        $_SESSION["SelectedTeam"] = $selectedTeamId;
        foreach ($teams as $team) {
            if ($team->team_id == $selectedTeamId) {
                $selectedTeam = $team;
            }
        }
        if (!$selectedTeam) {
            echo $lng->getTrn('mobile/team/noteams');
            return;
        }
        $playersOnSelectedTeam = $selectedTeam->getPlayers();
        // Filter players depending on settings and view mode.
        $tmp_players = array();
        foreach ($playersOnSelectedTeam as $player) {
            if ($player->is_dead || $player->is_sold) {
                continue;
            }
            array_push($tmp_players, $player);
        }
        $playersOnSelectedTeam = $tmp_players;
        foreach ($playersOnSelectedTeam as $player) {
            Player_HTMLOUT::setChoosableSkillsTranslations($player);
        }
        list($recentMatches, $pages) = Stats::getMatches(T_OBJ_TEAM, $selectedTeamId, false, false, false, false, array(), true, false);
        list($upcomingMatches, $pages) = Stats::getMatches(T_OBJ_TEAM, $selectedTeamId, false, false, false, false, array(), true, true);
        $allMatches = array_merge($recentMatches, $upcomingMatches);
        ?>
        <script type="text/javascript">
            $(document).ready(function() {
                var playersOnSelectedTeam = <?php 
        echo json_encode($playersOnSelectedTeam);
        ?>
;
                var matches = <?php 
        echo json_encode($allMatches);
        ?>
;
                var injuryTable = <?php 
        echo json_encode($T_INJS);
        ?>
;
                $('#tabs').tabs();
                $('#SelectedTeam').change(function() {
                    this.form.submit();
                });
				
                var mobileViewModel = new MobileViewModel(playersOnSelectedTeam, matches);
                
                mobileViewModel.matchDialogViewModel.selectedPlayerViewModel.injuryTable(injuryTable);
                mobileViewModel.matchDialogViewModel.myTeamId(<?php 
        echo $selectedTeamId;
        ?>
);
                
                ko.applyBindings(mobileViewModel);
            });
        </script>
        <div class="main">
            <form method="post" action="<?php 
        echo getFormAction('');
        ?>
">
                 <select id="SelectedTeam" name="SelectedTeam">
                    <?php 
        foreach ($teams as $team) {
            $isThisTeam = $team->team_id == $selectedTeamId;
            echo '<option value="' . $team->team_id . '"' . ($isThisTeam ? ' selected="selected"' : '') . '>' . $team->name . '</option>';
        }
        ?>
                </select>
                <span class="button-panel">
					<img id="open-menu" src="images/menu.svg" alt="Menu" class="icon ui-button ui-state-default ui-corner-all" data-bind="click: showMenu" />
					<ul id="menu" class="ui-state-default ui-corner-left ui-corner-left ui-corner-br" data-bind="visible: isMenuVisible">
						<li><a href="<?php 
        echo getFormAction('?section=management');
        ?>
"><?php 
        echo $lng->getTrn('mobile/team/management');
        ?>
</a></li>
						<li><a href="index.php"><?php 
        echo $lng->getTrn('mobile/team/desktop_site');
        ?>
</a></li>
						<li><a href="<?php 
        echo getFormAction('?logout=1');
        ?>
"><?php 
        echo $lng->getTrn('menu/logout');
        ?>
</a></li>
					</ul>
                </span>
            </form>
            <div>
                <?php 
        echo 'TV' . $selectedTeam->tv / 1000 . ', ' . $selectedTeam->treasury / 1000 . 'k, FF' . $selectedTeam->rg_ff;
        ?>
 
                <?php 
        if ($selectedTeam->apothecary) {
            echo ', ' . $lng->getTrn('common/apothecary');
        }
        ?>
            </div>
            <div id="tabs">
                <ul>
                    <li><a href="#Teams"><?php 
        echo $lng->getTrn('common/team');
        ?>
</a></li>
                    <li><a href="#Games"><?php 
        echo $lng->getTrn('menu/matches_menu/name');
        ?>
</a></li>
                </ul>
                <?php 
        Mobile_HTMLOUT::teamSummaryView($playersOnSelectedTeam);
        ?>
                <?php 
        Mobile_HTMLOUT::matchSummaryView($recentMatches, $upcomingMatches);
        ?>
            </div>
        </div>
        <?php 
    }
Пример #4
0
function sec_login()
{
    global $lng, $settings;
    $_URL_forgotpass = "******";
    if (isset($_GET['forgotpass'])) {
        if (!isset($_POST['_retry'])) {
            title($lng->getTrn('login/forgotpass'));
        }
        if (isset($_GET['cid']) && isset($_GET['activation_code'])) {
            $c = new Coach((int) $_GET['cid']);
            status($new_passwd = $c->confirmActivation($_GET['activation_code']));
            echo "<br><br>";
            echo $lng->getTrn('login/temppasswd') . " <b>{$new_passwd}</b><br>\n";
            echo '<a href="' . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $_GET['cid'], false, false) . '&amp;subsec=profile">' . $lng->getTrn('login/setnewpasswd') . '.</a>';
        } else {
            if (isset($_POST['coach_AC']) && isset($_POST['email'])) {
                $cid = get_alt_col('coaches', 'name', $_POST['coach_AC'], 'coach_id');
                $c = new Coach($cid);
                $correct_user = $c->mail == $_POST['email'];
                status($correct_user, $correct_user ? '' : $lng->getTrn('login/mismatch'));
                if ($correct_user) {
                    $c->requestPasswdReset();
                    echo "<br><br>";
                    echo $lng->getTrn('login/resetpasswdmail') . '.';
                } else {
                    // Return to same page.
                    unset($_POST['coach']);
                    unset($_POST['email']);
                    $_POST['_retry'] = true;
                    sec_login();
                }
            } else {
                ?>
            <div class='boxCommon'>
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_COACH;
                ?>
'><?php 
                echo $lng->getTrn('login/forgotpass');
                ?>
</h3>
                <div class='boxBody'>
                <form method="POST" action="<?php 
                echo $_URL_forgotpass;
                ?>
">
                    <?php 
                echo $lng->getTrn('login/loginname');
                ?>
<br>
                    <input type="text" name="coach_AC" size="20" maxlength="50">
                    <br><br>
                    Email<br>
                    <input type="text" name="email" size="20" maxlength="50">
                    <br><br>
                    <input type="submit" name="reqAC" value="<?php 
                echo $lng->getTrn('common/submit');
                ?>
">
                </form>
                </div>
            </div>
            <?php 
            }
        }
    } else {
        title($lng->getTrn('menu/login'));
        ?>
        <div class='boxCommon'>
            <h3 class='boxTitle<?php 
        echo T_HTMLBOX_COACH;
        ?>
'><?php 
        echo $lng->getTrn('menu/login');
        ?>
</h3>
            <div class='boxBody'>
            <form method="POST" action="<?php 
        echo getFormAction('');
        ?>
">
                <?php 
        echo $lng->getTrn('login/loginname');
        ?>
<br>
                <input type="text" name="coach" size="20" maxlength="50"><br><br>
                <?php 
        echo $lng->getTrn('login/passwd');
        ?>
<br>
                <input type="password" name="passwd" size="20" maxlength="50">
                <div style='display: none;'><input type='text' name='hackForHittingEnterToLogin' size='1'></div>
                <br><br>
                <?php 
        echo $lng->getTrn('login/remember');
        ?>
                <input type='checkbox' name='remember' value='1'>
                <br><br>
                <input type="submit" name="login" value="<?php 
        echo $lng->getTrn('login/loginbutton');
        ?>
">
            </form>
            <br><br>
            <?php 
        if (!Mobile::isMobile()) {
            if (Module::isRegistered('Registration') && $settings['allow_registration']) {
                echo "<a href='handler.php?type=registration'><b>Register</b></a>";
            }
            echo "<br><br>";
            echo "<a href='{$_URL_forgotpass}'><b>" . $lng->getTrn('login/forgotpass') . '</b></a>';
        }
        ?>
            </div>
        </div>
        <?php 
    }
}
Пример #5
0
    private function _teamManagementBox($players, $team)
    {
        global $lng, $rules, $DEA, $T_ALLOWED_PLAYER_NR;
        ?>
    <div class="boxTeamPage">
    <div class="boxTitle<?php 
        echo T_HTMLBOX_COACH;
        ?>
"><?php 
        echo $lng->getTrn('profile/team/box_tm/title') . ' - ' . $team->name;
        ?>
</div>
    <div class="boxBody">
        <?php 
        $base = 'profile/team';
        $tmanage = array('hire_player' => $lng->getTrn($base . '/box_tm/hire_player'), 'hire_journeyman' => $lng->getTrn($base . '/box_tm/hire_journeyman'), 'fire_player' => $lng->getTrn($base . '/box_tm/fire_player'), 'unbuy_player' => $lng->getTrn($base . '/box_tm/unbuy_player'), 'rename_player' => $lng->getTrn($base . '/box_tm/rename_player'), 'renumber_player' => $lng->getTrn($base . '/box_tm/renumber_player'), 'rename_team' => $lng->getTrn($base . '/box_tm/rename_team'), 'buy_goods' => $lng->getTrn($base . '/box_tm/buy_goods'), 'drop_goods' => $lng->getTrn($base . '/box_tm/drop_goods'), 'ready_state' => $lng->getTrn($base . '/box_tm/ready_state'), 'retire' => $lng->getTrn($base . '/box_tm/retire'), 'delete' => $lng->getTrn($base . '/box_tm/delete'));
        # If one of these are selected from the menu, a JavaScript confirm prompt is displayed before submitting.
        # Note: Don't add "hire_player" here - players may be un-bought if not having played any games.
        $tmange_confirm = array('hire_journeyman', 'fire_player', 'buy_goods', 'drop_goods');
        // Set default choice.
        if (!isset($_POST['menu_tmanage'])) {
            reset($tmanage);
            $_POST['menu_tmanage'] = key($tmanage);
        }
        // If action is already chosen, then make it the default selected.
        if (isset($_POST['type']) && array_key_exists($_POST['type'], $tmanage)) {
            $_POST['menu_tmanage'] = $_POST['type'];
        }
        ?>
        <form method="POST" name="menu_tmanage_form">
            <select name="menu_tmanage" onchange="document.menu_tmanage_form.submit();">
                <?php 
        foreach ($tmanage as $opt => $desc) {
            echo "<option value='{$opt}'" . ($_POST['menu_tmanage'] == $opt ? 'SELECTED' : '') . ">{$desc}</option>";
        }
        ?>
            </select>
            <!-- <input type="submit" name="tmanage" value="OK"> -->
        </form>

        <br><i><?php 
        echo $lng->getTrn('common/desc');
        ?>
:</i><br><br>
        <form name="form_tmanage" method="POST" enctype="multipart/form-data">
        <?php 
        $DISABLE = false;
        switch ($_POST['menu_tmanage']) {
            /**************
             * Hire player
             **************/
            case 'hire_player':
                echo $lng->getTrn('profile/team/box_tm/desc/hire_player');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name='player'>
                <?php 
                $active_players = array_filter($players, create_function('$p', "return (\$p->is_sold || \$p->is_dead || \$p->is_mng) ? false : true;"));
                $DISABLE = true;
                foreach ($DEA[$team->f_rname]['players'] as $pos => $details) {
                    // Show players on the select list if buyable, or if player is a potential journeyman AND team has not reached journeymen limit.
                    if ($team->isPlayerBuyable($details['pos_id']) && $team->treasury >= $details['cost'] || ($details['qty'] == 16 || $details['qty'] == 12) && count($active_players) < $rules['journeymen_limit']) {
                        echo "<option value='{$details['pos_id']}'>" . $details['cost'] / 1000 . "k | " . $lng->GetTrn('position/' . strtolower($lng->FilterPosition($pos))) . "</option>\n";
                        $DISABLE = false;
                    }
                }
                echo "</select>\n";
                ?>
                <br><br>
                <?php 
                echo $lng->getTrn('common/number');
                ?>
:<br>
                <select name="number">
                <?php 
                foreach ($T_ALLOWED_PLAYER_NR as $i) {
                    foreach ($players as $p) {
                        if ($p->nr == $i && !$p->is_sold && !$p->is_dead) {
                            continue 2;
                        }
                    }
                    echo "<option value='{$i}'>{$i}</option>\n";
                }
                ?>
                </select>
                <br><br>
                <?php 
                echo $lng->GetTrn('common/journeyman');
                ?>
 ? <input type="checkbox" name="as_journeyman" value="1">
                <br><br>
                <?php 
                echo $lng->getTrn('common/name');
                ?>
:<br>
                <input type="text" name="name">
                <input type="hidden" name="type" value="hire_player">
                <?php 
                break;
                /**************
                 * Hire journeymen
                 **************/
            /**************
             * Hire journeymen
             **************/
            case 'hire_journeyman':
                echo $lng->getTrn('profile/team/box_tm/desc/hire_journeyman');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name="player">
                <?php 
                $DISABLE = true;
                foreach ($players as $p) {
                    $price = $DEA[$team->f_rname]['players'][$p->pos]['cost'];
                    if (!$p->is_journeyman || $p->is_sold || $p->is_dead || $team->treasury < $price || !$team->isPlayerBuyable($p->f_pos_id) || $team->isFull()) {
                        continue;
                    }
                    echo "<option value='{$p->player_id}'>{$p->nr} {$p->name} | " . $price / 1000 . " k</option>\n";
                    $DISABLE = false;
                }
                ?>
                </select>
                <input type="hidden" name="type" value="hire_journeyman">
                <?php 
                break;
                /**************
                 * Fire player
                 **************/
            /**************
             * Fire player
             **************/
            case 'fire_player':
                echo $lng->getTrn('profile/team/box_tm/desc/fire_player') . ' ' . $rules['player_refund'] * 100 . "%.\n";
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name="player">
                <?php 
                $DISABLE = true;
                foreach ($players as $p) {
                    if ($p->is_dead || $p->is_sold) {
                        continue;
                    }
                    echo "<option value='{$p->player_id}'>" . ($rules['player_refund'] ? $p->value / 1000 * $rules['player_refund'] . "k refund | " : "") . "{$p->nr} {$p->name}</option>\n";
                    $DISABLE = false;
                }
                ?>
                </select>
                <input type="hidden" name="type" value="fire_player">
                <?php 
                break;
                /***************
                 * Un-buy player
                 **************/
            /***************
             * Un-buy player
             **************/
            case 'unbuy_player':
                echo $lng->getTrn('profile/team/box_tm/desc/unbuy_player');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name="player">
                <?php 
                $DISABLE = true;
                foreach ($players as $p) {
                    if ($p->is_unbuyable() && !$p->is_sold) {
                        echo "<option value='{$p->player_id}'>{$p->nr} {$p->name}</option>\n";
                        $DISABLE = false;
                    }
                }
                ?>
                </select>
                <input type="hidden" name="type" value="unbuy_player">
                <?php 
                break;
                /**************
                 * Rename player
                 **************/
            /**************
             * Rename player
             **************/
            case 'rename_player':
                echo $lng->getTrn('profile/team/box_tm/desc/rename_player');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name="player">
                <?php 
                $DISABLE = true;
                foreach ($players as $p) {
                    unset($color);
                    if ($p->is_dead) {
                        $color = COLOR_HTML_DEAD;
                    } elseif ($p->is_sold) {
                        $color = COLOR_HTML_SOLD;
                    }
                    echo "<option value='{$p->player_id}' " . (isset($color) ? "style='background-color: {$color};'" : '') . ">{$p->nr} {$p->name}</option>\n";
                    $DISABLE = false;
                }
                ?>
                </select>
                <br><br>
                <?php 
                echo $lng->getTrn('common/name');
                ?>
:<br>
                <input type='text' name='name' maxlength=50 size=20>
                <input type="hidden" name="type" value="rename_player">
                <?php 
                break;
                /**************
                 * Renumber player
                 **************/
            /**************
             * Renumber player
             **************/
            case 'renumber_player':
                echo $lng->getTrn('profile/team/box_tm/desc/renumber_player');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/player');
                ?>
:<br>
                <select name="player">
                <?php 
                $DISABLE = true;
                foreach ($players as $p) {
                    unset($color);
                    if ($p->is_dead) {
                        $color = COLOR_HTML_DEAD;
                    } elseif ($p->is_sold) {
                        $color = COLOR_HTML_SOLD;
                    }
                    echo "<option value='{$p->player_id}' " . (isset($color) ? "style='background-color: {$color};'" : '') . ">{$p->nr} {$p->name}</option>\n";
                    $DISABLE = false;
                }
                ?>
                </select>
                <br><br>
                <?php 
                echo $lng->getTrn('common/number');
                ?>
:<br>
                <select name="number">
                <?php 
                foreach ($T_ALLOWED_PLAYER_NR as $i) {
                    echo "<option value='{$i}'>{$i}</option>\n";
                }
                ?>
                </select>
                <input type="hidden" name="type" value="renumber_player">
                <?php 
                break;
                /**************
                 * Rename team
                 **************/
            /**************
             * Rename team
             **************/
            case 'rename_team':
                echo $lng->getTrn('profile/team/box_tm/desc/rename_team');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('common/name');
                ?>
:<br>
                <input type='text' name='name' maxlength='50' size='20'>
                <input type="hidden" name="type" value="rename_team">
                <?php 
                break;
                /**************
                 * Buy team goods
                 **************/
            /**************
             * Buy team goods
             **************/
            case 'buy_goods':
                echo $lng->getTrn('profile/team/box_tm/desc/buy_goods');
                $goods_temp = $team->getGoods();
                if ($DEA[$team->f_rname]['other']['rr_cost'] != $goods_temp['rerolls']['cost']) {
                    echo $lng->getTrn('profile/team/box_tm/desc/buy_goods_warn');
                }
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/thing');
                ?>
:<br>
                <select name="thing">
                <?php 
                $DISABLE = true;
                foreach ($team->getGoods() as $name => $details) {
                    if ($name == 'ff_bought' && !$team->mayBuyFF()) {
                        continue;
                    }
                    if (($team->{$name} < $details['max'] || $details['max'] == -1) && $team->treasury >= $details['cost']) {
                        echo "<option value='{$name}'>" . $details['cost'] / 1000 . "k | {$details['item']}</option>\n";
                        $DISABLE = false;
                    }
                }
                ?>
                </select>
                <input type="hidden" name="type" value="buy_goods">
                <?php 
                break;
                /**************
                 * Let go (drop) of team goods
                 **************/
            /**************
             * Let go (drop) of team goods
             **************/
            case 'drop_goods':
                echo $lng->getTrn('profile/team/box_tm/desc/drop_goods');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/thing');
                ?>
:<br>
                <select name="thing">
                <?php 
                $DISABLE = true;
                foreach ($team->getGoods() as $name => $details) {
                    if ($name == 'ff_bought' && !$team->mayBuyFF()) {
                        continue;
                    }
                    if ($team->{$name} > 0) {
                        echo "<option value='{$name}'>{$details['item']}</option>\n";
                        $DISABLE = false;
                    }
                }
                ?>
                </select>
                <input type="hidden" name="type" value="drop_goods">
                <?php 
                break;
                /**************
                 * Set ready state
                 **************/
            /**************
             * Set ready state
             **************/
            case 'ready_state':
                echo $lng->getTrn('profile/team/box_tm/desc/ready_state');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/teamready');
                ?>
                <input type="checkbox" name="bool" value="1" <?php 
                echo $team->rdy ? 'CHECKED' : '';
                ?>
>
                <input type="hidden" name="type" value="ready_state">
                <?php 
                break;
                /***************
                 * Retire
                 **************/
            /***************
             * Retire
             **************/
            case 'retire':
                echo $lng->getTrn('profile/team/box_tm/desc/retire');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/retire');
                ?>
                <input type="checkbox" name="bool" value="1">
                <input type="hidden" name="type" value="retire">
                <?php 
                break;
                /***************
                 * Delete
                 **************/
            /***************
             * Delete
             **************/
            case 'delete':
                echo $lng->getTrn('profile/team/box_tm/desc/delete');
                if (!$this->isDeletable()) {
                    $DISABLE = true;
                }
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/suredeleteteam');
                ?>
                <input type="checkbox" name="bool" value="1" <?php 
                echo $DISABLE ? 'DISABLED' : '';
                ?>
>
                <input type="hidden" name="type" value="delete">
                <?php 
                break;
        }
        ?>
            <br><br>
            <input type="submit" name="button" value="OK" <?php 
        echo $DISABLE ? 'DISABLED' : '';
        ?>
                <?php 
        if (in_array($_POST['menu_tmanage'], $tmange_confirm)) {
            echo "onClick=\"if(!confirm('" . $lng->getTrn('common/confirm_box') . "')){return false;}\"";
        }
        ?>
            >
            <?php 
        if (Mobile::isMobile()) {
            echo '<a href="' . getFormAction('') . '">' . $lng->getTrn('common/back') . '</a>';
        }
        ?>
        </form>
    </div>
</div>
<?php 
    }