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


PHP Tool::find_all方法代码示例

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


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

示例1: _manage_platoon

 public static function _manage_platoon($div, $plt)
 {
     $division = Division::findByName(strtolower($div));
     $platoonId = Platoon::getIdFromNumber($plt, $division->id);
     if (!is_null($platoonId)) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         if ($member->platoon_id == $platoonId || $user->role > 2 || User::isDev()) {
             $tools = Tool::find_all($user->role);
             $divisions = Division::find_all();
             $platoon = Platoon::findById($platoonId);
             $unassignedMembers = Platoon::unassignedMembers($platoonId, true);
             $squads = Squad::findByPlatoonId($platoonId);
             $memberCount = count((array) Platoon::members($platoonId));
             $js = 'manage';
             Flight::render('manage/platoon', compact('division', 'platoon', 'squads', 'unassignedMembers', 'memberCount'), 'content');
             Flight::render('layouts/application', compact('js', 'user', 'member', 'tools', 'divisions'));
         } else {
             // insufficient access
             Flight::redirect('404/', 404);
         }
     } else {
         // nonexistent platoon
         Flight::redirect('404/', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:26,代码来源:PlatoonController.php

示例2: _help

 public static function _help()
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     $division = Division::findById(intval($member->game_id));
     $js = 'help';
     Flight::render('application/help', compact('user', 'member', 'division'), 'content');
     Flight::render('layouts/application', compact('js', 'user', 'member', 'tools', 'divisions'));
 }
开发者ID:higginsd,项目名称:Division-Tracker,代码行数:11,代码来源:ApplicationController.php

示例3: _addNewMember

 public static function _addNewMember()
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     $division = Division::findById(intval($member->game_id));
     $platoons = Platoon::find_all($member->game_id);
     $platoon_id = $user->role >= 2 && !User::isDev() ? $member->platoon_id : false;
     $squads = Squad::findAll($member->game_id, $platoon_id);
     $js = 'recruit';
     Flight::render('recruiting/new_member', compact('user', 'member', 'division', 'platoons', 'squads'), 'content');
     Flight::render('layouts/application', compact('js', 'user', 'member', 'tools', 'divisions'));
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:14,代码来源:RecruitingController.php

示例4: _profile

 public static function _profile($id)
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     // profile data
     $memberInfo = Member::findByMemberId(intval($id));
     if (property_exists($memberInfo, 'id')) {
         $divisionInfo = Division::findById(intval($memberInfo->game_id));
         $platoonInfo = Platoon::findById(intval($memberInfo->platoon_id));
         $recruits = Member::findRecruits($memberInfo->member_id);
         $gamesPlayed = MemberGame::get($memberInfo->id);
         $aliases = MemberHandle::findByMemberId($memberInfo->id);
         // game data
         $bdate = date("Y-m-d", strtotime("tomorrow - 30 days"));
         $edate = date("Y-m-d", strtotime("tomorrow"));
         $totalGames = BfActivity::countPlayerGames($memberInfo->member_id, $bdate, $edate);
         $aodGames = BfActivity::countPlayerAODGames($memberInfo->member_id, $bdate, $edate);
         $games = BfActivity::find_allGames($memberInfo->member_id);
         $pctAod = $totalGames > 0 ? $aodGames * 100 / $totalGames : 0;
         switch ($divisionInfo->short_name) {
             case "bf":
                 $activity = array('totalGames' => $totalGames, 'aodGames' => $aodGames, 'games' => $games, 'pctAod' => $pctAod);
                 $activity_page = $divisionInfo->short_name;
                 break;
             default:
                 $activity = array();
                 $activity_page = 'default';
                 break;
         }
         if (property_exists($platoonInfo, 'id')) {
             $platoonInfo->link = "<li><a href='divisions/{$divisionInfo->short_name}/platoon/{$platoonInfo->number}'>{$platoonInfo->name}</a></li>";
             $platoonInfo->item = "<li class='list-group-item text-right'><span class='pull-left'><strong>Platoon: </strong></span> <span class='text-muted'>{$platoonInfo->name}</span></li>";
         }
         // if squad leader, show recruits
         if ($memberInfo->position_id == 5) {
             Flight::render('member/sl-personnel', array('member' => $memberInfo), 'sl_personnel');
         }
         Flight::render('member/alerts', array('memberInfo' => $memberInfo), 'alerts');
         Flight::render('member/recruits', array('recruits' => $recruits), 'recruits');
         Flight::render('member/member_data', array('memberInfo' => $memberInfo, 'divisionInfo' => $divisionInfo, 'platoonInfo' => $platoonInfo, 'aliases' => $aliases), 'member_data');
         Flight::render('member/activity/' . $activity_page, $activity, 'activity');
         Flight::render('member/history', array(), 'history');
         Flight::render('member/profile', array('user' => $user, 'member' => $member, 'memberInfo' => $memberInfo, 'divisionInfo' => $divisionInfo, 'platoonInfo' => $platoonInfo, 'gamesPlayed' => $gamesPlayed), 'content');
         Flight::render('layouts/application', array('js' => 'member', 'user' => $user, 'member' => $member, 'tools' => $tools, 'divisions' => $divisions));
     } else {
         Flight::redirect('/404', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:50,代码来源:MemberController.php

示例5: _authenticate

 public static function _authenticate()
 {
     if (User::isLoggedIn()) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         $tools = Tool::find_all($user->role);
         $divisions = Division::find_all();
         Flight::render('layouts/auth', [], 'content');
         Flight::render('layouts/application', compact('user', 'member', 'tools', 'divisions'));
     } else {
         Flight::render('layouts/auth', [], 'content');
         Flight::render('layouts/application', compact('user', 'member', 'tools', 'divisions'));
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:14,代码来源:UserController.php

示例6: _retentionNumbers

 public static function _retentionNumbers()
 {
     $user = User::find(intval($_SESSION['userid']));
     if ($user->role >= 3 || User::isDev()) {
         $member = Member::find(intval($_SESSION['memberid']));
         $tools = Tool::find_all($user->role);
         $divisions = Division::find_all();
         $recruited = Report::recruitedLast30days($member->game_id);
         $removed = Report::removedLast30days($member->game_id);
         $monthlyBreakdown = Report::recruitingWeekly($member->game_id);
         $byTheMonth = Report::recruitingByTheMonth($member->game_id);
         $js = 'report';
         Flight::render('reports/retention', compact('recruited', 'removed', 'js', 'monthlyBreakdown', 'byTheMonth'), 'content');
         Flight::render('layouts/application', array('user' => $user, 'member' => $member, 'tools' => $tools, 'divisions' => $divisions));
     } else {
         Flight::redirect('/404', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:18,代码来源:ReportController.php

示例7: _manage_loas

 public static function _manage_loas()
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     $division = Division::findById(intval($member->game_id));
     Flight::render('manage/loas', array('division' => $division, 'member' => $member, 'user' => $user), 'content');
     Flight::render('layouts/application', array('user' => $user, 'member' => $member, 'tools' => $tools, 'divisions' => $divisions, 'js' => 'manage'));
 }
开发者ID:higginsd,项目名称:Division-Tracker,代码行数:10,代码来源:DivisionController.php

示例8: _reports

 public static function _reports()
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     $division = Division::findByName(strtolower($div));
     Flight::render('modals/reports');
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:9,代码来源:DivisionController.php


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