本文整理汇总了PHP中Pool::GetCategoryChoices方法的典型用法代码示例。如果您正苦于以下问题:PHP Pool::GetCategoryChoices方法的具体用法?PHP Pool::GetCategoryChoices怎么用?PHP Pool::GetCategoryChoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pool
的用法示例。
在下文中一共展示了Pool::GetCategoryChoices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
//if we are removing a non template category:
$pool_categories = $pool->GetPoolCategoryData($pool_id);
}
$number_of_saved_categories = count($pool_categories);
if ($number_of_saved_categories > 0) {
$return_value = Update_Category_List($pool_categories, $multiple_choice);
echo $return_value;
}
}
if (isset($_GET['remove_category_choice'])) {
//if we are removing a given category choice from DB:
$category_id = $_GET['category_id'];
$removal_choice = $_GET['remove_category_choice'];
$pool = new Pool();
$pool->RemoveCategoryChoice($removal_choice);
$category_choices = $pool->GetCategoryChoices($category_id);
$number_categories_choices = count($category_choices);
if ($number_categories_choices > 0) {
$return_value = Update_Category_Choice_List($category_choices, $category_id);
echo $return_value;
}
}
//SUBMIT THE POOL - MAKE IT READY FOR INVITEES
if (isset($_GET['submit_pool'])) {
$pool = new Pool();
$result_array_test = $pool->MakePoolReadyForInvitees($pool_id);
if ($result_array_test == 0) {
//IF WE GET A 0 BACK FROM MakePoolReadyForInvitees FUNCTION, IT MEANS POOL IS ALREADY SUBMITTED
echo "Pool is already submitted!";
//note, as of 11/13, this text will not be shown anywhere
} else {
示例2: Update_Category_List
function Update_Category_List($pool_categories, $multiple_choice)
{
$pool = new Pool();
$category_counter = 1;
$return_array = array();
foreach ($pool_categories as $category_id => $category_info) {
if ($multiple_choice == 1) {
//if this is a multiple choice pool (NOTE: AS OF 3/26/14, THIS UPDATE_CATEGORY_LIST FUNCTION CANNOT DIFFERENTIATE BETWEEN MC CATEGORIES AND NON MC CATEGORIES FOR THE SAME POOL - I.e., THE MC ARGUMENT IS STATIC ACROSS ALL CATEGORIES)
$category_choices = $pool->GetCategoryChoices($category_id);
$choice_list = Update_Category_Choice_List($category_choices, $category_id);
$choice_return_value = <<<HTML
<div id="category_choices_container">
<h4 class="edit_category_choices_label"> Category Choices: </h4>
<div id="category{$category_id}_choice_space">
{$choice_list}
</div>
<div id="new_category{$category_id}_choice_goes_here" class="new_category_choice_goes_here_div">
<h4><span id="add_choice_button_for_category_{$category_id}" class="add_category_choice_button"><input type="button" onclick="add_category_choice({$category_id})" value="Add new choice"></span></h4>
</div>
</div> <!--END OF CATEGORY_CHOICE_CONTAINER DIV-->
HTML;
} else {
//if given pool is NOT multiple choice, choice_return_value should just be blank
$choice_return_value = "";
}
$return_array[$category_counter] = <<<HTML
<div id="category_{$category_counter}">
<div style="margin-left:50px" class="well well-sm">
<div class="row">
<div class="col-md-2">
<h4>
\t<span class="category_name_label">Category name: </span>
</h4>
</div>
<div class="col-md-6">
<h3>
<span class="label label-info"><span class="edit_pool_field" id="category_n_span{$category_info['Category ID']}" style="margin-left:0px; white-space:normal;">{$category_info['Category Name']}</span></span>
</h3>
</div>
<div class="col-md-2">
<h4>
Point Value: <span class="label label-info"> <span class="edit_pool_field" id="category_p_span{$category_info['Category ID']}"> {$category_info['Category Point Value']} </span> </span>
</h4>
</div>
<div class="col-md-2">
<h5>
<span class="remove_category_button"><input type="button" onclick="remove_category({$category_counter}, {$category_info['Category ID']}, {$multiple_choice})" value=" Remove
Category"></span>
</h5>
</div>
</div>
{$choice_return_value}
</div>
</div>
HTML;
$category_counter++;
}
foreach ($return_array as $category_number => $category_html_content) {
//concatenate each category's html section together into one long string of html text
$return_value = $return_value . $category_html_content;
}
return $return_value;
}