本文整理汇总了PHP中PilotData::getAllPilots方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::getAllPilots方法的具体用法?PHP PilotData::getAllPilots怎么用?PHP PilotData::getAllPilots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PilotData
的用法示例。
在下文中一共展示了PilotData::getAllPilots方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: savepro
public function savepro()
{
if ($this->post->firstname == '' || $this->post->lastname == '') {
$this->set('message', 'The first or lastname cannot be blank!');
$this->render('core_error.tpl');
return;
}
$params = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'hub' => $this->post->hub, 'retired' => $this->post->retired, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'transferhours' => $this->post->transferhours);
PilotData::updateProfile($this->post->pilotid, $params);
PilotData::SaveFields($this->post->pilotid, $_POST);
/* Don't calculate a pilot's rank if this is set */
if (Config::Get('RANKS_AUTOCALCULATE') == false) {
PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
} else {
RanksData::calculateUpdatePilotRank($this->post->pilotid);
}
StatsData::UpdateTotalHours();
$this->set('message', 'Profile updated successfully');
$this->render('core_success.tpl');
$this->set('pilots', PilotData::getAllPilots());
$this->render('/pm/pilot_manager.php');
if ($this->post->resend_email == 'true') {
$this->post->id = $this->post->pilotid;
$this->resendemail(false);
}
$pilot = PilotData::getPilotData($this->post->pilotid);
LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
return;
break;
}
示例2: calculatePilotRanks
/**
* Go through each pilot, check their hours, and see where they
* stand in the rankings. If they are above the minimum hours
* for that rank level, then make $last_rank that text. At the
* end, update that
*/
public static function calculatePilotRanks()
{
/* Don't calculate a pilot's rank if this is set */
if (Config::Get('RANKS_AUTOCALCULATE') === false) {
return;
}
$allranks = self::getAllRanks();
$pilots = PilotData::getAllPilots();
if (count($pilots) == 0 || !is_array($pilots)) {
return;
}
foreach ($pilots as $pilot) {
$last_rank = '';
$pilothours = intval($pilot->totalhours);
if (Config::Get('TRANSFER_HOURS_IN_RANKS') == true) {
$pilothours += $pilot->transferhours;
}
$i = 1;
foreach ($allranks as $rank) {
if ($pilothours >= intval($rank->minhours)) {
$rank_level = $i;
$last_rank = $rank->rank;
$last_rankid = $rank->rankid;
}
$i++;
}
$update = array('rankid' => $last_rankid, 'rank' => $last_rank, 'ranklevel' => $rank_level);
PilotData::updateProfile($pilot->pilotid, $update);
}
}
示例3: foreach
}
/* Run the update fixtures file */
echo '<h2>Populating Update Data...</h2>';
$sqlLines = Installer::readSQLFile(SITE_ROOT . '/install/fixtures/update.sql', TABLE_PREFIX);
foreach ($sqlLines as $sql) {
DB::query($sql['sql']);
if (DB::errno() != 0 && DB::errno() != 1062) {
echo '<div id="error" style="text-align: left;">Writing to "' . $sql['table'] . '" table... ';
echo "<br /><br />" . DB::error();
echo '</div>';
}
}
OperationsData::updateAircraftRankLevels();
/* Add them to the default group */
$status_type_list = Config::get('PILOT_STATUS_TYPES');
$pilot_list = PilotData::getAllPilots();
foreach ($pilot_list as $pilot) {
echo "Fixing settings for " . $pilot->firstname . " " . $pilot->lastname . "<br>";
PilotData::resetLedgerforPilot($pilot->pilotid);
PilotGroups::addUsertoGroup($pilot->pilotid, DEFAULT_GROUP);
# Reset the default groups
$status = $status_type_list[$pilot->retired];
foreach ($status['group_add'] as $group) {
PilotGroups::addUsertoGroup($pilot->pilotid, $group);
}
foreach ($status['group_remove'] as $group) {
PilotGroups::removeUserFromGroup($pilot->pilotid, $group);
}
}
SettingsData::saveSetting('PHPVMS_VERSION', $FULL_VERSION_STRING);
# Don't count forced updates
示例4: send_pilots
/**
* CentralData::send_pilots()
*
* @return
*/
public static function send_pilots()
{
if (!self::central_enabled()) {
return false;
}
if (self::$debug === false) {
$within_timelimit = CronData::check_hoursdiff('update_pilots', self::$limits['update_pilots']);
if ($within_timelimit == true) {
return false;
}
}
if (!($allpilots = PilotData::getAllPilots())) {
return false;
}
self::startBody('update_pilots');
self::addElement(null, 'total', count($allpilots));
foreach ($allpilots as $pilot) {
$pc = self::addElement(null, 'pilot', null, array('pilotid' => PilotData::GetPilotCode($pilot->code, $pilot->pilotid), 'pilotname' => $pilot->firstname . ' ' . $pilot->lastname, 'location' => $pilot->location));
}
CronData::set_lastupdate('update_pilots');
return self::sendToCentral();
}
示例5: calculatePilotRanks
/**
* Go through each pilot, check their hours, and see where they
* stand in the rankings. If they are above the minimum hours
* for that rank level, then make $last_rank that text. At the
* end, update that
*/
public static function calculatePilotRanks()
{
/* Don't calculate a pilot's rank if this is set */
if (Config::Get('RANKS_AUTOCALCULATE') === false) {
return;
}
$ranks_list = self::getAllRanks();
$pilots = PilotData::getAllPilots();
if (count($pilots) == 0 || !is_array($pilots)) {
return;
}
foreach ($pilots as $pilot) {
self::calculateUpdatePilotRank($pilot->pilotid, $ranks_list);
}
}