Author: Not specified Language: php
Description: Not specified Timestamp: 2013-06-17 21:24:19 +0000
View raw paste Reply
  1. <?php?
  2.     include('header.php');?
  3.     ?>      ?
  4.     <script type="text/javascript">?
  5.       google.load('visualization', '1', {packages: ['table']});?
  6.     </script>?
  7.                 <script type="text/javascript">?
  8.     function drawVisualization() {?
  9.           // Create and populate the data table.?
  10.       var data = google.visualization.arrayToDataTable([?
  11.        <?php?
  12.             header("Content-type: text/html; charset=UTF-8");?
  13.             include('db_manager.php');?
  14.             $db= new db_manager();?
  15.             $db->connect();?
  16.             $array=$db->get_last_read();?
  17.             echo "['Dato','Valore',''],";?
  18.             while($row=mysql_fetch_array($array)){?
  19.                 echo "['Temperatura','{$row[2]}','░C'],";?
  20.                 echo "['UmiditÓ','{$row[6]}','%'],";?
  21.                 echo "['Dew Point','{$row[5]}','░C'],";?
  22.                 echo "['VelocitÓ vento','{$row[7]}','Km/h'],";?
  23.                 echo "['Direzione vento','{$row[9]}','░'],";?
  24.                 echo "['Pioggia oggi','{$db->get_daily_rain()}','mm'],";?
  25.                 echo "['Pressione','{$row[19]}','hPa'],";?
  26.                 echo "['Tendenza pressione','{$row[20]}',''],";?
  27.                 echo "['Tempo','{$row[22]}',''],";?
  28.                 echo "['Ultimo aggiornamento','{$row[1]}','']";?
  29.                 }?
  30.             $db->close();?
  31.             ?>?
  32.       ]);?
  33.         var options = {?
  34.           title: 'Dati meteo correnti',?
  35.           width:620?
  36.         };?
  37.       // Create and draw the visualization.?
  38.       visualization = new google.visualization.Table(document.getElementById('table'));?
  39.       visualization.draw(data, options);?
  40.     }?
  41.     ?
  42.  ?
  43.     google.setOnLoadCallback(drawVisualization);?
  44.     </script>?
  45. <?php include('body1.php');?
  46.  include('weatherforecast.php'); ?>?
  47.     <div id="table"> ?
  48.         <?php?
  49.     include('footer.php'); ?>
View raw paste Reply