TheBulk Posted June 24, 2010 Report Share Posted June 24, 2010 Hi all, A quick question. I am working on the boarding pass for my VA. It is working nicely however I want to add a gate closure time which is dynamic rather than a static message. What I mean is to have some php coding (if poss) that takes the departure time and takes away 20mins to display the time the gate closes and this way it would display a time 20mins prior to depart. It would also be different for every flight no matter what the departure time. I have listed an example below. This is the static message: Gate closes: 20 minutes before flight departure Departure: 11:20 GMT The dynamic message: Gate closes: 11:00 GMT Departure: 11:20 GMT If anyone knows if this is possible and knows a way for me to do this it would be great. Cheers Jonny Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 28, 2010 Administrators Report Share Posted June 28, 2010 In schedule_boarding_pass.tpl find: <strong>Flight: </strong><?php echo $schedule->code.$schedule->flightnum?><br /> Make a new line after and add: <?php $close = explode(':', $schedule->deptime); if ($close[1] >= '20') { $close[1] = $close[1] - 20; } else { $close[1] = 20 - $close[1]; $close[1] = 60 - $close[1]; if ($close[0] == '0') { $close[0] = '23'; } else { $close[0] = $close[0] - '1'; } } ?> <strong>Gate Closes: </strong><?php echo $close[0].':'.$close[1]; ?><br /> This will give you a time 20 minutes earlier than the departure time for VA's using a 24 hour time format. You will have to adjust your template to make the airports line up with the dep and arr times. 1 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.