Jump to content

Becoming a Serious Problem


freshJet

Recommended Posts

The inactive pilot system within phpVMS is atrocious. Honestly. I'm sorry to say it but it really is. I have a pilot who can no longer login. He filed 2 PIREPs recently yet the system says he's inactive. I reset him to active and it went back to inactive. My local.config.php states that inactive pilots should be able to login, yet this doesn't work. I'm getting really annoyed about this and something needs done. I have a bunch of pilots who can't fly because they can't login. This needs fixed - and fast.

Link to comment
Share on other sites

Guest lorathon

I completely changed the "Stable" code to retire pilots. The one thing that I never liked was that if a pilot never logged in the pilot would not be retired.So I change the query to be based on join date not the last log in date.

Here are the 2 queries.

// Retire pilots who have never logged in after x days from joining			
$sql = "SELECT * FROM ".TABLE_PREFIX."pilots
	WHERE DATE_SUB(CURDATE(), INTERVAL  {$days} DAY) > `joindate`  
		AND `totalflights` = 0 
		AND `retired` = 0";		

$results = DB::get_results($sql);

// Retire pilots who have not flown in x days
$sql = "SELECT * FROM ".TABLE_PREFIX."pilots
	WHERE DATE_SUB(CURDATE(), INTERVAL  {$days} DAY) > `lastpirep` 
		AND `totalflights` > 0 AND `lastpirep` != 0
		AND `retired` = 0";

$results2 = DB::get_results($sql);

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...