Author: zecas
Date: Thu May 15 23:21:08 2014
New Revision: 109

URL: http://svn.gna.org/viewcvs/zzzt?rev=109&view=rev
Log:
améliorations des pages stats, dont la navigation

Modified:
    trunk/i18n/switch.php
    trunk/stats/daily.php
    trunk/stats/index.php
    trunk/stats/monthly.php
    trunk/stats/yearly.php

Modified: trunk/i18n/switch.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/i18n/switch.php?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/i18n/switch.php       (original)
+++ trunk/i18n/switch.php       Thu May 15 23:21:08 2014
@@ -16,7 +16,7 @@
     along with Zzzt! .  If not, see <http://www.gnu.org/licenses/>.
 */
 
-define("VERSION","1.7");
+define("VERSION","1.8");
 
 ini_set('display_errors','1');
 

Modified: trunk/stats/daily.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/daily.php?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/stats/daily.php       (original)
+++ trunk/stats/daily.php       Thu May 15 23:21:08 2014
@@ -11,7 +11,7 @@
  <meta charset="UTF-8">
   <link rel="shortcut icon" href="../images/inverter.png" type="image/x-png"/>
   <link rel="icon" href="../images/inverter.png" type="image/x-png"/>
-  <title><?php echo APPLICATION.' '.VERSION;?></title>
+  <title><?php echo APPLICATION.' '.VERSION.' - '.BY_DAY;?></title>
   <link rel="stylesheet" href="../morris/morris-0.4.3.min.css">
   <script src="../morris/jquery.min.js"></script>
   <script src="../morris/raphael-min.js"></script>
@@ -54,6 +54,10 @@
     ?>
 
     new Morris.Area({element: 'holder', lineColors: ['#<?php echo 
$db->rnd_color();?>','#<?php echo $db->rnd_color();?>'], 
+      hoverCallback: function (index, options, content) {
+       var row = options.data[index];
+       return '<a href=index.php?day=' + row.j + "><?php echo DAY_PROD;?></a>" 
+ content ;
+      },
       fillOpacity: 0.5, postUnits: 'kWh', behaveLikeLine: true, smooth: false, 
hideHover: 'auto',  data: [
       <?php
        for($i=0;$i<sizeof($values);$i++) {

Modified: trunk/stats/index.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/index.php?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/stats/index.php       (original)
+++ trunk/stats/index.php       Thu May 15 23:21:08 2014
@@ -21,20 +21,20 @@
   $db=new db($inverter);
   $heure=array();
   $values=array();
-  $champs=array('pac','pdc','tkk');
+  $champs=array('pac','pdc','kdy','tkk');
   if(!isset($_GET['day'])) $_GET['day']=date('Y-m-d');
   if(!isset($_GET['width'])) $_GET['width']=1000;
   if(!isset($_GET['height'])) $_GET['height']=550;
   $sql="SELECT ROUND(DATE_FORMAT(monitor_date,'%H%i'),0) AS md,
               ROUND(AVG(pac),0) AS pac,
               ROUND(AVG(pdc),0) AS pdc,
-              tkk FROM zzzt
+              kdy, tkk FROM zzzt
        WHERE DATE(`monitor_date`)='{$_GET['day']}' GROUP BY md ORDER BY md 
ASC";
   $db->query($sql);
   while ($row = $db->fetch()) {
     if(isset($prev) && 
-       ( ($prev<=$row['pdc'] && $prev+10>$row['pdc']) || ($prev>=$row['pdc'] 
&& $prev-10<$row['pdc']) ) 
-      ) $skip=1; else $skip=0;
+       ( ($prev<=$row['pdc'] && $prev*1.02>=$row['pdc']) || 
($prev>=$row['pdc'] && $prev*0.98<=$row['pdc']) ) 
+      ) {$skip=1;} else {$skip=0;}
     if(!$skip) {
       $prev=$row['pdc'];
       $heure[]=$_GET['day'].' 
'.implode(':',str_split(str_pad((int)$row['md'],4,"0",STR_PAD_LEFT),2));
@@ -49,7 +49,7 @@
  <meta charset="UTF-8">
   <link rel="shortcut icon" href="../images/inverter.png" type="image/x-png"/>
   <link rel="icon" href="../images/inverter.png" type="image/x-png"/>
-  <title><?php echo APPLICATION.' '.VERSION;?></title>
+  <title><?php echo APPLICATION.' '.VERSION.' - '.$_GET['day'];?></title>
 <link rel="stylesheet" href="../morris/morris-0.4.3.min.css">
 <script src="../morris/jquery.min.js"></script>
 <script src="../morris/raphael-min.js"></script>
@@ -57,8 +57,8 @@
 
   <style>
     table { width: 100%;}
-    #holderP { width: 100%; height: 300px; }
-    #holderR { width: 100%; height: 200px; }
+    #holderP { width: 100%; height: 400px; }
+    #holderR { width: 100%; height: 300px; }
   </style>
 </head>
 <body>
@@ -102,16 +102,16 @@
         document.write("<div id=\"holderR\"></div>");
       </script>
       <noscript>
-      <img src='<?php echo $fixe;?>pac&amp;height=300'>
-    </TD></tr>
-    <tr><TD colspan=3>
-      <img src='<?php echo $fixe;?>kdy&amp;height=150'>
-    </TD></tr>
-    <tr><TD colspan=3>
-      <img src='<?php echo $fixe;?>rendement&amp;height=150&amp;setYMin=80'>
-    </TD></tr>
-    <tr><TD colspan=3>
-      <img src='<?php echo $fixe;?>tkk&amp;height=100&amp;setYMin=20'>
+      <img src='<?php echo $fixe;?>pac&amp;height=300' title='<?php echo 
PAC;?>' alt='<?php echo PAC;?>'>
+    </TD></tr>
+    <tr><TD colspan=3>
+      <img src='<?php echo $fixe;?>kdy&amp;height=150' title='<?php echo 
KDY;?>' alt='<?php echo KDY;?>'>
+    </TD></tr>
+    <tr><TD colspan=3>
+      <img src='<?php echo $fixe;?>rendement&amp;height=150&amp;setYMin=80' 
title='<?php echo EFFICIENCY;?>' alt='<?php echo EFFICIENCY;?>'>
+    </TD></tr>
+    <tr><TD colspan=3>
+      <img src='<?php echo $fixe;?>tkk&amp;height=100&amp;setYMin=20' 
title='<?php echo TKK;?>' alt='<?php echo TKK;?>'>
       </noscript>
     </TD></tr>
     <tr><TD colspan=3>
@@ -194,17 +194,18 @@
   
 <script type="text/javascript" charset="utf-8">
         
- new Morris.Area({element: 'holderP',postUnits: 'W', lineColors: 
['#FF3300','#006699'], pointSize: 0,
+ new Morris.Area({element: 'holderP', lineColors: 
['#006600','#FF3300','#006699'], pointSize: 0, smooth: false,
   behaveLikeLine: true, fillOpacity: 0.5, hideHover: 'auto', lineWidth: 
1,data: [
   <?php
     for($i=0;$i<sizeof($values['pac']);$i++) {
       echo "{ h: '".$heure[$i]."'";
+      echo ", 'k': ".$values['kdy'][$i]*100;
       echo ", 'a': ".$values['pac'][$i];
       echo ", 'd': ".$values['pdc'][$i];
-      if($i<sizeof($values['pac'])-1) echo " },\n"; else echo " }\n";
+     if($i<sizeof($values['pac'])-1) echo " },\n"; else echo " }\n";
     }
   ?>
-  ], xkey: 'h', ykeys: ['a','d'], labels: ['<?php echo PAC;?>','<?php echo 
PDC;?>'] });
+  ], xkey: 'h', ykeys: ['k','a','d'], labels: ['<?php echo KDY;?> 
(daWh)','<?php echo PAC;?> (W)','<?php echo PDC;?> (W)'] });
   
  new Morris.Line({element: 'holderR', lineColors: ['#1751A7','#006600'], 
pointSize: 0,
   hideHover: 'auto', lineWidth: 1, data: [

Modified: trunk/stats/monthly.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/monthly.php?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/stats/monthly.php     (original)
+++ trunk/stats/monthly.php     Thu May 15 23:21:08 2014
@@ -11,7 +11,7 @@
  <meta charset="UTF-8">
   <link rel="shortcut icon" href="../images/inverter.png" type="image/x-png"/>
   <link rel="icon" href="../images/inverter.png" type="image/x-png"/>
-  <title><?php echo APPLICATION.' '.VERSION;?></title>
+  <title><?php echo APPLICATION.' '.VERSION.' - '.BY_MONTH;?></title>
   <link rel="stylesheet" href="../morris/morris-0.4.3.min.css">
   <script src="../morris/jquery.min.js"></script>
   <script src="../morris/raphael-min.js"></script>

Modified: trunk/stats/yearly.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/yearly.php?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/stats/yearly.php      (original)
+++ trunk/stats/yearly.php      Thu May 15 23:21:08 2014
@@ -12,7 +12,7 @@
  <meta charset="UTF-8">
   <link rel="shortcut icon" href="../images/inverter.png" type="image/x-png"/>
   <link rel="icon" href="../images/inverter.png" type="image/x-png"/>
-  <title><?php echo APPLICATION.' '.VERSION;?></title>
+  <title><?php echo APPLICATION.' '.VERSION.' - '.KYR;?></title>
   <link rel="stylesheet" href="../morris/morris-0.4.3.min.css">
   <script src="../morris/jquery.min.js"></script>
   <script src="../morris/raphael-min.js"></script>
@@ -51,7 +51,7 @@
       ], xkey: 'a', ykeys: ['y'], labels: [''] });
 
   </script>
-  <noscript><img src=image_by_month.php?width=1000&amp;height=600></noscript>
+  <noscript><img src='image_by_year.php?width=1000&amp;height=600' alt='<?php 
echo KYR;?>'></noscript>
 
 
 </body>


_______________________________________________
Zzzt-commits mailing list
Zzzt-commits@gna.org
https://mail.gna.org/listinfo/zzzt-commits

Reply via email to