當前位置: 首頁>>代碼示例>>PHP>>正文


PHP game::select方法代碼示例

本文整理匯總了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) {
開發者ID:errorcodexero,項目名稱:scouting,代碼行數:31,代碼來源:score-game.php

示例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);
開發者ID:errorcodexero,項目名稱:scouting,代碼行數:31,代碼來源:make-game.php


注:本文中的game::select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。