Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $result = mysql_query("SELECT in_date,out_date FROM bookings");
- $count = mysql_num_rows($result);
- $query = $db->get_results("SELECT in_date,out_date FROM bookings");
- foreach($query as $row){
- $in_date=$row->in_date;
- $out_date=$row->out_date;
- $in_day=substr($row->in_date,-2);
- $out_day=substr($row->out_date,-2);
- ?>
- <script>
- $('#dpbs').datepicker({
- format: "yyyy-mm-dd",
- startView:1,
- weekStart: 6,
- todayBtn: true,
- language: "de",
- daysOfWeekDisabled: "0,1,2,3,4,5,6",
- datesDisabled: ['11/14/2016', '11/10/2016'],
- daysOfWeekHighlighted: "6",
- calendarWeeks: true,
- beforeShowDay: function (date){
- for (var ij = 1; ij < <?php echo json_encode($count);?>; ij++){
- if (date.getMonth() == (new Date()).getMonth())
- for(var i=<?php echo json_encode($in_day);?>;i<<?php echo json_encode($out_day);?>;i++){
- switch (date.getDate()){
- case i:
- return {
- tooltip: 'Example tooltip',
- classes: 'active'
- };
- }
- }
- }
- },
- toggleActive: true
- });
- </script>
- <?php } ?>
- .on('show',function(e) {
- $('td.day.activeClass').each(function(index, element) {
- var $element = $(element)
- $element.attr("title", "Promo Date");
- $element.data("container", "body");
- $element.tooltip()
- });
Add Comment
Please, Sign In to add comment