Guest User

Untitled

a guest
Nov 20th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?php
  2. $result = mysql_query("SELECT in_date,out_date FROM bookings");
  3. $count = mysql_num_rows($result);
  4. $query = $db->get_results("SELECT in_date,out_date FROM bookings");
  5.  
  6. foreach($query as $row){
  7. $in_date=$row->in_date;
  8. $out_date=$row->out_date;
  9. $in_day=substr($row->in_date,-2);
  10. $out_day=substr($row->out_date,-2);
  11. ?>
  12.  
  13. <script>
  14. $('#dpbs').datepicker({
  15. format: "yyyy-mm-dd",
  16. startView:1,
  17. weekStart: 6,
  18. todayBtn: true,
  19. language: "de",
  20. daysOfWeekDisabled: "0,1,2,3,4,5,6",
  21. datesDisabled: ['11/14/2016', '11/10/2016'],
  22. daysOfWeekHighlighted: "6",
  23. calendarWeeks: true,
  24. beforeShowDay: function (date){
  25.  
  26. for (var ij = 1; ij < <?php echo json_encode($count);?>; ij++){
  27. if (date.getMonth() == (new Date()).getMonth())
  28. for(var i=<?php echo json_encode($in_day);?>;i<<?php echo json_encode($out_day);?>;i++){
  29.  
  30. switch (date.getDate()){
  31. case i:
  32. return {
  33. tooltip: 'Example tooltip',
  34. classes: 'active'
  35. };
  36. }
  37. }
  38. }
  39. },
  40. toggleActive: true
  41. });
  42. </script>
  43. <?php } ?>
  44.  
  45. .on('show',function(e) {
  46. $('td.day.activeClass').each(function(index, element) {
  47. var $element = $(element)
  48. $element.attr("title", "Promo Date");
  49. $element.data("container", "body");
  50. $element.tooltip()
  51. });
Add Comment
Please, Sign In to add comment