本文整理汇总了PHP中game::select方法的典型用法代码示例。如果您正苦于以下问题:PHP game::select方法的具体用法?PHP game::select怎么用?PHP game::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game
的用法示例。
在下文中一共展示了game::select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
<?php
require_once 'lib/db.php';
require_once 'lib/competition.php';
require_once 'lib/team.php';
require_once 'lib/game.php';
include 'authenticate.php';
include 'title.php';
$con = DB::connect();
$matchid = $_GET["match"];
$teamnumber = $_GET["team"];
$match = match::select($con, $matchid);
$game = game::select($con, $matchid, $teamnumber);
if ($game == null) {
$game = new game();
}
// useful for setting checkboxes...
function check($val)
{
if ($val) {
echo "checked";
}
}
$red = $match->RedAlliance;
$blue = $match->BlueAlliance;
$color = 'red';
// figure out if we're scoring a blue or red team, to adjust the color
if ($teamnumber == $blue->TeamOne || $teamnumber == $blue->TeamTwo || $teamnumber == $blue->TeamThree) {
$color = 'blue';
}
// so we can scout the team in the same position in the next match.
if ($teamnumber == $blue->TeamOne || $teamnumber == $red->TeamOne) {
示例2: die
if ($match == null) {
die("match not found.");
}
if ($team == null) {
die("team not found.");
}
// reportMatch($match);
printf("match = %s, team = %s\n", $match->ID, $match->Number);
/*
$game = new game();
$game->MatchID = $match->ID;
$game->MatchNumber = $match->Number;
$game->TeamNumber = $team->Number;
$game->Autonomous = 9;
$game->Teleop = 42;
$game->Climbing = 20;
$game->ColoredFrisbees = 1;
$game->Offensive = true;
$game->Disqualified = false;
$game->TippedOver = false;
$game->MechanicalFailure = false;
$game->LostCommunication = true;
$game->DidNotMove = false;
$game->Comment = "A really good robot with a long comment.";
$game->insert($con);
*/
$game = game::select($con, $match->ID, $team->Number);
reportGames(array($game));
// $games = $match->selectGames($con);
// reportGames($games);