Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
deprecated flighttime column for flighttime_stamp in total hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabeel Shahzad committed Mar 23, 2011
1 parent 369ad9e commit f375860
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/common/PilotData.class.php
Expand Up @@ -470,7 +470,19 @@ public static function updateLogin($pilotid) {
*/
public static function getPilotHours($pilotid) {

$sql = 'SELECT `flighttime` FROM ' . TABLE_PREFIX . 'pireps
$sql= 'SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(`flighttime_stamp`))) AS total_time
FROM '.TABLE_PREFIX.'pireps
WHERE `accepted`=' . PIREP_ACCEPTED.'
AND `pilotid`=' . $pilotid;

$result = DB::get_row($sql);
if(!$result) {
return '0.0';
}

return $result->total_time;

/*$sql = 'SELECT `flighttime` FROM ' . TABLE_PREFIX . 'pireps
WHERE `accepted`=' . PIREP_ACCEPTED . '
AND `pilotid`=' . $pilotid;
Expand All @@ -483,7 +495,7 @@ public static function getPilotHours($pilotid) {
$total = Util::AddTime($total, $report->flighttime);
}
return $total;
return $total;*/
}

/**
Expand Down

0 comments on commit f375860

Please sign in to comment.