Exemplo n.º 1
0
        <!--END TIE BREAKER INPUT-->

<?php 
    foreach ($pool_members_id_array_keys as $each_user => $user_id) {
        //generate list of user picks for each user in the pool ($each_user is the key of the pool_members_id_array_keys array and starts at 0)
        $user_info = $user->GetUserInfo($user_id);
        //get the given user's username and email address and store them in the user_info array
        if ($pool_members_id_array[$user_id]['Nickname'] == "no_nickname") {
            //if user does not have a nickname for the pool
            $nickname = $user_info['Email Address'];
            //set user's display name to be their email address is they have no nickname
        } else {
            //if user does have a nickname for the pool
            $nickname = $pool_members_id_array[$user_id]['Nickname'];
        }
        $user_picks_fetch = $pool->GetUserPicks($user_id, $pool_id);
        //get the given user's picks
        $category_counter = 1;
        ?>
            <h3><?php 
        echo $nickname;
        ?>
's Picks:</h3>
<?php 
        foreach ($pool_category_fetch as $category_id => $category_info) {
            //generate list of categories for pool and populate the given user's picks for each category
            $incorrect_by_default = 0;
            //reset incorrect_by_default variable if it was previously equal to 1
            if (isset($user_picks_fetch[$category_id])) {
                //if a pick already exists for given category, we store it in the pick_display_value variable
                $user_pick_explode_array = explode('|', $user_picks_fetch[$category_id]);
Exemplo n.º 2
0
        echo $error_message;
    }
    if ($_GET['make_live'] == '762' . $pool_id . '8354') {
        //if we are making the pool live
        $pool = new Pool($pool_id);
        $make_pool_live_result = $pool->MakePoolLive($pool_id);
        header("Location: pool.php?pool_id={$pool_id}");
        //refresh the pool.php page once pool is live
    }
    if ($_GET['end_pool'] == '8341' . $pool_id . '8165') {
        //if we are ending the pool:
        $pool = new Pool($pool_id);
        $end_pool_result = $pool->EndPool($pool_id);
        header("Location: pool.php?pool_id={$pool_id}");
        //refresh the pool.php page once pool is live
    }
    //GET USER PICKS SO THAT WE CAN SHOW THEM ON PAGE:
    //CALLED FROM POOL_MEMBERS.PHP AND FINAL_POOL_RANKINGS.PHP PAGES AS OF 12/25/13
    if ($_GET['show_user_picks'] == 1) {
        $pool = new Pool();
        $user_picks_fetch = $pool->GetUserPicks($_GET['user_id'], $_GET['pool_id']);
        $user_picks_json = json_encode($user_picks_fetch);
        echo $user_picks_json;
    }
}
?>
 



Exemplo n.º 3
0
*/
//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 {
    ?>