HighFlyerPL185 Posted January 25, 2013 Report Share Posted January 25, 2013 Hi there, I am running into a brick wall with some of the issues over schedules, and as a result, I have a few questions. 1. I disabled some of my schedules, but they still appear for some reason in the search results, any ideas? 2. Has anyone got any code or suggestions on how to do a thing where, once a user books a flight, it will ask him for a day to fly it on? With that, it will reject the booking if the flight isn't operating on that... date, and accept if it is. 3. What is the format for entering flight time into a .csv file? Is it HH:MM as in the admin panel? Cheers. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 25, 2013 Administrators Report Share Posted January 25, 2013 1 - If you are using the default schedule search you should not be getting the disabled schedules as the function skips any schedule that is set to 1 or "true" in the enabled column. I would check to see if the schedules are actually disabled (set to 0 or "false" in the enabled column) in the database. If you are using an addon search module it may not be set to filter out the disabled schedules. 2 - There is nothing default to accomplish rejecting a PIREP if it is not flown on the scheduled day. The scedules_results template should be skipping over anything that is not flown the current day of the week. You should have the following code to skip non current day schedules in your template. /* Skip over a route if it's not for this day of week Left this here, so it can be omitted if your VA doesn't use this. Comment out these two lines if you don't want to. */ /* Check if a 7 is being used for Sunday, since PHP thinks 0 is Sunday */ $route->daysofweek = str_replace('7', '0', $route->daysofweek); if(strpos($route->daysofweek, date('w')) === false) continue; /* END DAY OF WEEK CHECK */ 3 - Yes, I believe that the proper format for time in the csv is - 12:15 1 Quote Link to comment Share on other sites More sharing options...
HighFlyerPL185 Posted January 25, 2013 Author Report Share Posted January 25, 2013 Thanks simpilot, useful as always. I'm using your FrontSchedules plugin, hence probably why, I imagine? That leads me onto a cheeky question, is it possible to remove copyright and add a much fancier, neater link (or an entire table row and a paragraph ) in a partners page to your website, or would that invalidate your copyright rules? Also, for some reason on the default schedule search, I have a string from a Javascript popping up, and not exactly sure how one links to another. The Javascript is just time and data displayed on the schedule_results.tpl. In regards to question two, I am aware of the method you've posted above, however it's a bit of a nuisance to remove the schedules on the selected day. Someone might like to book a flight ahead for that day, if they're busy, therefore I'm wondering if it can be somehow resolved. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 25, 2013 Administrators Report Share Posted January 25, 2013 A link back to my site somewhere on your site would be greatly appreciated, it does not have to be directly in the module layout. Front Schedules I do not believe is set to skip inactive schedules. You should be able to add it to the data query though. As far as not allowing pilots to fly a flight on a non-scheduled day, you could probably do it a few different ways. You could check the schedule when the user tries to get the bid from the site using acars, but if they already have it loaded into their client from a previous connection they will be able to get past the check. You can also check it on the submission of the PIREP and reject the PIREP if it is filed on a non-scheduled day, although I think a pilot may get a little miffed if he just flew a long flight only to have it rejected. You could also check it everytime that acars data is submitted to update the live map, although short of sending a message back to the pilot I don't know how you would actually stop them from flying the flight. The other thing I would think about is server time versus fs time from the user, if they are not the same I think it would cause some issues if a flight is close to midnight. Quote Link to comment Share on other sites More sharing options...
HighFlyerPL185 Posted January 25, 2013 Author Report Share Posted January 25, 2013 Right, sounds like every proposition has a drawback. I guess I'll have to properly sit down and think about it thoroughly. In the worst case scenario, I'll settle for the schedule disable on the day. Where would I add it to the data query? Would I have to add it to FrontSchedules.php and into the findflight public? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 25, 2013 Administrators Report Share Posted January 25, 2013 In frontschedulesdata.class.php try adding another AND statement; change this public function findschedules($arricao, $depicao, $airline, $aircraft) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_schedules.aircraft LIKE '$aircraft' AND phpvms_aircraft.id LIKE '$aircraft"; return DB::get_results($query); } to this; public function findschedules($arricao, $depicao, $airline, $aircraft) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_schedules.aircraft LIKE '$aircraft' AND phpvms_aircraft.id LIKE '$aircraft' AND phpvms_schedules.enabled = '1'"; return DB::get_results($query); } and also change; public function findschedule($arricao, $depicao, $airline) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft"; return DB::get_results($query); } to this; public function findschedule($arricao, $depicao, $airline) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft AND phpvms_schedules.enabled = '1'"; return DB::get_results($query); } 1 Quote Link to comment Share on other sites More sharing options...
HighFlyerPL185 Posted January 25, 2013 Author Report Share Posted January 25, 2013 Thank you 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.