/[dolibarr]/dolibarr/htdocs/energie/graph.php
ViewVC logotype

Diff of /dolibarr/htdocs/energie/graph.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by rodolphe, Thu Aug 11 08:36:47 2005 UTC revision 1.2 by rodolphe, Thu Aug 11 08:46:14 2005 UTC
# Line 57  if ($_POST["action"] == 'addvalue') Line 57  if ($_POST["action"] == 'addvalue')
57    
58  llxHeader($langs, '',$langs->trans("Compteur"),"Compteur");  llxHeader($langs, '',$langs->trans("Compteur"),"Compteur");
59    
60  $html = new Form($db);  if ($_GET["period"] == '')
61    {
62  /*********************************************************************    $period = "day";
63   *  }
64   * Mode creation  else
  *  
  *  
  ************************************************************************/  
 if ($_GET["action"] == 'create')  
65  {  {
66    print_titre("Ajouter une compteur");    $period = $_GET["period"];
67    }
68    
69  }  $head[0][0] = DOL_URL_ROOT.'/energie/graph.php?period=day';
70  else  $head[0][1] = $langs->trans("Day");
71  /* *************************************************************************** */  $h++;
72  /*                                                                             */  
73  /* Mode vue                                                                    */  $head[$h][0] = DOL_URL_ROOT.'/energie/graph.php?period=week';
74  /*                                                                             */  $head[$h][1] = $langs->trans("Week");
75  /* *************************************************************************** */  $h++;
76  {    
77    if ($_GET["id"] > 0)  $head[$h][0] = DOL_URL_ROOT.'/energie/graph.php?period=month';
78    $head[$h][1] = $langs->trans("Month");
79    $h++;
80    
81    $head[$h][0] = DOL_URL_ROOT.'/energie/graph.php?period=year';
82    $head[$h][1] = $langs->trans("Year");
83    $h++;
84    
85    $as["day"] = 0;
86    $as["week"] = 1;
87    $as["month"] = 2;
88    $as["year"] = 3;
89    
90    dolibarr_fiche_head($head, $as[$period], $soc->nom);      
91    
92    print '<table class="noborder" width="100%">';
93    
94    $sql = "SELECT c.rowid, c.libelle";
95    $sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur as c";
96    $sql .= " ORDER BY c.libelle DESC";
97    $resql = $db->query($sql);
98    if ( $resql)
99    {
100      $num = $db->num_rows($resql);
101      if ($num)
102      {      {
103        $compteur = new EnergieCompteur($db, $user);        $i = 0;
104        if ( $compteur->fetch($_GET["id"]) == 0)        
105          {                $var = True;
106            $head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id;        while ($i < $num)
107            $head[0][1] = "Compteur";          {
108            $h++;            $var=!$var;
109              $obj = $db->fetch_object($resql);
           $head[$h][0] = DOL_URL_ROOT.'/energie/graph.php?id='.$compteur->id;  
           $head[$h][1] = "Graph";  
           $a = 1;  
             
           dolibarr_fiche_head($head, $a, $soc->nom);        
             
           print '<table class="border" width="100%">';  
           print "<tr><td>".$langs->trans("Compteur")."</td>";  
           print '<td width="50%">';  
           print $compteur->libelle;  
           print "</td></tr>";              
           print "</table><br>";  
110                                        
           print '</div>';  
             
   
           print '<table class="noborder" width="100%">';  
   
111            print '<tr><td align="center">';            print '<tr><td align="center">';
112            $file = "day.".$compteur->id.".png";            $file = $period.".".$obj->rowid.".png";
           print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';  
           print '</td><td align="center">';  
           $file = "week.".$compteur->id.".png";  
113            print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';            print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
114            print '</td></tr>';            print '</td></tr>';
115              
116            print '<tr><td align="center">';            $i++;
           $file = "month.".$compteur->id.".png";  
           print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';  
           print '</td><td align="center">';  
           $file = "year.".$compteur->id.".png";  
           print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';  
           print '</td></tr></table><br>';  
   
           print "<br>\n";  
         }  
       else  
         {  
           /* Commande non trouvée */  
           print "Compteur inexistant";  
117          }          }
118      }          
   else  
     {  
       print "Compteur inexistant";  
119      }      }
120  }  }
121    print '</table><br>';
122    
123  $db->close();  $db->close();
124    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26