本文整理匯總了PHP中Pool::GetTieBreakerAnswer方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pool::GetTieBreakerAnswer方法的具體用法?PHP Pool::GetTieBreakerAnswer怎麽用?PHP Pool::GetTieBreakerAnswer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pool
的用法示例。
在下文中一共展示了Pool::GetTieBreakerAnswer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
?>
<h4>
<span class='glyphicon glyphicon-pencil' id='pool_score_manual_glyph'></span>
</h4>
<h3>
<span class='label label-warning'><a href='score_pool_manual.php?pool_id=<?php
echo $pool_id;
?>
' style="color:white">Click here to score picks</a></span>
</h3>
<?php
} else {
//if user is not leader, the pool IS a template, the pool is NOT live, OR there is a pool winner set:
//AS OF 5/20/14, WE ARE DISPLAYING THE TIE BREAKER ANSWER HERE
//THIS COULD BE CHANGED TO BE SOME OTHER CONTENT/FILLER
$user_tie_breaker_answer = $pool->GetTieBreakerAnswer($current_user_id, $pool_id);
if (is_null($user_tie_breaker_answer)) {
//if there is no tie breaker answer chosen
$user_tie_breaker_answer_display = "<span style='font-style:italic'>**No answer chosen**</span>";
} else {
//if there is a tie breaker answer chosen:
$user_tie_breaker_answer_display = "<span class='label label-primary'>" . $user_tie_breaker_answer . "</span>";
}
?>
<h4>
<span class="glyphicon glyphicon-certificate" id="pool_mypicks_link_glyph"></span>
</h4>
<h4>
Your Tie-breaker answer is:
</h4>
<h3>
示例2: header
//IT IS EXPECTED THAT THIS PAGE WILL BE LOADED WITH THE POOL_ID VARIABLE SET IN THE URL
if (!isset($_GET['pool_id'])) {
//if no pool ID is specified in URL, return the user to the homepage:
header("Location: home.php");
} else {
//if we successfully got the pool id from the URL:
include_once 'inc/class.pool.inc.php';
$pool_id = $_GET['pool_id'];
//get pool ID from URL
$pool = new Pool();
//new instance of the Pool class
//Below functions fetch the necessary pool data for the user:
$pool_fetch_result = $pool->GetPoolData($pool_id);
$pool_category_fetch = $pool->GetPoolCategoryData($pool_id);
$user_picks_fetch = $pool->GetUserPicks($_SESSION['Username'], $pool_id);
$tie_breaker_answer = $pool->GetTieBreakerAnswer($_SESSION['Username'], $pool_id);
if (isset($tie_breaker_answer)) {
$tie_breaker_answer_display = $tie_breaker_answer;
} else {
$tie_breaker_answer_display = "**Enter your tie-breaker answer here!**";
}
}
if ($pool_fetch_result == 0) {
//if the pool id passed thru url does not exist in database:
?>
<p>Error: pool does not exist</p>
<p><a href="home.php">Click here to return to home page</a></p>
<?php
} else {
?>
<span id="pool_id_span" style="display:none"><?php