Jump to content

Total Hours Flown


TAV1702

Recommended Posts

I am getting a format like : Total Hours Flown: 1400:19:15

I get this on multiple areas of my site. I can deal with the minutes but I would like to loose the seconds. Can anyone point me in the right direction. I made a few edits here and there that I found in that format but nothing changed.

Link to comment
Share on other sites

  • 2 weeks later...

Yeah so I am not figuring this out. I have looked everywhere until I was blue in the face and I am not finding out where the flight times are being pulled from.

The time shows up like that in the admin panel dashboard, latest arivals on the front page, and just about everywhere else that has flight times listed.

Does anyone know where in the admin files the time is figured up and tossed out on to the site? Maybe it is a module file and not and admin file?

Link to comment
Share on other sites

Ok so in the StatsData.class.php I found the following:

/**
 * StatsData::updateTotalHours()
 *
 * @return
 */
   public static function updateTotalHours() {

    $sql = "SELECT SUM(TIME_TO_SEC(flighttime_stamp)) AS `total`
		    FROM `".TABLE_PREFIX."pireps`
		    WHERE `accepted`=".PIREP_ACCEPTED;

    $totaltime = DB::get_row($sql);
    if(!$totaltime) {
	    $totaltime = '00:00:00';
    } else {
	    $totaltime = Util::secondsToTime($totaltime->total);
    }
    SettingsData::SaveSetting('TOTAL_HOURS', $totaltime);
   }
   /**
 * Get the total number of hours flown by pilots
 */
   public static function TotalHours() {
    return SettingsData::GetSettingValue('TOTAL_HOURS');
   }

I can see where it is getting the seconds from, editing that does no good. Does anyone have a clue? I am sure the seconds need to be counted to keep an accurate count, but to display on the website is over kill. I would rather it just be hours:minutes i.e. 09:23

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...