1
我有一個住宅預訂系統,我可以禁用特定的日子,但從註冊的日子我的表中禁用日子。 我有2個表habitaciones
和reservas
使用數據庫(mysql,php)在住宅系統中的Disponibility(禁用天數)
table habitaciones (room)
id_habitacion integer..
table `reservas` (bookings)
`id_reserva integer`
id_habitacion integer
`llegada date` (startdate)
`salida date` (enddate)
我從llegada
輸入和salida
<input style="height: 31px;" id="datepicker2" class="form-control" name="llegada">
<input style="height: 31px;" id="datepicker3" class="form-control" name="salida">
在腳本日期選擇器,我有:
<script>
var disableddates = ["12-12-2016", "13-12-2016", "14-12-2016", "14-12-2016"];
function DisableSpecificDates(date) {
var string = jQuery.datepicker.formatDate('dd-mm-yy', date);
return [disableddates.indexOf(string) == -1];
}
$(function() {
$("#datepicker2").datepicker({
beforeShowDay: DisableSpecificDates
});
});
</script>
這工作: Disable days ["12-12-2016", "13-12-2016", "14-12-2016", "14-12-2016"]
現在我已經從表reservas
select * from reservas
的日期,我最後需要營救表reservas
和殘疾人天 這個日期llegada
和salida
(其中id_habitacion ....)(我的英語是多還是少)
問題是什麼? – Blag
我需要從我的數據庫禁用這些日子,而不是從此代碼:var disableddates = [「12-12-2016」,「13-12-2016」,「14-12-2016」,「14-12-2016」] ; 我不知道如何從表reservas日期,這個日期把禁用 –
你有沒有嘗試過一些PHP/SQL來做到這一點?如果是的話,請把它放在你的問題上;) – Blag