本文整理汇总了PHP中Division::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::findById方法的具体用法?PHP Division::findById怎么用?PHP Division::findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Division
的用法示例。
在下文中一共展示了Division::findById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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'));
}
示例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'));
}
示例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'));
}
示例4: __construct
public function __construct($game_id)
{
$this->game_id = $game_id;
// get data
$this->division = Division::findById($this->game_id);
$this->platoons = Platoon::find_all($this->game_id);
// colors
$this->division_leaders_color = "#00FF00";
$this->platoon_leaders_color = "#00FF00";
$this->squad_leaders_color = "#FFA500";
$this->div_name_color = "#FF0000";
$this->platoon_num_color = "#FF0000";
$this->platoon_pos_color = "#40E0D0";
// number of columns
$this->num_columns = 4;
// widths
$this->players_width = 900;
$this->info_width = 800;
// misc settings
$this->min_num_squad_leaders = 2;
self::generate();
}
示例5: __construct
public function __construct($game_id)
{
$this->banner = "http://i.imgur.com/BKkTYMC.jpg";
$this->game_id = $game_id;
// get data
$this->division = Division::findById($this->game_id);
$this->platoons = Platoon::find_all($this->game_id);
// colors
$this->division_leaders_color = "#FF0000";
$this->general_sergeants_color = "#00FFFF";
$this->platoon_name_color = "#00FFFF";
$this->platoon_leader_color = "#FFA07A";
$this->squad_leader_color = "orange";
// number of columns
$this->num_columns_squads = 3;
// widths
$this->players_width = 900;
$this->info_width = 800;
// misc settings
$this->min_num_squad_leaders = 2;
self::generate();
}
示例6: _doAddMember
public static function _doAddMember()
{
$user = User::find(intval($_SESSION['userid']));
$member = Member::find(intval($_SESSION['memberid']));
$division = Division::findById($member->game_id);
$platoon_id = $user->role >= 3 || User::isDev() ? $_POST['platoon_id'] : $member->platoon_id;
$squad_id = $user->role >= 2 || User::isDev() ? $_POST['squad_id'] : Squad::mySquadId($member->id) ?: 0;
$recruiter = $member->member_id;
$position_id = 6;
// provide params for brand new members
$params = array('member_id' => $_POST['member_id'], 'forum_name' => trim($_POST['forum_name']), 'recruiter' => $recruiter, 'game_id' => $_POST['game_id'], 'status_id' => 999, 'join_date' => date("Y-m-d H:i:s"), 'last_forum_login' => date("Y-m-d H:i:s"), 'last_activity' => date("Y-m-d H:i:s"), 'last_forum_post' => date("Y-m-d H:i:s"), 'last_promotion' => date("Y-m-d H:i:s"), 'rank_id' => 1, 'platoon_id' => $platoon_id, 'squad_id' => $squad_id, 'position_id' => $position_id);
if (Member::exists($_POST['member_id'])) {
// update existing record
$existing_member_id = Member::findId($_POST['member_id']);
$params = array_merge($params, array('id' => $existing_member_id));
$affected_rows = Member::modify($params);
if ($affected_rows > 0) {
UserAction::create(array('type_id' => 10, 'date' => date("Y-m-d H:i:s"), 'user_id' => $member->member_id, 'target_id' => $params['member_id']));
$data = array('success' => true, 'message' => "Existing member successfully updated!");
} else {
$data = array('success' => false, 'message' => "Existing member could not be updated.");
}
} else {
// member doesn't exist
$insert_id = Member::create($params);
if ($insert_id != 0) {
UserAction::create(array('type_id' => 1, 'date' => date("Y-m-d H:i:s"), 'user_id' => $member->member_id, 'target_id' => $params['member_id']));
$data = array('success' => true, 'message' => "Member successfully added!");
} else {
$data = array('success' => false, 'message' => "Member could not be added.");
}
}
if ($insert_id != 0) {
if (isset($_POST['played_games'])) {
$games = $_POST['played_games'];
foreach ($games as $game) {
$memberGame = new stdClass();
$memberGame->member_id = $insert_id;
$memberGame->game_id = $game;
MemberGame::add($memberGame);
}
}
if (isset($_POST['ingame_name'])) {
$ingame_name = trim($_POST['ingame_name']);
$handle = new stdClass();
$handle->member_id = $insert_id;
$handle->handle_type = $division->primary_handle;
$handle->handle_value = $ingame_name;
$handle->handle_account_id = '0';
$handle->invalid = '0';
$handle->invalid_date = '0000-00-00';
MemberHandle::add($handle);
}
}
echo json_encode($data);
}
示例7:
<?php
$division = Division::findById($_POST['division_id']);
$platoon = Platoon::findById($_POST['platoon_id']);
$leaders = Platoon::SquadLeaders($_POST['division_id'], $_POST['platoon_id']);
?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title"><strong>Create</strong> New Squad</h4>
</div>
<form id="create_squad">
<div class="modal-body">
<p>Select a squad leader to assign to your new squad. Or select none to create a squad without a leader, to be assigned later. If the player you want is not listed, ensure that they are set as a squad leader through their tracker profile, that they are assigned to the correct platoon, and that they aren't already a leader of an existing squad.</p>
<p>Modifying: <strong><?php
echo $platoon->name;
?>
</strong> of the <strong><?php
echo $division->full_name;
?>
</strong> division</p>
<input type='hidden' name='platoon_id' value='<?php
echo $_POST['platoon_id'];
?>
'></input>
<input type='hidden' name='division_id' value='<?php