Advertisement
HelloDearSir

Untitled

May 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if($_SESSION['login'] != "That GRRRRREAT") {
  4. header('Location: login.php');
  5. exit();
  6. } else {
  7. $username = $_SESSION['Username'];
  8. }
  9. ?>
  10.  
  11. <!DOCTYPE html>
  12. <html lang="en-GB">
  13. <head>
  14. <title>test2.php</title>
  15. <link rel="stylesheet" href="css/booking.css">
  16. <meta content="width=device-width, initial-scale=1" name="viewport" />
  17. <meta charset="utf-8">
  18. <script src="main.js"></script>
  19. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  20. </head>
  21. <body>
  22. <div id ="nav">
  23. <label for="toggle">&#9776;</label>
  24. <input type="checkbox" id="toggle">
  25. <div class = "menu">
  26. <a href="profilepage.php"><?php echo $_SESSION['Username']; ?> </a>
  27. <a href="messages.php">Messages </a>
  28. <a href="book.php">Booking</a>
  29. <a href="logout.php"> Log Out </a>
  30. </div>
  31. </div>
  32.  
  33. <div class="heading">
  34. <h2> booking</h2>
  35. </div>
  36. <input size="20px" size="20px" maxlengh="15" type="text" name="username" id="user" required>
  37. <div id = "filter"></div>
  38. <table>
  39. <thead>
  40. <tr>
  41. <th>First Name </th>
  42. <th>&nbsp;</th>
  43. <th>Last Name </th>
  44. <th>&nbsp;</th>
  45. <th>Phone Number</th>
  46. <th>&nbsp;</th>
  47. <th> Location </th>
  48. <th>&nbsp;</th>
  49. <th>Time </th>
  50. <th>&nbsp;</th>
  51. <th>Date </th>
  52. <th>&nbsp;</th>
  53. <th>Statues </th>
  54. <th>&nbsp;</th>
  55. <th>Action </th>
  56. <th>&nbsp;</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <?php
  61. require 'booking.php';
  62. require 'connection.php';
  63. //select from tasks db where student = session cookie
  64. $query= 'SELECT * FROM `booking` WHERE `tutor`= "'.$_SESSION['Username'].'"';
  65. $results = mysqli_query($connect, $query);
  66. if ($results)
  67. { //if the query is uccessful then do this.
  68. while ($row = mysqli_fetch_assoc($results))
  69. {
  70. $tutor= $row['tutor'];
  71. $fn= $row['First'];
  72. $ln = $row['Last'];
  73. $meetplace = $row['location'];
  74. $time = $row['time'];
  75. $date = $row['bookingd'];
  76. $phonen = $row['Phone'];
  77. if($tutor == $_SESSION['Username'])
  78. { ?>
  79. <tr>
  80. <td class= "task"> <?php echo $fn; ?></td>
  81. <td>&nbsp;</td>
  82. <td class= "task"> <?php echo $ln; ?></td>
  83. <td>&nbsp;</td>
  84. <td class = "task"> <?php echo $phonen;?> </td>
  85. <td>&nbsp;</td>
  86. <td class = "task"><?php echo $meetplace;?></td>
  87. <td>&nbsp;</td>
  88. <td class = "task"> <?php echo $time;?> </td>
  89. <td>&nbsp;</td>
  90. <td class = "task"><?php echo $date;?> </td>
  91. <td> &nbsp;</tb>
  92.  
  93. <td class = "colr" id= "color">pending</td>
  94.  
  95. <td class = "delete"> <a href="books.php?del_task=<?php echo $row['id'];?>"> X</a></td>
  96. <td class="tick" id ="tick"> <a href='#'> &#10004; </a></td>
  97. </tr>
  98.  
  99.  
  100. <?php }
  101. }
  102. } ?>
  103. </tbody>
  104.  
  105.  
  106. </table>
  107. </div>
  108. </body>
  109. <script>
  110. $(document).ready(function(){
  111.  
  112. $('.deletes').css({color:'green'});
  113. $('.tick').css({color:'red'});
  114. $(".colr").css({color:'orange'});
  115.  
  116. });
  117.  
  118. $("#tick").click(function()
  119. {
  120. var colors = $(this).data('colr');
  121. $("#color").text("accept");
  122. // $(".colr").text().replace("pending", "Accept");
  123. $("#color").css("color","green");
  124.  
  125. //$(this).css("color", "green");
  126. });
  127.  
  128.  
  129.  
  130. </script>
  131. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement