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


PHP GroupManager::getTableData方法代码示例

本文整理汇总了PHP中GroupManager::getTableData方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::getTableData方法的具体用法?PHP GroupManager::getTableData怎么用?PHP GroupManager::getTableData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GroupManager的用法示例。


在下文中一共展示了GroupManager::getTableData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ShowUsers

 function ShowUsers($filter)
 {
     require_once PATH_ACCESS . '/UserManager.php';
     require_once PATH_ACCESS . '/GroupManager.php';
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $globalSettingsManager = new globalSettingsManager();
     $userManager = new UserManager();
     $groupManager = new GroupManager();
     try {
         $groups = $groupManager->getTableData();
         //$users = $userManager->getTableData();
         isset($_GET['sitePointer']) ? $showPage = $_GET['sitePointer'] + 0 : ($showPage = 1);
         $nextPointer = $showPage * 10 - 10;
         $users = $userManager->getUsersSorted($nextPointer, $filter);
     } catch (Exception $e) {
         $this->logs->log('ADMIN', 'MODERATE', sprintf('Error while getting Data from MySQL:%s in %s', $e->getMessage(), __METHOD__));
         $this->userInterface->dieError($this->messages['error']['get_data_failed']);
     }
     foreach ($users as &$user) {
         $is_named = false;
         foreach ($groups as $gn) {
             if ($gn['ID'] == $user['GID']) {
                 $user['groupname'] = $gn['name'];
                 $is_named = true;
                 break;
             }
         }
         $is_named or $user['groupname'] = 'Error: This group is non-existent!';
     }
     $specialCourses = $globalSettingsManager->getSpecialCourses();
     $specialCourses_exploded = explode("|", $specialCourses);
     $navbar = navBar($showPage, 'SystemUsers', 'System', 'SpecialCourse', '3', $filter);
     $this->SpecialCourseInterface->ShowUsers($users, $specialCourses_exploded, $navbar);
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:34,代码来源:AdminSpecialCourseProcessing.php

示例2: ChangePriceclass

 /**
  * Changes a Priceclass
  * @param string $priceclass_id The ID of the Priceclass to change
  */
 function ChangePriceclass($priceclass_id)
 {
     if (isset($_GET['where'], $_POST['ID'], $_POST['name'], $_POST['price'], $_POST['group_id'])) {
         $pc_old_ID = $_GET['where'];
         $pc_ID = $_POST['ID'];
         $pc_name = $_POST['name'];
         $pc_price = $_POST['price'];
         $pc_GID = $_POST['group_id'];
         $pc_price = str_replace(',', '.', $pc_price);
         if (!preg_match('/\\A^[0-9]{0,2}((,|\\.)[0-9]{2})?\\z/', $pc_price)) {
             $this->pcInterface->dieError($this->msg['err_inp_price']);
         } else {
             if (!preg_match('/\\A^[0-9]{1,5}\\z/', $pc_ID)) {
                 $this->pcInterface->dieError($this->msg['err_inp_id']);
             } else {
                 if (!preg_match('/\\A^[0-9]{1,5}\\z/', $pc_old_ID)) {
                     $this->pcInterface->dieError($this->msg['err_get']);
                 }
             }
         }
         try {
             $this->pcManager->changePriceClass($pc_old_ID, $pc_name, $pc_GID, $pc_price, $pc_ID);
         } catch (Exception $e) {
             $this->pcInterface->dieError($this->msg['err_change_priceclass'] . $e->getMessage());
         }
         $this->pcInterface->dieMsg($this->msg['fin_change_priceclass']);
     } else {
         require_once PATH_ACCESS . '/GroupManager.php';
         $groupManager = new GroupManager('groups');
         try {
             $priceclass = $this->pcManager->getEntryData($priceclass_id, '*');
             $current_group_name = $groupManager->getEntryData($priceclass['GID'], 'name');
             $groups = $groupManager->getTableData();
         } catch (Exception $e) {
         }
         foreach ($groups as &$group) {
             if ($group['ID'] == $priceclass['GID']) {
                 $group['default'] = 'selected';
             } else {
                 $group['default'] = '';
             }
         }
         $this->pcInterface->ChangePriceclass($priceclass, $groups, $current_group_name['name']);
     }
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:49,代码来源:AdminPriceclassProcessing.php


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