Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. <?php
  2. require_once 'connection1.php';
  3. ?>
  4. <html>
  5. <link rel="stylesheet" type="text/css" href='https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css'/>
  6.  
  7. <?php
  8.  
  9. $sql="SELECT * FROM borang_kepuasan";
  10. $result=mysqli_query($conn,$sql);
  11.  
  12.  
  13.  
  14. echo "<table id='example' class='display' cellspacing='1' width='100%'>";
  15. echo "<thead>";
  16. echo "<tr>";
  17. echo "<td>Soalan 1</td>";
  18. echo "<td>Soalan 2</td>";
  19. echo "<td>Soalan 3</td>";
  20. echo "<td>Soalan 4</td>";
  21. echo "<td>Soalan 5</td>";
  22. echo "<td>Soalan 6</td>";
  23. echo "<td>Soalan 7</td>";
  24. echo "<td> Nota / Testimoni </td>";
  25. echo "</tr>";
  26. echo "</thead>";
  27. echo "<tbody>";
  28.  
  29.  
  30. if (mysqli_num_rows($result) > 0) {
  31. while ($row = mysqli_fetch_assoc($result)) {
  32. echo "<tr>";
  33. echo "<td>$row[soalan1]</td>";
  34. echo "<td>$row[soalan2]</td>";
  35. echo "<td>$row[soalan3]</td>";
  36. echo "<td>$row[soalan4]</td>";
  37. echo "<td>$row[soalan5]</td>";
  38. echo "<td>$row[soalan6]</td>";
  39. echo "<td>$row[soalan7]</td>";
  40. echo "<td>$row[nota]</td>";
  41. echo "</tr>";
  42. }
  43. } else {
  44. echo "0 results";
  45. }
  46.  
  47. echo "</tbody>";
  48. echo "</table>";
  49. echo "<center>";
  50. echo "<table>";
  51. echo "<tr>";
  52. echo "<td>";
  53. echo "<button style=height:30px width:80px value=Kembali onClick=location.href='admin1.php'>";
  54. echo "Kembali";
  55. echo "</button>";
  56. echo "</td>";
  57. echo "<td>";
  58. echo "<button style=height:30px width:80px value=Log Out onClick=location.href='logout.php'>";
  59. echo "Log Out";
  60. echo "</a>";
  61. echo "</button>";
  62. echo "</center>";
  63. ?>
  64. </html>
  65. <script src='//code.jquery.com/jquery-1.12.4.js'></script>
  66. <script src='https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js'></script>
  67. <script>
  68. $('#example').DataTable();
  69. </script>
  70.  
  71. <?php
  72. $servername = "localhost";
  73. $username = "dweetcom";
  74. $password = "8qXwm217Mf";
  75.  
  76. // Create connection
  77. $conn = new mysqli($servername, $username, $password) ;
  78. if (mysqli_connect_errno()) {
  79. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  80. }
  81.  
  82. @mysqli_select_db("dweetcom_borang",$conn);
  83. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement