19 |
* $Source$ |
* $Source$ |
20 |
* |
* |
21 |
*/ |
*/ |
|
|
|
|
|
|
22 |
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/line.class.php"); |
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/line.class.php"); |
23 |
|
|
24 |
class GraphLignesActives extends GraphLine { |
class GraphLignesActives extends GraphLine { |
25 |
|
|
|
|
|
26 |
Function GraphLignesActives($DB, $file) |
Function GraphLignesActives($DB, $file) |
27 |
{ |
{ |
28 |
$this->db = $DB; |
$this->db = $DB; |
96 |
$this->GraphDraw($this->file, $active, $labels); |
$this->GraphDraw($this->file, $active, $labels); |
97 |
} |
} |
98 |
} |
} |
99 |
|
|
100 |
|
|
101 |
|
class GraphLignesCommandees extends GraphLine { |
102 |
|
|
103 |
|
Function GraphLignesCommandees($DB, $file) |
104 |
|
{ |
105 |
|
$this->db = $DB; |
106 |
|
$this->file = $file; |
107 |
|
|
108 |
|
$this->client = 0; |
109 |
|
$this->titre = "Lignes en commandes"; |
110 |
|
|
111 |
|
$this->barcolor = "green"; |
112 |
|
$this->showframe = true; |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
Function GraphMakeGraph() |
117 |
|
{ |
118 |
|
$num = 0; |
119 |
|
|
120 |
|
$sql = "SELECT dates, statut,nb"; |
121 |
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_ligne_statistique"; |
122 |
|
$sql .= " WHERE statut = 2"; |
123 |
|
$sql .= " ORDER BY dates ASC"; |
124 |
|
|
125 |
|
$resql = $this->db->query($sql); |
126 |
|
if ($resql) |
127 |
|
{ |
128 |
|
$num = $this->db->num_rows($resql); |
129 |
|
$i = 0; |
130 |
|
$j = -1; |
131 |
|
$attente = array(); |
132 |
|
$acommander = array(); |
133 |
|
$commandee = array(); |
134 |
|
$active = array(); |
135 |
|
$last = 0; |
136 |
|
|
137 |
|
while ($i < $num) |
138 |
|
{ |
139 |
|
$row = $this->db->fetch_row($resql); |
140 |
|
|
141 |
|
$j++; |
142 |
|
$labels[$j] = substr($row[0],5,2)."/".substr($row[0],2,2); |
143 |
|
$attente[$j] = 0; |
144 |
|
$acommander[$j] = 0; |
145 |
|
$commandee[$j] = 0; |
146 |
|
$active[$j] = 0; |
147 |
|
$last = substr($row[0],5,2)."/".substr($row[0],2,2); |
148 |
|
|
149 |
|
if ($row[1] == 2) |
150 |
|
{ |
151 |
|
$active[$j] = $row[2]; |
152 |
|
} |
153 |
|
|
154 |
|
$i++; |
155 |
|
} |
156 |
|
|
157 |
|
$this->db->free(); |
158 |
|
} |
159 |
|
else |
160 |
|
{ |
161 |
|
print $this->db->error() . ' ' . $sql; |
162 |
|
} |
163 |
|
|
164 |
|
$this->LabelInterval = 1; |
165 |
|
|
166 |
|
$a = round($num / 20,0); |
167 |
|
|
168 |
|
if ($a > 1) |
169 |
|
{ |
170 |
|
$this->LabelInterval = $a; |
171 |
|
} |
172 |
|
|
173 |
|
$this->GraphDraw($this->file, $active, $labels); |
174 |
|
} |
175 |
|
} |
176 |
|
|
177 |
|
|
178 |
?> |
?> |