Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = '192.168.0.54:3306';
- $dbuser = 'track';
- $dbpass = 'Ostrich17!';
- $conn = ($GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass));
- if(! $conn ) {
- die('Could not connect: ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
- }
- $sql = 'select beacon,location from location.location where time="10:38";';
- ((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE " . 'location'));
- $result = mysqli_query($conn , $sql);
- $rows = array();
- while($r = mysqli_fetch_assoc($result)) {
- $rows[][] = $r;
- }
- $json_location = json_encode($rows);
- ?>
- <!doctype html>
- <html>
- <head>
- <title>Table Tracker</title>
- <link rel="stylesheet" href="css/full.css">
- <script>
- var data = '<?php echo json_encode($json_location); ?>';
- console.log(data)
- var paintBeacon = function() {
- id= ('table#zoning')
- .find('tr td#'+ 1)
- .css('background-color',red)
- }
- </script>
- </head>
- <body>
- <script>
- var trackview = "<table id=zoning><tbody><tr>";
- for (var i =1; i < 101; i++) {
- if (i % 10 == 1 && i != 1) {
- trackview += "</tr><tr>";
- }
- trackview += "<td id="+ i +">"+ i +"</td>";
- }
- trackview += "</tr></tbody></table>";
- document.write(trackview)
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement