本文整理汇总了PHP中PilotData::resetLedgerforPilot方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::resetLedgerforPilot方法的具体用法?PHP PilotData::resetLedgerforPilot怎么用?PHP PilotData::resetLedgerforPilot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PilotData
的用法示例。
在下文中一共展示了PilotData::resetLedgerforPilot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resetpilotpay
/**
* Maintenance::resetpilotpay()
*
* @return
*/
public function resetpilotpay()
{
CodonModule::checkPermission(MAINTENANCE);
echo '<h3>Resetting Pilot Pay</h3>';
$allpilots = PilotData::GetAllPilots();
foreach ($allpilots as $p) {
#$total = PilotData::resetPilotPay($p->pilotid);
$total = PilotData::resetLedgerforPilot($p->pilotid);
#$total = PilotData::fillMissingLedgerForPIREPS();
echo "{$p->firstname} {$p->lastname} - total \$ {$total}<br />";
}
echo 'Done';
LogData::addLog(Auth::$userinfo->pilotid, 'Reset pilot pay');
}
示例2: foreach
$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
if (!isset($_GET['force'])) {
Installer::RegisterInstall($FULL_VERSION_STRING);
}