Advertisement
Guest User

Untitled

a guest
Mar 31st, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. <script>
  2. window.addEventListener("load", function(){
  3. var load_screen = document.getElementById("load_screen");
  4. document.body.removeChild(load_screen);
  5. });
  6. </script>
  7. <?php
  8.  
  9. if ($harfor >0) {sleep(120);}
  10. ?>
  11. <div id="load_screen"><div id="loading"><img src='images/loader.jpg' height=''></div></div>
  12.  
  13. <?php
  14. if ($harfor <0)
  15. echo "<img src='images/temp.gif' height='1000px'>";
  16. ?>
  17.  
  18. <?php
  19. include_once('includes/header.php');
  20. include_once('includes/footer.php');
  21. ?>
  22. <ul>
  23. <div style='max-width:192px;max-height:192px;width:auto;height:50%;margin:0 auto 0 auto;'>
  24. <li><a href="index.php"><img src='images/fuzzy.jpg'></a></li>
  25. </div>
  26. <?php
  27.  
  28. date_default_timezone_set("Europe/Copenhagen");
  29. $tid = date("H.i");
  30. $dag = date("D");
  31.  
  32. // Menu
  33. if ($tid >= 09.15 and $tid <= 17.15 and $dag != "Sat" and $dag != "Sun") {
  34. echo "<li><a class='active' href='index.php'>Aktier aktive</a> </li>" ;
  35. }
  36. else {
  37. echo "<li><a class='active' href='index.php'>Aktier offline </a> </li>";
  38. }
  39.  
  40. ?>
  41. <li><a href="faq.php">Spørsmål</a></li>
  42. <li><a href='omkring.php'>Omkring aktierne</a></li>
  43. <li><a href='hjelp.php'>Tilkald IT hjælp</a></li>
  44. </ul>
  45.  
  46.  
  47. <?php
  48. include_once('includes/php.php');
  49. ?>
  50.  
  51. <div class="center">
  52. <table>
  53. <?php
  54.  
  55. foreach ($stockData as $key => $stock){
  56. echo "<tr> <th>" . "<div id='keyvar'>" . $key . "</div>" .
  57.  
  58. //Titles for the tables
  59. "</th>" . "<th>" . "<div class='overskrift'>" . "Kurs" . "</div>" .
  60. "</th>" . "<th>" . "<div class='overskrift'>" . "Værdi" . "</div>" .
  61. "</th>" . "<th>". "<div class='overskrift'>" . "Ændring". "</div>" .
  62. "</th>" . "<th>". "<div class='overskrift'>" . "Procent" . "</div>" .
  63. "</th>" . "<th>" ."<div class='overskrift'>" . "Afkast" . "</div>" .
  64. "<tr> <td></td>" .
  65.  
  66. //Values for the tables
  67. "<td>" . "<div class='values'>" . $stock['data']['value'] . "</div>" . "</td>" .
  68. "<td>" . "<div class='values'>" . ($stock['data']['value'] * $stock['amount']) . "</div>" . "</td>";
  69. //Make the background red
  70. if($stock['data']['change'] < 0){
  71. echo "<td>" . "<div class='values1'>" . @($stock['data']['change'] * $stock['amount']) . "</div>" . "</td>" .
  72. "<td>" . "<div class='values'>" . $stock['data']['pp'] . "</div>" . "</td>";
  73. }
  74. //Make the background green
  75. if($stock['data']['change'] > 0){
  76. echo "<td>" . "<div class='values2'>" . @($stock['data']['change'] * $stock['amount']) . "</div>" . "</td>" .
  77. "<td>" . "<div class='values'>" . $stock['data']['pp'] . "</div>" . "</td>";
  78. }
  79. //Make the background neutral
  80. if($stock['data']['change'] == 0){
  81. echo "<td>" . "<div class='values'>" . @($stock['data']['change'] * $stock['amount']) . "</div>" . "</td>" .
  82. "<td>" . "<div class='values'>" . $stock['data']['pp'] . "</div>" . "</td>";
  83. }
  84.  
  85. echo "<td>" . "<div class='values'>" . (($stock['data']['value'] - $stock['bought'])* $stock['amount']) . "</div>" . "</td>" . "</tr>";
  86. }
  87.  
  88.  
  89. $minstart = (14492.60);
  90.  
  91. $minnu = 0;
  92. foreach ($stockData as $key => $stock)
  93. {
  94. $minnu += $stock['data']['value'] * $stock['amount'];
  95. }
  96.  
  97. $idag = 0;
  98. foreach ($stockData as $key => $stock)
  99. {
  100. @$idag += $stock['data']['change'] * $stock['amount'];
  101. }
  102.  
  103. $harfor = ($minnu - $minstart);
  104. echo "<div id='value-container'>";
  105. echo "Total ". $minnu . " " . "|" . " ";
  106. echo "Total i dag ". $idag . " " . "|" . " ";
  107.  
  108.  
  109. if ($harfor < 0) {
  110. echo "Mistet " . $harfor;
  111. }
  112. elseif ($harfor > 0) {
  113. echo "Tjent " . $harfor;
  114. }
  115.  
  116.  
  117. echo "</div>";
  118. ?>
  119.  
  120.  
  121. <?php
  122.  
  123. /*
  124. // Sende $idag til databasse
  125. $servername = "localhost";
  126. $username = "mike1989_getinfo";
  127. $password = "";
  128. $dbname = "mike1989_DayToDay";
  129.  
  130. // Create connection
  131. $conn = new mysqli($servername, $username, $password, $dbname);
  132.  
  133. // Check connection
  134. if ($conn->connect_error) {
  135. die("Connection failed: " . $conn->connect_error);
  136. }
  137. $sql = "INSERT INTO money (date, money)
  138. VALUES ($dato, $harfor)";
  139.  
  140. while ($tid == 17.15 and $dag != Sat and $dag != Sun) {
  141. if (mysqli_query($conn, $sql)) {
  142. echo "New record created successfully";
  143. sleep(60);
  144. }
  145. else {
  146. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  147. }
  148. }
  149.  
  150. //Katte
  151. */
  152. ?>
  153.  
  154. </table>
  155. </div>
  156. <div id="cats">
  157.  
  158. <?php
  159. //temp
  160. ?>
  161.  
  162. <?php
  163.  
  164. if ($harfor >0) {
  165. echo "<iframe width='600' height='410' src='https://www.youtube.com/embed/3GwjfUFyY6M?autoplay=1'>";
  166. echo "</iframe>";
  167.  
  168. }
  169. if ($idag < 0 and $idag >= -80 ){
  170. echo "<img src='images/sad.jpg' height='410px'>";
  171. }
  172.  
  173. elseif ($dag == 'Sat' or $dag == 'Sun') {
  174. echo "<img src='images/weekend.jpg' height='410px'>";
  175. }
  176. elseif ($idag == 0) {
  177. echo "<img src='images/soon.jpg' height='410px'>";
  178. }
  179.  
  180. elseif ($idag >= 80 && $idag < 150) {
  181. echo "<img src='images/goddag.jpg' height='410px'>";
  182. }
  183.  
  184. elseif ($idag >= 150) {
  185. echo "<img src='images/win.jpg' height='410px'>";
  186. }
  187.  
  188. elseif ($idag <= -80 and $idag >= -150) {
  189. echo "<img src='images/shit.jpg' height='410px'>";
  190. }
  191.  
  192. elseif ($idag <= -150) {
  193. echo "<img src='images/fuck.jpg' height='410px'>";
  194. }
  195.  
  196. elseif ($idag > 0 and $idag < 80 ) {
  197. echo "<img src='images/happy.jpg' height='410px'>";
  198. }
  199.  
  200.  
  201. ?>
  202. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement