<!-- begin head.php -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Monitoring</title>
    <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="scripts/jquery-1.6.4.js"></script>
    
    <style type="text/css">@import "scripts/redmond.datepick.css";</style>
    <script type="text/javascript" src="scripts/jquery.datepick.js"></script>
    <script type="text/javascript" src="scripts/jquery.datepick-cs.js"></script>
  </head>
  <body>
  
<script type="text/javascript">

 $(document).ready(function(){
   $("tr.barvi:even").css("background-color","#E5E5E5");
   $("td.imag").css("background-color","#FFFFFF");   
 });
</script>


<?php
if (($page=="prehled") || ($page=="detail"))
{  

$selfUrl = $_SERVER['PHP_SELF'];
$getValues = array();
foreach($_GET as $key => $value) {
    array_push($getValues, $key."=".$value);
}
if(count($getValues) > 0) $selfUrl .= "?".implode('&', $getValues);
$break = Explode('/', $selfUrl);
$selfUrl = $break[count($break) - 1]; 
$selfUrl.="&ajax=true";
$dotaz=mysql_query("SELECT val FROM settings WHERE id='refresh';");
$refr=mysql_fetch_row($dotaz);  

echo '

<script type="text/javascript">

setInterval("refreshni()", '.$refr[0].' * 1000);
 
 function refreshni(){ 
  	  $.ajax({
      url: "'.$selfUrl.'",
      cache: false,
      async: false
     }).done(function(data) {
          $("#refr").replaceWith(data);
     });
 };
</script>

';      
}


if ( ($_COOKIE['prihlasen']=="ano") && ($_COOKIE['guest']!="ano"))
{
$dotaz=mysql_query("SELECT DISTINCT sensor FROM temp;");
$neas=mysql_num_rows($dotaz);  

if ($neas>0) {include("include/popup_novysnimac.php");}
}

?>





    <div id="wrapper">	
      <div id="logo">		<h1>Webový monitoring</h1>		
        <p>
          <em>spotřeby elektrické energie domácích spotřebičů.</em>
        </p>	
      </div>	
      <hr />	
      <!-- end #logo -->	



<!-- end head.php -->         