freshJet Posted June 16, 2012 Report Share Posted June 16, 2012 Whilst looking at my bookings list for my pilots the idea of having a reminder of bookings hit me. I know this can be done. I was considering something along the lines having an email sent to the pilot if their bid is more than one week old. And to prevent several emails at once (say the pilot booked a 10-leg journey) mention each booking in the one mail. I would do a rough code but my brain won't work. I've been working on a lot tonight. ----- Oh and one more thing, some of you may remember me asking what the cons of deleting a pilot were. Well, I found this in my PilotData.class.php: public static function deletePilot($pilotid) { $sql = array(); unset(self::$pilot_data[$pilotid]); $sql[] = 'DELETE FROM '.TABLE_PREFIX.'acarsdata WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'bids WHERE pilotid='.$pilotid; --------------------> $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pireps WHERE pilotid='.$pilotid; <------------------ $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pilots WHERE pilotid='.$pilotid; # These SHOULD delete on cascade, but incase they don't $sql[] = 'DELETE FROM '.TABLE_PREFIX.'fieldvalues WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'groupmembers WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pirepcomments WHERE pilotid='.$pilotid; foreach($sql as $query) { $res = DB::query($query); } if(DB::errno() != 0) return false; return true; } If I were to remove the noted line from this code would it then prevent the PIREPs that the pilot flew being deleted? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted June 16, 2012 Moderators Report Share Posted June 16, 2012 Yes it will prevent pireps from being deleted. Also you can remove the following lines: $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pirepcomments WHERE pilotid='.$pilotid; \\This command removes the comments on the pilot's pireps Quote Link to comment Share on other sites More sharing options...
freshJet Posted June 16, 2012 Author Report Share Posted June 16, 2012 Oh yeah thanks Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted June 17, 2012 Moderators Report Share Posted June 17, 2012 But if you disabled the code and someone reads a deleted pilot PIREP, it won't show up mostly in landing rates stats, PIREP list. ETC. I think. Be very weary with that. Quote Link to comment Share on other sites More sharing options...
freshJet Posted June 17, 2012 Author Report Share Posted June 17, 2012 Yeah I know I considered that but then i thought how would anyone be able to read it anyway? It's the stats I want... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.