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


PHP Match::read方法代码示例

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


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

示例1: VALUES

    if (!empty($_POST['terms'])) {
        if ($_POST['terms'] == _('Acepto')) {
            $db->query("INSERT INTO league_terms VALUES({$current_user->user_id}, 'nivea')");
        } else {
            header("location: /");
            exit;
        }
    }
    $accepted_terms = $db->get_row("SELECT count(*) as t FROM league_terms WHERE user_id={$current_user->user_id} AND vendor='nivea'")->t == 1;
}
/* }}} */
$sites = $db->get_results("select * from subs where visible order by id asc");
$args = compact('league', 'accepted_terms', 'sites');
Haanga::Load('league/layout-header.tpl', $args);
if (isset($_GET['match'])) {
    $match = new Match(intval($_GET['match']));
    if ($match->read() && $match->league_id == $league->id) {
        $match->print_summary();
    }
} else {
    foreach ($league->get_pages($league->per_page) as $m) {
        $match = new Match($m->id);
        $match->read();
        $match->print_summary();
    }
    echo '<div class="pages-ad">';
    do_pages_reverse($league->total, $league->per_page);
    echo '</div>';
}
echo '</body></html>';
/* vim:set noet ci pi sts=0 sw=4 ts=4: */
开发者ID:brainsqueezer,项目名称:fffff,代码行数:31,代码来源:index.php

示例2: array

            }
        }
    }
    $_GET = array('action' => 'list');
    $_SERVER['QUERY_STRING'] = http_build_query($_GET);
}
do_header(_('Administración de Ligas'));
do_league_tabs();
$data = array('leagues' => $db->get_results("SELECT id,name FROM league"), 'teams' => $db->get_results("SELECT id,name FROM league_teams"));
switch ($_GET['action']) {
    case 'create':
        create_form('match', _('Agregar un partido'), $data);
        break;
    case 'update':
        $league = new Match($_GET['id']);
        if (!$league->read()) {
            die(_("No se puede encontrar el PArtido"));
        }
        create_form('match', _('Editar un partido'), array_merge($data, get_object_vars($league)));
        break;
    case 'list':
    default:
        $total = $db->get_row("SELECT count(*) as total from " . Match::TABLE)->total;
        $per_page = 30;
        $pages = ceil($total / $per_page);
        $current = $pages;
        if (!empty($_GET['page']) && is_numeric($_GET['page'])) {
            $current = intval($_GET['page']);
        }
        $offset = ($pages - $current) * $per_page;
        $sql = "SELECT\n\t\tm.*,\n\t\tt1.name as local,\n\t\tt1.shortname as local_short,\n\t\tt2.name as visitante,\n\t\tt2.shortname as visitante_short,\n\t\tl.name as liga\n\tFROM \n\t\t" . Match::TABLE . " m\n\tINNER JOIN " . Team::TABLE . " t1 ON (t1.id = m.local)\n\tINNER JOIN " . Team::TABLE . " t2 ON (t2.id = m.visitor)\n\tINNER JOIN " . League::TABLE . " l ON (l.id = m.league_id)\n\tORDER BY id DESC\n\tLIMIT {$offset}, {$per_page}\n\t";
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:31,代码来源:matches.php


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