Advertisement
avalonpb

Untitled

Jun 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php
  2. $dbhost = '192.168.0.54:3306';
  3. $dbuser = 'track';
  4. $dbpass = 'Ostrich17!';
  5.  
  6. $conn = ($GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass));
  7.  
  8. if(! $conn ) {
  9. die('Could not connect: ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
  10. }
  11.  
  12. $sql = 'select beacon,location from location.location where time="10:38";';
  13. ((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE " . 'location'));
  14.  
  15. $result = mysqli_query($conn , $sql);
  16. $rows = array();
  17. while($r = mysqli_fetch_assoc($result)) {
  18. $rows[][] = $r;
  19. }
  20.  
  21. $json_location = json_encode($rows);
  22.  
  23. ?>
  24.  
  25. <!doctype html>
  26.  
  27. <html>
  28. <head>
  29. <title>Table Tracker</title>
  30.  
  31. <link rel="stylesheet" href="css/full.css">
  32. <script>
  33. var data = '<?php echo json_encode($json_location); ?>';
  34. console.log(data)
  35. var paintBeacon = function() {
  36. id= ('table#zoning')
  37. .find('tr td#'+ 1)
  38. .css('background-color',red)
  39. }
  40. </script>
  41.  
  42. </head>
  43.  
  44. <body>
  45.  
  46.  
  47. <script>
  48.  
  49. var trackview = "<table id=zoning><tbody><tr>";
  50.  
  51. for (var i =1; i < 101; i++) {
  52. if (i % 10 == 1 && i != 1) {
  53. trackview += "</tr><tr>";
  54. }
  55. trackview += "<td id="+ i +">"+ i +"</td>";
  56. }
  57.  
  58. trackview += "</tr></tbody></table>";
  59.  
  60. document.write(trackview)
  61.  
  62. </script>
  63.  
  64. </body>
  65.  
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement