hotheadhacker

Table prnt

Nov 17th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4. table a:link {
  5. color: #666;
  6. font-weight: bold;
  7. text-decoration:none;
  8. }
  9. table a:visited {
  10. color: #999999;
  11. font-weight:bold;
  12. text-decoration:none;
  13. }
  14. table a:active,
  15. table a:hover {
  16. color: #bd5a35;
  17. text-decoration:underline;
  18. }
  19. table {
  20. font-family:Arial, Helvetica, sans-serif;
  21. color:#666;
  22. font-size:12px;
  23. text-shadow: 1px 1px 0px #fff;
  24. background:#eaebec;
  25. margin:20px;
  26. border:#ccc 1px solid;
  27.  
  28. -moz-border-radius:3px;
  29. -webkit-border-radius:3px;
  30. border-radius:3px;
  31.  
  32. -moz-box-shadow: 0 1px 2px #d1d1d1;
  33. -webkit-box-shadow: 0 1px 2px #d1d1d1;
  34. box-shadow: 0 1px 2px #d1d1d1;
  35. }
  36. table th {
  37. padding:21px 25px 22px 25px;
  38. border-top:1px solid #fafafa;
  39. border-bottom:1px solid #e0e0e0;
  40.  
  41. background: #ededed;
  42. background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb));
  43. background: -moz-linear-gradient(top, #ededed, #ebebeb);
  44. }
  45. table th:first-child {
  46. text-align: left;
  47. padding-left:20px;
  48. }
  49. table tr:first-child th:first-child {
  50. -moz-border-radius-topleft:3px;
  51. -webkit-border-top-left-radius:3px;
  52. border-top-left-radius:3px;
  53. }
  54. table tr:first-child th:last-child {
  55. -moz-border-radius-topright:3px;
  56. -webkit-border-top-right-radius:3px;
  57. border-top-right-radius:3px;
  58. }
  59. table tr {
  60. text-align: center;
  61. padding-left:20px;
  62. }
  63. table td:first-child {
  64. text-align: left;
  65. padding-left:20px;
  66. border-left: 0;
  67. }
  68. table td {
  69. padding:18px;
  70. border-top: 1px solid #ffffff;
  71. border-bottom:1px solid #e0e0e0;
  72. border-left: 1px solid #e0e0e0;
  73.  
  74. background: #fafafa;
  75. background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
  76. background: -moz-linear-gradient(top, #fbfbfb, #fafafa);
  77. }
  78. table tr.even td {
  79. background: #f6f6f6;
  80. background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6));
  81. background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6);
  82. }
  83. table tr:last-child td {
  84. border-bottom:0;
  85. }
  86. table tr:last-child td:first-child {
  87. -moz-border-radius-bottomleft:3px;
  88. -webkit-border-bottom-left-radius:3px;
  89. border-bottom-left-radius:3px;
  90. }
  91. table tr:last-child td:last-child {
  92. -moz-border-radius-bottomright:3px;
  93. -webkit-border-bottom-right-radius:3px;
  94. border-bottom-right-radius:3px;
  95. }
  96. table tr:hover td {
  97. background: #f2f2f2;
  98. background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0));
  99. background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0);
  100. }
  101. </style>
  102. </head>
  103. <?php
  104. $dbhost = 'localhost';
  105. $dbuser = 'root';
  106. $dbpass = 'hhh';
  107. $db = 'pro1';
  108. $conn = mysqli_connect($dbhost, $dbuser, $dbpass,$db);
  109. if(! $conn ) {
  110. die('Could not connect: ' . mysql_error());
  111. }
  112. echo 'Connected successfully';
  113.  
  114.  
  115.  
  116. $id = $_GET['id'];
  117. //mysql_select_db('pro', $conn);
  118. $result = mysqli_query($conn,"select * from details where id='$id'");
  119. echo "<br><br>";
  120. echo "<center>";
  121. echo "<table border='1'>
  122. <tr>
  123.  
  124. <th>ID</th>
  125. <th>First Name</th>
  126. <th>Last Name</th>
  127. <th>Email Id</th>
  128. <th>Location</th>
  129. <th>Members</th>
  130. <th>Occasion</th>
  131. <th>Date</th>
  132. </tr>";
  133.  
  134. while($row = mysqli_fetch_array($result))
  135. {
  136. echo "<tr>";
  137. echo "<td>" . $row['id'] . "</td>";
  138. echo "<td>" . $row['fname'] . "</td>";
  139. echo "<td>" . $row['lname'] . "</td>";
  140. echo "<td>" . $row['email'] . "</td>";
  141. echo "<td>" . $row['location'] . "</td>";
  142. echo "<td>" . $row['members'] . "</td>";
  143. echo "<td>" . $row['occasion'] . "</td>";
  144. echo "<td>" . $row['date'] . "</td>";
  145. echo "</tr>";
  146. }
  147. echo "</table>";
  148. echo "</center>";
  149.  
  150. mysqli_close($conn);
  151. ?>
  152. </html>
Add Comment
Please, Sign In to add comment