diff --git a/web/include/_head.php b/web/include/_head.php index 4902939d7a4ddd831ea81ad807cd67bb43eee00d..b528d123f527ac93b903055bda5dc46eab8e546c 100644 --- a/web/include/_head.php +++ b/web/include/_head.php @@ -45,13 +45,10 @@ <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> - <a href="#">About</a> + <a href="index.php">Dashbaord</a> </li> <li> - <a href="#">Services</a> - </li> - <li> - <a href="#">Contact</a> + <a href="admin/" target="_blank">Admin</a> </li> </ul> </div> diff --git a/web/index.php b/web/index.php index 39d7d2d2e888f0e53c9f0bd150fdab49c627ffa5..d7dba18744e8cd9d3e23d6ba87db14e576a029fc 100755 --- a/web/index.php +++ b/web/index.php @@ -14,6 +14,7 @@ include("include/_head.php"); <?php $sql = new SQL(); $link = $sql->getLink(); +$graphs = array(); $query = "SELECT * FROM (tbl_register INNER JOIN tbl_parameter ON tbl_register.id = tbl_parameter.fid_register) INNER JOIN tbl_data ON tbl_parameter.id = tbl_data.fid_parameter WHERE tbl_register.id IN (SELECT max(id) FROM tbl_register group by clientAddress) AND tbl_data.id IN (SELECT max(id) FROM tbl_data group by fid_parameter) GROUP BY name"; @@ -51,8 +52,9 @@ while($row = $result->fetch_assoc()) { }else{ echo ' <a href="details.php?param='.$row2["fid_parameter"].'"> - <img class="img-responsive" src="graph.php?param='.$row2["fid_parameter"].'" alt=""> + <img class="img-responsive" src="graph.php?param='.$row2["fid_parameter"].'" alt="" id="p'.$row2["fid_parameter"].'"> </a>'; + array_push($graphs, $row2["fid_parameter"]); } echo ' <h3> @@ -66,6 +68,20 @@ while($row = $result->fetch_assoc()) { <!-- /.row -->'; } + +echo ' +<script> +setInterval(function() { + '; + + foreach ($graphs as &$param){ + echo "document.getElementById('p".$param."').src = 'graph.php?param=".$param."&rand=' + Math.random(); + "; + } +echo ' +}, 1000); +</script> +'; ?>