Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Need to fetch time slots from database based on date selection

Need to fetch time slots from database based on date selection

5:20 pm on Aug 28, 2018 (gmt 0)

New User

joined:Aug 1, 2018
posts: 1
votes: 0

I am creating a little script which show available time slots based on date choise from calander. I got a good script which match 70% to my requirement, but there is only one problem, the script is showing time slot which are predifined, what my aim is; i need to call time slots based on date selection, from database using php and sql.

here is the full script which i found :

<html lang="en">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
.popover {
left: 60% !important;
.btn {
margin: 1%;
<div class=" col-md-4">
<div class="date-picker-2" placeholder="Recipient's username" id="ttry" aria-describedby="basic-addon2"></div>
<span class="" id="example-popover-2"></span> </div>
<div id="example-popover-2-content" class="hidden"> </div>
<div id="example-popover-2-title" class="hidden"> </div>
html : true,
content: function() {
return $("#example-popover-2-content").html();
title: function() {
return $("#example-popover-2-title").html();
onSelect: function(dateText) {
$('#example-popover-2-title').html('<b>Avialable Appiontments</b>');
var html = '<button class="btn btn-success">8:00 am 9:00 am</button><br><button class="btn btn-success">10:00 am 12:00 pm</button><br><button class="btn btn-success">12:00 pm 2:00 pm</button>';
$('#example-popover-2-content').html('Avialable Appiontments On <strong>'+dateText+'</strong><br>'+html);