Prevent the same aircraft from being booked by two pilots

Is there a way to prevent the same aircraft from being booked by two pilots at the same time? And what about this aircraft that was reserved to be released again to be reserved only after the flight has ended?

 

Thanks for any help.

You’d have to adjust the schedule_results.php file and add some lines of code there, maybe before this line

https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L18

For example:

 

\<?php $allbids = SchedulesData::getAllBids(); foreach($allbids as $bid) { if ($bid-\>aircraft == $schedule-\>aircraft) { continue; } } ?\>

That will hide the schedule completely if the aircraft has been booked already, if you want to show the schedule but not show the “Add to bid” button then you will need to add that further down in the file and adjust the code here

https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L43

20 minutes ago, web541 said:

You’d have to adjust the schedule_results.php file and add some lines of code there, maybe before this line

https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L18

For example:

 

<?php $allbids = SchedulesData::getAllBids(); foreach($allbids as $bid) { if ($bid->aircraft == $schedule->aircraft) { continue; } } ?>

That will hide the schedule completely if the aircraft has been booked already, if you want to show the schedule but not show the “Add to bid” button then you will need to add that further down in the file and adjust the code here

https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/schedule_results.php#L43

 

Thank you I will try and return.