So I'm making a reservations form, and I'll store all the data including the date in the database, but I don't want the certain dates to show if certain time has pass today, (example 12:00 CET), or if the date is unavaliable, either due to date from database-tbl_unavaliable or due to reaching max amnout of reservations for the day (10 for example).
So far after a few hours of searching I've found only this on SO, I don't know if the thing i want is doable or not with php since it's kind of the only thing I currently somewhat know and I'm still currently learning it. I do not know anything of JavaScript. But is there a kind of way to maybe get a $variable
with php and make that a condition in JavaScript or something similar?
<script>
function getISODate(){
var d = new Date();
return d.getFullYear() + '-' +
('0' + (d.getMonth()+1)).slice(-2) + '-' +
('0' + d.getDate()).slice(-2);
}
window.onload = function() {
document.getElementById('minToday').setAttribute('min',getISODate());
}
</script>
<p>Select date(must be on or after today)<input type="date" id="minToday"></p>