commit 79bddb269217ad38520d214287431bae29ca37ba
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Thu Oct 13 16:48:19 2011 +0200

    ajout du lien vers recap interventions

diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_interventions.php b/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_interventions.php
new file mode 100644
index 0000000..475aac0
--- /dev/null
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_interventions.php
@@ -0,0 +1,119 @@
+<?php
+
+// Récap de toutes les interventions d'un client ...
+
+if(!defined('GLPI_ROOT')){
+  define('GLPI_ROOT', '../../..');
+}
+include_once (GLPI_ROOT . "/inc/includes.php");
+
+//Les dates en francais svp
+setlocale(LC_TIME, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8'); 
+
+checkRight("config","w");
+//checkSeveralRightsOr(array("config" => "w", "profile" => "w"));
+
+commonHeader("anet_epacks",$_SERVER['PHP_SELF'],"config","plugins");
+print "<h1>Création du récapitulatif pour un client</h1>";
+
+print "<p>Choix de la période : " . $_SESSION['glpiactive_entity'] . "</p>";
+
+print "<form><p>Début: 01-
+<select name=\"start_month\">
+<option value=\"" . $start_month . "\">$start_month</option>
+<option value=\"01\">jan</option>
+<option value=\"02\">fev</option>
+<option value=\"03\">mar</option>
+<option value=\"04\">avr</option>
+<option value=\"05\">mai</option>
+<option value=\"06\">juin</option>
+<option value=\"07\">juil</option>
+<option value=\"08\">aout</option>
+<option value=\"09\">sept</option>
+<option value=\"10\">oct</option>
+<option value=\"11\">nov</option>
+<option value=\"12\">dec</option>
+</select>
+<select name=\"start_year\">
+<option value=\"" . $start_year . "\">$start_year</option>
+<option value=\"2009\">2009</option>
+<option value=\"2010\">2010</option>
+<option value=\"2011\">2011</option>
+<option value=\"2012\">2012</option>
+<option value=\"2013\">2013</option>
+</select>
+";
+
+print "Fin: 01-
+<select name=\"end_month\">
+<option value=\"" . $end_month . "\">$end_month</option>
+<option value=\"01\">jan</option>
+<option value=\"02\">fev</option>
+<option value=\"03\">mar</option>
+<option value=\"04\">avr</option>
+<option value=\"05\">mai</option>
+<option value=\"06\">juin</option>
+<option value=\"07\">juil</option>
+<option value=\"08\">aout</option>
+<option value=\"09\">sept</option>
+<option value=\"10\">opt</option>
+<option value=\"11\">nov</option>
+<option value=\"12\">dec</option>
+</select>
+<select name=\"end_year\">
+<option value=\"" . $end_year . "\">$end_year</option>
+<option value=\"2010\">2010</option>
+<option value=\"2011\">2011</option>
+<option value=\"2012\">2012</option>
+<option value=\"2013\">2013</option>
+<option value=\"2014\">2014</option>
+</select>
+<input type=\"submit\">
+</p>
+</form>";
+
+
+
+global $DB;
+
+
+//Le tableau global pour avoir la liste des revendeurs
+//parentid=3 -> c'est l'entité "partenaires"
+$query = "SELECT * FROM `glpi_tracking` WHERE `FK_entities`=" . $_SESSION['glpiactive_entity'] . " AND `date`>'" . $start_year . "-" . $start_month ."-01' AND `date`<'" . $end_year . "-" . $end_month ."-01'";
+//print $query;
+$result = $DB->query($query) or die($DB->error());
+
+print "<table class='tab_cadre' width='100%' cellpadding='2'>\n";
+print "<tr class='tab_bg_3'>
+   <td>Date</td>
+   <td>Détails</td>
+   <td>Durée</td>
+   </tr>\n";
+$total = 0;
+for($i = 0; $i < $DB->numrows($result); $i++) {
+  $data=$DB->fetch_array($result);
+  print "<tr class='tab_bg_3'>\n";
+  print "  <td valign=\"top\">" . $data['date'] . " </td>
+  <td valign=\"top\"><a href=\"../../../front/tracking.form.php?ID=" . $data['ID'] . "\">" . $data['name'] . "</a></td>
+  <td valign=\"top\">" . $data['realtime'] . "</td>
+</tr>\n";
+  $total += ($data['realtime']*60);
+ }
+$totalh = ($total/60);
+print "<tr><td>Total:</td>
+<td colspan=\"2\"\">" . round($totalh) . " heures et " . substr($totalh-round($totalh),2,2)  . " minutes</td>
+</tr>";
+print "</table>";
+
+/*
+print "<p style=\"page-break-after: always\">&nbsp;</p>\n";
+print "  <h2 style=\"text-align: left\"> Synthèse du relevé mensuel de " . $_GET['month'] . "/" . $_GET['year']  . "</h2>";
+print "<table>
+<tr class='tab_bg_3'>
+  <td colspan=\"3\"><br />Nombre total de revendeurs: " . $i . "<br /></td>
+</tr>\n";
+print "</table>";
+*/
+
+commonFooter();
+?>
