Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. <div id="eventContent" title="Event Details" style="display:none;">
  2. Name: <span id="name"></span><br>
  3. Start: <span id="startTime"></span><br>
  4. End: <span id="endTime"></span><br><br>
  5. <p id="eventInfo"></p>
  6. <button id="confirm_button" type="button">Confirm</button>
  7. <button id="refuse_button" type="button">Refuse</button>
  8. <button type="close_button">Close</button>
  9. </div>
  10.  
  11. <script>
  12. $(document).ready(function () {
  13.  
  14. $('#calendar').fullCalendar({
  15. header: {
  16. left: '',
  17. center: 'prev title next',
  18. right: ''
  19. },
  20. events: "http://localhost/calendar_directory/calendar_db_connect.php",
  21. eventRender: function (event, element) {
  22. element.click(function () {
  23. var start = $.fullCalendar.formatDate(event.start, "YYYY-MM-DD");
  24. var end = $.fullCalendar.formatDate(event.end, "YYYY-MM-DD");
  25.  
  26. $("#name").html(event.title);
  27. $("#startTime").html(start);
  28. $("#endTime").html(end);
  29. $("#eventContent").dialog({modal: true, title: event.title, width: 350});
  30.  
  31.  
  32. $("#refuse_button").click(function ()
  33. {
  34. var id = event._id;
  35. var confirmed_number = 2;
  36. var decision = confirm("Do you really want to refuse that?");
  37.  
  38. if (decision)
  39. {
  40. $.ajax({
  41. url: "http://localhost/calendar_directory/confirm_events.php",
  42. data: '&id=' + id + '&confirmed_number=' + confirmed_number,
  43. type: "POST",
  44. success: function (json)
  45. {
  46. console.log(id);
  47. return;
  48. }
  49. });
  50. }
  51. });
  52.  
  53. $("#confirm_button").click(function ()
  54. {
  55. var id = event._id;
  56. var confirmed_number = 1;
  57. var decision = confirm("Do you really want to confirm that?");
  58. if (decision)
  59. {
  60. $.ajax({
  61. url: "http://localhost/calendar_directory/confirm_events.php",
  62. data: '&id=' + id + '&confirmed_number=' + confirmed_number,
  63. type: "POST",
  64. success: function (json) {
  65. console.log("confirmed");
  66. return;
  67. }
  68. });
  69. }
  70. })
  71. });
  72. },
  73.  
  74. });
  75. });
  76. </script>
  77.  
  78. $("#refuse_button").unbind("click").click(function(){
  79. /*Your code goes here*/
  80. }
  81. $("#confirm_button").unbind("click").click(function(){
  82. /*Your code goes here*/
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement