Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. <style style="text/css">
  2. .scroll-up {
  3. height: 500px;
  4. width: 400px;
  5. overflow: hidden;
  6. position: relative;
  7. background: yellow;
  8. color: black;
  9. border: 1px solid black;
  10. }
  11. .scroll-up p {
  12. position: absolute;
  13. width: 400px;
  14. padding-right: 100%;
  15. height: 100%;
  16. margin: 0;
  17. line-height: 50px;
  18. text-align: center;
  19. /* Starting position */
  20. -moz-transform:translateY(100%);
  21. -webkit-transform:translateY(100%);
  22. transform:translateY(100%);
  23. /* Apply animation to this element */
  24. -moz-animation: scroll-up 20s linear infinite;
  25. -webkit-animation: scroll-up 20s linear infinite;
  26. animation: scroll-up 20s linear infinite;
  27. }
  28. .clones_wrapper {
  29. height: 500px;
  30. width: 400px;
  31. overflow: hidden;
  32. position: relative;
  33. background: yellow;
  34. color: black;
  35. border: 1px solid black;
  36. }
  37.  
  38.  
  39. /* Move it (define the animation) */
  40. @-moz-keyframes scroll-up {
  41. 0% { -moz-transform: translateY(100%); }
  42. 100% { -moz-transform: translateY(-100%); }
  43. }
  44. @-webkit-keyframes scroll-up {
  45. 0% { -webkit-transform: translateY(100%); }
  46. 100% { -webkit-transform: translateY(-100%); }
  47. }
  48. @keyframes scroll-up {
  49. 0% {
  50. -moz-transform: translateY(100%); /* Browser bug fix */
  51. -webkit-transform: translateY(100%); /* Browser bug fix */
  52. transform: translateY(100%);
  53. }
  54. 100% {
  55. -moz-transform: translateY(-100%); /* Browser bug fix */
  56. -webkit-transform: translateY(-100%); /* Browser bug fix */
  57. transform: translateY(-100%);
  58. }
  59. }
  60. </style>
  61.  
  62. <div class="clones_wrapper">
  63.  
  64. <h2 align='center'>Clones</h2>
  65.  
  66. <table style = width:400px;><tr><th>Strain</th><th>Type</th><th>Rating</th><th>Price</th></tr></table>
  67.  
  68. <div class="scroll-up">
  69. <p><?php
  70.  
  71.  
  72. echo "<table>";
  73. echo "<marquee behavior='scroll', direction='up'></marquee>";
  74.  
  75. class TableRows extends RecursiveIteratorIterator {
  76. function __construct($it) {
  77. parent::__construct($it, self::LEAVES_ONLY);
  78. }
  79.  
  80. function current() {
  81. return "<td align='center' style='width:150px;'>" . parent::current(). "</td>";
  82. }
  83.  
  84. function beginChildren() {
  85. echo "<tr>";
  86. }
  87.  
  88. function endChildren() {
  89. echo "</tr>" . "n";
  90. }
  91.  
  92. }
  93.  
  94. $servername = "localhost";
  95. $username = "root";
  96. $password = "";
  97. $dbname = "clonemenudb";
  98.  
  99. try {
  100. $conn = new PDO("mysql:host=$servername;dbname=clonemenudb", $username, $password);
  101. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  102. $stmt = $conn->prepare("SELECT strain, type, imagefile, price FROM clones_db");
  103. $stmt->execute();
  104.  
  105.  
  106. // set the resulting array to associative
  107. $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
  108. foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) {
  109. echo $v;
  110. }
  111.  
  112.  
  113. }
  114. catch(PDOException $e) {
  115. echo "Error: " . $e->getMessage();
  116. }
  117. $conn = null;
  118. echo "</table>";
  119.  
  120. ?>
  121.  
  122.  
  123. </p>
  124.  
  125. </div>
  126. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement