Révision 79bddb26
plugins/anet_epacks/front/plugin_anet_epacks.view_recap_interventions.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// Récap de toutes les interventions d'un client ... |
|
4 |
|
|
5 |
if(!defined('GLPI_ROOT')){ |
|
6 |
define('GLPI_ROOT', '../../..'); |
|
7 |
} |
|
8 |
include_once (GLPI_ROOT . "/inc/includes.php"); |
|
9 |
|
|
10 |
//Les dates en francais svp |
|
11 |
setlocale(LC_TIME, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8'); |
|
12 |
|
|
13 |
checkRight("config","w"); |
|
14 |
//checkSeveralRightsOr(array("config" => "w", "profile" => "w")); |
|
15 |
|
|
16 |
commonHeader("anet_epacks",$_SERVER['PHP_SELF'],"config","plugins"); |
|
17 |
print "<h1>Création du récapitulatif pour un client</h1>"; |
|
18 |
|
|
19 |
print "<p>Choix de la période : " . $_SESSION['glpiactive_entity'] . "</p>"; |
|
20 |
|
|
21 |
print "<form><p>Début: 01- |
|
22 |
<select name=\"start_month\"> |
|
23 |
<option value=\"" . $start_month . "\">$start_month</option> |
|
24 |
<option value=\"01\">jan</option> |
|
25 |
<option value=\"02\">fev</option> |
|
26 |
<option value=\"03\">mar</option> |
|
27 |
<option value=\"04\">avr</option> |
|
28 |
<option value=\"05\">mai</option> |
|
29 |
<option value=\"06\">juin</option> |
|
30 |
<option value=\"07\">juil</option> |
|
31 |
<option value=\"08\">aout</option> |
|
32 |
<option value=\"09\">sept</option> |
|
33 |
<option value=\"10\">oct</option> |
|
34 |
<option value=\"11\">nov</option> |
|
35 |
<option value=\"12\">dec</option> |
|
36 |
</select> |
|
37 |
<select name=\"start_year\"> |
|
38 |
<option value=\"" . $start_year . "\">$start_year</option> |
|
39 |
<option value=\"2009\">2009</option> |
|
40 |
<option value=\"2010\">2010</option> |
|
41 |
<option value=\"2011\">2011</option> |
|
42 |
<option value=\"2012\">2012</option> |
|
43 |
<option value=\"2013\">2013</option> |
|
44 |
</select> |
|
45 |
"; |
|
46 |
|
|
47 |
print "Fin: 01- |
|
48 |
<select name=\"end_month\"> |
|
49 |
<option value=\"" . $end_month . "\">$end_month</option> |
|
50 |
<option value=\"01\">jan</option> |
|
51 |
<option value=\"02\">fev</option> |
|
52 |
<option value=\"03\">mar</option> |
|
53 |
<option value=\"04\">avr</option> |
|
54 |
<option value=\"05\">mai</option> |
|
55 |
<option value=\"06\">juin</option> |
|
56 |
<option value=\"07\">juil</option> |
|
57 |
<option value=\"08\">aout</option> |
|
58 |
<option value=\"09\">sept</option> |
|
59 |
<option value=\"10\">opt</option> |
|
60 |
<option value=\"11\">nov</option> |
|
61 |
<option value=\"12\">dec</option> |
|
62 |
</select> |
|
63 |
<select name=\"end_year\"> |
|
64 |
<option value=\"" . $end_year . "\">$end_year</option> |
|
65 |
<option value=\"2010\">2010</option> |
|
66 |
<option value=\"2011\">2011</option> |
|
67 |
<option value=\"2012\">2012</option> |
|
68 |
<option value=\"2013\">2013</option> |
|
69 |
<option value=\"2014\">2014</option> |
|
70 |
</select> |
|
71 |
<input type=\"submit\"> |
|
72 |
</p> |
|
73 |
</form>"; |
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
global $DB; |
|
78 |
|
|
79 |
|
|
80 |
//Le tableau global pour avoir la liste des revendeurs |
|
81 |
//parentid=3 -> c'est l'entité "partenaires" |
|
82 |
$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'"; |
|
83 |
//print $query; |
|
84 |
$result = $DB->query($query) or die($DB->error()); |
|
85 |
|
|
86 |
print "<table class='tab_cadre' width='100%' cellpadding='2'>\n"; |
|
87 |
print "<tr class='tab_bg_3'> |
|
88 |
<td>Date</td> |
|
89 |
<td>Détails</td> |
|
90 |
<td>Durée</td> |
|
91 |
</tr>\n"; |
|
92 |
$total = 0; |
|
93 |
for($i = 0; $i < $DB->numrows($result); $i++) { |
|
94 |
$data=$DB->fetch_array($result); |
|
95 |
print "<tr class='tab_bg_3'>\n"; |
|
96 |
print " <td valign=\"top\">" . $data['date'] . " </td> |
|
97 |
<td valign=\"top\"><a href=\"../../../front/tracking.form.php?ID=" . $data['ID'] . "\">" . $data['name'] . "</a></td> |
|
98 |
<td valign=\"top\">" . $data['realtime'] . "</td> |
|
99 |
</tr>\n"; |
|
100 |
$total += ($data['realtime']*60); |
|
101 |
} |
|
102 |
$totalh = ($total/60); |
|
103 |
print "<tr><td>Total:</td> |
|
104 |
<td colspan=\"2\"\">" . round($totalh) . " heures et " . substr($totalh-round($totalh),2,2) . " minutes</td> |
|
105 |
</tr>"; |
|
106 |
print "</table>"; |
|
107 |
|
|
108 |
/* |
|
109 |
print "<p style=\"page-break-after: always\"> </p>\n"; |
|
110 |
print " <h2 style=\"text-align: left\"> Synthèse du relevé mensuel de " . $_GET['month'] . "/" . $_GET['year'] . "</h2>"; |
|
111 |
print "<table> |
|
112 |
<tr class='tab_bg_3'> |
|
113 |
<td colspan=\"3\"><br />Nombre total de revendeurs: " . $i . "<br /></td> |
|
114 |
</tr>\n"; |
|
115 |
print "</table>"; |
|
116 |
*/ |
|
117 |
|
|
118 |
commonFooter(); |
|
119 |
?> |
Formats disponibles : Unified diff