本文整理汇总了PHP中Pool::GetUserPicks方法的典型用法代码示例。如果您正苦于以下问题:PHP Pool::GetUserPicks方法的具体用法?PHP Pool::GetUserPicks怎么用?PHP Pool::GetUserPicks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pool
的用法示例。
在下文中一共展示了Pool::GetUserPicks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<!--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]);
示例2: Pool
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;
}
}
?>
示例3: 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 {
?>