Пример #1
0
 public static function logViewPage()
 {
     global $coach, $lng;
     if (!is_object($coach) || $coach->ring != Coach::T_RING_GLOBAL_ADMIN) {
         fatal("Sorry. Only site administrators and commissioners are allowed to access this section.");
     }
     title($lng->getTrn('name', 'LogSubSys'));
     echo "<table style='width:100%;'>\n";
     echo "<tr><td><i>Date</i></td><td><i>Message</i></td></tr><tr><td colspan='2'><hr></td></tr>\n";
     $query = "SELECT * FROM log WHERE date > SUBDATE(NOW(), INTERVAL " . LOG_HIST_LENGTH . " MONTH) ORDER BY date DESC";
     $result = mysql_query($query);
     $logs = array();
     while ($l = mysql_fetch_object($result)) {
         echo "<tr><td>" . textdate($l->date) . "</td><td>{$l->msg}</td></tr>\n";
     }
     echo "</table>\n";
 }
Пример #2
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>";
    }
Пример #3
0
    private function _news($ALLOW_EDIT)
    {
        global $lng;
        $team = $this;
        // Copy. Used instead of $this for readability.
        title("<a name='anc'>" . $lng->getTrn('profile/team/news') . "</a>");
        $news = $team->getNews(MAX_TNEWS);
        ?>
    <div class="row">
        <div class="boxWide">
            <div class="boxTitle<?php 
        echo T_HTMLBOX_INFO;
        ?>
"><?php 
        echo $lng->getTrn('profile/team/tnews');
        ?>
</div>
            <div class="boxBody">
            <?php 
        $news_2 = array();
        foreach ($news as $n) {
            $news_2[] = '<p>' . fmtprint($n->txt) . '<div id="newsedit' . $n->news_id . '" style="display:none; clear:both;"><form method="POST">
                    <textarea name="txt" cols="60" rows="4">' . $n->txt . '</textarea>
                    <input type="hidden" name="type" value="newsedit">
                    <input type="hidden" name="news_id" value="' . $n->news_id . '">
                    <br><br>
                    <input type="submit" value="' . $lng->getTrn('common/submit') . '">
                </form></div>
                <div style="text-align: right;"><p style="display: inline;">' . textdate($n->date, true) . ($ALLOW_EDIT ? '&nbsp;' . inlineform(array('type' => 'newsdel', 'news_id' => $n->news_id), "newsForm{$n->news_id}", $lng->getTrn('common/delete')) . "&nbsp; <a href='javascript:void(0);' onClick=\"slideToggle('newsedit" . $n->news_id . "');\">" . $lng->getTrn('common/edit') . "</a>" : '') . '</p></div><br></p>';
        }
        echo implode("<hr>\n", $news_2);
        if (empty($news)) {
            echo '<i>' . $lng->getTrn('profile/team/nonews') . '</i>';
        }
        if ($ALLOW_EDIT) {
            ?>
                <hr>
                <br>
                <b><?php 
            echo $lng->getTrn('profile/team/wnews');
            ?>
</b>
                <form method="POST">
                    <textarea name='txt' cols='60' rows='4'></textarea>
                    <br><br>
                    <input type="hidden" name="type" value="news">
                    <input type='submit' value="<?php 
            echo $lng->getTrn('common/submit');
            ?>
">
                </form>
                <?php 
        }
        ?>
            </div>
        </div>
    </div>
    <?php 
    }
Пример #4
0
 public static function upcomingGames($obj, $obj_id, $node, $node_id, $opp_obj, $opp_obj_id, array $opts)
 {
     /*
         Make upcoming games table.
     
          $opts = array(
             'url' => The URL of the page on which this table is to be printed.
             'n' => (int) Fetch the n most recent games. If not specified all matches are displayed.
             'GET_SS' => GET Sorting suffix
          );
     */
     global $lng;
     $T_ROUNDS = Match::getRounds();
     $extra = array('doNr' => false, 'noHelp' => true);
     if (!array_key_exists('GET_SS', $opts)) {
         $opts['GET_SS'] = '';
     } else {
         $extra['GETsuffix'] = $opts['GET_SS'];
     }
     # GET Sorting Suffix
     if (!(array_key_exists('n', $opts) && $opts['n'])) {
         $opts['n'] = false;
     }
     if (!$opts['n']) {
         $N = array();
     } else {
         $N = isset($_GET["page"]) ? array((int) $_GET["page"], $opts['n']) : array(1, $opts['n']);
     }
     if ($obj && $obj_id) {
         list($matches, $pages) = Stats::getMatches($obj, $obj_id, $node, $node_id, $opp_obj, $opp_obj_id, $N, true, true);
     } else {
         list($matches, $pages) = Match::getMatches($N, $node ? $node : false, $node ? $node_id : false, true);
     }
     $extra['page'] = $N[0];
     $extra['pages'] = $pages;
     foreach ($matches as $m) {
         $m->date_created_disp = textdate($m->date_created, true);
         $m->mlink = "<a href='index.php?section=matches&amp;type=report&amp;mid={$m->match_id}'>" . $lng->getTrn('common/view') . "</a>";
         $m->tour_name = Tour::getTourUrl($m->f_tour_id);
         $m->league_name = League::getLeagueUrl(get_parent_id(T_NODE_TOURNAMENT, $m->f_tour_id, T_NODE_LEAGUE));
         if (in_array($m->round, array_keys($T_ROUNDS))) {
             $m->round = $T_ROUNDS[$m->round];
         }
         $m->team1_name = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team1_id, false, false) . "'>{$m->team1_name}</a>&nbsp;<i>(<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $m->coach1_id, false, false) . "'>{$m->coach1_name}</a>)</i>";
         $m->team2_name = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team2_id, false, false) . "'>{$m->team2_name}</a>&nbsp;<i>(<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_COACH, $m->coach2_id, false, false) . "'>{$m->coach2_name}</a>)</i>";
     }
     $fields = array('date_created_disp' => array('desc' => $lng->getTrn('common/datecreated'), 'nosort' => true), 'league_name' => array('desc' => $lng->getTrn('common/league'), 'nosort' => true), 'tour_name' => array('desc' => $lng->getTrn('common/tournament'), 'nosort' => true), 'round' => array('desc' => $lng->getTrn('common/round'), 'nosort' => true), 'team1_name' => array('desc' => $lng->getTrn('common/home'), 'nosort' => true), 'team2_name' => array('desc' => $lng->getTrn('common/away'), 'nosort' => true), 'mlink' => array('desc' => $lng->getTrn('common/match'), 'nosort' => true));
     HTMLOUT::sort_table($lng->getTrn('common/upcomingmatches'), $opts['url'], $matches, $fields, array('+round', '+date_created'), isset($_GET["sort{$opts['GET_SS']}"]) ? array(($_GET["dir{$opts['GET_SS']}"] == 'a' ? '+' : '-') . $_GET["sort{$opts['GET_SS']}"]) : array(), $extra);
 }
Пример #5
0
    private function _injuryHistory()
    {
        global $lng, $T_INJS;
        $p = $this;
        // Copy. Used instead of $this for readability.
        list($injhist, $stats, $match_objs) = $p->getInjHistory();
        ?>
    <div class="row">
        <div class="boxWide">
            <div class="boxTitle<?php 
        echo T_HTMLBOX_STATS;
        ?>
"><a href='javascript:void(0);' onClick="slideToggleFast('injhist');"><b>[+/-]</b></a> &nbsp;<?php 
        echo $lng->getTrn('profile/player/injhist');
        ?>
</div>
            <div class="boxBody" id="injhist">
                <table class="common">
                    <tr>
                        <td><b><?php 
        echo $lng->getTrn('common/injs');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/tournament');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/opponent');
        ?>
</b></td>
                        <td><b>MVP</b></td>
                        <td><b>Cp</b></td>
                        <td><b>Td</b></td>
                        <td><b>Int</b></td>
                        <td><b>Cas</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/score');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/result');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/dateplayed');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/match');
        ?>
</b></td>
                    </tr>
                    <?php 
        foreach (array_keys($injhist) as $mid) {
            $m = $match_objs[$mid];
            foreach ($injhist[$mid] as $k => $v) {
                $injhist[$mid][$k] = ucfirst(strtolower($T_INJS[$v]));
            }
            ?>
                        <tr>
                        <td><?php 
            echo implode(', ', $injhist[$mid]);
            ?>
</td>
                        <td><?php 
            echo get_parent_name(T_NODE_MATCH, $m->match_id, T_NODE_TOURNAMENT);
            ?>
</td>
                        <td><?php 
            echo $p->owned_by_team_id == $m->team1_id ? $m->team2_name : $m->team1_name;
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['mvp'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['cp'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['td'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['intcpt'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['bh'] + $stats[$mid]['si'] + $stats[$mid]['ki'];
            ?>
</td>
                        <td><?php 
            echo $m->team1_score . ' - ' . $m->team2_score;
            ?>
</td>
                        <td><?php 
            echo matchresult_icon($m->is_draw ? 'D' : ($m->winner == $p->owned_by_team_id ? 'W' : 'L'));
            ?>
</td>
                        <td><?php 
            echo textdate($m->date_played, false, false);
            ?>
</td>
                        <td><a href='javascript:void(0)' onClick="window.open('index.php?section=matches&amp;type=report&amp;mid=<?php 
            echo $m->match_id;
            ?>
');"><?php 
            echo $lng->getTrn('common/view');
            ?>
</a></td>
                        </tr>
                        <?php 
        }
        ?>
                </table>
            </div>
        </div>
    </div>
    <?php 
    }
Пример #6
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++;
            }
        }
    }
Пример #7
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>";
    }
Пример #8
0
function sec_main()
{
    global $settings, $rules, $coach, $lng, $leagues;
    MTS('Main start');
    list($sel_lid, $HTML_LeagueSelector) = HTMLOUT::simpleLeagueSelector();
    $IS_GLOBAL_ADMIN = is_object($coach) && $coach->ring == Coach::T_RING_GLOBAL_ADMIN;
    /*
     *  Was any main board actions made?
     */
    if (isset($_POST['type']) && is_object($coach) && $coach->isNodeCommish(T_NODE_LEAGUE, $sel_lid)) {
        if (get_magic_quotes_gpc()) {
            if (isset($_POST['title'])) {
                $_POST['title'] = stripslashes($_POST['title']);
            }
            if (isset($_POST['txt'])) {
                $_POST['txt'] = stripslashes($_POST['txt']);
            }
        }
        $msg = isset($_POST['msg_id']) ? new Message((int) $_POST['msg_id']) : null;
        switch ($_POST['type']) {
            case 'msgdel':
                status($msg->delete());
                break;
            case 'msgnew':
                status(Message::create(array('f_coach_id' => $coach->coach_id, 'f_lid' => $IS_GLOBAL_ADMIN && isset($_POST['BC']) && $_POST['BC'] ? Message::T_BROADCAST : $sel_lid, 'title' => $_POST['title'], 'msg' => $_POST['txt'])));
                break;
            case 'msgedit':
                status($msg->edit($_POST['title'], $_POST['txt']));
                break;
            case 'pin':
                status($msg->pin(1));
                break;
            case 'unpin':
                status($msg->pin(0));
                break;
        }
    }
    /*
     *  Now we are ready to generate the HTML code.
     */
    ?>
    <div class="main_head"><?php 
    echo $settings['league_name'];
    ?>
</div>
    <div class='main_leftColumn'>
        <div class="main_leftColumn_head">
            <?php 
    echo "<div class='main_leftColumn_welcome'>\n";
    echo $settings['welcome'];
    echo "</div>\n";
    echo "<div class='main_leftColumn_left'>\n";
    if (count($leagues) > 1) {
        echo $HTML_LeagueSelector;
    }
    echo "</div>\n";
    echo "<div class='main_leftColumn_right'>\n";
    if (is_object($coach) && $coach->isNodeCommish(T_NODE_LEAGUE, $sel_lid)) {
        echo "<a href='javascript:void(0);' onClick=\"slideToggle('msgnew');\">" . $lng->getTrn('main/newmsg') . "</a>&nbsp;\n";
    }
    if (Module::isRegistered('RSSfeed')) {
        echo "<a href='handler.php?type=rss'>RSS</a>\n";
    }
    echo "</div>\n";
    ?>
            <div style="display:none; clear:both;" id="msgnew">
                <br><br>
                <form method="POST">
                    <textarea name="title" rows="1" cols="50"><?php 
    echo $lng->getTrn('common/notitle');
    ?>
</textarea><br><br>
                    <textarea name="txt" rows="15" cols="50"><?php 
    echo $lng->getTrn('common/nobody');
    ?>
</textarea><br><br>
                    <?php 
    if ($IS_GLOBAL_ADMIN) {
        echo $lng->getTrn('main/broadcast');
        ?>
<input type="checkbox" name="BC"><br><br><?php 
    }
    ?>
                    <input type="hidden" name="type" value="msgnew">
                    <input type="submit" value="<?php 
    echo $lng->getTrn('common/submit');
    ?>
">
                </form>
            </div>
        </div>

        <?php 
    /*
        Generate main board.
    
        Left column is the message board, consisting of both commissioner messages and game summaries/results.
        To generate this table we create a general array holding the content of both.
    */
    $j = 1;
    $prevPinned = 0;
    foreach (TextSubSys::getMainBoardMessages($settings['fp_messageboard']['length'], $sel_lid, $settings['fp_messageboard']['show_team_news'], $settings['fp_messageboard']['show_match_summaries']) as $e) {
        if ($prevPinned == 1 && !$e->pinned) {
            echo "<hr>\n";
        }
        $prevPinned = $e->pinned;
        echo "<div class='boxWide'>\n";
        echo "<h3 class='boxTitle{$e->cssidx}'>{$e->title}</h3>\n";
        echo "<div class='boxBody'>\n";
        $fmtMsg = fmtprint($e->message);
        # Basic supported syntax: linebreaks.
        echo "\r\n                    <div id='e{$j}' class='expandable'>{$fmtMsg}</div>\r\n                    <script type='text/javascript'>\r\n                      \$('#e{$j}').expander({\r\n                        slicePoint:       300,\r\n                        expandText:       '" . $lng->getTrn('main/more') . "',\r\n                        collapseTimer:    0,\r\n                        userCollapseText: ''\r\n                      });\r\n                      </script>";
        echo "<br><hr>\n";
        echo "<table class='boxTable'><tr>\n";
        switch ($e->type) {
            case T_TEXT_MATCH_SUMMARY:
                echo "<td align='left' width='100%'>" . $lng->getTrn('main/posted') . " " . textdate($e->date) . " " . (isset($e->date_mod) && $e->date_mod != $e->date ? "(" . $lng->getTrn('main/lastedit') . " " . textdate($e->date_mod) . ") " : '') . $lng->getTrn('main/by') . " {$e->author}</td>\n";
                echo "<td align='right'><a href='index.php?section=matches&amp;type=report&amp;mid={$e->match_id}'>" . $lng->getTrn('common/view') . "</a></td>\n";
                break;
            case T_TEXT_MSG:
                echo "<td align='left' width='100%'>" . $lng->getTrn('main/posted') . " " . textdate($e->date) . " " . $lng->getTrn('main/by') . " {$e->author}</td>\n";
                if (is_object($coach) && ($IS_GLOBAL_ADMIN || $coach->coach_id == $e->author_id)) {
                    // Only admins may delete messages, or if it's a commissioner's own message.
                    echo "<td align='right'><a href='javascript:void(0);' onClick=\"slideToggle('msgedit{$e->msg_id}');\">" . $lng->getTrn('common/edit') . "</a></td>\n";
                    echo "<td align='right'>";
                    $fieldname = 'pin';
                    if ($e->pinned) {
                        $fieldname = 'unpin';
                    }
                    echo inlineform(array('type' => "{$fieldname}", 'msg_id' => $e->msg_id), "{$fieldname}{$e->msg_id}", $lng->getTrn("main/{$fieldname}"));
                    echo "</td>";
                    echo "<td align='right'>";
                    echo inlineform(array('type' => 'msgdel', 'msg_id' => $e->msg_id), "msgdel{$e->msg_id}", $lng->getTrn('common/delete'));
                    echo "</td>";
                }
                break;
            case T_TEXT_TNEWS:
                echo "<td align='left' width='100%'>" . $lng->getTrn('main/posted') . " " . textdate($e->date) . "</td>\n";
                break;
        }
        ?>
                    </tr></table>
                    <?php 
        if ($e->type == T_TEXT_MSG) {
            echo "<div style='display:none;' id='msgedit{$e->msg_id}'>\n";
            echo "<hr><br>\n";
            echo '<form method="POST">
                            <textarea name="title" rows="1" cols="50">' . $e->title . '</textarea><br><br>
                            <textarea name="txt" rows="15" cols="50">' . $e->message . '</textarea><br><br>
                            <input type="hidden" name="type" value="msgedit">
                            <input type="hidden" name="msg_id" value="' . $e->msg_id . '">
                            <input type="submit" value="' . $lng->getTrn('common/submit') . '">
                        </form>';
            echo "</div>";
        }
        ?>
                </div>
            </div>
            <?php 
        $j++;
    }
    ?>

    </div>
    <?php 
    MTS('Board messages generated');
    /*
        The right hand side column optionally (depending on settings) contains standings, latest game results, touchdown and casualties stats.
        We will now generate the stats, so that they are ready to be printed in correct order.
    */
    echo "<div class='main_rightColumn'>\n";
    $boxes_all = array_merge($settings['fp_standings'], $settings['fp_leaders'], $settings['fp_events'], $settings['fp_latestgames']);
    usort($boxes_all, create_function('$a,$b', 'return (($a["box_ID"] > $b["box_ID"]) ? 1 : (($a["box_ID"] < $b["box_ID"]) ? -1 : 0) );'));
    $boxes = array();
    foreach ($boxes_all as $box) {
        # These fields distinguishes the box types.
        if (isset($box['fields'])) {
            $box['dispType'] = 'standings';
        } else {
            if (isset($box['field'])) {
                $box['dispType'] = 'leaders';
            } else {
                if (isset($box['content'])) {
                    $box['dispType'] = 'events';
                } else {
                    $box['dispType'] = 'latestgames';
                }
            }
        }
        switch ($box['type']) {
            case 'league':
                $_type = T_NODE_LEAGUE;
                break;
            case 'division':
                $_type = T_NODE_DIVISION;
                break;
            case 'tournament':
                $_type = T_NODE_TOURNAMENT;
                break;
            default:
                $_type = T_NODE_LEAGUE;
        }
        $box['type'] = $_type;
        $boxes[] = $box;
    }
    // Used in the below standings dispType boxes.
    global $core_tables, $ES_fields;
    $_MV_COLS = array_merge(array_keys($core_tables['mv_teams']), array_keys($ES_fields));
    $_MV_RG_INTERSECT = array_intersect(array_keys($core_tables['teams']), array_keys($core_tables['mv_teams']));
    // Let's print those boxes!
    foreach ($boxes as $box) {
        switch ($box['dispType']) {
            case 'standings':
                $_BAD_COLS = array();
                # Halt on these columns/fields.
                switch ($box['type']) {
                    case T_NODE_TOURNAMENT:
                        if (!get_alt_col('tours', 'tour_id', $box['id'], 'tour_id')) {
                            break 2;
                        }
                        $tour = new Tour($box['id']);
                        $SR = array_map(create_function('$val', 'return $val[0]."mv_".substr($val,1);'), $tour->getRSSortRule());
                        break;
                    case T_NODE_DIVISION:
                        $_BAD_COLS = array('elo', 'swon', 'slost', 'sdraw', 'win_pct');
                        # Divisions do not have pre-calculated, MV, values of these fields.
                        // Fall through!
                    # Divisions do not have pre-calculated, MV, values of these fields.
                    // Fall through!
                    case T_NODE_LEAGUE:
                    default:
                        global $hrs;
                        $SR = $hrs[$box['HRS']]['rule'];
                        foreach ($SR as &$f) {
                            $field = substr($f, 1);
                            if (in_array($field, $_MV_RG_INTERSECT)) {
                                if (in_array($field, $_BAD_COLS)) {
                                    # E.g. divisions have no win_pct record for teams like the mv_teams table (for tours) has.
                                    fatal("Sorry, the element '{$field}' in your specified house sortrule #{$box['HRS']} is not supported for your chosen type (ie. tournament/division/league).");
                                }
                                $f = $f[0] . "rg_" . substr($f, 1);
                            } else {
                                $f = $f[0] . "mv_" . substr($f, 1);
                            }
                        }
                        break;
                }
                list($teams, ) = Stats::getRaw(T_OBJ_TEAM, array($box['type'] => $box['id']), array(1, $box['length']), $SR, false);
                ?>
            <div class='boxWide'>
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_STATS;
                ?>
'><?php 
                echo $box['title'];
                ?>
</h3>
                <div class='boxBody'>
                    <table class="boxTable">
                        <?php 
                echo "<tr>\n";
                foreach ($box['fields'] as $title => $f) {
                    echo "<td><i>{$title}</i></td>\n";
                }
                echo "</tr>\n";
                foreach ($teams as $t) {
                    if (!$t['retired']) {
                        echo "<tr>\n";
                        foreach ($box['fields'] as $title => $f) {
                            if (in_array($f, $_MV_COLS)) {
                                $f = 'mv_' . $f;
                            }
                            echo "<td>";
                            if ($settings['fp_links'] && $f == 'name') {
                                echo "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $t['team_id'], false, false) . "'>{$t['name']}</a>";
                            } elseif (is_numeric($t[$f]) && !ctype_digit($t[$f][0] == '-' ? substr($t[$f], 1) : $t[$f])) {
                                echo sprintf('%1.2f', $t[$f]);
                            } else {
                                echo in_array($f, array('tv')) ? $t[$f] / 1000 : $t[$f];
                            }
                            echo "</td>\n";
                        }
                        echo "</tr>\n";
                    }
                }
                ?>
                    </table>
                    <?php 
                if (isset($box['infocus']) && $box['infocus']) {
                    echo "<hr>";
                    _infocus($teams);
                }
                ?>
                </div>
            </div>
            <?php 
                MTS('Standings table generated');
                break;
            case 'latestgames':
                if ($box['length'] <= 0) {
                    break;
                }
                ?>
            <div class="boxWide">
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_MATCH;
                ?>
'><?php 
                echo $box['title'];
                ?>
</h3>
                <div class='boxBody'>
                    <table class="boxTable">
                        <tr>
                            <td style="text-align: right;" width="50%"><i><?php 
                echo $lng->getTrn('common/home');
                ?>
</i></td>
                            <td> </td>
                            <td style="text-align: left;" width="50%"><i><?php 
                echo $lng->getTrn('common/away');
                ?>
</i></td>
                            <td><i><?php 
                echo $lng->getTrn('common/date');
                ?>
</i></td>
                            <td> </td>
                        </tr>
                        <?php 
                list($matches, $pages) = Match::getMatches(array(1, $box['length']), $box['type'], $box['id'], false);
                foreach ($matches as $m) {
                    echo "<tr valign='top'>\n";
                    $t1name = $settings['fp_links'] ? "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team1_id, false, false) . "'>{$m->team1_name}</a>" : $m->team1_name;
                    $t2name = $settings['fp_links'] ? "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $m->team2_id, false, false) . "'>{$m->team2_name}</a>" : $m->team2_name;
                    echo "<td style='text-align: right;'>{$t1name}</td>\n";
                    echo "<td><nobr>{$m->team1_score}&mdash;{$m->team2_score}</nobr></td>\n";
                    echo "<td style='text-align: left;'>{$t2name}</td>\n";
                    echo "<td>" . str_replace(' ', '&nbsp;', textdate($m->date_played, true)) . "</td>";
                    echo "<td><a href='index.php?section=matches&amp;type=report&amp;mid={$m->match_id}'>Show</a></td>";
                    echo "</tr>";
                }
                ?>
                    </table>
                </div>
            </div>
            <?php 
                MTS('Latest matches table generated');
                break;
            case 'leaders':
                $f = 'mv_' . $box['field'];
                list($players, ) = Stats::getRaw(T_OBJ_PLAYER, array($box['type'] => $box['id']), array(1, $box['length']), array('-' . $f), false);
                ?>
            <div class="boxWide">
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_STATS;
                ?>
'><?php 
                echo $box['title'];
                ?>
</h3>
                <div class='boxBody'>
                    <table class="boxTable">
                        <tr>
                            <td><i><?php 
                echo $lng->getTrn('common/name');
                ?>
</i></td>
                            <?php 
                if ($box['show_team']) {
                    ?>
<td><i><?php 
                    echo $lng->getTrn('common/team');
                    ?>
</i></td><?php 
                }
                ?>
                            <td><i>#</i></td>
                            <td><i><?php 
                echo $lng->getTrn('common/value');
                ?>
</i></td>
                        </tr>
                        <?php 
                foreach ($players as $p) {
                    echo "<tr>\n";
                    echo "<td>" . ($settings['fp_links'] ? "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $p['player_id'], false, false) . "'>{$p['name']}</a>" : $p['name']) . "</td>\n";
                    if ($box['show_team']) {
                        echo "<td>" . ($settings['fp_links'] ? "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $p['owned_by_team_id'], false, false) . "'>{$p['f_tname']}</a>" : $p['f_tname']) . "</td>\n";
                    }
                    echo "<td>" . $p[$f] . "</td>\n";
                    echo "<td>" . $p['value'] / 1000 . "k</td>\n";
                    echo "</tr>";
                }
                ?>
                    </table>
                </div>
            </div>
            <?php 
                MTS('Leaders standings generated');
                break;
            case 'events':
                $events = _events($box['content'], $box['type'], $box['id'], $box['length']);
                ?>
            <div class="boxWide">
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_STATS;
                ?>
'><?php 
                echo $box['title'];
                ?>
</h3>
                <div class='boxBody'>
                    <table class="boxTable">
                        <?php 
                $head = array_pop($events);
                echo "<tr>\n";
                foreach ($head as $col => $name) {
                    echo "<td><i>{$name}</i></td>\n";
                }
                echo "</tr>\n";
                foreach ($events as $e) {
                    echo "<tr>\n";
                    foreach ($head as $col => $name) {
                        switch ($col) {
                            case 'date':
                                $e->{$col} = str_replace(' ', '&nbsp;', textdate($e->{$col}, true));
                                break;
                            case 'name':
                                if ($settings['fp_links']) {
                                    $e->{$col} = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $e->pid, false, false) . "'>" . $e->{$col} . "</a>";
                                }
                                break;
                            case 'tname':
                                if ($settings['fp_links']) {
                                    $e->{$col} = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $e->f_tid, false, false) . "'>" . $e->{$col} . "</a>";
                                }
                                break;
                            case 'rname':
                                if ($settings['fp_links']) {
                                    $e->{$col} = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_RACE, $e->f_rid, false, false) . "'>" . $e->{$col} . "</a>";
                                }
                                break;
                            case 'f_pos_name':
                                if ($settings['fp_links']) {
                                    $e->{$col} = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_RACE, $e->f_rid, false, false) . "'>" . $e->{$col} . "</a>";
                                }
                                break;
                            case 'value':
                                $e->{$col} = $e->{$col} / 1000 . 'k';
                                break;
                        }
                        echo "<td>" . $e->{$col} . "</td>\n";
                    }
                    echo "</tr>\n";
                }
                ?>
                    </table>
                </div>
            </div>
            <?php 
                MTS('Events box generated');
                break;
        }
    }
    ?>
    </div>
    <div class="main_foot">
        <?php 
    HTMLOUT::dnt();
    ?>
        <br>
        <a TARGET="_blank" href="http://nicholasmr.dk/index.php?sec=obblm">OBBLM official website</a><br><br>
        This web site is completely unofficial and in no way endorsed by Games Workshop Limited.
        <br>
        Bloodquest, Blood Bowl, the Blood Bowl logo, The Blood Bowl Spike Device, Chaos, the Chaos device, the Chaos logo, Games Workshop, Games Workshop logo, Nurgle, the Nurgle device, Skaven, Tomb Kings, and all associated marks, names, races, race insignia, characters, vehicles, locations, units, illustrations and images from the Blood Bowl game, the Warhammer world are either (R), TM and/or (C) Games Workshop Ltd 2000-2006, variably registered in the UK and other countries around the world. Used without permission. No challenge to their status intended. All Rights Reserved to their respective owners.
    </div>
    <?php 
}
Пример #9
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>";
    }
Пример #10
0
    public static function main($argv)
    {
        global $lng;
        title($lng->getTrn('name', __CLASS__));
        echo $lng->getTrn('desc', __CLASS__) . "<br><br>\n";
        list($sel_node, $sel_node_id) = HTMLOUT::nodeSelector(array());
        echo "<br>";
        $_rows = 0;
        foreach (self::getMemMatches($sel_node, $sel_node_id) as $d => $matches) {
            $_container_style = 'float:left; width:50%;';
            if ($_rows == 0) {
                echo "<div style='{$_container_style}'>";
            }
            ?>
        <div class="boxWide">
            <div class="boxTitle<?php 
            echo T_HTMLBOX_INFO;
            ?>
"><?php 
            echo $lng->getTrn($d, __CLASS__);
            ?>
</div>
            <div class="boxBody">
                <table class="common">
                <?php 
            if (empty($matches)) {
                ?>
<tr><td align="center"><br><br><?php 
                echo preg_replace('/\\sX\\s/', ' ' . MAX_MEM_MATCHES . ' ', $lng->getTrn('filled', __CLASS__));
                ?>
<br><br></td></tr><?php 
            } else {
                $i = count($matches);
                foreach ($matches as $m) {
                    $t1 = new Team($m->team1_id);
                    $t2 = new Team($m->team2_id);
                    $img1 = new ImageSubSys(IMGTYPE_TEAMLOGO, $t1->team_id);
                    $img2 = new ImageSubSys(IMGTYPE_TEAMLOGO, $t2->team_id);
                    ?>
                    <tr>
                        <td align="left" style="width:40%;"><img border='0px' height='30' width='30' alt='team picture' src='<?php 
                    echo $img1->getPath();
                    ?>
'><?php 
                    echo $t1->name;
                    ?>
</td>
                        <td align="center">
                        <?php 
                    switch ($d) {
                        case 'td':
                        case 'cp':
                        case 'intcpt':
                        case 'ki':
                        case 'cas':
                            $v = array();
                            $s = $d == 'cas' ? 'bh+ki+si' : $d;
                            foreach (array(1, 2) as $j) {
                                $query = "SELECT SUM({$s}) as '{$s}' FROM matches, match_data WHERE f_match_id = match_id AND match_id = {$m->match_id} AND f_team_id = team{$j}_id";
                                $result = mysql_query($query);
                                $row = mysql_fetch_assoc($result);
                                $v[$j] = $row[$s] ? $row[$s] : 0;
                            }
                            echo "<b>{$v['1']} &nbsp;-&nbsp; {$v['2']}</b>";
                            break;
                        case 'svic':
                            echo "<b>{$m->team1_score} &nbsp;-&nbsp; {$m->team2_score}</b>";
                            break;
                        case 'inc':
                            echo '<b>' . $m->income1 / 1000 . 'k - ' . $m->income2 / 1000 . 'k</b>';
                            break;
                        case 'gate':
                            echo '<b>' . $m->gate / 1000 . 'k</b>';
                            break;
                        case 'mfans':
                            echo "<b>{$m->fans}</b>";
                            break;
                        case 'tvdiff':
                            echo '<b>' . $m->tv1 / 1000 . 'k - ' . $m->tv2 / 1000 . 'k</b>';
                            break;
                    }
                    ?>
                        </td>
                        <td align="right" style="width:40%;"><?php 
                    echo $t2->name;
                    ?>
<img border='0px' height='30' width='30' alt='team picture' src='<?php 
                    echo $img2->getPath();
                    ?>
'></td>
                    </tr>
                    <tr>
                        <td align="right" colspan="3">
                        <small>
                        <i><?php 
                    echo get_alt_col('tours', 'tour_id', $m->f_tour_id, 'name');
                    ?>
, <?php 
                    echo textdate($m->date_played, true);
                    ?>
</i>,
                        <a href="index.php?section=matches&amp;type=report&amp;mid=<?php 
                    echo $m->match_id;
                    ?>
"><?php 
                    echo $lng->getTrn('common/view');
                    ?>
</a>
                        </small>
                        </td>
                    </tr>
                    <?php 
                    if (--$i > 0) {
                        echo '<tr><td colspan="3"><hr></td></tr>';
                    }
                }
            }
            ?>
                </table>
            </div>
        </div>
        <?php 
            if (is_int(($_rows + 1) / MMATCHES_BREAK)) {
                echo "</div>";
                echo "<div style='{$_container_style}'>";
            }
            $_rows++;
        }
        echo "</div>";
    }