220061
Well-Known Coder
Hello,
Does anyone know how I can disable certain dates in my calendar based on the dates that are in the db??
so if the db has start_date (start_datum) 1-7-2022 and end_date (eind_datum) 3-7-2022. Then I want the code to disable all 3 of those days.
code:
Picture of what it looks right now

Does anyone know how I can disable certain dates in my calendar based on the dates that are in the db??
so if the db has start_date (start_datum) 1-7-2022 and end_date (eind_datum) 3-7-2022. Then I want the code to disable all 3 of those days.
code:
JavaScript:
<?php include "config.php"; ?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Display multiple months</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<?php
$huis_ID = "1";
$sql = "SELECT * FROM reserveringen WHERE huis_ID = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $huis_ID);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
echo $row['ID'];
echo $row['start_datum'];
echo $row['eind_datum'];
?>
<script>
$(function() {
$( "#datepicker" ).datepicker({
numberOfMonths: 1,
minDate:0,
showButtonPanel: true,
altFormat: 'dd-MM-yyyy',
});
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker" name ="datepicker"></p>
<?php } ?>
</body>
</html>
Picture of what it looks right now
