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


PHP UserDB::getBasicUserById方法代码示例

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


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

示例1: get

 public static function get()
 {
     $page = new Page();
     $page->data['title'] = 'Transacties';
     //Checks if user is set, if not redirect to manage user
     if (!isset($_GET['user'])) {
         header('Location: manageuser', true, 303);
     } else {
         //Gets the amount from GET or use default
         if (isset($_GET['amount'])) {
             $amount = $_GET['amount'];
         } else {
             $amount = MoneyTransactionsViewConfig::DEFAULT_AMOUNT;
         }
         try {
             //Get user for his name
             $page->data['TransactionsNameView']['fullName'] = UserDB::getBasicUserById($_GET['user'])->getFullName();
             //Get transactions for user
             $transactions = MoneyTransactionDB::getTransactionsByUserId($_GET['user'], $amount);
             $transactionCount = count($transactions);
             //If no transactions show no transactions view, otherwise show list with transactions
             if ($transactionCount > 0) {
                 $page->data['TransactionsWithDiscountListView']['transactions'] = $transactions;
                 $page->data['TransactionsWithDiscountListView']['totalAmount'] = $transactionCount;
                 $page->addView('transactions/TransactionsTitleView');
                 $page->addView('transactions/TransactionsNameView');
                 $page->addView('transactions/TransactionsBackToManageUserLinkView');
                 $page->addView('transactions/TransactionsWithDiscountListView');
             } else {
                 $page->data['InfoMessageNoDescriptionWithLinkView']['infoTitle'] = 'Er zijn nog geen transacties';
                 $page->data['InfoMessageNoDescriptionWithLinkView']['redirectUrl'] = 'manageuser';
                 $page->addView('transactions/TransactionsTitleView');
                 $page->addView('transactions/TransactionsNameView');
                 $page->addView('info/InfoMessageNoDescriptionWithLinkView');
             }
         } catch (Exception $ex) {
             $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         }
         $page->showWithMenu();
     }
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:43,代码来源:UserTransactionsController.php

示例2: get

 public static function get()
 {
     $page = new Page();
     $page->data['title'] = 'Winnaar van de week';
     $page->addView('weeklyWinner/WeeklyWinnerTopView');
     try {
         $weeklyWinnerData = WeeklyWinnerDB::getThisWeeksWinnerData();
         //If there's already a winner we show it's data
         if ($weeklyWinnerData) {
             $user = UserDB::getBasicUserById($weeklyWinnerData->userId);
             $page->data['WeeklyWinnerShowWinnerView']['winnerFullName'] = $user->getFullName();
             $page->data['WeeklyWinnerShowWinnerView']['hasCollectedPrize'] = $weeklyWinnerData->hasCollectedPrize;
             $page->addView('weeklyWinner/WeeklyWinnerShowWinnerView');
         } else {
             $page->data['WeeklyWinnerGenerateFormView']['generate_winner_formAction'] = $_SERVER['REQUEST_URI'];
             $page->addView('weeklyWinner/WeeklyWinnerGenerateFormView');
         }
     } catch (Exception $ex) {
         $page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'] = 'Kon winnaar niet ophalen';
         $page->addView('error/ErrorMessageNoDescriptionNoLinkView');
     }
     $page->showWithMenu();
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:23,代码来源:WeeklyWinnerController.php


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