本文整理汇总了PHP中PilotData::UpdateFlightHours方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::UpdateFlightHours方法的具体用法?PHP PilotData::UpdateFlightHours怎么用?PHP PilotData::UpdateFlightHours使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PilotData
的用法示例。
在下文中一共展示了PilotData::UpdateFlightHours方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resethours
/**
* Maintenance::resethours()
*
* @return
*/
public function resethours()
{
CodonModule::checkPermission(MAINTENANCE);
echo '<h3>Updating Total Hours Count</h3>';
$total = 0;
echo '<p>Calculating hours for all pilots: <br />';
$allpilots = PilotData::GetAllPilots();
foreach ($allpilots as $pilot) {
$hours = PilotData::UpdateFlightHours($pilot->pilotid);
$total = Util::AddTime($total, $hours);
echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . " - found {$hours} flight hours for number <br />";
}
echo "Pilots have a total of <strong>{$total} hours</strong><br /><br />";
echo "<strong>Now counting from PIREPS</strong><br />";
StatsData::UpdateTotalHours();
echo 'Found ' . StatsData::TotalHours() . ' total hours, updated<br /></p>';
LogData::addLog(Auth::$userinfo->pilotid, 'Reset hours');
}
示例2: foreach
if ($version < 11700) {
echo '<p>Updating your database...</p>';
Installer::add_to_config('TRANSFER_HOURS_IN_RANKS', false, 'Include the transfer hours in ranks');
Installer::sql_file_update(SITE_ROOT . '/install/update_700.sql');
# Specific Checks
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . "settings\n\t\t\t\t\tWHERE name='TOTAL_HOURS'";
$res = DB::get_row($sql);
if (!$res) {
$sql = "INSERT INTO `phpvms_settings` (`friendlyname`, `name`, `value`,`descrip`,`core`)\n\t\t\tVALUES ('Total Hours', 'TOTAL_HOURS', '', 'These are the total hours your VA has flown', '0')";
DB::query($sql);
}
echo '<strong>Updating hours</strong><br />';
$allpilots = PilotData::GetAllPilots();
foreach ($allpilots as $pilot) {
$hours = PilotData::UpdateFlightHours($pilot->pilotid);
$total = Util::AddTime($total, $hours);
}
echo "Pilots have a total of <strong>{$total} hours</strong><br /><br />";
echo "<strong>Updating PIREPS Hours</strong><br />";
StatsData::UpdateTotalHours();
echo 'Found ' . StatsData::TotalHours() . ' total hours, updated<br />';
}
if ($version < 20854) {
Installer::add_to_config('USERS_ONLINE_TIME', 20, 'The StatsData::UserOnline() function - how many minutes to check');
Installer::sql_file_update(SITE_ROOT . '/install/update_854.sql');
}
Installer::sql_file_update(SITE_ROOT . '/install/update.sql');
OperationsData::updateAircraftRankLevels();
/* Add them to the default group */
$allpilots = PilotData::GetAllPilots();