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


PHP Pool::GetCategoryChoices方法代码示例

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

示例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: &nbsp; </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: &nbsp; </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">&nbsp;<span class="edit_pool_field" id="category_p_span{$category_info['Category ID']}">&nbsp;{$category_info['Category Point Value']}&nbsp; </span>&nbsp;</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;
}
开发者ID:epsilon670,项目名称:Poolski,代码行数:63,代码来源:update_categories_list.php


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