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


PHP Pool::GetTieBreakerAnswer方法代码示例

本文整理汇总了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>
开发者ID:the212,项目名称:Poolski,代码行数:31,代码来源:pool.php

示例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 
开发者ID:epsilon670,项目名称:Poolski,代码行数:31,代码来源:pool_BACKUP_20131119.php


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