Пример #1
0
 public static function starHireHistory($obj, $obj_id, $node, $node_id, $star_id = false, $opts = array())
 {
     global $lng;
     /* 
         If $star_id is false, then the HH from all stars of $obj = $obj_id will be displayed, instead of only the HH of star = $star_id 
     */
     if (!array_key_exists('GET_SS', $opts)) {
         $opts['GET_SS'] = '';
     } else {
         $extra['GETsuffix'] = $opts['GET_SS'];
     }
     # GET Sorting Suffix
     $extra['doNr'] = false;
     $extra['noHelp'] = true;
     if ($ANC = array_key_exists('anchor', $opts)) {
         $extra['anchor'] = $opts['anchor'];
     }
     $mdat = array();
     foreach ($star_id ? array(new Star($star_id)) : Star::getStars($obj, $obj_id, $node, $node_id) as $s) {
         foreach ($s->getHireHistory($obj, $obj_id, $node, $node_id) as $m) {
             $o = (object) array();
             foreach (array('match_id', 'date_played', 'hiredBy', 'hiredAgainst', 'hiredByName', 'hiredAgainstName') as $k) {
                 $o->{$k} = $m->{$k};
             }
             foreach ($s->getStats(T_NODE_MATCH, $m->match_id) as $k => $v) {
                 $o->{$k} = $v;
             }
             $o->match = $lng->getTrn('common/view');
             $o->tour = get_alt_col('tours', 'tour_id', $m->f_tour_id, 'name');
             $o->score = "{$m->team1_score} - {$m->team2_score}";
             $o->result = matchresult_icon($m->team1_id == $m->hiredBy && $m->team1_score > $m->team2_score || $m->team2_id == $m->hiredBy && $m->team1_score < $m->team2_score ? 'W' : ($m->team1_score == $m->team2_score ? 'D' : 'L'));
             $o->star_id = $s->star_id;
             $o->name = $s->name;
             array_push($mdat, $o);
         }
     }
     $fields = array('date_played' => array('desc' => $lng->getTrn('common/dateplayed')), 'name' => array('desc' => $lng->getTrn('common/star'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_STAR, false, false, false), 'field' => 'obj_id', 'value' => 'star_id')), 'tour' => array('desc' => $lng->getTrn('common/tournament')), 'hiredByName' => array('desc' => $lng->getTrn('profile/star/hiredby'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, false, false, false), 'field' => 'obj_id', 'value' => 'hiredBy')), 'hiredAgainstName' => array('desc' => $lng->getTrn('common/opponent'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, false, false, false), 'field' => 'obj_id', 'value' => 'hiredAgainst')), 'cp' => array('desc' => 'Cp'), 'td' => array('desc' => 'Td'), 'intcpt' => array('desc' => 'Int'), 'cas' => array('desc' => 'Cas'), 'bh' => array('desc' => 'BH'), 'si' => array('desc' => 'Si'), 'ki' => array('desc' => 'Ki'), 'mvp' => array('desc' => 'MVP'), 'score' => array('desc' => $lng->getTrn('common/score'), 'nosort' => true), 'result' => array('desc' => $lng->getTrn('common/result'), 'nosort' => true), 'match' => array('desc' => $lng->getTrn('common/match'), 'href' => array('link' => 'index.php?section=matches&amp;type=report', 'field' => 'mid', 'value' => 'match_id'), 'nosort' => true));
     if ($star_id) {
         unset($fields['name']);
     }
     if ($obj && $obj_id) {
         unset($fields['hiredByName']);
     }
     $title = $lng->getTrn('common/starhh');
     if ($ANC) {
         $title = "<a name='{$opts['anchor']}'>" . $title . '<a>';
     }
     HTMLOUT::sort_table($title, $opts['url'], $mdat, $fields, sort_rule('star_HH'), isset($_GET["sort{$opts['GET_SS']}"]) ? array(($_GET["dir{$opts['GET_SS']}"] == 'a' ? '+' : '-') . $_GET["sort{$opts['GET_SS']}"]) : array(), $extra);
 }
Пример #2
0
    public static function report()
    {
        // Is $match_id valid?
        $match_id = (int) $_GET['mid'];
        if (!get_alt_col('matches', 'match_id', $match_id, 'match_id')) {
            fatal("Invalid match ID.");
        }
        global $lng, $stars, $rules, $settings, $coach, $racesHasNecromancer, $racesMayRaiseRotters, $DEA, $T_PMD__ENTRY_EXPECTED;
        global $T_MOUT_REL, $T_MOUT_ACH, $T_MOUT_IR, $T_MOUT_INJ;
        global $leagues, $divisions, $tours;
        $T_ROUNDS = Match::getRounds();
        // Perform actions (delete, lock/unlock and reset). Needs the
        $IS_LOCAL_ADMIN = is_object($coach) && $coach->isNodeCommish(T_NODE_TOURNAMENT, get_alt_col('matches', 'match_id', $match_id, 'f_tour_id'));
        self::matchActions($IS_LOCAL_ADMIN);
        // Create objects
        $m = new Match($match_id);
        $team1 = new Team($m->team1_id);
        $team2 = new Team($m->team2_id);
        // Determine visitor privileges.
        $lid = $divisions[$tours[$m->f_tour_id]['f_did']]['f_lid'];
        $ALLOW_EDIT = !$m->locked && is_object($coach) && ($coach->ring == Coach::T_RING_GLOBAL_ADMIN || $leagues[$lid]['ring'] == Coach::T_RING_LOCAL_ADMIN || $coach->isInMatch($m->match_id));
        $DIS = $ALLOW_EDIT ? '' : 'DISABLED';
        // Lock page for other reasons? (Used journeys etc)
        $USED_JOURNEYMAN_PRESENT = false;
        foreach (array(1 => $team1, 2 => $team2) as $id => $t) {
            foreach ($t->getPlayers() as $p) {
                if (!self::player_validation($p, $m)) {
                    continue;
                }
                if (!$m->is_played && $p->is_journeyman_used) {
                    $USED_JOURNEYMAN_PRESENT = true;
                }
            }
        }
        if ($USED_JOURNEYMAN_PRESENT) {
            $DIS = 'DISABLED';
        }
        // Relay to ES report page?
        if (isset($_GET['es_report'])) {
            # Don't care what value the GET field has!
            self::report_ES($match_id, !$ALLOW_EDIT);
            return;
        }
        $easyconvert = new array_to_js();
        @$easyconvert->add_array($stars, 'phpStars');
        // Load stars array into JavaScript array.
        echo $easyconvert->output_all();
        echo '<script language="JavaScript" type="text/javascript">
    var ID_MERCS = ' . ID_MERCS . ';
    var ID_STARS_BEGIN = ' . ID_STARS_BEGIN . ';
    </script>
    ';
        /*****************
         *
         * Submitted form?
         *
         *****************/
        if (isset($_POST['button']) && $ALLOW_EDIT) {
            if (get_magic_quotes_gpc()) {
                $_POST['summary'] = stripslashes($_POST['summary']);
            }
            MTS('Report submit STARTED');
            // FIRST, if any raised zombies are kept we need to create their player objects in order have the correct player- vs. match creation & played dates.
            foreach (array(1 => $team1, 2 => $team2) as $id => $t) {
                if (in_array($t->f_race_id, $racesHasNecromancer) && isset($_POST["t{$id}zombie"])) {
                    $pos_id = $DEA[$t->f_rname]['players']['Zombie']['pos_id'];
                    list($exitStatus, $pid) = Player::create(array('nr' => $t->getFreePlayerNr(), 'f_pos_id' => $pos_id, 'team_id' => $t->team_id, 'name' => 'RAISED ZOMBIE'), array('free' => true));
                    /*
                        Knowing the new zombie's PID we relocate the zombie match data to regular player data - this allows us
                        to use the same loop for submitting the zombie's match data.
                    */
                    foreach ($T_PMD__ENTRY_EXPECTED as $f) {
                        $postName = "{$f}_t{$id}zombie";
                        $_POST["{$f}_{$pid}"] = isset($_POST[$postName]) ? $_POST[$postName] : 0;
                        unset($_POST[$postName]);
                    }
                }
            }
            // SECONDLY, look for raised rotters too, do same as above with zombies...
            foreach (array(1 => $team1, 2 => $team2) as $id => $t) {
                if (in_array($t->f_race_id, $racesMayRaiseRotters) && isset($_POST["t{$id}rotterCnt"]) && ($N = (int) $_POST["t{$id}rotterCnt"]) > 0) {
                    foreach (range(1, $N) as $n) {
                        $pos_id = $DEA[$t->f_rname]['players']['Rotter']['pos_id'];
                        list($exitStatus, $pid) = Player::create(array('nr' => $t->getFreePlayerNr(), 'f_pos_id' => $pos_id, 'team_id' => $t->team_id, 'name' => "RAISED ROTTER {$n}"), array('free' => true));
                        /*
                            Knowing the new rotter's PID we relocate the rotter match data to regular player data - this allows us
                            to use the same loop for submitting the rotter's match data.
                        */
                        foreach ($T_PMD__ENTRY_EXPECTED as $f) {
                            $postName = "{$f}_t{$id}rotter{$n}";
                            $_POST["{$f}_{$pid}"] = isset($_POST[$postName]) ? $_POST[$postName] : 0;
                            unset($_POST[$postName]);
                        }
                    }
                }
            }
            // Update general match data
            status($m->update(array('submitter_id' => (int) $_SESSION['coach_id'], 'stadium' => (int) $_POST['stadium'], 'gate' => (int) $_POST['gate'] * 1000, 'fans' => (int) $_POST['fans'], 'ffactor1' => (int) $_POST['ff1'], 'ffactor2' => (int) $_POST['ff2'], 'income1' => (int) $_POST['inc1'] * 1000, 'income2' => (int) $_POST['inc2'] * 1000, 'team1_score' => (int) $_POST['result1'], 'team2_score' => (int) $_POST['result2'], 'smp1' => (int) $_POST['smp1'], 'smp2' => (int) $_POST['smp2'], 'tcas1' => (int) $_POST['tcas1'], 'tcas2' => (int) $_POST['tcas2'], 'fame1' => (int) $_POST['fame1'], 'fame2' => (int) $_POST['fame2'], 'tv1' => (int) $_POST['tv1'] * 1000, 'tv2' => (int) $_POST['tv2'] * 1000)), 'Saving match report');
            if (!empty($_POST['summary'])) {
                $m->saveText($_POST['summary']);
                # Save summery.
            }
            MTS('matches entry submitted');
            // Update match's player data
            foreach (array(1 => $team1, 2 => $team2) as $id => $t) {
                /* Save ordinary players */
                foreach ($t->getPlayers() as $p) {
                    if (!self::player_validation($p, $m)) {
                        continue;
                    }
                    // We create zero entries for MNG player(s). This is required!
                    $pid = $p->player_id;
                    # Shortcut
                    if ($p->getStatus($m->match_id) == MNG) {
                        $_POST["mvp_{$pid}"] = 0;
                        $_POST["cp_{$pid}"] = 0;
                        $_POST["td_{$pid}"] = 0;
                        $_POST["intcpt_{$pid}"] = 0;
                        $_POST["bh_{$pid}"] = 0;
                        $_POST["si_{$pid}"] = 0;
                        $_POST["ki_{$pid}"] = 0;
                        $_POST["ir1_d1_{$pid}"] = 0;
                        $_POST["ir1_d2_{$pid}"] = 0;
                        $_POST["ir2_d1_{$pid}"] = 0;
                        $_POST["ir2_d2_{$pid}"] = 0;
                        $_POST["ir3_d1_{$pid}"] = 0;
                        $_POST["ir3_d2_{$pid}"] = 0;
                        $_POST["inj_{$pid}"] = NONE;
                        $_POST["agn1_{$pid}"] = NONE;
                        $_POST["agn2_{$pid}"] = NONE;
                    }
                    $m->entry($p->player_id, array('mvp' => $_POST["mvp_{$pid}"], 'cp' => $_POST["cp_{$pid}"], 'td' => $_POST["td_{$pid}"], 'intcpt' => $_POST["intcpt_{$pid}"], 'bh' => $_POST["bh_{$pid}"], 'si' => $_POST["si_{$pid}"], 'ki' => $_POST["ki_{$pid}"], 'ir1_d1' => $_POST["ir1_d1_{$pid}"], 'ir1_d2' => $_POST["ir1_d2_{$pid}"], 'ir2_d1' => $_POST["ir2_d1_{$pid}"], 'ir2_d2' => $_POST["ir2_d2_{$pid}"], 'ir3_d1' => $_POST["ir3_d1_{$pid}"], 'ir3_d2' => $_POST["ir3_d2_{$pid}"], 'inj' => $_POST["inj_{$pid}"], 'agn1' => $_POST["agn1_{$pid}"], 'agn2' => $_POST["agn2_{$pid}"]));
                }
                MTS('Saved all REGULAR player entries in match_data for team ' . $id);
                /*
                    Save stars entries.
                */
                foreach ($stars as $star) {
                    $s = new Star($star['id']);
                    if (isset($_POST['team_' . $star['id']]) && $_POST['team_' . $star['id']] == $id) {
                        $sid = $s->star_id;
                        $m->entry($sid, array('f_team_id' => $t->team_id, 'mvp' => isset($_POST["mvp_{$sid}"]) && $_POST["mvp_{$sid}"] ? 1 : 0, 'cp' => $_POST["cp_{$sid}"], 'td' => $_POST["td_{$sid}"], 'intcpt' => $_POST["intcpt_{$sid}"], 'bh' => $_POST["bh_{$sid}"], 'si' => $_POST["si_{$sid}"], 'ki' => $_POST["ki_{$sid}"], 'ir1_d1' => 0, 'ir1_d2' => 0, 'ir2_d1' => 0, 'ir2_d2' => 0, 'ir3_d1' => 0, 'ir3_d2' => 0, 'inj' => NONE, 'agn1' => NONE, 'agn2' => NONE));
                    } else {
                        $s->rmMatchEntry($m->match_id, $t->team_id);
                    }
                }
                MTS('Saved all STAR player entries in match_data for team ' . $id);
                /*
                    Save mercenary entries.
                */
                Mercenary::rmMatchEntries($m->match_id, $t->team_id);
                // Remove all previously saved mercs in this match.
                for ($i = 0; $i <= 20; $i++) {
                    # We don't expect over 20 mercs. This is just some large random number.
                    $idm = '_' . ID_MERCS . '_' . $i;
                    if (isset($_POST["team{$idm}"]) && $_POST["team{$idm}"] == $id) {
                        $m->entry(ID_MERCS, array('f_team_id' => $t->team_id, 'nr' => $i, 'skills' => $_POST["skills{$idm}"], 'mvp' => isset($_POST["mvp{$idm}"]) && $_POST["mvp{$idm}"] ? 1 : 0, 'cp' => $_POST["cp{$idm}"], 'td' => $_POST["td{$idm}"], 'intcpt' => $_POST["intcpt{$idm}"], 'bh' => $_POST["bh{$idm}"], 'si' => $_POST["si{$idm}"], 'ki' => $_POST["ki{$idm}"], 'ir1_d1' => 0, 'ir1_d2' => 0, 'ir2_d1' => 0, 'ir2_d2' => 0, 'ir3_d1' => 0, 'ir3_d2' => 0, 'inj' => NONE, 'agn1' => NONE, 'agn2' => NONE));
                    }
                }
                MTS('Saved all MERC player entries in match_data for team ' . $id);
            }
            $m->finalizeMatchSubmit();
            # Required!
            MTS('Report submit ENDED');
            // Refresh objects used to display form.
            $m = new Match($match_id);
            $team1 = new Team($m->team1_id);
            $team2 = new Team($m->team2_id);
        }
        // Change round form submitted?
        if ($IS_LOCAL_ADMIN && isset($_POST['round'])) {
            status($m->chRound((int) $_POST['round']));
        }
        /****************
         *
         * Generate form
         *
         ****************/
        $teamUrl1 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team1_id, false, false) . "\">" . $m->team1_name . "</a>";
        $teamUrl2 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team2_id, false, false) . "\">" . $m->team2_name . "</a>";
        $coachUrl1 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $team1->owned_by_coach_id, false, false) . "\">" . $team1->f_cname . "</a>";
        $coachUrl2 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $team2->owned_by_coach_id, false, false) . "\">" . $team2->f_cname . "</a>";
        $raceUrl1 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_RACE, $team1->f_race_id, false, false) . "\">" . $lng->getTrn('race/' . strtolower(str_replace(' ', '', $team1->f_rname))) . "</a>";
        $raceUrl2 = "<a href=\"" . urlcompile(T_URL_PROFILE, T_OBJ_RACE, $team2->f_race_id, false, false) . "\">" . $lng->getTrn('race/' . strtolower(str_replace(' ', '', $team2->f_rname))) . "</a>";
        $leagueUrl = League::getLeagueUrl(get_parent_id(T_NODE_MATCH, $m->match_id, T_NODE_LEAGUE));
        $divUrl = "<a href=\"" . urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, T_NODE_DIVISION, get_parent_id(T_NODE_MATCH, $m->match_id, T_NODE_DIVISION)) . "\">" . get_parent_name(T_NODE_MATCH, $m->match_id, T_NODE_DIVISION) . "</a>";
        $tourUrl = Tour::getTourUrl(get_parent_id(T_NODE_MATCH, $m->match_id, T_NODE_TOURNAMENT));
        title($teamUrl1 . " - " . $teamUrl2);
        $CP = 8;
        // Colspan.
        ?>
    <table>
    <tr><td></td><td style='text-align: right;'><i><?php 
        echo $lng->getTrn('common/home');
        ?>
</i></td><td>&mdash;</td><td style='text-align: left;'><i><?php 
        echo $lng->getTrn('common/away');
        ?>
</i></td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/teams');
        ?>
</b>:</td><td style='text-align: right;'><?php 
        echo "{$teamUrl1}</td><td> &mdash; </td><td style='text-align: left;'>{$teamUrl2}";
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/coaches');
        ?>
</b>:</td><td style='text-align: right;'><?php 
        echo "{$coachUrl1}</td><td> &mdash; </td><td style='text-align: left;'>{$coachUrl2}";
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/races');
        ?>
</b>:</td><td style='text-align: right;'><?php 
        echo "{$raceUrl1}</td><td> &mdash; </td><td style='text-align: left;'>{$raceUrl2}";
        ?>
</td></tr>
    <tr><td colspan="4"><hr></td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/league');
        ?>
</b>:</td><td colspan="3">    <?php 
        echo $leagueUrl;
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/division');
        ?>
</b>:</td><td colspan="3">  <?php 
        echo $divUrl;
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/tournament');
        ?>
</b>:</td><td colspan="3"><?php 
        echo $tourUrl;
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/round');
        ?>
</b>:</td><td colspan="3">     <?php 
        echo $T_ROUNDS[$m->round];
        ?>
</td></tr>
    <tr><td><b><?php 
        echo $lng->getTrn('common/dateplayed');
        ?>
</b>:</td><td colspan="3"><?php 
        echo $m->is_played ? textdate($m->date_played) : '<i>' . $lng->getTrn('matches/report/notplayed') . '</i>';
        ?>
</td></tr>
    <?php 
        if (Module::isRegistered('PDFMatchReport')) {
            $str = '<a href="handler.php?type=pdfmatchreport&amp;tid1=' . $team1->team_id . '&amp;tid2=' . $team2->team_id . '&amp;mid=' . $m->match_id . '" TARGET="_blank">Download PDF report</a>';
            echo "<tr><td><b>Match report</b>:</td><td>{$str}</td></tr>";
        }
        if (Module::isRegistered('UPLOAD_BOTOCS')) {
            echo "<tr><td><b>Replay</b>:</td><td colspan='3'><a href='handler.php?type=leegmgr&amp;replay={$m->match_id}'>View replay</a></td></tr>";
        }
        if ($IS_LOCAL_ADMIN) {
            ?>
		<script language="JavaScript" type="text/javascript">
			function match_delete() {
				return confirm('<?php 
            echo $lng->getTrn('matches/tourmatches/matchdelete');
            ?>
');
			}
			function match_reset() {
				return confirm('<?php 
            echo $lng->getTrn('matches/tourmatches/reset_notice');
            ?>
');
			}
		</script>
	    <?php 
            $matchURL = "index.php?section=matches&type=report&amp;mid={$m->match_id}";
            $deleteURL = "index.php?section=matches&amp;type=tourmatches&amp;trid={$m->f_tour_id}&amp;mid={$m->match_id}";
            echo "<tr><td><b>Admin:</b></td><td colspan='3'><b>";
            echo "<a onclick=\"return match_reset();\" href='{$matchURL}&amp;action=reset'>" . $lng->getTrn('common/reset') . "</a>&nbsp;\n";
            echo "<a onclick=\"return match_delete();\" href='{$deleteURL}&amp;action=delete' style='color:" . (!empty($m->date_played) ? 'Red' : 'Blue') . ";'>" . $lng->getTrn('common/delete') . "</a>&nbsp;\n";
            echo "<a href='{$matchURL}&amp;action=" . ($m->locked ? 'unlock' : 'lock') . "'>" . ($m->locked ? $lng->getTrn('common/unlock') : $lng->getTrn('common/lock')) . "</a>&nbsp;\n";
            echo "<br><a href='javascript:void(0);' onClick='slideToggleFast(\"chRound\");'>" . $lng->getTrn('matches/report/chround') . "</a><div id='chRound' style='display:none;'>\n\t\t<form method='POST'>\n\t\t<select name='round'>";
            foreach ($T_ROUNDS as $id => $desc) {
                echo "<option value='{$id}'>" . $desc . "</option>\n";
            }
            echo "</select>\n\t\t<input type='submit' value='" . $lng->getTrn('matches/report/chround') . "'>\n\t\t</form>\n\t\t</div>";
            echo "</b></td></tr>";
        }
        ?>
    </table>
    <br>
    <?php 
        echo "<b><a TARGET='_blank' href='" . DOC_URL_GUIDE . "'>" . $lng->getTrn('common/needhelp') . "</a></b><br><br>";
        ?>
    <form method="POST" enctype="multipart/form-data">
        <table class="common">
            <tr class='commonhead'><td colspan="<?php 
        echo $CP;
        ?>
"><b><?php 
        echo $lng->getTrn('matches/report/info');
        ?>
</b></td></tr>
            <tr><td class='seperator' colspan='<?php 
        echo $CP;
        ?>
'></td></tr>
            <tr><td colspan='<?php 
        echo $CP;
        ?>
'>
                <b><?php 
        echo $lng->getTrn('matches/report/stadium');
        ?>
</b>&nbsp;
                <select name="stadium" <?php 
        echo $DIS;
        ?>
>
                    <?php 
        $stad = $m->stadium ? $m->stadium : $m->team1_id;
        foreach (array($team1, $team2) as $_t) {
            echo "<option value='{$_t->team_id}'" . ($stad == $_t->team_id ? 'SELECTED' : '') . ">{$_t->name}</option>\n";
        }
        ?>
                </select>
            </td></tr>
            <tr><td colspan='<?php 
        echo $CP;
        ?>
'>
                <b><?php 
        echo $lng->getTrn('common/gate');
        ?>
</b>&nbsp;
                <input type="text" name="gate" onChange='numError(this);' value="<?php 
        echo $m->gate ? $m->gate / 1000 : 0;
        ?>
" size="4" maxlength="4" <?php 
        echo $DIS;
        ?>
>k
            </td></tr>
            <tr><td colspan='<?php 
        echo $CP;
        ?>
'>
                <b><?php 
        echo $lng->getTrn('matches/report/fans');
        ?>
</b>&nbsp;
                <input type="text" name="fans" onChange='numError(this);' value="<?php 
        echo $m->fans;
        ?>
" size="7" maxlength="12" <?php 
        echo $DIS;
        ?>
>
            </td></tr>
            <?php 
        if (!$settings['hide_ES_extensions']) {
            ?>
                <tr><td colspan='<?php 
            echo $CP;
            ?>
'>
                    <b>E</b>xtra player <b>S</b>tats (ES) <a href="index.php?section=matches&amp;type=report&amp;mid=<?php 
            echo $m->match_id;
            ?>
&amp;es_report=1">report page here</a>
                </td></tr>
                <?php 
        }
        ?>
            <tr><td class="seperator" colspan='<?php 
        echo $CP;
        ?>
'></td></tr>
            <tr class='commonhead'>
                <td><b><?php 
        echo $lng->getTrn('common/teams');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('common/score');
        ?>
</b></td>
                <td><b>&Delta; <?php 
        echo $lng->getTrn('matches/report/treas');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('matches/report/ff');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('matches/report/smp');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('matches/report/tcas');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('matches/report/fame');
        ?>
</b></td>
                <td><b><?php 
        echo $lng->getTrn('matches/report/tv');
        ?>
</b></td>
            </tr>

            <tr><td class='seperator' colspan='<?php 
        echo $CP;
        ?>
'></td></tr>
            <?php 
        foreach (array(1, 2) as $N) {
            echo "<tr>\n";
            echo "<td>" . ${"teamUrl{$N}"} . "</td>\n";
            echo "<td><input type='text' onChange='numError(this);' name='result{$N}' value='" . (int) $m->{"team{$N}_score"} . "' size='1' maxlength='2' {$DIS}></td>\n";
            echo "<td><input type='text' onChange='numErrorAllowNegative(this);' name='inc{$N}' value='" . (int) $m->{"income{$N}"} / 1000 . "' size='4' maxlength='4' {$DIS}>k</td>\n";
            echo "<td>";
            foreach (array('1' => 'green', '0' => 'blue', '-1' => 'red') as $Nff => $color) {
                echo "<input {$DIS} type='radio' name='ff{$N}' value='{$Nff}' " . ($m->{"ffactor{$N}"} == (int) $Nff ? 'CHECKED' : '') . "><font color='{$color}'><b>{$Nff}</b></font>";
            }
            echo "</td>\n";
            echo "<td><input type='text' onChange='numError(this);' name='smp{$N}' value='" . $m->{"smp{$N}"} . "' size='1' maxlength='2' {$DIS}>" . $lng->getTrn('matches/report/pts') . "</td>\n";
            echo "<td><input type='text' onChange='numError(this);' name='tcas{$N}' value='" . $m->{"tcas{$N}"} . "' size='1' maxlength='2' {$DIS}></td>\n";
            echo "<td><input type='text' onChange='numError(this);' name='fame{$N}' value='" . $m->{"fame{$N}"} . "' size='1' maxlength='2' {$DIS}></td>\n";
            echo "<td><input type='text' onChange='numError(this);' name='tv{$N}' value='" . ($m->is_played ? $m->{"tv{$N}"} / 1000 : ${"team{$N}"}->value / 1000) . "' size='4' maxlength='10' {$DIS}>k</td>\n";
            echo "</tr>\n";
        }
        ?>
        </table>

        <?php 
        $playerFields = array_merge($T_MOUT_REL, $T_MOUT_ACH, $T_MOUT_IR, $T_MOUT_INJ);
        $CPP = count($playerFields);
        foreach (array(1 => $team1, 2 => $team2) as $id => $t) {
            ?>
            <table class='common'>
            <tr><td class='seperator' colspan='<?php 
            echo $CPP;
            ?>
'></td></tr>
            <tr class='commonhead'><td colspan='<?php 
            echo $CPP;
            ?>
'>
                <b><a href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $t->team_id, false, false);
            ?>
"><?php 
            echo $t->name;
            ?>
</a> <?php 
            echo $lng->getTrn('matches/report/report');
            ?>
</b>
            </td></tr>
            <tr><td class='seperator' colspan='<?php 
            echo $CPP;
            ?>
'></td></tr>
            <?php 
            echo "<tr>\n";
            foreach (array_values($playerFields) as $f) {
                // We need to translate table headers
                switch (strtolower(str_replace(' ', '', $f))) {
                    case 'name':
                        $header_text = $lng->getTrn('common/name');
                        break;
                    case 'mvp':
                        $header_text = $lng->getTrn('matches/report/mvp');
                        break;
                    case 'cp':
                        $header_text = $lng->getTrn('matches/report/cp');
                        break;
                    case 'bh':
                        $header_text = $lng->getTrn('matches/report/bh');
                        break;
                    case 'si':
                        $header_text = $lng->getTrn('matches/report/si');
                        break;
                    case 'ki':
                        $header_text = $lng->getTrn('matches/report/ki');
                        break;
                    case 'ir1d1':
                        $header_text = $lng->getTrn('matches/report/ir1') . " D1";
                        break;
                    case 'ir1d2':
                        $header_text = $lng->getTrn('matches/report/ir1') . " D2";
                        break;
                    case 'ir2d1':
                        $header_text = $lng->getTrn('matches/report/ir2') . " D1";
                        break;
                    case 'ir2d2':
                        $header_text = $lng->getTrn('matches/report/ir2') . " D2";
                        break;
                    case 'ir3d1':
                        $header_text = $lng->getTrn('matches/report/ir3') . " D1";
                        break;
                    case 'ir3d2':
                        $header_text = $lng->getTrn('matches/report/ir3') . " D2";
                        break;
                    case 'inj':
                        $header_text = $lng->getTrn('matches/report/inj');
                        break;
                    case 'ageing1':
                        $header_text = $lng->getTrn('matches/report/ageing1');
                        break;
                    case 'ageing2':
                        $header_text = $lng->getTrn('matches/report/ageing2');
                        break;
                    default:
                        $header_text = $f;
                }
                echo "<td><i>{$header_text}</i></td>\n";
            }
            echo "</tr>\n";
            $NORMSTAT = true;
            // only normal player statuses
            foreach ($t->getPlayers() as $p) {
                if (!self::player_validation($p, $m)) {
                    continue;
                }
                // Fetch player data from match
                $status = $p->getStatus($m->match_id);
                $mdat = $m->getPlayerEntry($p->player_id);
                // Print player row
                if ($p->is_journeyman_used && !$m->is_played) {
                    $bgcolor = COLOR_HTML_JOURNEY_USED;
                    $NORMSTAT = false;
                } elseif ($p->is_journeyman) {
                    $bgcolor = COLOR_HTML_JOURNEY;
                    $NORMSTAT = false;
                } elseif ($status == MNG) {
                    $bgcolor = COLOR_HTML_MNG;
                    $NORMSTAT = false;
                } elseif ($p->mayHaveNewSkill()) {
                    $bgcolor = COLOR_HTML_NEWSKILL;
                    $NORMSTAT = false;
                } else {
                    $bgcolor = false;
                }
                self::_print_player_row($p->player_id, '<a href="index.php?section=objhandler&type=1&obj=1&obj_id=' . $p->player_id . '">' . $p->name . '</a>', $p->nr, $lng->getTrn('position/' . strtolower($lng->FilterPosition($p->position))) . ($status == MNG ? '&nbsp;[MNG]' : ''), $bgcolor, $mdat, $DIS || $status == MNG);
            }
            echo "</table>\n";
            echo "<br>\n";
            if (!$NORMSTAT) {
                ?>
<table class="text"><tr><td style="width: 100%;"></td><?php 
                if (1) {
                    ?>
                    <td style="background-color: <?php 
                    echo COLOR_HTML_MNG;
                    ?>
;"><font color='black'><b>&nbsp;MNG&nbsp;</b></font></td>
                    <td style="background-color: <?php 
                    echo COLOR_HTML_JOURNEY;
                    ?>
;"><font color='black'><b>&nbsp;Journeyman&nbsp;</b></font></td>
                    <td style="background-color: <?php 
                    echo COLOR_HTML_JOURNEY_USED;
                    ?>
;"><font color='black'><b>&nbsp;Used&nbsp;journeyman&nbsp;</b></font></td>
                    <td style="background-color: <?php 
                    echo COLOR_HTML_NEWSKILL;
                    ?>
;"><font color='black'><b>&nbsp;New&nbsp;skill&nbsp;available&nbsp;</b></font></td>
                    <?php 
                }
                ?>
</tr></table><?php 
            }
            // Add raised zombies
            global $racesHasNecromancer;
            if (in_array($t->f_race_id, $racesHasNecromancer)) {
                echo "<hr style='width:200px;float:left;'><br>\n                <b>Raised zombie?:</b> <input type='checkbox' name='t{$id}zombie' value='1' onclick='slideToggleFast(\"t{$id}zombie\");'><br>\n";
                echo "<div id='t{$id}zombie' style='display:none;'>\n";
                echo "<table class='common'>\n";
                self::_print_player_row("t{$id}zombie", 'Raised zombie', '&mdash;', 'Zombie', false, array(), $DIS);
                echo "</table>\n";
                echo "</div>\n";
            }
            // Add raised rotters
            global $racesMayRaiseRotters;
            if (in_array($t->f_race_id, $racesMayRaiseRotters)) {
                $maxRotters = 6;
                # Note there is no real limit for raised rotters.
                echo "<hr style='width:200px;float:left;'><br>\n                <b>Raised rotters?:</b>\n                <select name='t{$id}rotterCnt' onChange='var i = this.options[this.selectedIndex].value; var j=1; for (j=1; j<={$maxRotters}; j++) {if (j<=i) {slideDownFast(\"t{$id}rotter\"+j);} else {slideUpFast(\"t{$id}rotter\"+j);}}' >";
                foreach (range(0, $maxRotters) as $n) {
                    echo "<option value='{$n}'>{$n}</option>";
                }
                echo "</select>\n";
                foreach (range(0, $maxRotters) as $n) {
                    echo "<div id='t{$id}rotter{$n}' style='display:none;'><table class='common'>\n";
                    self::_print_player_row("t{$id}rotter{$n}", "Raised Rotter #{$n}", '&mdash;', 'Rotter', false, array(), $DIS);
                    echo "</table></div>\n";
                }
            }
            ?>

            <table style='border-spacing: 0px 10px;'>
                <tr><td align="left" valign="top">
                    <b>Star Players</b>:
                    <input type='button' id="addStarsBtn_<?php 
            echo $id;
            ?>
" value="<?php 
            echo $lng->getTrn('common/add');
            ?>
"
                    onClick="stars = document.getElementById('stars_<?php 
            echo $id;
            ?>
'); addStarMerc(<?php 
            echo $id;
            ?>
, stars.options[stars.selectedIndex].value);" <?php 
            echo $DIS;
            ?>
>
                    <select id="stars_<?php 
            echo $id;
            ?>
" <?php 
            echo $DIS;
            ?>
>
                        <?php 
            foreach ($stars as $s => $d) {
                echo "<option " . (in_array($t->f_race_id, $d['races']) ? 'style="background-color: ' . COLOR_HTML_READY . ';"' : '') . " value='{$d['id']}'>{$s}</option>\n";
            }
            ?>
                    </select>
                </td></tr>
                <tr><td align="left" valign="top">
                    <b>Mercenaries</b>: <input type='button' id="addMercsBtn_<?php 
            echo $id;
            ?>
" value="<?php 
            echo $lng->getTrn('common/add');
            ?>
" onClick="addStarMerc(<?php 
            echo "{$id}, " . ID_MERCS;
            ?>
);" <?php 
            echo $DIS;
            ?>
>
                </td></tr>
            </table>

            <table class='common' id='<?php 
            echo "starsmercs_{$id}";
            ?>
'>
            </table>
            <?php 
        }
        ?>
        <table class='common'>
            <tr><td class='seperator' colspan='13'></td></tr>
            <tr class='commonhead'><td colspan='13'><b><?php 
        echo $lng->getTrn('matches/report/summary');
        ?>
</b></td></tr>
            <tr><td colspan='13'><textarea name='summary' rows='10' cols='100' <?php 
        echo $DIS . ">" . $m->getText();
        ?>
</textarea></td></tr>
        </table>
        <br>
        <center>
            <input type="submit" name='button' value="<?php 
        echo $lng->getTrn('common/save');
        ?>
" <?php 
        echo $DIS;
        ?>
>
            <?php 
        if ($USED_JOURNEYMAN_PRESENT) {
            echo "<br><br><b>" . $lng->getTrn('matches/report/usedjourney') . "</b>";
        }
        ?>
        </center>
    </form>
    <br><br>
    <?php 
        /*
            Now, we call javascript routine(s) to fill out stars and mercs rows, if such entries exist in database.
        */
        $i = 0;
        // Counter. Used to pass PHP-data to Javascript.
        foreach (array(1 => $team1->team_id, 2 => $team2->team_id) as $id => $t) {
            foreach (Star::getStars(STATS_TEAM, $t, STATS_MATCH, $m->match_id) as $s) {
                echo "<script language='JavaScript' type='text/javascript'>\n";
                echo "var mdat{$i} = [];\n";
                $mdat = $s->getStats(T_NODE_MATCH, $m->match_id);
                foreach (array_keys($T_MOUT_ACH) as $f) {
                    echo "mdat{$i}['{$f}'] = " . $mdat[$f] . ";\n";
                }
                echo "existingStarMerc({$id}, {$s->star_id}, mdat{$i});\n";
                echo "</script>\n";
                $i++;
            }
            foreach (Mercenary::getMercsHiredByTeam($t, $m->match_id) as $merc) {
                echo "<script language='JavaScript' type='text/javascript'>\n";
                echo "var mdat{$i} = [];\n";
                foreach (array_merge(array_keys($T_MOUT_ACH), array('skills')) as $f) {
                    echo "mdat{$i}['{$f}'] = " . $merc->{$f} . ";\n";
                }
                echo "existingStarMerc({$id}, " . ID_MERCS . ", mdat{$i});\n";
                echo "</script>\n";
                $i++;
            }
        }
    }
Пример #3
0
    public static function handlePost($cid)
    {
        global $lng, $_POST, $coach, $raceididx, $DEA, $rules, $racesNoApothecary;
        if (!isset($_POST['action'])) {
            return;
        }
        if (!self::allowEdit($cid, $coach)) {
            status(false, $lng->getTrn('notallowed', 'TeamCreator'));
            return;
        }
        $lid_did = $_POST['lid_did'];
        @(list($lid, $did) = explode(',', $_POST['lid_did']));
        setupGlobalVars(T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS, array('lid' => (int) $lid));
        // Load correct $rules for league.
        if (get_magic_quotes_gpc()) {
            $_POST['tname'] = stripslashes($_POST['tname']);
        }
        $rid = $_POST['raceid'];
        $race = $DEA[$raceididx[$rid]];
        /* Handle or the 'other' stuff around the team - rerolls etc */
        $rerolls = $_POST['qtyo0'];
        $fans = $_POST['qtyo1'];
        $cl = $_POST['qtyo2'];
        $ac = $_POST['qtyo3'];
        $treasury = $rules['initial_treasury'];
        $treasury -= $rerolls * $race['other']['rr_cost'];
        $treasury -= $fans * 10000;
        $treasury -= $cl * 10000;
        $treasury -= $ac * 10000;
        $rerolls += $rules['initial_rerolls'];
        $fans += $rules['initial_fan_factor'];
        $cl += $rules['initial_ass_coaches'];
        $ac += $rules['initial_cheerleaders'];
        if (!in_array($rid, $racesNoApothecary)) {
            $apoth = $_POST['qtyo4'];
            if ($apoth) {
                $treasury -= 50000;
            }
        } else {
            $apoth = 0;
        }
        /* Create an array with all the players in. Do this first to check for sufficient funds */
        $players = array();
        $idx = 0;
        $rosterNum = 1;
        foreach ($race['players'] as $pos => $d) {
            $pid = $_POST['pid' . $idx];
            if ($pid != $d['pos_id']) {
                // mismatched position ID
                status(false, $pid . ' but was ' . $d['pos_id']);
                return;
            }
            $qty = $_POST['qtyp' . $idx];
            for ($i = 0; $i < $qty; $i++) {
                $treasury -= $d['cost'];
                $player = array();
                $player['name'] = "";
                $player['nr'] = $rosterNum++;
                $player['f_pos_id'] = $d['pos_id'];
                $players[] = $player;
            }
            $idx++;
        }
        /* Enforce league rules and common BB ones */
        $errors = array();
        if ($treasury < 0) {
            $errors[] = $lng->getTrn('tooExpensive', 'TeamCreator');
        }
        if (sizeof($players) < 11) {
            $errors[] = $lng->getTrn('tooFewPlayers', 'TeamCreator');
        }
        if (sizeof($players) > $rules['max_team_players']) {
            $errors[] = $lng->getTrn('tooManyPlayers', 'TeamCreator');
        }
        if (self::checkLimit($rules['max_rerolls'], $rerolls)) {
            $errors[] = $lng->getTrn('tooManyRR', 'TeamCreator') . " " . $rerolls . " vs " . $rules['max_rerolls'];
        }
        if (self::checkLimit($rules['max_fan_factor'], $fans)) {
            $errors[] = $lng->getTrn('tooManyFF', 'TeamCreator') . " " . $fans . " vs " . $rules['max_fan_factor'];
        }
        if (self::checkLimit($rules['max_ass_coaches'], $ac)) {
            $errors[] = $lng->getTrn('tooManyAc', 'TeamCreator') . " " . $ac . " vs " . $rules['max_ass_coaches'];
        }
        if (self::checkLimit($rules['max_cheerleaders'], $cl)) {
            $errors[] = $lng->getTrn('tooManyCl', 'TeamCreator') . " " . $cl . " vs " . $rules['max_cheerleaders'];
        }
        /* Actually create the team in the database */
        if (sizeof($errors) == 0) {
            list($exitStatus, $tid) = Team::create(array('name' => $_POST['tname'], 'owned_by_coach_id' => (int) $cid, 'f_race_id' => (int) $rid, 'treasury' => $treasury, 'apothecary' => $apoth, 'rerolls' => $rerolls, 'ff_bought' => $fans, 'ass_coaches' => $ac, 'cheerleaders' => $cl, 'won_0' => 0, 'lost_0' => 0, 'draw_0' => 0, 'played_0' => 0, 'wt_0' => 0, 'gf_0' => 0, 'ga_0' => 0, 'imported' => 0, 'f_lid' => (int) $lid, 'f_did' => isset($did) ? (int) $did : Team::T_NO_DIVISION_TIE));
            if ($exitStatus) {
                $errors[] = Team::$T_CREATE_ERROR_MSGS[$exitStatus];
            }
        }
        /* Actually create all the players in the database */
        if (sizeof($errors) == 0) {
            $opts = array();
            $opts['free'] = 1;
            // already deducted cost from treasry
            foreach ($players as $player) {
                $player['team_id'] = $tid;
                list($exitStatus, $pid) = Player::create($player, $opts);
                if ($exitStatus) {
                    $errors = array_merge($errors, Player::$T_CREATE_ERROR_MSGS[$exitStatus]);
                }
            }
        }
        /* Report errors and reset the form, or redirect to the team page */
        if (sizeof($errors) > 0) {
            $msg = implode(",<br />", $errors);
            status(false, $msg);
            $post = (object) $_POST;
            echo <<<EOQ
   <script type="text/javascript">
      \$(document).ready(function() {
      document.getElementById('rid').value = {$post->rid};
      changeRace({$post->rid});
      document.getElementById('tname').value = '{$post->tname}';
EOQ;
            foreach ($_POST as $element => $value) {
                if (0 == strncmp($element, "qty", 3)) {
                    $idx = substr($element, 4, 1);
                    $type = substr($element, 3, 1);
                    echo <<<EOQ

      document.getElementById('{$element}').selectedIndex = {$value};
      updateQty({$idx}, '{$type}', {$value});
EOQ;
                }
            }
            echo <<<EOQ
      var lid = document.getElementById('lid_did');
      for (var i = 0; i < lid.options.length; i++) {
         if (lid.options[i].value=={$post->lid_did}) {
            lid.selectedIndex = i;
            break;
         }
      }
      });
   </script>
EOQ;
        } else {
            // Everything worked, redirect to the team page
            status(true, $lng->getTrn('created', 'TeamCreator'));
            $teamUrl = "'" . str_replace("amp;", "", urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $tid, false, false)) . "'";
            echo <<<EOQ
   <script type="text/javascript">
      \$(document).ready(function() {
         window.location = {$teamUrl};
      });
   </script>
EOQ;
        }
    }
Пример #4
0
    private static function make_menu()
    {
        global $lng, $coach, $settings, $rules, $admin_menu;
        ?>
    <ul class="css3menu1 topmenu">
        <li class="topfirst"><a href="index.php?section=main"><?php 
        echo $lng->getTrn('menu/home');
        ?>
</a>
		 <ul>
            <?php 
        if (Settings::getValueOrDefault('show-regional-menu', false)) {
            foreach (League::getLeaguesByLocation() as $locationName => $leagues) {
                echo '<li><a href="#">' . $locationName . ' ></a><ul>';
                foreach ($leagues as $league) {
                    echo '<li><a href="index.php?SLS_lid=' . $league->lid . '">' . $league->name . '</a></li>';
                }
                echo '</ul></li>';
            }
            if (isset($_SESSION['logged_in'])) {
                echo '<li><a href="index.php?section=requestleague">Request a League</a></li>';
            }
            echo '<li><a href="http://www.thenaf.net/leagues/leagues-locator/" >TheNAF.net League Locator</a></li>';
            echo '<li><a href="index.php?SLS_lid=1" >League Hosting Home</a></li>';
        }
        ?>
            <li><a href="index.php?section=about">About OBBLM</a></li>
		</ul>
    </li>
<?php 
        if (isset($_SESSION['logged_in'])) {
            ?>

<li class="topfirst"><a href="#">User Menu</a>
        <ul>
            <li class="subfirst"><a href="handler.php?type=teamcreator">Create a New Team</a></li>
            <li><a href="index.php?section=matches&amp;type=usersched" >Schedule Match</a></li>
             <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=teams';
            ?>
"><?php 
            echo $lng->getTrn('cc/coach_teams');
            ?>
</a></li>
            <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=profile';
            ?>
"><?php 
            echo $lng->getTrn('cc/profile');
            ?>
</a></li>
            <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=stats';
            ?>
"><?php 
            echo $lng->getTrn('common/stats');
            ?>
</a></li>
           <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=recentmatches';
            ?>
"><?php 
            echo $lng->getTrn('common/recentmatches');
            ?>
</a></li>
            <li><a rel="nofollow"href="index.php?logout=1"><?php 
            echo $lng->getTrn('menu/logout');
            ?>
</a></li>
            </ul><?php 
        } else {
            ?>
<li class="topfirst"><a rel="nofollow" href="index.php?section=login" style="height:20px;line-height:20px;"><?php 
            echo $lng->getTrn('menu/login');
            ?>
</a></li><?php 
        }
        ?>

<?php 
        if (!empty($admin_menu)) {
            ?>
    <li class="topmenu">
        <a href="#"><?php 
            echo $lng->getTrn('menu/admin_menu/name');
            ?>
</a>
        <ul>
            <li class="subfirst">
                <a href="handler.php?type=leaguepref"><?php 
            echo $lng->getTrn('name', 'LeaguePref');
            ?>
</a>
            </li>
            <?php 
            if (Module::isRegistered('Conference')) {
                echo '<li><a href="handler.php?type=conference">' . $lng->getTrn('name', 'Conference') . '</a></li>';
            }
            if (Module::isRegistered('Scheduler')) {
                echo '<li><a href="handler.php?type=scheduler">' . $lng->getTrn('menu/admin_menu/schedule') . '</a></li>';
            }
            foreach ($admin_menu as $lnk => $desc) {
                if (!is_array($desc)) {
                    echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}'>{$desc}</a></li>\n";
                } else {
                    echo '<li><a href="#">' . $desc['title'] . '<ul>';
                    foreach ($desc['sub'] as $sub) {
                        echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}&amp;{$sub['href']}'>{$sub['title']}</a></li>\n";
                    }
                    echo '</ul></li>';
                }
            }
            ?>
        </ul>
    </li>
<?php 
        }
        ?>
        

<li class="topmenu">
    <a href="#">League Menu</a>
    <ul>
        <li class="subfirst"><a href="index.php?section=rules"><?php 
        echo $lng->getTrn('menu/rules');
        ?>
</a></li>
        <li><a href="handler.php?type=leaguetables"><?php 
        echo $lng->getTrn('name', 'LeagueTables');
        ?>
</a></li>
        <li><a href="index.php?section=teamlist"><?php 
        echo $lng->getTrn('menu/teams');
        ?>
</a></li>
        <li><a href="index.php?section=coachlist"><?php 
        echo $lng->getTrn('menu/coaches');
        ?>
</a></li>
        <li><a href="index.php?section=matches&amp;type=recent"><?php 
        echo $lng->getTrn('menu/matches_menu/recent');
        ?>
</a></li>
        <li><a href="index.php?section=matches&amp;type=upcoming"><?php 
        echo $lng->getTrn('menu/matches_menu/upcoming');
        ?>
</a>
        <?php 
        if (!empty($settings['league_url'])) {
            $leagueUrl = $settings['league_url'];
            $leagueUrl = !strpos($leagueUrl, 'http') ? 'http://' . $leagueUrl : $leagueUrl;
            ?>
  <li><a href="<?php 
            echo $leagueUrl;
            ?>
"><?php 
            echo $settings['league_url_name'];
            ?>
</a></li><?php 
        }
        ?>
    </ul>
</li>
        
<li class="topmenu"><a rel="nofollow" href="index.php?section=rules">League History</a>
    <ul>   
        <?php 
        if (Module::isRegistered('Gallery')) {
            ?>
<li><a href="handler.php?type=gallery"><?php 
            echo $lng->getTrn('name', 'Gallery');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Wanted')) {
            ?>
<li><a href="handler.php?type=wanted"><?php 
            echo $lng->getTrn('name', 'Wanted');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Prize')) {
            ?>
<li><a href="handler.php?type=prize"><?php 
            echo $lng->getTrn('name', 'Prize');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('HOF')) {
            ?>
<li><a href="handler.php?type=hof"><?php 
            echo $lng->getTrn('name', 'HOF');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('FamousTeams')) {
            ?>
<li><a href="handler.php?type=famousteams"><?php 
            echo $lng->getTrn('name', 'FamousTeams');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Memmatches')) {
            ?>
<li><a href="handler.php?type=memmatches"><?php 
            echo $lng->getTrn('name', 'Memmatches');
            ?>
</a></li><?php 
        }
        ?>
        <li><a href="index.php?section=matches&amp;type=tours"><?php 
        echo $lng->getTrn('menu/matches_menu/tours');
        ?>
</a></li>
    </ul>
</li>
        
<li class="topmenu"><a rel="nofollow" href="#">Statistics</a>
    <ul>
        <li class="subfirst"><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/team_stn');
        ?>
</a></li>
        <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_PLAYER, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/player_stn');
        ?>
</a></li>
        <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_COACH, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/coach_stn');
        ?>
</a></li>
        <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_RACE, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/race_stn');
        ?>
</a></li>
        <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_STAR, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/star_stn');
        ?>
</a></li>
    </ul>
</li>
        
<li class="topmenu"><a rel="nofollow" href="#">Game Rules</a>
    <ul> 
        <li class="subfirst"><a rel="nofollow" href="#">CRP Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=0" style="height:10px;line-height:10px;">Amazon</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=1" style="height:10px;line-height:10px;">Chaos</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=2" style="height:10px;line-height:10px;">Chaos Dwarf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=3" style="height:10px;line-height:10px;">Dark Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=4" style="height:10px;line-height:10px;">Dwarf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=5" style="height:10px;line-height:10px;">Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=6" style="height:10px;line-height:10px;">Goblin</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=7" style="height:10px;line-height:10px;">Halfling</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=8" style="height:10px;line-height:10px;">High Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=9" style="height:10px;line-height:10px;">Human</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=10" style="height:10px;line-height:10px;">Khemri</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=11" style="height:10px;line-height:10px;">Lizardman</a></li>
           <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=13" style="height:10px;line-height:10px;">Necromantic</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=14" style="height:10px;line-height:10px;">Norse</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=15" style="height:10px;line-height:10px;">Nurgle</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=16" style="height:10px;line-height:10px;">Ogre</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=12" style="height:10px;line-height:10px;">Orc</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=19" style="height:10px;line-height:10px;">Skaven</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=17" style="height:10px;line-height:10px;">Undead</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=18" style="height:10px;line-height:10px;">Vampire</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=20" style="height:10px;line-height:10px;">Wood Elf</a></li>
        </ul></li>
        <li class="subfirst"><a rel="nofollow" href="#">LRB6 Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=21" style="height:10px;line-height:10px;">Chaos Pact</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=22" style="height:10px;line-height:10px;">Slann</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=23" style="height:10px;line-height:10px;">Underworld</a></li>
        </ul></li>
        <li class="subfirst"><a rel="nofollow" href="#">(Optional) Community Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=24" style="height:10px;line-height:10px;">Bretonnian</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=25" style="height:10px;line-height:10px;">Khorne</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=26" style="height:10px;line-height:10px;">Simyin</a></li>
        </ul></li>
        <li><a href="http://www.thenaf.net/wp-content/uploads/2013/06/CRP1.pdf">The CRP (Full Blood Bowl Rules)</a></li>
        <li><a href="http://the-outcast.com/bloodbowl/blood%20bowl%20crp%20lite.pdf">A5 Rules Summary</a></li>  
    </ul>
</li>  

<?php 
        if (Module::isRegistered('Search')) {
            ?>
<li><a href="handler.php?type=search"><?php 
            echo $lng->getTrn('name', 'Search');
            ?>
</a></li><?php 
        }
        ?>
    
    <?php 
    }
Пример #5
0
 private function _games()
 {
     global $lng;
     $team = $this;
     // Copy. Used instead of $this for readability.
     title('<div class="team-management-title">' . $lng->getTrn('profile/team/games') . '</div>');
     HTMLOUT::recentGames(T_OBJ_TEAM, $team->team_id, false, false, false, false, array('url' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . '&amp;subsec=games', 'n' => MAX_RECENT_GAMES, 'GET_SS' => 'gp'));
     echo "<br>";
     HTMLOUT::upcomingGames(T_OBJ_TEAM, $team->team_id, false, false, false, false, array('url' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . '&amp;subsec=games', 'n' => MAX_RECENT_GAMES, 'GET_SS' => 'ug'));
 }
Пример #6
0
    public static function printList($node, $node_id, $ALLOW_EDIT)
    {
        global $lng;
        $entries = self::getFT($node, $node_id);
        echo "<table style='table-layout:fixed; width:" . (count($entries) == 1 ? 50 : 100) . "%;'><tr>";
        # The percentage difference is a HTML layout fix.
        $i = 1;
        foreach ($entries as $e) {
            if ($i > 2) {
                echo "\n</tr>\n<tr>\n";
                $i = 1;
            }
            ?>
        <td style='width:50%;' valign='top'>
        <div class="boxWide" style="width: 80%; margin: 20px auto 20px auto;">
            <div class="boxTitle<?php 
            echo T_HTMLBOX_INFO;
            ?>
">
                <?php 
            echo "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $e->tid, false, false) . "'>{$e->name}</a>";
            echo " (<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $e->f_cid, false, false) . "'>{$e->f_cname}</a>)";
            echo ": " . $e->title;
            ?>
            </div>
            <div class="boxBody">
                <table class="common">
                    <tr>
                        <td align="left" valign="top">
                            <?php 
            echo $e->about;
            ?>
                        </td>
                        <td align="right" style='width:25%;'>
                            <img border='0px' height='75' width='75' alt='team picture' src="<?php 
            $img = new ImageSubSys(IMGTYPE_TEAMLOGO, $e->tid);
            echo $img->getPath();
            ?>
">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
                    <tr>
                        <td align="left">
                        <?php 
            echo $lng->getTrn('posted', __CLASS__) . ' ' . textdate($e->date, true);
            ?>
                        </td>
                        <td colspan="2" align="right">
                        <?php 
            if ($ALLOW_EDIT) {
                ?>
 
                            <a href="handler.php?type=famousteams&amp;action=edit&amp;ft_id=<?php 
                echo $e->ft_id;
                ?>
"><?php 
                echo $lng->getTrn('edit', __CLASS__);
                ?>
</a>
                            &nbsp;
                            <a href="handler.php?type=famousteams&amp;action=delete&amp;ft_id=<?php 
                echo $e->ft_id;
                ?>
"><?php 
                echo $lng->getTrn('del', __CLASS__);
                ?>
</a> 
                            <?php 
            }
            ?>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        </td>
        <?php 
            $i++;
        }
        echo "</tr></table>";
    }
Пример #7
0
 private function _games()
 {
     global $lng;
     $team = $this;
     // Copy. Used instead of $this for readability.
     title("<a name='anc'>" . $lng->getTrn('profile/team/games') . "</a>");
     HTMLOUT::recentGames(T_OBJ_TEAM, $team->team_id, false, false, false, false, array('url' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . '&amp;subsec=games', 'n' => MAX_RECENT_GAMES, 'GET_SS' => 'gp'));
     echo "<br>";
     HTMLOUT::upcomingGames(T_OBJ_TEAM, $team->team_id, false, false, false, false, array('url' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . '&amp;subsec=games', 'n' => MAX_RECENT_GAMES, 'GET_SS' => 'ug'));
     #    upcomingGames($obj, $obj_id, $node, $node_id, $opp_obj, $opp_obj_id, array $opts)
 }
Пример #8
0
    private static function make_menu()
    {
        global $lng, $coach, $settings, $rules, $admin_menu;
        ?>
    <ul id="nav" class="dropdown dropdown-horizontal">
        <?php 
        if (isset($_SESSION['logged_in'])) {
            ?>
<li><a href="index.php?logout=1">     <?php 
            echo $lng->getTrn('menu/logout');
            ?>
</a></li><?php 
        } else {
            ?>
<li><a href="index.php?section=login"><?php 
            echo $lng->getTrn('menu/login');
            ?>
</a></li><?php 
        }
        if (isset($_SESSION['logged_in']) && is_object($coach)) {
            echo '<li><a href="' . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '">' . $lng->getTrn('menu/cc') . ' (' . ucfirst($coach->name) . ')</a></li>';
            if (!empty($admin_menu)) {
                ?>
                <li><span class="dir"><?php 
                echo $lng->getTrn('menu/admin_menu/name');
                ?>
</span>
                    <ul>
                    <?php 
                foreach ($admin_menu as $lnk => $desc) {
                    if (!is_array($desc)) {
                        echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}'>{$desc}</a></li>\n";
                    } else {
                        ?>
                            <li><span class="dir"><?php 
                        echo $desc['title'];
                        ?>
</span>
                            <ul>
                            <?php 
                        foreach ($desc['sub'] as $sub) {
                            echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}&amp;{$sub['href']}'>{$sub['title']}</a></li>\n";
                        }
                        ?>
                            </ul>
                            </li>
                            <?php 
                    }
                }
                ?>
                    </ul>
                </li>
                <?php 
            }
        }
        ?>
        <li><a href="index.php?section=main"><?php 
        echo $lng->getTrn('menu/home');
        ?>
</a></li>
        <li><a href="index.php?section=teamlist"><?php 
        echo $lng->getTrn('menu/teams');
        ?>
</a></li>
        <li><a href="index.php?section=coachlist"><?php 
        echo $lng->getTrn('menu/coaches');
        ?>
</a></li>
        <li><span class="dir"><?php 
        echo $lng->getTrn('menu/matches_menu/name');
        ?>
</span>
            <ul>
                <li><a href="index.php?section=matches&amp;type=tours"><?php 
        echo $lng->getTrn('menu/matches_menu/tours');
        ?>
</a></li>
                <li><a href="index.php?section=matches&amp;type=recent"><?php 
        echo $lng->getTrn('menu/matches_menu/recent');
        ?>
</a></li>
                <li><a href="index.php?section=matches&amp;type=upcoming"><?php 
        echo $lng->getTrn('menu/matches_menu/upcoming');
        ?>
</a></li>
                <?php 
        if (isset($_SESSION['logged_in'])) {
            ?>
                  <li><a href="index.php?section=matches&amp;type=usersched"><?php 
            echo $lng->getTrn('menu/matches_menu/usersched');
            ?>
</a></li>
                <?php 
        }
        ?>
            </ul>
        </li>
        <li><span class="dir"><?php 
        echo $lng->getTrn('menu/statistics_menu/name');
        ?>
</span>
            <ul>
                <li><a href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/team_stn');
        ?>
</a></li>
                <li><a href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_PLAYER, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/player_stn');
        ?>
</a></li>
                <li><a href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_COACH, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/coach_stn');
        ?>
</a></li>
                <li><a href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_RACE, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/race_stn');
        ?>
</a></li>
                <li><a href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_STAR, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/star_stn');
        ?>
</a></li>
            </ul>
        </li>
        <?php 
        // To avoid showing the plugin menu if no plugins are loaded, we start output buffering here
        ob_start();
        ?>
        <?php 
        if (Module::isRegistered('Search')) {
            ?>
<li><a href="handler.php?type=search"><?php 
            echo $lng->getTrn('name', 'Search');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('TeamCompare')) {
            ?>
<li><a href="handler.php?type=teamcompare"><?php 
            echo $lng->getTrn('name', 'TeamCompare');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('HOF')) {
            ?>
<li><a href="handler.php?type=hof"><?php 
            echo $lng->getTrn('name', 'HOF');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('FamousTeams')) {
            ?>
<li><a href="handler.php?type=famousteams"><?php 
            echo $lng->getTrn('name', 'FamousTeams');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Wanted')) {
            ?>
<li><a href="handler.php?type=wanted"><?php 
            echo $lng->getTrn('name', 'Wanted');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Prize')) {
            ?>
<li><a href="handler.php?type=prize"><?php 
            echo $lng->getTrn('name', 'Prize');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Cemetery')) {
            ?>
<li><a href="handler.php?type=cemetery&amp;tid=0"><?php 
            echo $lng->getTrn('name', 'Cemetery');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Memmatches')) {
            ?>
<li><a href="handler.php?type=memmatches"><?php 
            echo $lng->getTrn('name', 'Memmatches');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('SGraph')) {
            ?>
<li><a href="handler.php?type=graph&amp;gtype=<?php 
            echo SG_T_LEAGUE;
            ?>
&amp;id=none"><?php 
            echo $lng->getTrn('name', 'SGraph');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Gallery')) {
            ?>
<li><a href="handler.php?type=gallery"><?php 
            echo $lng->getTrn('name', 'Gallery');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('LeagueTables')) {
            ?>
<li><a href="handler.php?type=leaguetables"><?php 
            echo $lng->getTrn('menu-label', 'LeagueTables');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (Module::isRegistered('Conference')) {
            ?>
<li><a href="handler.php?type=conference"><?php 
            echo $lng->getTrn('menu-conf', 'Conference');
            ?>
</a></li><?php 
        }
        ?>
        <?php 
        if (isset($_SESSION['logged_in']) && is_object($coach) && ($coach->ring == Coach::T_RING_GLOBAL_ADMIN || $coach->ring == Coach::T_RING_LOCAL_ADMIN)) {
            ?>
        <?php 
            if (Module::isRegistered('Scheduler')) {
                ?>
<li><a href="handler.php?type=scheduler"><?php 
                echo $lng->getTrn('name', 'Scheduler');
                ?>
</a></li><?php 
            }
            ?>
        <?php 
            if (Module::isRegistered('UPLOAD_BOTOCS') && $settings['leegmgr_enabled']) {
                ?>
<li><a href="handler.php?type=leegmgr">Client Match Report Upload</a></li><?php 
            }
            ?>
        <?php 
            if (Module::isRegistered('PDFMatchReport')) {
                ?>
<li><a href="handler.php?type=pdfmatchreport"><?php 
                echo $lng->getTrn('name', 'PDFMatchReport');
                ?>
</a></li><?php 
            }
            ?>
        <?php 
        }
        ?>
        <?php 
        $plugin_menu = trim(ob_get_contents());
        ob_end_clean();
        if (strlen($plugin_menu) > 0) {
            ?>
        <li><span class="dir"><?php 
            echo $lng->getTrn('menu/plugins');
            ?>
</span>
            <ul>
              <?php 
            echo $plugin_menu;
            ?>
            </ul>
        </li>
        <?php 
        }
        /*end of output buffering of the plugin menu*/
        ?>

        <li><a href="index.php?section=rules"><?php 
        echo $lng->getTrn('menu/rules');
        ?>
</a></li>
        <li><a href="index.php?section=about">OBBLM</a></li>
        <?php 
        if (!empty($settings['league_url'])) {
            ?>
<li><a href="<?php 
            echo $settings['league_url'];
            ?>
"><?php 
            echo $settings['league_url_name'];
            ?>
</a></li><?php 
        }
        ?>
    </ul>
    <?php 
    }
Пример #9
0
function _infocus($teams)
{
    //Create a new array of teams to display
    $ids = array();
    foreach ($teams as $team) {
        if (!$team['retired']) {
            $ids[] = $team['team_id'];
        }
    }
    if (empty($teams)) {
        return;
    }
    global $lng, $_INFOCUSCNT;
    //Select random team
    $teamKey = array_rand($ids);
    $teamId = $ids[$teamKey];
    $team = new Team($teamId);
    $teamLink = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $teamId, false, false) . "'>{$team->name}</a>";
    //Create $logo_html
    $img = new ImageSubSys(IMGTYPE_TEAMLOGO, $team->team_id);
    $logo_html = "<img border='0px' height='60' alt='Team picture' src='" . $img->getPath($team->f_race_id) . "'>";
    //Create $starPlayers array used to display the three most experienced players on the team
    $starPlayers = array();
    foreach ($team->getPlayers() as $p) {
        if ($p->is_dead || $p->is_sold) {
            continue;
        }
        $starPlayers[] = array('name' => preg_replace('/\\s/', '&nbsp;', $p->name), 'spp' => $p->mv_spp);
    }
    //Sort the array
    usort($starPlayers, create_function('$objA,$objB', 'return ($objA["spp"] < $objB["spp"]) ? +1 : -1;'));
    $starPlayers = array_slice($starPlayers, 0, 3);
    # Show only 3 Star players
    ?>
    <style type="text/css">
        /* InFocus Mod */
        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .leftContentTd{
            font-weight: bold;
            padding-right: 1em;
        }

        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .teamLogo {
            float: left;
            margin: 0 36px 0 20px;
        }

        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .teamName {
            font-weight: bold;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 {
            position:relative;
            left: 160px;
            height: 80px;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 P {
            font-weight: bold;
            margin-top: 5px;
            margin-bottom: 5px;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV {
            position:absolute;
            top:0;
            left:0;
            z-index:8;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.invisible {
            display: none;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.inFocus {
            z-index:10;
            display: inline;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.last-inFocus {
            z-index:9;redeclare compare_spp
        }
    </style>
    <div id="inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
" >
        <h3><?php 
    echo $lng->getTrn('main/infocus') . ': ' . $teamLink;
    ?>
</h3><br>
        <div style='clear:both;'>
            <div class='teamLogo'>
                <?php 
    echo $logo_html;
    ?>
            </div>
            <div id="inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
">
                <div class="inFocus">
                    <table>
                        <tr><td class="leftContentTd"><?php 
    echo $lng->getTrn('common/coach');
    ?>
</td><td><?php 
    echo $team->f_cname;
    ?>
</td></tr>
                        <tr><td class="leftContentTd"><?php 
    echo $lng->getTrn('common/race');
    ?>
</td><td><?php 
    echo $team->f_rname;
    ?>
</td></tr>
                        <tr><td class="leftContentTd"><?php 
    echo 'TV';
    ?>
</td><td><?php 
    echo (string) ($team->tv / 1000);
    ?>
k</td></tr>
                    </table>
                </div>
                <div class="invisible">
                    <p><?php 
    echo $lng->getTrn('common/stars');
    ?>
</p>
                    <table>
                        <?php 
    foreach ($starPlayers as $player) {
        echo "<tr><td class='leftContentTd'>" . $player['name'] . "</td><td>" . $player['spp'] . " spp</td></tr>";
    }
    ?>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script>
    /* 
     * This script creates a slideshow of all <div>s in the "inFocusContent" div
     * 
     * Based on an example by Jon Raasch:
     *
     * http://jonraasch.com/blog/a-simple-jquery-slideshow
     */
    function nextContent<?php 
    echo $_INFOCUSCNT;
    ?>
() {
        var $currentDiv = $('#inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.inFocus');
        var $nextDiv = $currentDiv.next().length ? $currentDiv.next() : $('#inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV:first');
        $currentDiv.addClass('last-inFocus');

        //Fade current out
        $currentDiv.animate({opacity: 0.0}, 500, function() {
            $currentDiv.removeClass('inFocus last-inFocus');
            $currentDiv.addClass('invisible');
        });

        //Fade next in
        $nextDiv.css({opacity: 0.0})
            .addClass('inFocus')
            .animate({opacity: 1.0}, 500, function() {
            });
    }

    $(function() {
        setInterval( "nextContent<?php 
    echo $_INFOCUSCNT;
    ?>
()", 5000 );
    });
    </script>
    
    <?php 
    $_INFOCUSCNT++;
}
Пример #10
0
    protected static function _compare($tid1, $tid2)
    {
        $t1 = new Team($tid1);
        $t2 = new Team($tid2);
        # http://docs.jquery.com/UI/Progressbar
        ?>
      <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
      <!--
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
      <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
      -->
    <center>
    <table style='width:70%; '>
        <tr><td style='width:120px;'> </td>
            <td><a href="<?php 
        echo urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $tid1, false, false);
        ?>
"><b><?php 
        echo $t1->name;
        ?>
</b></a></td>
            <td><a href="<?php 
        echo urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $tid2, false, false);
        ?>
"><b><?php 
        echo $t2->name;
        ?>
</b></a></td>
        </tr>
        <tr><td>Team value</td>
            <td><?php 
        self::_bar($t1->value / 1000 / self::$T_MAX_TV * 100, $t1->value / 1000 . 'k &mdash; ' . self::_getLevel($t1->value / 1000), $t1->value / 1000 / self::$T_MAX_TV * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->value / 1000 / self::$T_MAX_TV * 100, $t2->value / 1000 . 'k &mdash; ' . self::_getLevel($t2->value / 1000), $t2->value / 1000 / self::$T_MAX_TV * 100);
        ?>
</td>
        </tr>
        <tr><td>ELO</td>
            <td><?php 
        self::_bar($t1->rg_elo / self::$T_MAX_ELO * 100, $t1->rg_elo, $t1->rg_elo / self::$T_MAX_ELO * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->rg_elo / self::$T_MAX_ELO * 100, $t2->rg_elo, $t2->rg_elo / self::$T_MAX_ELO * 100);
        ?>
</td>
        </tr>
        <tr><td>Games played</td>
            <td><?php 
        self::_bar($t1->mv_played / self::$T_MAX_PLAYED * 100, $t1->mv_played, $t1->mv_played / self::$T_MAX_PLAYED * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_played / self::$T_MAX_PLAYED * 100, $t2->mv_played, $t2->mv_played / self::$T_MAX_PLAYED * 100);
        ?>
</td>
        </tr>
        <tr><td>Games won</td>
            <td><?php 
        self::_bar($t1->mv_won / self::$T_MAX_WON * 100, $t1->mv_won, $t1->mv_won / self::$T_MAX_WON * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_won / self::$T_MAX_WON * 100, $t2->mv_won, $t2->mv_won / self::$T_MAX_WON * 100);
        ?>
</td>
        </tr>
        <tr><td>Goals scored</td>
            <td><?php 
        self::_bar($t1->mv_gf / self::$T_MAX_GF * 100, $t1->mv_gf, $t1->mv_gf / self::$T_MAX_GF * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_gf / self::$T_MAX_GF * 100, $t2->mv_gf, $t2->mv_gf / self::$T_MAX_GF * 100);
        ?>
</td>
        </tr>
        <tr><td>CAS inflicted</td>
            <td><?php 
        self::_bar($t1->mv_cas / self::$T_MAX_CAS * 100, $t1->mv_cas, $t1->mv_cas / self::$T_MAX_CAS * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_cas / self::$T_MAX_CAS * 100, $t2->mv_cas, $t2->mv_cas / self::$T_MAX_CAS * 100);
        ?>
</td>
        </tr>
        <tr><td>CP</td>
            <td><?php 
        self::_bar($t1->mv_cp / self::$T_MAX_CP * 100, $t1->mv_cp, $t1->mv_cp / self::$T_MAX_CP * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_cp / self::$T_MAX_CP * 100, $t2->mv_cp, $t2->mv_cp / self::$T_MAX_CP * 100);
        ?>
</td>
        </tr>
        <tr><td>Int</td>
            <td><?php 
        self::_bar($t1->mv_intcpt / self::$T_MAX_INT * 100, $t1->mv_intcpt, $t1->mv_intcpt / self::$T_MAX_INT * 100);
        ?>
</td>
            <td><?php 
        self::_bar($t2->mv_intcpt / self::$T_MAX_INT * 100, $t2->mv_intcpt, $t2->mv_intcpt / self::$T_MAX_INT * 100);
        ?>
</td>
        </tr>
    </table>
    </center>
    <br><br>
    The scales of the bar graphs are static and are relative to what is considered "much" of a given team property.
   
    <?php 
    }
Пример #11
0
    public static function printList($node, $node_id, $ALLOW_EDIT)
    {
        global $lng;
        $entries = self::getWanted($node, $node_id);
        echo "<table style='table-layout:fixed; width:" . (count($entries) == 1 ? 50 : 100) . "%;'><tr>";
        # The percentage difference is a HTML layout fix.
        $i = 1;
        foreach ($entries as $e) {
            if ($i > 2) {
                echo "\n</tr>\n<tr>\n";
                $i = 1;
            }
            ?>
        <td style='width:50%;' valign='top'>
        <div class="boxWide" style="width: 80%; margin: 20px auto 20px auto;">
            <div class="boxTitle<?php 
            echo T_HTMLBOX_INFO;
            ?>
"><?php 
            echo $lng->getTrn('wanted', __CLASS__) . ": <a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $e->pid, false, false) . "'>{$e->name}</a>";
            echo ' (<a href="' . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $e->f_tid, false, false) . '">' . $e->f_tname . '</a>)';
            ?>
            </div>
            <div class="boxBody">
                <table class="common">
                    <tr>
                        <td colspan="2" align="left" valign="top">
                            <b><?php 
            echo $lng->getTrn('g_title', __CLASS__);
            ?>
:</b><br>
                            <?php 
            echo $e->bounty;
            ?>
                            <br>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top">
                        <br>
                        <b><?php 
            echo $lng->getTrn('g_about', __CLASS__);
            ?>
:</b><br>
                        <?php 
            echo $e->why;
            if ($e->date_died) {
                echo "<br><br><font color='red'><b>" . $lng->getTrn('killed', __CLASS__) . "</b></font>\n";
            }
            ?>
                        </td>
                        <td align="right" style="width: 25%;">
                            <img border='0px' height='75' width='75' alt='player picture' src="<?php 
            $img = new ImageSubSys(T_OBJ_PLAYER, $e->pid);
            echo $img->getPath();
            ?>
">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
                    <tr>
                        <td align="left">
                        <?php 
            echo $lng->getTrn('posted', __CLASS__) . ' ' . textdate($e->date, true);
            ?>
                        </td>
                        <td align="right">
                        <?php 
            if ($ALLOW_EDIT) {
                ?>
 
                            <a href="handler.php?type=wanted&amp;action=edit&amp;wanted_id=<?php 
                echo $e->wanted_id;
                ?>
"><?php 
                echo $lng->getTrn('edit', __CLASS__);
                ?>
</a>
                            &nbsp;
                            <a href="handler.php?type=wanted&amp;action=delete&amp;wanted_id=<?php 
                echo $e->wanted_id;
                ?>
"><?php 
                echo $lng->getTrn('del', __CLASS__);
                ?>
</a> 
                            <?php 
            }
            ?>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        </td>
        <?php 
            $i++;
        }
        echo "</tr></table>";
    }
Пример #12
0
    public static function main($argv)
    {
        global $lng;
        title($lng->getTrn('name', 'Search'));
        ?>
    <script>
        $(document).ready(function(){
            var options, a,b;

            options = { 
                minChars:2, 
                serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_COACH;
        ?>
',
                onSelect: function(value, data){ window.location = '<?php 
        echo str_replace("amp;", "", urlcompile(T_URL_PROFILE, T_OBJ_COACH, false, false, false));
        ?>
&obj_id='+data; },
            };
            a = $('#coach').autocomplete(options);
            
            options = { 
                minChars:2, 
                serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_TEAM;
        ?>
',
                onSelect: function(value, data){ window.location = '<?php 
        echo str_replace("amp;", "", urlcompile(T_URL_PROFILE, T_OBJ_TEAM, false, false, false));
        ?>
&obj_id='+data; },
            };
            b = $('#team').autocomplete(options);
        });
    </script>
    
    <div class='boxCommon'>
        <h3 class='boxTitle<?php 
        echo T_HTMLBOX_COACH;
        ?>
'><?php 
        echo $lng->getTrn('name', 'Search');
        ?>
</h3>
        <div class='boxBody'>
            <?php 
        echo $lng->getTrn('search_tname', 'Search');
        ?>
<br>
            <input id='team' type="text" name="team" size="30" maxlength="50"><br>
            <br>
            <?php 
        echo $lng->getTrn('search_cname', 'Search');
        ?>
<br>
            <input id='coach' type="text" name="coach" size="30" maxlength="50"><br>
        </div>
    </div>
    <?php 
    }
Пример #13
0
    private static function make_menu()
    {
        global $lng, $coach, $settings, $rules, $admin_menu;
        ?>
    <ul id="css3menu1" class="topmenu">
        <li class="topfirst"><a href="index.php?section=main" style="height:20px;line-height:20px;"><?php 
        echo $lng->getTrn('menu/home');
        ?>
</a>
		 <ul>
            <li class="subfirst"><a href="#" >Europe ></a>
				<ul>
					<li><a href="#" >UK ></a>
						<ul>
							<li><a href="index.php?SLS_lid=5" >Basildon Warboyz (Basildon)</a></li>
                            <li><a href="index.php?SLS_lid=4" >FennLong (Basildon)</a></li>
                            <li><a href="index.php?SLS_lid=6" >League of Extraordinary Gentlemen (Swindon)</a></li>
                            <li><a href="index.php?SLS_lid=8" >Rom-at-the-Ford's Blood Bowl League (Romford)</a></li>
                            <li><a href="index.php?SLS_lid=9" >ARBBL (Andover)</a></li>
                            <li><a href="index.php?SLS_lid=15" >Bristol Vanguard (Bristol)</a></li>
                            <li><a href="index.php?SLS_lid=14" >MAD League (Ashfordby)</a></li>
                            <li><a href="index.php?SLS_lid=12" >DSBBTT (London)</a></li>
                            <li><a href="index.php?SLS_lid=13" >KRBBL (Folkestone)</a></li>
						</ul>
                    </li>
					<li><a href="#" >Sweden ></a>
						<ul>
							<li><a href="index.php?SLS_lid=2" >MARBBL (Malmo)</a></li>
						</ul>
                    </li>    
					<li><a href="#" >Spain ></a>
						<ul>
							<li><a href="index.php?SLS_lid=18" >Liga Burgalesa</a></li>
						</ul>
                    </li>                      
					<li><a href="#" >Germany ></a>
						<ul>
							<li><a href="index.php?SLS_lid=7" >United Friends</a></li>
						</ul>
                    </li>   
				</ul>
            </li>
			<li><a href="#" >North America ></a>
				<ul>
					<li><a href="#" >USA ></a>
                		<ul>
							<li><a href="index.php?SLS_lid=11" >KABBL (Knoxville)</a></li>
                            <li><a href="index.php?SLS_lid=16" >KIL (Denver)</a></li>
                            <li><a href="index.php?SLS_lid=19" >PaDGBBL (Vista CA)</a></li>
						</ul>                                             
                    </li>
					<li><a href="#" >Canada ></a>
                		<ul>
							<li><a href="index.php?SLS_lid=10" >CHOP (Vancouver)</a></li>
						</ul>     
                    </li>
				</ul>
            </li>
			<li><a href="#" >Rest of the World ></a>
				<ul>
					<li><a href="#" >Australia ></a>
                		<ul>
							<li><a href="index.php?SLS_lid=17" >Newcastle Legion</a>
</li>
						</ul>  
                    </li>
				</ul>
            </li>
            <li><a href="http://www.thenaf.net/leagues/leagues-locator/" >TheNAF.net League Locator</a></li>
<li><a href="index.php?SLS_lid=1" >League Hosting Home</a></li>
            <li><a href="index.php?section=about">About OBBLM</a></li>
		</ul>
    </li>
<?php 
        if (isset($_SESSION['logged_in'])) {
            ?>

<li class="topfirst"><a href="#" style="height:20px;line-height:20px;">User Menu</a>
        <ul>
            <li class="subfirst"><a href="handler.php?type=teamcreator">Create a New Team</a></li>
            <li><a href="index.php?section=matches&amp;type=usersched" >Schedule Match</a></li>
             <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=teams';
            ?>
"><?php 
            echo $lng->getTrn('cc/coach_teams');
            ?>
</a></li>
            <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=profile';
            ?>
"><?php 
            echo $lng->getTrn('cc/profile');
            ?>
</a></li>
            <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=stats';
            ?>
"><?php 
            echo $lng->getTrn('common/stats');
            ?>
</a></li>
           <li><a rel="nofollow" href="<?php 
            echo urlcompile(T_URL_PROFILE, T_OBJ_COACH, $coach->coach_id, false, false) . '&amp;subsec=recentmatches';
            ?>
"><?php 
            echo $lng->getTrn('common/recentmatches');
            ?>
</a></li>
            <li><a rel="nofollow"href="index.php?logout=1"><?php 
            echo $lng->getTrn('menu/logout');
            ?>
</a></li>
            </ul><?php 
        } else {
            ?>
<li class="topfirst"><a rel="nofollow" href="index.php?section=login" style="height:20px;line-height:20px;"><?php 
            echo $lng->getTrn('menu/login');
            ?>
</a></li><?php 
        }
        ?>

<?php 
        if (!empty($admin_menu)) {
            ?>
		<li class="topmenu"><a href="#" style="height:20px;line-height:20px;"><?php 
            echo $lng->getTrn('menu/admin_menu/name');
            ?>
</a>
					<ul>
                        <li class="subfirst"><a href="handler.php?type=leaguepref"><?php 
            echo $lng->getTrn('name', 'LeaguePref');
            ?>
</a></li>
<?php 
            if (Module::isRegistered('Conference')) {
                ?>
<li><a href="handler.php?type=conference"><?php 
                echo $lng->getTrn('name', 'Conference');
                ?>
</a></li><?php 
            }
            ?>
                        <?php 
            foreach ($admin_menu as $lnk => $desc) {
                if (!is_array($desc)) {
                    echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}'>{$desc}</a></li>\n";
                } else {
                    ?>
                        <li><a href="#"><?php 
                    echo $desc['title'];
                    ?>
                            <ul><?php 
                    foreach ($desc['sub'] as $sub) {
                        echo "<li><a href='index.php?section=admin&amp;subsec={$lnk}&amp;{$sub['href']}'>{$sub['title']}</a></li>\n";
                    }
                    ?>
                            </ul>
                            </li>
                            <?php 
                }
            }
            ?>
                </ul>
                </li>
                <?php 
        }
        ?>
        

<li class="topmenu"><a href="#" style="height:20px;line-height:20px;">League Menu</a>
            <ul>
                <li class="subfirst"><a href="index.php?section=rules"><?php 
        echo $lng->getTrn('menu/rules');
        ?>
</a></li>
                <li><a href="handler.php?type=leaguetables"><?php 
        echo $lng->getTrn('name', 'LeagueTables');
        ?>
</a></li>
                <li><a href="index.php?section=teamlist"><?php 
        echo $lng->getTrn('menu/teams');
        ?>
</a></li>
                <li><a href="index.php?section=coachlist"><?php 
        echo $lng->getTrn('menu/coaches');
        ?>
</a></li>
                <li><a href="index.php?section=matches&amp;type=recent"><?php 
        echo $lng->getTrn('menu/matches_menu/recent');
        ?>
</a></li>
                <li><a href="index.php?section=matches&amp;type=upcoming"><?php 
        echo $lng->getTrn('menu/matches_menu/upcoming');
        ?>
</a>
                <?php 
        if (!empty($settings['league_url'])) {
            ?>
  <li><a href="<?php 
            echo $settings['league_url'];
            ?>
"><?php 
            echo $settings['league_url_name'];
            ?>
</a></li><?php 
        }
        ?>
            </ul>
    </li>
        
<li class="topmenu"><a rel="nofollow" href="index.php?section=rules" style="height:20px;line-height:20px;">League History</a>
    <ul>   
                <?php 
        if (Module::isRegistered('Gallery')) {
            ?>
<li><a href="handler.php?type=gallery"><?php 
            echo $lng->getTrn('name', 'Gallery');
            ?>
</a></li><?php 
        }
        ?>
                <?php 
        if (Module::isRegistered('Wanted')) {
            ?>
<li><a href="handler.php?type=wanted"><?php 
            echo $lng->getTrn('name', 'Wanted');
            ?>
</a></li><?php 
        }
        ?>
                <?php 
        if (Module::isRegistered('Prize')) {
            ?>
<li><a href="handler.php?type=prize"><?php 
            echo $lng->getTrn('name', 'Prize');
            ?>
</a></li><?php 
        }
        ?>
                <?php 
        if (Module::isRegistered('HOF')) {
            ?>
<li><a href="handler.php?type=hof"><?php 
            echo $lng->getTrn('name', 'HOF');
            ?>
</a></li><?php 
        }
        ?>
                <?php 
        if (Module::isRegistered('FamousTeams')) {
            ?>
<li><a href="handler.php?type=famousteams"><?php 
            echo $lng->getTrn('name', 'FamousTeams');
            ?>
</a></li><?php 
        }
        ?>
                <?php 
        if (Module::isRegistered('Memmatches')) {
            ?>
<li><a href="handler.php?type=memmatches"><?php 
            echo $lng->getTrn('name', 'Memmatches');
            ?>
</a></li><?php 
        }
        ?>
                <li><a href="index.php?section=matches&amp;type=tours"><?php 
        echo $lng->getTrn('menu/matches_menu/tours');
        ?>
</a></li>
    </ul></li>


        
        
<li class="topmenu"><a rel="nofollow" href="#" style="height:20px;line-height:20px;">Statistics</a>
            <ul>
                <li class="subfirst"><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/team_stn');
        ?>
</a></li>
                <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_PLAYER, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/player_stn');
        ?>
</a></li>
                <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_COACH, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/coach_stn');
        ?>
</a></li>
                <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_RACE, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/race_stn');
        ?>
</a></li>
                <li><a rel="nofollow" href="<?php 
        echo urlcompile(T_URL_STANDINGS, T_OBJ_STAR, false, false, false);
        ?>
"><?php 
        echo $lng->getTrn('menu/statistics_menu/star_stn');
        ?>
</a></li>
            </ul>
        </li>
        
<li class="topmenu"><a rel="nofollow" href="#" style="height:20px;line-height:20px;">Game Rules</a>
    <ul> 
        <li class="subfirst"><a rel="nofollow" href="#">CRP Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=0" style="height:10px;line-height:10px;">Amazon</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=1" style="height:10px;line-height:10px;">Chaos</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=2" style="height:10px;line-height:10px;">Chaos Dwarf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=3" style="height:10px;line-height:10px;">Dark Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=4" style="height:10px;line-height:10px;">Dwarf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=5" style="height:10px;line-height:10px;">Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=6" style="height:10px;line-height:10px;">Goblin</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=7" style="height:10px;line-height:10px;">Halfling</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=8" style="height:10px;line-height:10px;">High Elf</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=9" style="height:10px;line-height:10px;">Human</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=10" style="height:10px;line-height:10px;">Khemri</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=11" style="height:10px;line-height:10px;">Lizardman</a></li>
           <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=13" style="height:10px;line-height:10px;">Necromantic</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=14" style="height:10px;line-height:10px;">Norse</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=15" style="height:10px;line-height:10px;">Nurgle</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=16" style="height:10px;line-height:10px;">Ogre</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=12" style="height:10px;line-height:10px;">Orc</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=19" style="height:10px;line-height:10px;">Skaven</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=17" style="height:10px;line-height:10px;">Undead</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=18" style="height:10px;line-height:10px;">Vampire</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=20" style="height:10px;line-height:10px;">Wood Elf</a></li>
        </ul></li>
        <li class="subfirst"><a rel="nofollow" href="#">LRB6 Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=21" style="height:10px;line-height:10px;">Chaos Pact</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=22" style="height:10px;line-height:10px;">Slann</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=23" style="height:10px;line-height:10px;">Underworld</a></li>
        </ul></li>
        <li class="subfirst"><a rel="nofollow" href="#">(Optional) Community Rosters ></a>
            <ul><li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=24" style="height:10px;line-height:10px;">Bretonnian</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=25" style="height:10px;line-height:10px;">Khorne</a></li>
            <li><a href="index.php?section=objhandler&type=1&obj=4&obj_id=26" style="height:10px;line-height:10px;">Simyin</a></li>
        </ul></li>
        <li><a href="http://www.thenaf.net/wp-content/uploads/2013/06/CRP1.pdf">The CRP (Full Blood Bowl Rules)</a></li>
        <li><a href="http://the-outcast.com/bloodbowl/blood%20bowl%20crp%20lite.pdf">A5 Rules Summary</a></li>  
    </ul>
</li>  

<?php 
        if (Module::isRegistered('Search')) {
            ?>
<li><a href="handler.php?type=search"><?php 
            echo $lng->getTrn('name', 'Search');
            ?>
</a></li><?php 
        }
        ?>
    
    <?php 
    }
Пример #14
0
 public static function standings()
 {
     global $lng;
     title($lng->getTrn('menu/statistics_menu/race_stn'));
     HTMLOUT::standings(STATS_RACE, false, false, array('url' => urlcompile(T_URL_STANDINGS, T_OBJ_RACE, false, false, false)));
 }
Пример #15
0
 public static function getLeagueUrl($lid, $l_name = null)
 {
     if (!isset($l_name)) {
         $l_name = get_alt_col('leagues', 'lid', $lid, 'name');
     }
     return "<a href=\"" . urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, T_NODE_LEAGUE, $lid) . "\">" . $l_name . "</a>";
 }
Пример #16
0
    private function _recentGames()
    {
        global $lng;
        $p = $this;
        // Copy. Used instead of $this for readability.
        ?>
    <div class="row">
        <div class="boxWide">
            <div class="boxTitle<?php 
        echo T_HTMLBOX_MATCH;
        ?>
"><a href='javascript:void(0);' onClick="slideToggleFast('played');"><b>[+/-]</b></a> &nbsp;<?php 
        echo $lng->getTrn('common/recentmatches');
        ?>
</div>
            <div class="boxBody" id="played">
                <?php 
        HTMLOUT::recentGames(STATS_PLAYER, $p->player_id, false, false, false, false, array('n' => MAX_RECENT_GAMES, 'url' => urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $p->player_id, false, false)));
        ?>
            </div>
        </div>
    </div>
    <?php 
    }
Пример #17
0
    public static function main($argv)
    {
        // Check if teamid is provided, else show error mess
        $team_id = $_GET['team_id'];
        if (!get_alt_col('teams', 'team_id', $team_id, 'team_id')) {
            fatal("Invalid team ID.");
        }
        global $stars, $DEA, $rules, $skillarray, $inducements, $racesNoApothecary;
        // Move these constants to header.php?
        define('MAX_STARS', 2);
        define('MERC_EXTRA_COST', 30000);
        define('MERC_EXTRA_SKILL_COST', 50000);
        $ind_cost = 0;
        $redirectlink = 'handler.php?type=roster&detailed=0&team_id=' . $team_id;
        $t = new Team($team_id);
        $star_list[0] = '      <option value="0">-No Induced Stars-</option>' . "\n";
        foreach ($stars as $s => $d) {
            $star_list[0] .= "      <option " . (in_array($t->f_race_id, $d['races']) ? 'style="background-color: ' . COLOR_HTML_READY . ';" ' : '') . "value=\"{$d['id']}\">{$s}</option>\n";
        }
        ?>
<!--
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link type="text/css" href="css/stylesheet1.css" rel="stylesheet">
-->
<style type="text/css">
td { background-color: #EEEEEE; color: #000000; font: 13px Tahoma; }
td.indtitle { background-color: #EEEEEE; color: #000000; font: bold 12px Tahoma; }
td.boxie { background-color: #EEEEEE; color: #000000; }
td.cent { text-align: center; }
td.cent2 { text-align: center; background-color: #EEEEEE; color: #000000; }
td.right { text-align: right; background-color: #EEEEEE; color: #000000; }
</style>
<script language="javascript">
<!--
function SendToPDF()
{
    document.InduceForm.action = "<?php 
        print $redirectlink;
        ?>
"    // Redirect to pdf_roster
    document.InduceForm.submit();        // Submit the page
    return true;
}
-->
</script>
<!--
</head>
<body>
<div class="everything">
<div class="section">
-->
<?php 
        title('Inducements try-out');
        ?>
<form action="" method="post" name="InduceForm">

<table>
    <tr>
        <td class="indtitle">Star Name</td>
        <td class="indtitle">Cost</td>
        <td class="indtitle">MA</td>
        <td class="indtitle">ST</td>
        <td class="indtitle">AG</td>
        <td class="indtitle">AV</td>
        <td class="indtitle">Skills</td> <!-- <td>Cp</td><td>Td</td><td>Int</td><td>Cas</td><td>BH</td><td>Si</td><td>Ki</td><td>MVP</td><td>SPP</td> -->
    </tr>
<?php 
        $brick_n_grotty = false;
        $i = 1;
        while ($i <= MAX_STARS) {
            print "  <tr>\n";
            if (array_key_exists("Star{$i}", $_POST)) {
                $sid = $_POST["Star{$i}"];
                if ($sid != 0) {
                    $s = new Star($sid);
                    #      $s->setStats(false, false, false, false);
                    $star_list[$i] = $star_list[0];
                    if ($sid == "-6" || $sid == "-7") {
                        // Select Brick as selected and add row for Grotty later
                        $brick_n_grotty = true;
                        $star_list[$i] = str_replace('option value="-6"', 'option selected value="-6"', $star_list[$i]);
                        // Hardcoded Brick
                        $star_list[$i] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="-6"', 'option selected style="background-color: ' . COLOR_HTML_READY . ';" value="-6"', $star_list[$i]);
                        $sid = -6;
                        $s = new Star($sid);
                        // Making sure to switch from Grotty to Brick
                        #        $s->setStats(false, false, false, false);
                        $star_list[0] = str_replace('      <option value="-6">Brick Far\'th (+ Grotty)</option>' . "\n", '', $star_list[0]);
                        // Removing Brick from second row
                        $star_list[0] = str_replace('      <option style="background-color: ' . COLOR_HTML_READY . ';" value="-6">Brick Far\'th (+ Grotty)</option>' . "\n", '', $star_list[0]);
                        $star_list[0] = str_replace('      <option value="-7">Grotty (included in Brick Far\'th)</option>' . "\n", '', $star_list[0]);
                        // Removing Grotty from second row
                        $star_list[0] = str_replace('      <option style="background-color: ' . COLOR_HTML_READY . ';" value="-7">Grotty (included in Brick Far\'th)</option>' . "\n", '', $star_list[0]);
                    } else {
                        $star_list[$i] = str_replace('option value="' . $sid . '"', 'option selected value="' . $sid . '"', $star_list[$i]);
                        $star_list[$i] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '"', 'option selected style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '"', $star_list[$i]);
                        $star_list[0] = str_replace('<option value="' . $sid . '">' . $s->name . "</option>\n", '', $star_list[0]);
                        $star_list[0] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '">' . $s->name . "</option>\n", '', $star_list[0]);
                    }
                    print '    <td class="boxie"><SELECT name="Star' . $i . '" onChange="this.form.submit()">' . "\n";
                    print $star_list[$i];
                    print '    </SELECT></td>' . "\n";
                    print '<td class="cent">' . str_replace('000', '', $s->cost) . "k</td>\n<td class=\"cent\">" . $s->ma . "</td>\n<td class=\"cent\">" . $s->st . "</td>\n<td class=\"cent\">" . $s->ag . "</td>\n<td class=\"cent\">" . $s->av . "</td>\n<td>\n<small>" . skillsTrans($s->skills) . "</small></td>\n";
                    //      print "<td>".$s->cp."</td>\n<td>".$s->td."</td>\n<td>".$s->intcpt."</td>\n<td>".$s->cas."</td>\n<td>".$s->bh."</td>\n<td>".$s->si."</td>\n<td>".$s->ki."</td>\n<td>".$s->mvp."</td>\n<td>".$s->spp."</td>\n<td>";
                    print "</tr>\n";
                    $ind_cost += $s->cost;
                    $i++;
                    continue;
                }
            }
            print '    <td class="boxie"><SELECT name="Star' . $i . '" onChange="this.form.submit()">' . "\n";
            print $star_list[0];
            print '    </SELECT>' . "\n";
            print '</tr>' . "\n";
            $i++;
            break;
        }
        if ($brick_n_grotty) {
            // Print Grotty and add hidden input field
            $sid = -7;
            // ID for Grotty hardcoded :-P
            $s = new Star($sid);
            #  $s->setStats(false, false, false, false);
            echo '<tr>';
            $grotty_nr = MAX_STARS + 1;
            echo '<td>' . $s->name . '<input type="hidden" name="Star' . $grotty_nr . '" value="-7"></td>';
            print "<td class=\"cent\">" . str_replace('000', '', $s->cost) . "k</td>\n<td class=\"cent\">" . $s->ma . "</td>\n<td class=\"cent\">" . $s->st . "</td>\n<td class=\"cent\">" . $s->ag . "</td>\n<td class=\"cent\">" . $s->av . "</td>\n<td>\n<small>" . implode(', ', skillsTrans($s->skills)) . "</small></td>\n";
            //  print "<td>".$s->cp."</td>\n<td>".$s->td."</td>\n<td>".$s->intcpt."</td>\n<td>".$s->cas."</td>\n<td>".$s->bh."</td>\n<td>".$s->si."</td>\n<td>".$s->ki."</td>\n<td>".$s->mvp."</td>\n<td>".$s->spp."</td>\n<td>";
            print "</tr>\n";
        }
        ?>
</table>
<table>
    <tr>
        <td class="indtitle">Mercenaries</td>
        <td class="indtitle">Position</td>
        <td class="indtitle">Cost</td>
        <td class="indtitle">MA</td>
        <td class="indtitle">ST</td>
        <td class="indtitle">AG</td>
        <td class="indtitle">AV</td>
        <td class="indtitle">Skills</td>
        <td class="indtitle">Extra Skill</td>
    </tr>
<?php 
        // Validate to not exceed maximum number of positionals? Leaving it open for now.
        $merc_list[0] = '            <option value="0">-No Induced Mercs-</option>' . "\n";
        $merc = array(0 => 'No Merc');
        $i = 0;
        foreach ($DEA[$t->f_rname]["players"] as $p => $m) {
            $i++;
            $merc_list[0] .= '            <option value="' . "{$i}" . '">' . "Merc {$p}" . '</option>' . "\n";
            array_push($merc, $m);
            $pos[$i] = $p;
        }
        $i = 1;
        while (isset($_POST["Merc{$i}"])) {
            print "    <tr>\n";
            if ($_POST["Merc{$i}"] != '0') {
                $mid = $_POST["Merc{$i}"];
                if (isset($_POST["Extra{$i}"])) {
                    $extra_skill_cost = $_POST["Extra{$i}"] == '-No Extra Skill-' ? 0 : MERC_EXTRA_SKILL_COST;
                    $extra[$i] = $_POST["Extra{$i}"];
                } else {
                    $extra_skill_cost = 0;
                    $extra[$i] = false;
                }
                // Fill skill list from what normal skills positional has to chose from
                $n_skills = $DEA[$t->f_rname]['players'][str_replace('Merc ', '', $pos[$mid])]['norm'];
                $extra_list[$i] = "            <option>-No Extra Skill-</option>\n";
                foreach ($n_skills as $category) {
                    foreach ($skillarray[$category] as $id => $skill) {
                        if (!in_array($id, $merc[$mid]["def"])) {
                            $extra_list[$i] .= '<option>' . skillsTrans($id) . '</option>' . "\n";
                        }
                    }
                }
                $merc_list[$i] = str_replace('<option value="' . $mid . '"', '<option selected value="' . $mid . '"', $merc_list[0]);
                print '        <td><SELECT name="Merc' . $i . '" onChange="this.form.submit()">' . "\n";
                print $merc_list[$i];
                $cost[$i] = (int) $merc[$mid]["cost"] + MERC_EXTRA_COST + $extra_skill_cost;
                echo "        </SELECT></td>\n";
                if (!in_array(99, $merc[$mid]["def"])) {
                    array_unshift($merc[$mid]["def"], 99);
                }
                // Adding Loner to default skills if Merc does not have Loner already
                $def_skills = skillsTrans($merc[$mid]["def"]);
                if (empty($def_skills)) {
                    $def_skills[] = '&nbsp;';
                }
                print "        <td>{$pos[$mid]}</td><td>" . str_replace('000', '', $cost[$i]) . "k</td><td class=\"cent\">" . $merc[$mid]["ma"] . "</td><td class=\"cent\">" . $merc[$mid]["st"] . "</td>";
                print "<td class=\"cent\">" . $merc[$mid]["ag"] . "</td><td class=\"cent\">" . $merc[$mid]["av"] . "</td><td><small>" . implode(', ', $def_skills) . "</small></td>\n";
                if ($extra[$i] != false) {
                    $extra_list[$i] = str_replace('<option>' . $extra[$i] . '</option>', '<option selected>' . $extra[$i] . '</option>', $extra_list[$i]);
                }
                echo '        <td><SELECT name="Extra' . $i . '" onChange="this.form.submit()">' . "\n";
                print $extra_list[$i];
                echo "        </SELECT></td>\n";
                echo "    </tr>\n";
                $ind_cost += $cost[$i];
                $i++;
                continue;
            } else {
                $merc_list[$i] = $merc_list[0];
                break;
            }
        }
        echo "    <tr>\n";
        echo '      <td><SELECT name="Merc' . $i . '" onChange="this.form.submit()">' . "\n";
        print $merc_list[0];
        echo "      </SELECT></td>\n";
        echo "    </tr>\n";
        ?>

</table>
<table>
<tr><td>
<table>
    <tr>
        <td class="indtitle">Inducement</td>
        <td class="indtitle">#</td>
        <td class="indtitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td class="indtitle">Cost</td>
        <td class="indtitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td class="indtitle">Total Cost</td>
    </tr>
<?php 
        // Regular inducements
        $r = $t->f_rname;
        $rid = $t->f_race_id;
        // Checking if team can hire Igor or Wandering Apo
        unset($inducements[in_array($rid, $racesNoApothecary) ? 'Wandering Apothecaries' : 'Igor']);
        foreach ($inducements as $ind_name => $ind) {
            $this_cost = $ind[in_array($rid, $ind['reduced_cost_races']) ? 'reduced_cost' : 'cost'];
            # Reduced cost?
            echo '<tr>';
            print '<td>' . $ind_name . ' (0-' . $ind['max'] . ')</td>';
            echo '<td><SELECT name="' . str_replace(' ', '_', $ind_name) . '" onChange="this.form.submit()">';
            // Changing spaces to underscores for (ugly?) POST workaround
            $ind_list = "<option>0</option>\n";
            for ($i = 1; $i <= $ind['max']; $i++) {
                $ind_list .= '<option>' . $i . "</option>\n";
            }
            $pi = 0;
            if (isset($_POST[str_replace(' ', '_', $ind_name)])) {
                $pi = $_POST[str_replace(' ', '_', $ind_name)];
                if ($pi != 0) {
                    $ind_list = str_replace('<option>' . $pi . '</option>', '<option selected>' . $pi . '</option>', $ind_list);
                }
            }
            print $ind_list;
            echo '</SELECT></td>';
            echo '<td class="cent2">x</td><td class="cent">' . $this_cost / 1000 . 'k</td>';
            echo '<td class="cent2">=</td>';
            $ind_cost += $pi * $this_cost;
            echo '<td class="cent">' . $pi * $this_cost / 1000 . 'k</td>';
            echo '</tr>';
        }
        // Cards
        $card_list = '';
        # Declare.
        echo '<tr>';
        echo '<td>Card budget</td><td class="cent2">&nbsp;</td><td class="cent2">&nbsp;</td>';
        echo '<td><SELECT name="Card" onChange="this.form.submit()">';
        for ($i = 0; $i <= 1000; $i += 50) {
            $card_list .= '<option>' . $i . "k</option>\n";
        }
        $cardb = '';
        if (isset($_POST["Card"])) {
            $cardb = $_POST["Card"];
            if ($cardb != 0) {
                $card_list = str_replace('<option>' . $cardb . '</option>', '<option selected>' . $cardb . '</option>', $card_list);
            }
        }
        $card_cost = str_replace('k', '', $cardb);
        $ind_cost += $card_cost * 1000;
        print $card_list;
        echo '</SELECT></td>';
        echo '<td class="cent2">=</td><td class="cent">' . $cardb . '</td>';
        echo '</tr>';
        ?>
<tr>
<td class="right" colspan="6"><br><input type="submit" name="Submit" value="Create PDF roster" onclick="return SendToPDF();"></td></tr>
<tr><td><a href="<?php 
        echo urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team_id, false, false);
        ?>
"> <- Back to team page</a></td></tr>
</table>
</td><td class="cent2">
<table>
<?php 
        function kilo($str)
        {
            if (strpos($str, '000000')) {
                return str_replace('000', '', $str) . '000';
            } else {
                return str_replace('000', '', $str);
            }
        }
        echo '<tr><td class="indtitle">Team Value:</td><td class="indtitle">' . kilo($t->value) . 'k</td></tr>';
        echo '<tr><td class="indtitle">Inducements Value:</td><td class="indtitle">' . kilo($ind_cost) . 'k</td></tr>';
        echo '<tr><td class="indtitle">Match Value:</td><td class="indtitle">' . kilo($ind_cost + $t->value) . 'k</td></tr>';
        ?>

</table>
</td>
</tr>

</table>
</form>
<!--
</div>
</div>
</body>
</html>
-->

<?php 
    }
Пример #18
0
    public static function conferenceAdmin()
    {
        global $lng, $tours, $coach;
        title($lng->getTrn('name', 'Conference'));
        self::handleActions();
        $tour_id = 0;
        if (isset($_POST['tour_id'])) {
            $tour_id = $_POST['tour_id'];
        }
        $firstTour = self::tournamentSelector($tour_id);
        // no tournament - they need to select something to see more.
        if ($tour_id == 0) {
            $tour_id = $firstTour;
        }
        // double check this coach is allowed to administer this tournament
        if (!$coach->isNodeCommish(T_NODE_TOURNAMENT, $tour_id)) {
            echo "<div class='boxWide'>";
            HTMLOUT::helpBox($lng->getTrn('not-admin', 'Conference'));
            echo "</div>";
            return;
        }
        $tour = new Tour($tour_id);
        $addConfTitle = $lng->getTrn('addConf', 'Conference');
        echo <<<EOQ
\t<div class='boxWide'>
\t\t<h3 class='boxTitle4'>{$tour->name}</h3>
\t\t<br />
\t\t<form name="add_conf" method="POST" action="handler.php?type=conference">
\t\t\t<input name='action' type='hidden' value='add_conf' />
\t\t\t<input name='tour_id' type='hidden' value='{$tour_id}' />
\t\t\t<input name='conf_name' type='hidden' value='{$tour_id}' />
\t\t\t<input id='conf_name' type="text" name="conf_name" size="30" maxlength="50">
\t\t\t<input type="submit" value="{$addConfTitle}">
\t\t</form>
\t</div>
    <script language="javascript">
    \tfunction removeTeam(conf_id, team_id) {
\t\t\tdocument.forms["remove_team"].conf_id.value=conf_id;
\t\t\tdocument.forms["remove_team"].team_id.value=team_id;
\t\t\tdocument.forms["remove_team"].submit();
\t\t}
    \tfunction removeConf(conf_id) {
\t\t\tdocument.forms["remove_conf"].conf_id.value=conf_id;
\t\t\tdocument.forms["remove_conf"].submit();
\t\t}
    </script>
\t<form name="remove_team" method="POST" action="handler.php?type=conference">
\t\t<input name='action' type='hidden' value='remove_team' />
\t\t<input name='tour_id' type='hidden' value='{$tour_id}' />
\t\t<input name='conf_id' id='conf_id' type='hidden' value='0' />
\t\t<input name='team_id' id='team_id' type='hidden' value='0' />
\t</form>
\t<form name="remove_conf" method="POST" action="handler.php?type=conference">
\t\t<input name='action' type='hidden' value='remove_conf' />
\t\t<input name='tour_id' type='hidden' value='{$tour_id}' />
\t\t<input name='conf_id' id='conf_id' type='hidden' value='0' />
\t</form>
\t<table class="boxTable">
EOQ;
        $confs = self::getConferencesForTour($tour->tour_id);
        $idx = 0;
        foreach ($confs as $conf) {
            $conf->loadTeams();
            if ($idx % 2 == 0) {
                echo "<tr valign='top'>";
            }
            echo <<<EOQ
\t\t<td>
\t\t<div class='boxCommon' style='margin-top: 0px; width=325px'>
\t\t\t<h4 class='boxTitleConf'>{$conf->name} <a onclick="return removeConf({$conf->conf_id});"><img src="images/remove.png" height="16" width="16" title="remove {$conf->name}" alt="remove {$conf->name}"/></a></h4>
\t\t\t<div style='white-space:nowrap; margin: 0px; padding: 5px; padding-top: 0px; line-height:175%; border 0px;'>
EOQ;
            self::findTeam($tour->tour_id, $conf->conf_id);
            foreach ($conf->teams as $team) {
                $link = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . "'>{$team->name}</a>";
                echo <<<EOQ
\t\t\t\t<br />{$link} <a onclick="return removeTeam({$conf->conf_id},{$team->team_id});"><img src="images/remove.png" height="12" width="12" title="remove {$team->name} from {$conf->name}" alt="remove {$team->name} from {$conf->name}"/></a>
EOQ;
            }
            echo <<<EOQ
\t\t\t</div>
\t\t</div>
\t\t</td>
EOQ;
            if ($idx % 2 == 1) {
                echo "</tr>";
            }
            $idx++;
        }
        echo <<<EOQ
\t</table>
EOQ;
    }
Пример #19
0
 public static function showTeam($t, &$i)
 {
     echo "<tr>\n";
     echo "<td>" . ++$i . "</td>";
     echo "<td><a href='" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $t->owned_by_coach_id, false, false) . "'>" . $t->f_cname . "</a></td>";
     echo "<td><a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $t->team_id, false, false) . "'>" . $t->name . "</a></td>";
     echo "<td><a href='" . urlcompile(T_URL_PROFILE, T_OBJ_RACE, $t->f_race_id, false, false) . "'>" . $t->f_rname . "</a></td>";
     echo "<td>" . $t->tv / 1000 . "k</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "<td>0</td>";
     echo "</tr>\n";
 }
Пример #20
0
    public static function main($argv)
    {
        global $lng;
        title($lng->getTrn('name', 'Gallery'));
        list($sel_lid, $HTML_LeagueSelector) = HTMLOUT::simpleLeagueSelector();
        if (isset($_POST['type'])) {
            echo "<center><a href='handler.php?type=gallery'>" . $lng->getTrn('common/back') . "</a></center>\n";
            switch ($_POST['type']) {
                case 'team':
                    $t = new Team((int) $_POST['tid']);
                    echo "<b>" . $lng->getTrn('playersof', 'Gallery') . " {$t->name}</b><br><hr><br>\n";
                    foreach ($t->getPlayers() as $p) {
                        $img = new ImageSubSys(IMGTYPE_PLAYER, $p->player_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$p->name} (#{$p->nr})<br><a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $p->player_id, false, false) . "'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
                case 'stad':
                    echo "<b>" . $lng->getTrn('stads', 'Gallery') . "</b><br><hr><br>\n";
                    $teams = get_rows('teams', array('team_id', 'name'), array("f_lid = {$sel_lid}"));
                    objsort($teams, array('+name'));
                    foreach ($teams as $t) {
                        $img = new ImageSubSys(IMGTYPE_TEAMSTADIUM, $t->team_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$t->name}<br><a href='{$pic}'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
                case 'coach':
                    echo "<b>" . $lng->getTrn('coaches', 'Gallery') . "</b><br><hr><br>\n";
                    $q = "SELECT coach_id, name FROM coaches,memberships WHERE cid = coach_id AND lid = {$sel_lid} GROUP BY cid, lid ORDER BY name ASC";
                    $result = mysql_query($q);
                    while ($c = mysql_fetch_object($result)) {
                        $img = new ImageSubSys(IMGTYPE_COACH, $c->coach_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$c->name}<br><a href='{$pic}'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
            }
            return;
        }
        echo $HTML_LeagueSelector;
        echo "<br><br>\n";
        echo $lng->getTrn('note', 'Gallery');
        ?>
    <ul>
    <li>
        <?php 
        $teams = get_rows('teams', array('team_id', 'name'), array("f_lid = {$sel_lid}"));
        objsort($teams, array('+name'));
        echo $lng->getTrn('players', 'Gallery') . "\n        <form method='POST' style='display:inline; margin:0px;'><select name='tid' onChange='this.form.submit();'>\n        <option value='0'>&mdash; " . $lng->getTrn('none', 'Gallery') . " &mdash;</option>" . implode("\n", array_map(create_function('$o', 'return "<option value=\'$o->team_id\'>$o->name</option>";'), $teams)) . "</select><input type='hidden' name='type' value='team'></form>\n        ";
        ?>
    </li>
    <li><?php 
        echo inlineform(array('type' => 'stad'), 'stadForm', $lng->getTrn('stads', 'Gallery'));
        ?>
</li>
    <li><?php 
        echo inlineform(array('type' => 'coach'), 'coachesForm', $lng->getTrn('coaches', 'Gallery'));
        ?>
</li>
    </ul>
    <?php 
    }
Пример #21
0
    private static function printList($team, $ALLOW_EDIT)
    {
        global $lng;
        if ($team) {
            $entries = self::entries($team->team_id);
            title("<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $team->team_id, false, false) . "'>" . $team->name . '</a>&nbsp;' . $lng->getTrn('name', __CLASS__));
        } else {
            $entries = self::entries(null);
            title($lng->getTrn('name', __CLASS__));
        }
        echo "<table style='table-layout:fixed; width:" . (count($entries) == 1 ? 50 : 100) . "%;'><tr>";
        # The percentage difference is a HTML layout fix.
        $i = 1;
        foreach ($entries as $e) {
            $boxname = "container" . $e->pid;
            $ENTRY_EXISTS = isset($e->cemetery_id) && (int) $e->cemetery_id > 0;
            if ($i > 2) {
                echo "\n</tr>\n<tr>\n";
                $i = 1;
            }
            ?>
        <td style='width:50%;' valign='top'>
        <div class="boxWide" style="width: 80%; margin: 20px auto 20px auto;">
            <div class="boxTitle<?php 
            echo T_HTMLBOX_INFO;
            ?>
">
                <?php 
            echo "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $e->pid, false, false) . "'>{$e->name}</a>";
            if (!$team) {
                # Not a single teams cemetery, but all of the cemetery.
                echo " (<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $e->f_tid, false, false) . "'>" . $e->f_tname . '</a>)';
            }
            if (!empty($e->title)) {
                echo ": {$e->title}";
            }
            ?>
            </div>
            <div class="boxBody">
                <table class="common">
                    <tr>
                        <td align="left" valign="top">
                            <?php 
            echo $lng->getTrn('died', __CLASS__) . " " . textdate($e->date_died, true) . ' ' . $lng->getTrn('after', __CLASS__) . ' <b>' . $e->lifetime . ' ' . $lng->getTrn('days', __CLASS__) . "</b><br><br>";
            echo $e->about;
            ?>
                        </td>
                        <td align="right" style='width:25%;'>
                            <img border='0px' height='75' width='75' alt='player picture' src="<?php 
            $img = new ImageSubSys(T_OBJ_PLAYER, $e->pid);
            echo $img->getPath();
            ?>
">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
                    <tr>
                        <td align="left">
                        <?php 
            if ($ENTRY_EXISTS) {
                echo $lng->getTrn('posted', __CLASS__) . ' ' . textdate($e->date, true);
            }
            ?>
                        </td>
                        <td align="right">
                        <?php 
            if ($ALLOW_EDIT) {
                ?>
 
                            <a href='javascript:void(0);' onClick="slideToggle('<?php 
                echo $boxname;
                ?>
');"><?php 
                echo $lng->getTrn('edit', __CLASS__);
                ?>
</a>
                            &nbsp;
                            <?php 
                if (isset($e->cemetery_id) && (int) $e->cemetery_id > 0) {
                    echo inlineform(array('action' => 'delete', 'pid' => $e->pid), "cemform{$e->cemetery_id}", $lng->getTrn('del', __CLASS__));
                }
            }
            ?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div id="<?php 
            echo $boxname;
            ?>
" style="display:none; clear:both;">
                                <br>
                                <form method="POST">
                                    <?php 
            echo "<b>" . $lng->getTrn('g_title', __CLASS__) . '</b> &mdash; ' . $lng->getTrn('title', __CLASS__);
            ?>
<br>
                                    <textarea name="title" cols="48" rows="1"><?php 
            if ($ENTRY_EXISTS) {
                echo $e->title;
            }
            ?>
</textarea><br><br>
                                    <?php 
            echo "<b>" . $lng->getTrn('g_about', __CLASS__) . '</b> &mdash; ' . $lng->getTrn('about', __CLASS__);
            ?>
<br>
                                    <textarea name="about" cols="48" rows="12"><?php 
            if ($ENTRY_EXISTS) {
                echo $e->about;
            }
            ?>
</textarea>
                                    <input type="hidden" name="action" value="edit">
                                    <input type="hidden" name="pid" value="<?php 
            echo $e->pid;
            ?>
">
                                    <br><br>
                                    <input type="submit" value="<?php 
            echo $lng->getTrn('common/submit');
            ?>
">
                                </form>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        </td>
        <?php 
            $i++;
        }
        echo "</tr></table>";
    }
Пример #22
0
 private function _recentGames()
 {
     echo "<div id='cc_recentmatches' style='clear:both;'>\n";
     echo "<br>";
     $url = urlcompile(T_URL_PROFILE, T_OBJ_COACH, $this->coach_id, false, false) . '&amp;subsec=recentmatches';
     HTMLOUT::recentGames(T_OBJ_COACH, $this->coach_id, false, false, false, false, array('url' => $url, 'n' => MAX_RECENT_GAMES, 'GET_SS' => 'gp'));
     echo "</div>";
 }
Пример #23
0
 public static function getTourUrl($tour_id, $tour_name = null)
 {
     if (isset($tour_id)) {
         if (!isset($tour_name)) {
             $tour_name = get_alt_col('tours', 'tour_id', $tour_id, 'name');
         }
         if (Module::isRegistered('LeagueTables')) {
             $tourUrl = "<a href=\"handler.php?type=leaguetables&tour_id=" . $tour_id . "\">" . $tour_name . "</a>";
         } else {
             $tourUrl = "<a href=\"" . urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, T_NODE_TOURNAMENT, $tour_id) . "\">" . $tour_name . "</a>";
         }
         return $tourUrl;
     } else {
         return '<i>' . $lng->getTrn('common/none') . '</i>';
     }
 }