Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.44 KB | None | 0 0
  1. <?php
  2.  
  3. require_once("../config.php");
  4. require_once($_SERVER['DOCUMENT_ROOT'].'/control/stats.inc.php');
  5. echo '<!DOCTYPE html>
  6. <html>
  7.    <head>
  8.        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  9.         <title>Domowy system sterowania</title>
  10.         <meta http-equiv="refresh" content="30">
  11.         </head>
  12. <body background="weather.png">';
  13.  
  14.     $state = get_state();
  15.     $digi = get_sensors_state();
  16.     echo "<br><font size='8'><center>Termometry</center></font><br><br>";
  17.     echo "<font size='9'><table rules='all' border=1 width='100%'><tr>";
  18.     $i = 1;
  19.     foreach($sensors as $uid => $sensor)
  20.         if($sensor["type"] == 1)
  21.             if(isset($digi[$uid])) {
  22.                 echo "<td align='center'>".$sensor["name"]." : <b>".$digi[$uid]." °C</b></td>";
  23.                 if(count($sensors) > 5 && $i++%(ceil((count($sensors) - 1)/2)) == 0)
  24.                     echo "</tr><tr>";
  25.             }
  26.            
  27.     echo "</tr></table>";
  28. ?>
  29.  
  30.  
  31. <font size='9'><table rules='all' border=1 width='100%'><tr>
  32. <td align='center'>
  33.     Wifi:<iframe width="50" height="50" style="border: 0px solid #cccccc;" src="https://thingspeak.com/channels/175015/field/1/last.html"><td></iframe></a>
  34.  
  35. <td align='center'>
  36.     <a href="https://thingspeak.com/channels/175015/charts/2?height=700&width=1300?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=10&type=spline" target="_blank" >Wifi: <iframe width="50" height="50" style="border: 0px solid #cccccc;" src="https://thingspeak.com/channels/175015/field/2/last.html"><td></iframe>
  37.    
  38.     <td align='center'>
  39.     <A href="https://thingspeak.com/channels/212901/charts/1?height=400&width=1020?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=10&type=spline">krystianek@Cebula:<iframe width="50" height="50" style="border: 0px solid #cccccc;" src="https://thingspeak.com/channels/212901/field/1/last.html"></iframe></td>
  40. </td></tr></table>
  41.  
  42. <center><iframe width="500" height="500" style="border: 0px solid #cccccc;" align='right' src="https://thingspeak.com/apps/plugins/120613">
  43.  
  44.  
  45. <a href='http://192.168.88.30/control/meteo.php'>Wykres</a>
  46.  
  47.  
  48.  
  49.  
  50. <?php
  51. class engine
  52. {
  53.  // ciach
  54.  
  55.  public function get_ip($ip2long = true)
  56.  {
  57.   if($_SERVER['HTTP_CLIENT_IP'])
  58.   {
  59.    $ip = $_SERVER['HTTP_CLIENT_IP'];
  60.   }
  61.   else if($_SERVER['HTTP_X_FORWARDED_FOR'])
  62.   {
  63.    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  64.   }
  65.   else
  66.   {
  67.    $ip = $_SERVER['REMOTE_ADDR'];
  68.   }
  69.  
  70.   if($ip2long)
  71.   {
  72.    $ip = ip2long($ip);
  73.   }
  74.  
  75.   return $ip;
  76.  }
  77.  
  78.  // ciach
  79. }
  80. ?>
  81. UPDATE:
  82. <?php echo date('d.m.Y. H.i.s'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement