41 |
|
|
42 |
if ($_GET["id"]) |
if ($_GET["id"]) |
43 |
{ |
{ |
44 |
|
$year = strftime("%Y",time()); |
45 |
$distri = new DistributeurTelephonie($db); |
$distri = new DistributeurTelephonie($db); |
46 |
$distri->fetch($_GET["id"]); |
$distri->fetch($_GET["id"]); |
47 |
|
|
54 |
|
|
55 |
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; |
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; |
56 |
|
|
57 |
print '<tr><td width="30%" valign="top">'; |
print '<tr><td width="70%" valign="top">'; |
58 |
|
|
59 |
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/po.month.png" alt="Prise d\'ordre" title="Prise d\'ordre"><br /><br />'."\n"; |
60 |
|
|
61 |
|
print '</td><td valign="top" width="30%">'; |
62 |
|
|
63 |
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; |
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; |
64 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
65 |
print '<td>Mois</td><td align="right">Prise d\'ordre</td></tr>'; |
print '<td>Mois</td><td align="right">Prise d\'ordre</td></tr>'; |
66 |
|
|
67 |
$sql = "SELECT sum(p.montant), date_format(datepo, '%m-%Y')"; |
$sql = "SELECT sum(p.montant), date_format(datepo, '%m-%Y')"; |
68 |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; |
|
|
|
69 |
$sql .= " WHERE p.fk_distributeur = ".$_GET["id"]; |
$sql .= " WHERE p.fk_distributeur = ".$_GET["id"]; |
70 |
$sql .= " GROUP BY date_format(p.datepo, '%Y%m') DESC"; |
$sql .= " GROUP BY date_format(p.datepo, '%Y%m') DESC"; |
|
|
|
71 |
$resql = $db->query($sql); |
$resql = $db->query($sql); |
72 |
|
|
73 |
if ($resql) |
if ($resql) |
76 |
$i = 0; |
$i = 0; |
77 |
$total = 0; |
$total = 0; |
78 |
|
|
79 |
while ($i < $num) |
while ($row = $db->fetch_row($resql)) |
80 |
{ |
{ |
81 |
$row = $db->fetch_row($i); |
$var=!$var; |
82 |
|
print "<tr $bc[$var]><td>".$row[1].'</td>'; |
|
$var=!$var; |
|
|
|
|
|
print "<tr $bc[$var]>"; |
|
|
|
|
|
print '<td>'.$row[1].'</td>'; |
|
|
|
|
83 |
print '<td align="right">'.price($row[0]).'</td></tr>'; |
print '<td align="right">'.price($row[0]).'</td></tr>'; |
|
$i++; |
|
84 |
} |
} |
85 |
$db->free(); |
$db->free(); |
86 |
} |
} |
88 |
{ |
{ |
89 |
print $db->error() . ' ' . $sql; |
print $db->error() . ' ' . $sql; |
90 |
} |
} |
91 |
print '</table><br />'; |
print '</table>'; |
|
|
|
|
|
|
|
print '</td><td valign="top" width="70%">'; |
|
|
|
|
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/po.month.png" alt="Prise d\'ordre" title="Prise d\'ordre"><br /><br />'."\n"; |
|
92 |
|
|
93 |
|
print '</td></tr><tr><td valign="top" width="70%">'; |
94 |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/clients.hebdomadaire.png" alt="Nouveaux clients" title="Nouveaux clients"><br /><br />'."\n"; |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/clients.hebdomadaire.png" alt="Nouveaux clients" title="Nouveaux clients"><br /><br />'."\n"; |
95 |
|
print '</td><td>'; |
96 |
|
|
97 |
|
print '</td></tr><tr><td valign="top" width="70%">'; |
98 |
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/resultat.mensuel.png" alt="Resultat" title="Resultat"><br /><br />'."\n"; |
99 |
|
print '</td><td valign="top" width="30%">'; |
100 |
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; |
101 |
|
print '<tr class="liste_titre"><td>Mois</td><td align="right">Resultat</td></tr>'; |
102 |
|
|
103 |
|
$sql = "SELECT valeur,legend FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
104 |
|
$sql .= " WHERE graph = 'distributeur.resultat.mensuel.".$_GET["id"]."'"; |
105 |
|
$sql .= " ORDER BY legend DESC"; |
106 |
|
$resql = $db->query($sql); |
107 |
|
|
108 |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/resultat.mensuel.png" alt="Commission mensuelle" title="Commission mensuelle"><br /><br />'."\n"; |
if ($resql) |
109 |
|
{ |
110 |
|
while ($row = $db->fetch_row($resql)) |
111 |
|
{ |
112 |
|
$var=!$var; |
113 |
|
print "<tr $bc[$var]><td>".$row[1].'</td>'; |
114 |
|
print '<td align="right">'.price($row[0]).'</td></tr>'; |
115 |
|
} |
116 |
|
$db->free(); |
117 |
|
} |
118 |
|
else |
119 |
|
{ |
120 |
|
print $db->error() . ' ' . $sql; |
121 |
|
} |
122 |
|
print '</table>'; |
123 |
|
|
124 |
|
print '</td></tr><tr><td valign="top" width="70%">'; |
125 |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/gain.mensuel.png" alt="Gain mensuel" title="Gain mensuel"><br /><br />'."\n"; |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/gain.mensuel.png" alt="Gain mensuel" title="Gain mensuel"><br /><br />'."\n"; |
126 |
|
print '</td><td valign="top" width="30%">'; |
127 |
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; |
128 |
|
print '<tr class="liste_titre"><td>Mois</td><td align="right">Gain</td></tr>'; |
129 |
|
|
130 |
|
$sql = "SELECT valeur,legend FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
131 |
|
$sql .= " WHERE graph = 'distributeur.gain.mensuel.".$_GET["id"]."'"; |
132 |
|
$sql .= " ORDER BY legend DESC"; |
133 |
|
$resql = $db->query($sql); |
134 |
|
|
135 |
|
if ($resql) |
136 |
|
{ |
137 |
|
while ($row = $db->fetch_row($resql)) |
138 |
|
{ |
139 |
|
$var=!$var; |
140 |
|
print "<tr $bc[$var]><td>".$row[1].'</td>'; |
141 |
|
print '<td align="right">'.price($row[0]).'</td></tr>'; |
142 |
|
} |
143 |
|
$db->free(); |
144 |
|
} |
145 |
|
else |
146 |
|
{ |
147 |
|
print $db->error() . ' ' . $sql; |
148 |
|
} |
149 |
|
print '</table>'; |
150 |
|
|
151 |
|
print '</td></tr><tr><td valign="top" width="70%">'; |
152 |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/commission.mensuel.png" alt="Commission mensuelle" title="Commission mensuelle"><br /><br />'."\n"; |
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/commission.mensuel.png" alt="Commission mensuelle" title="Commission mensuelle"><br /><br />'."\n"; |
153 |
|
|
154 |
|
print '</td><td valign="top" width="30%">'; |
155 |
|
|
156 |
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; |
157 |
|
print '<tr class="liste_titre"><td>Mois</td><td align="right">Commission</td></tr>'; |
158 |
|
|
159 |
|
$sql = "SELECT valeur,legend FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
160 |
|
$sql .= " WHERE graph = 'distributeur.commission.mensuel.".$_GET["id"]."'"; |
161 |
|
$sql .= " ORDER BY legend DESC"; |
162 |
|
$resql = $db->query($sql); |
163 |
|
|
164 |
|
if ($resql) |
165 |
|
{ |
166 |
|
while ($row = $db->fetch_row($resql)) |
167 |
|
{ |
168 |
|
$var=!$var; |
169 |
|
print "<tr $bc[$var]><td>".$row[1].'</td>'; |
170 |
|
print '<td align="right">'.price($row[0]).'</td></tr>'; |
171 |
|
} |
172 |
|
$db->free(); |
173 |
|
} |
174 |
|
else |
175 |
|
{ |
176 |
|
print $db->error() . ' ' . $sql; |
177 |
|
} |
178 |
|
print '</table>'; |
179 |
|
|
180 |
|
|
181 |
print '</td></tr>'; |
print '</td></tr>'; |
182 |
print '</table>'; |
print '</table>'; |
183 |
|
|