Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>A10 Family</title>
  6. <link rel="shortcut icon" href="/a10.ico" type="image/x-icon">
  7. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  8. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  9. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.10.16/r-2.2.0/datatables.min.css"/>
  10. <link href="https://fonts.googleapis.com/css?family=Lemonada|Varela+Round" rel="stylesheet">
  11.  
  12. <style type="text/css">
  13. .wraper {
  14. max-width: 900px;
  15. margin: 30px auto;
  16. }
  17.  
  18. #linkfb {
  19. text-decoration: none;
  20. }
  21.  
  22. .header {
  23. font-size: 80px;
  24. text-align: center;
  25. color: #428ccc;
  26. transition: all 1.4s ease-in-out;
  27. margin: 40px auto;
  28. }
  29.  
  30. .header:hover {
  31. color: #ff0059;
  32. transform: rotateX(360deg) scale(1.3);
  33. }
  34.  
  35. body {
  36. font-family: 'Varela Round', sans-serif;
  37. }
  38.  
  39. #my-table {
  40. border:8px double #428ccc;
  41. border-collapse: collapse;
  42. border-radius: 10px;
  43. }
  44.  
  45. thead tr {
  46. background-color: #a9cae6;
  47. font-family: 'Lemonada', cursive;
  48. }
  49.  
  50. tbody tr {
  51. transition:font-size 0.5s;
  52. background-color: #fff;
  53. }
  54.  
  55. tbody tr:hover {
  56. font-size: 1.15em;
  57. font-weight: 700;
  58. color: #ff0059;
  59. }
  60.  
  61. #imgcover {
  62. max-width: 900px;
  63. border-radius: 10px;
  64. box-shadow: 5px 5px 10px #428ccc;
  65. }
  66.  
  67. </style>
  68. </head>
  69. <body>
  70.  
  71.  
  72. <?php
  73. $servername = "localhost";
  74. $username = "id2858015_a10db";
  75. $password = "a10db";
  76. $database = "id2858015_a10db";
  77.  
  78. // Create connection
  79. $conn = mysqli_connect($servername, $username, $password, $database);
  80.  
  81. // Check connection
  82. if (!$conn) {
  83. die("Connection failed: " . mysqli_connect_error());
  84. }
  85. // echo "Connected successfully";
  86.  
  87.  
  88. $sql = "SELECT id, lastname, firstname, gender, birthday, phone, address from classinfo";
  89. $result = mysqli_query($conn, $sql);
  90. if(!$result){
  91. die( "Can't query data".mysqli_error($conn) );
  92. }
  93.  
  94. if (mysqli_num_rows($result) > 0) {
  95. // 1. Tiêu đề bảng
  96. ?>
  97. <!-- Mã HTML -->
  98. <div class="wraper">
  99. <img src="https://scontent.fsgn2-2.fna.fbcdn.net/v/t31.0-8/17636894_625120654365431_3172362985629731171_o.jpg?oh=7c3d4246f578331bbfb88a008f1b3583&oe=5AA17326" id="imgcover">
  100. <a href="https://www.facebook.com/groups/207559346072681/" id="linkfb" data-toggle="tooltip" title="Bấm để vào Facebook Δ10 ҒΔMILΨ !"><h1 class="header">Δ10 ҒΔMILΨ</h1></a>
  101. <table class="table table-bordered" id="my-table">
  102. <thead>
  103. <tr>
  104. <th>#</th>
  105. <th>Last Name</th>
  106. <th>First Name</th>
  107. <th>Gender</th>
  108. <th>Birthday</th>
  109. <th>Address</th>
  110. <th>Phone</th>
  111. </tr>
  112. </thead>
  113. <tbody>
  114. <?php
  115. // 2. Các dòng dữ liệu
  116. while($row = mysqli_fetch_assoc($result)) {
  117. // Chuyển ngày sang dạng d-m-Y
  118. $dob = date("d-m-Y", strtotime($row["birthday"]));
  119.  
  120. echo "<tr>";
  121. echo "<td>".$row["id"]."</td>";
  122. echo "<td>".$row["lastname"]."</td>";
  123. echo "<td>".$row["firstname"]."</td>";
  124. echo "<td>".$row["gender"]."</td>";
  125. echo "<td>".$row["birthday"]."</td>";
  126. echo "<td>".$row["address"]."</td>";
  127. echo "<td>".$row["phone"]."</td>";
  128. echo "</tr>";
  129. }
  130. // 3. Kết thúc bảng
  131. ?>
  132. <!-- Mã HTML -->
  133. </tbody>
  134. </table>
  135. </div>
  136. <?php
  137. } else {
  138. echo "0 results";
  139. }
  140.  
  141. mysqli_close($conn);
  142. ?>
  143. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  144. <script
  145. src="https://code.jquery.com/jquery-3.2.1.min.js"
  146. integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  147. crossorigin="anonymous"></script>
  148. <script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.16/r-2.2.0/datatables.min.js"></script>
  149. <script type="text/javascript">
  150. $(document).ready(function() {
  151. // Sử dụng Datatable
  152. $('#my-table').DataTable({
  153. responsive: true
  154. });
  155.  
  156. // Tooltip
  157. $('[data-toggle="tooltip"]').tooltip();
  158. });
  159.  
  160. //Xóa watermark
  161. $(document).ready(function(){
  162. $('body').find('img[src$="https://cloud.githubusercontent.com/assets/23024110/20663010/9968df22-b55e-11e6-941d-edbc894c2b78.png"]').parent().closest('a').closest('div').remove();
  163. });
  164. </script>
  165. </body>
  166. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement