hneve

index

Jun 4th, 2018
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <meta http-equiv="refresh" content="60" >
  6. <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  7. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  8.  
  9. <link href="style.css" rel="stylesheet" type="text/css">
  10. </head>
  11. <body>
  12. <div id="top_banner"> Været i Solbyveien <a href="config.php"><img src="gear.png" width=30 height=30 > </a> </div>
  13.  
  14. <?php
  15. require_once('db_functions.php');
  16.  
  17. $devices = getConfiguredDevices($pdo);
  18. //print_r($devices);
  19.  
  20. foreach($devices as $device){ //HTML=>?>
  21. <div id="container">
  22. <div id="timestamp"><?php echo $device["data_last_time_fixed"]; ?></div>
  23. <div id="deviceId"><?php echo $device["data_id"]; ?> </div>
  24. <div id="heading"><?php echo $device["data_heading"]; ?> </div>
  25. <div id="data" onClick="showGraph(<?php echo $device["id"]; ?>)"><?php echo $device["data_last_value"]; ?>
  26. <img src="graf.png" alt="se graf" width="20" height="20">
  27. </div><div id="ph<?php echo $device["id"]; ?>"></div>
  28. </div>
  29. <?php } //<=HTML
  30.  
  31. ?>
  32. <script>
  33. function showGraph(id){
  34. //document.getElementById("ph"+id).innerHTML = "Hello World";
  35. $("#ph"+id).load("chart.php?id="+id);
  36. }
  37.  
  38. </script>
  39. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment