当前位置: 首页>>代码示例>>PHP>>正文


PHP Stats::getMatches方法代码示例

本文整理汇总了PHP中Stats::getMatches方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::getMatches方法的具体用法?PHP Stats::getMatches怎么用?PHP Stats::getMatches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stats的用法示例。


在下文中一共展示了Stats::getMatches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: upcomingGames

 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);
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:49,代码来源:class_htmlout.php

示例2: sec_mobile_main

    public static function sec_mobile_main()
    {
        global $coach, $lng, $T_INJS;
        $teams = $coach->getTeams();
        $selectedTeamId = Mobile_HTMLOUT::getSelectedTeamId();
        $_SESSION["SelectedTeam"] = $selectedTeamId;
        foreach ($teams as $team) {
            if ($team->team_id == $selectedTeamId) {
                $selectedTeam = $team;
            }
        }
        if (!$selectedTeam) {
            echo $lng->getTrn('mobile/team/noteams');
            return;
        }
        $playersOnSelectedTeam = $selectedTeam->getPlayers();
        // Filter players depending on settings and view mode.
        $tmp_players = array();
        foreach ($playersOnSelectedTeam as $player) {
            if ($player->is_dead || $player->is_sold) {
                continue;
            }
            array_push($tmp_players, $player);
        }
        $playersOnSelectedTeam = $tmp_players;
        foreach ($playersOnSelectedTeam as $player) {
            Player_HTMLOUT::setChoosableSkillsTranslations($player);
        }
        list($recentMatches, $pages) = Stats::getMatches(T_OBJ_TEAM, $selectedTeamId, false, false, false, false, array(), true, false);
        list($upcomingMatches, $pages) = Stats::getMatches(T_OBJ_TEAM, $selectedTeamId, false, false, false, false, array(), true, true);
        $allMatches = array_merge($recentMatches, $upcomingMatches);
        ?>
        <script type="text/javascript">
            $(document).ready(function() {
                var playersOnSelectedTeam = <?php 
        echo json_encode($playersOnSelectedTeam);
        ?>
;
                var matches = <?php 
        echo json_encode($allMatches);
        ?>
;
                var injuryTable = <?php 
        echo json_encode($T_INJS);
        ?>
;
                $('#tabs').tabs();
                $('#SelectedTeam').change(function() {
                    this.form.submit();
                });
				
                var mobileViewModel = new MobileViewModel(playersOnSelectedTeam, matches);
                
                mobileViewModel.matchDialogViewModel.selectedPlayerViewModel.injuryTable(injuryTable);
                mobileViewModel.matchDialogViewModel.myTeamId(<?php 
        echo $selectedTeamId;
        ?>
);
                
                ko.applyBindings(mobileViewModel);
            });
        </script>
        <div class="main">
            <form method="post" action="<?php 
        echo getFormAction('');
        ?>
">
                 <select id="SelectedTeam" name="SelectedTeam">
                    <?php 
        foreach ($teams as $team) {
            $isThisTeam = $team->team_id == $selectedTeamId;
            echo '<option value="' . $team->team_id . '"' . ($isThisTeam ? ' selected="selected"' : '') . '>' . $team->name . '</option>';
        }
        ?>
                </select>
                <span class="button-panel">
					<img id="open-menu" src="images/menu.svg" alt="Menu" class="icon ui-button ui-state-default ui-corner-all" data-bind="click: showMenu" />
					<ul id="menu" class="ui-state-default ui-corner-left ui-corner-left ui-corner-br" data-bind="visible: isMenuVisible">
						<li><a href="<?php 
        echo getFormAction('?section=management');
        ?>
"><?php 
        echo $lng->getTrn('mobile/team/management');
        ?>
</a></li>
						<li><a href="index.php"><?php 
        echo $lng->getTrn('mobile/team/desktop_site');
        ?>
</a></li>
						<li><a href="<?php 
        echo getFormAction('?logout=1');
        ?>
"><?php 
        echo $lng->getTrn('menu/logout');
        ?>
</a></li>
					</ul>
                </span>
            </form>
            <div>
//.........这里部分代码省略.........
开发者ID:rythos42,项目名称:naflm,代码行数:101,代码来源:class_mobile_htmlout.php


注:本文中的Stats::getMatches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。