Author: zecas Date: Fri Jan 1 11:49:26 2016 New Revision: 129 URL: http://svn.gna.org/viewcvs/zzzt?rev=129&view=rev Log: code cleanup
Modified: trunk/i18n/switch.php trunk/index.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=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/i18n/switch.php (original) +++ trunk/i18n/switch.php Fri Jan 1 11:49:26 2016 @@ -1,6 +1,6 @@ <?php /* This file is part of Zzzt!. - Copyright (C) 2009-2015 Antonio Ho, José Jorge + Copyright (C) 2009-2016 Antonio Ho, José Jorge Zzzt! is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ along with Zzzt! . If not, see <http://www.gnu.org/licenses/>. */ -define("VERSION","2.1"); +define("VERSION","2.2"); ini_set('display_errors','1'); @@ -38,4 +38,26 @@ if(!function_exists('socket_create')) $error=(ERROR_SOCKETS); +function htmlCommun( $titre ) { ?> +<!DOCTYPE html> +<html> +<head> + <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.' - '.$titre;?></title> + <link rel="stylesheet" href="../morris/morris.css"> + <link rel="stylesheet" href="../morris/zzzt.css"> + <script src="../morris/jquery.min.js"></script> + <script src="../morris/raphael-min.js"></script> + <script src="../morris/morris.min.js"></script> + + <style> + html, body { height: 95%; } + #holder { width: 98%; height: 100%; } + #moyenne { position: absolute; right: 50px; top: 25px;} + </style> +</head> + +<?php } ?> Modified: trunk/index.php URL: http://svn.gna.org/viewcvs/zzzt/trunk/index.php?rev=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/index.php (original) +++ trunk/index.php Fri Jan 1 11:49:26 2016 @@ -15,13 +15,9 @@ You should have received a copy of the GNU General Public License along with Zzzt! . If not, see <http://www.gnu.org/licenses/>. */ + + htmlCommun(''); ?> -<!DOCTYPE html> -<html> -<head> - <title>Zzzt!</title> - <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"/> -</head> -<a href=inverter><img src=./images/inverter_big.png border=0 alt='Zzzt!'></a> +<body> + <a href=inverter><img src=./images/inverter_big.png border=0 alt='Zzzt!'></a> +</body> Modified: trunk/stats/daily.php URL: http://svn.gna.org/viewcvs/zzzt/trunk/stats/daily.php?rev=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/stats/daily.php (original) +++ trunk/stats/daily.php Fri Jan 1 11:49:26 2016 @@ -1,6 +1,6 @@ <?php /* This file is part of Zzzt!. - Copyright (C) 2009-2015 Antonio Ho, José Jorge + Copyright (C) 2009-2016 Antonio Ho, José Jorge Zzzt! is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,24 +21,8 @@ $inverter=new inverter(); $db=new db($inverter); $jour=$values=$record=array(); + htmlCommun(BY_DAY); ?> -<!DOCTYPE html> -<html> -<head> - <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.' - '.BY_DAY;?></title> - <link rel="stylesheet" href="../morris/morris.css"> - <script src="../morris/jquery.min.js"></script> - <script src="../morris/raphael-min.js"></script> - <script src="../morris/morris.min.js"></script> - - <style> - html, body { height: 95%; } - #holder { width: 98%; height: 100%; } - </style> -</head> <body> <b><a href=../inverter/index.php><?php echo APPLICATION;?></a></b> Modified: trunk/stats/index.php URL: http://svn.gna.org/viewcvs/zzzt/trunk/stats/index.php?rev=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/stats/index.php (original) +++ trunk/stats/index.php Fri Jan 1 11:49:26 2016 @@ -1,6 +1,6 @@ <?php /* This file is part of Zzzt!. - Copyright (C) 2009-2015 Antonio Ho, José Jorge + Copyright (C) 2009-2016 Antonio Ho, José Jorge Zzzt! is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,33 +42,9 @@ foreach($champs as $c) $values[$c][]=$row[$c]; } } + htmlCommun($_GET['day']); ?> -<!DOCTYPE html> -<html> -<head> - <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.' - '.$_GET['day'];?></title> -<link rel="stylesheet" href="../morris/morris.css"> -<script src="../morris/jquery.min.js"></script> -<script src="../morris/raphael-min.js"></script> -<script src="../morris/morris.min.js"></script> - - <style> - table { width: 100%;} - #holderP { width: 100%; height: 400px; } - #holderR { width: 100%; height: 300px; } - #etat { - position: absolute; - top: 4em; - right: 1em; - background-color: #ddd; - border-radius: 0.5em; - padding: 0.5em; - } - </style> -</head> + <body> <b><a href=../inverter/index.php><?php echo APPLICATION;?></a></b> <a href=daily.php><?php echo BY_DAY;?></a> Modified: trunk/stats/monthly.php URL: http://svn.gna.org/viewcvs/zzzt/trunk/stats/monthly.php?rev=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/stats/monthly.php (original) +++ trunk/stats/monthly.php Fri Jan 1 11:49:26 2016 @@ -1,6 +1,6 @@ <?php /* This file is part of Zzzt!. - Copyright (C) 2009-2014 Antonio Ho, José Jorge + Copyright (C) 2009-2016 Antonio Ho, José Jorge Zzzt! is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,25 +20,9 @@ $inverter=new inverter(); $db=new db($inverter); $year=$annees=$values=array(); + + htmlCommun(BY_MONTH); ?> -<!DOCTYPE html> -<html> -<head> - <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.' - '.BY_MONTH;?></title> - <link rel="stylesheet" href="../morris/morris.css"> - <script src="../morris/jquery.min.js"></script> - <script src="../morris/raphael-min.js"></script> - <script src="../morris/morris.min.js"></script> - - <style> - html, body { height: 95%; } - #holder { width: 98%; height: 100%; } - #moyenne { position: absolute; right: 50px; top: 25px;} - </style> -</head> <body> <b><a href=../inverter/index.php><?php echo APPLICATION;?></a></b> Modified: trunk/stats/yearly.php URL: http://svn.gna.org/viewcvs/zzzt/trunk/stats/yearly.php?rev=129&r1=128&r2=129&view=diff ============================================================================== --- trunk/stats/yearly.php (original) +++ trunk/stats/yearly.php Fri Jan 1 11:49:26 2016 @@ -1,6 +1,6 @@ <?php /* This file is part of Zzzt!. - Copyright (C) 2009-2014 Antonio Ho, José Jorge + Copyright (C) 2009-2016 Antonio Ho, José Jorge Zzzt! is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,24 +21,8 @@ $db=new db($inverter); if(!isset($_GET['year'])) $_GET['year']=date('Y'); $year=$mois=$annees=$values=array(); + htmlCommun(KYR); ?> -<!DOCTYPE html> -<html> -<head> - <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.' - '.KYR;?></title> - <link rel="stylesheet" href="../morris/morris.css"> - <script src="../morris/jquery.min.js"></script> - <script src="../morris/raphael-min.js"></script> - <script src="../morris/morris.min.js"></script> - - <style> - html, body { height: 95%; } - #holder { width: 98%; height: 100%; } - </style> -</head> <body> <b><a href=../inverter/index.php><?php echo APPLICATION;?></a></b> @@ -53,7 +37,7 @@ $db->query($sql); while ($row = $db->fetch()) $values[$row['year']]['production']=$row['production']; $sql="SELECT YEAR(date) AS year, SUM(production) AS partiel FROM zzzt_daily - WHERE DAYOFYEAR(date) <= DAYOFYEAR(NOW()) + WHERE DAYOFYEAR(date) < DAYOFYEAR(NOW()) GROUP BY YEAR(date)"; $db->query($sql); while ($row = $db->fetch()) $values[$row['year']]['partiel']=$row['partiel']; _______________________________________________ Zzzt-commits mailing list Zzzt-commits@gna.org https://mail.gna.org/listinfo/zzzt-commits