Advertisement
HelloDearSir

Untitled

May 25th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 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.  
  64. //select from tasks db where student = session cookie
  65. $query= 'SELECT * FROM `booking` WHERE `tutor`= "'.$_SESSION['Username'].'"
  66. AND `student` = "'.$_SESSION['Username'].'" ';
  67. $results = mysqli_query($connect, $query);
  68. if ($results)
  69. { //if the query is uccessful then do this.
  70. while ($row = mysqli_fetch_assoc($results))
  71. {
  72. $tutor= $row['tutor'];
  73. $student = $row['student'];
  74. $fn= $row['First'];
  75. $ln = $row['Last'];
  76. $meetplace = $row['location'];
  77. $time = $row['time'];
  78. $date = $row['bookingd'];
  79. $phonen = $row['Phone'];
  80. if($tutor == $_SESSION['Username'] || $student == $_SESSION['Username'])
  81. {
  82.  
  83.  
  84. ?>
  85. <tr>
  86. <td class= "task"> <?php echo $fn; ?></td>
  87. <td>&nbsp;</td>
  88. <td class= "task"> <?php echo $ln; ?></td>
  89. <td>&nbsp;</td>
  90. <td class = "task"> <?php echo $phonen;?> </td>
  91. <td>&nbsp;</td>
  92. <td class = "task"><?php echo $meetplace;?></td>
  93. <td>&nbsp;</td>
  94. <td class = "task"> <?php echo $time;?> </td>
  95. <td>&nbsp;</td>
  96. <td class = "task"><?php echo $date;?> </td>
  97. <td> &nbsp;</tb>
  98.  
  99. <td class = "colr" id= "color"> <?php echo 'pending';?></td>
  100.  
  101. <td class = "delete"> <a href="books.php?del_task=<?php echo $row['id'];?>"> X</a></td>
  102. <td class="tick" id ="tick"> <a href="books.php?accpet=<?php echo $row['id'];?>"> &#10004; </a></td>
  103. </tr>
  104.  
  105.  
  106. <?php }
  107. }
  108. }
  109.  
  110.  
  111. ?>
  112. </tbody>
  113.  
  114.  
  115. </table>
  116. </div>
  117. </body>
  118. <script*/
  119. $(document).ready(function(){
  120. $('.deletes').css({color:'green'});
  121. $('.tick').css({color:'red'});
  122. $(".colr").css({color:'orange'});
  123. });
  124. $(".tick").click(function()
  125. {
  126. var colors = $(this).data('colr');
  127. $("#color").text("accept");
  128. // $(".colr").text().replace("pending", "Accept");
  129. $("#color").css("color","green");
  130. //$(this).css("color", "green");
  131. });*/
  132. </script>
  133. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement