Nouvelle arbo des graphs

This commit is contained in:
Rodolphe Quiedeville 2005-03-15 11:49:07 +00:00
parent 301a610e25
commit c495a27c9b
2 changed files with 25 additions and 17 deletions

View File

@ -91,28 +91,31 @@ if ($_GET["id"])
print '<tr><td width="50%" valign="top" align="center">';
$img_root = DOL_DATA_ROOT."/graph/telephonie/";
$file = "client/".substr($soc->id,0,1)."/".$soc->id."/graphca.png";
$mesg_no_graph = 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
if (file_exists($img_root . $file))
$img_root = DOL_DATA_ROOT."/graph/".substr($soc->id,-1)."/telephonie/client/";
$file = $img_root.$soc->id."/graphca.png";
if (file_exists($file))
{
print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">';
}
else
{
print 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
print $mesg_no_graph;
}
print '</td><td width="50%" valign="top" align="center">';
$file = "client/".substr($soc->id,0,1)."/".$soc->id."/graphgain.png";
if (file_exists($img_root . $file))
$file = $img_root.$soc->id."/graphgain.png";
if (file_exists($file))
{
print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">';
}
else
{
print 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
print $mesg_no_graph;
}
print '</td></tr>';
@ -123,26 +126,28 @@ if ($_GET["id"])
print '<tr><td width="50%" valign="top" align="center">';
$file = "client/".substr($soc->id,0,1)."/".$soc->id."/graphappelsdureemoyenne.png";
if (file_exists($img_root . $file))
$file = $img_root.$soc->id."/graphappelsdureemoyenne.png";
if (file_exists($file))
{
print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">';
}
else
{
print 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
print $mesg_no_graph;
}
print '</td><td width="50%" valign="top" align="center">';
$file = "client/".substr($soc->id,0,1)."/".$soc->id."/nb-comm-mensuel.png";
if (file_exists($img_root . $file))
$file = $img_root.$soc->id."/nb-comm-mensuel.png";
if (file_exists($file))
{
print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">';
}
else
{
print 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
print $mesg_no_graph;
}
print '</td></tr></table>';

View File

@ -139,12 +139,14 @@ class Process
{
//print ".";
$file = $img_root . "client/".substr($client,0,1)."/".$client."/graphca.png";
$img_root = DOL_DATA_ROOT."/graph/".substr($client,-1)."/telephonie/client/";
$file = $img_root . $client."/graphca.png";
$graphca = new GraphCa($this->db, $file);
$graphca->client = $client;
$graphca->GraphDraw();
$file = $img_root . "client/".substr($client,0,1)."/".$client."/graphgain.png";
$file = $img_root . $client."/graphgain.png";
$graphgain = new GraphGain ($this->db, $file);
$graphgain->client = $client;
@ -164,14 +166,14 @@ class Process
$this->db->query($sql);
$file = $img_root . "client/".substr($client,0,1)."/".$client."/graphappelsdureemoyenne.png";
$file = $img_root . $client."/graphappelsdureemoyenne.png";
$graphgain = new GraphAppelsDureeMoyenne ($this->db, $file);
$graphgain->client = $client;
$graphgain->show_console = 0 ;
$graphgain->GraphDraw();
$file = $img_root . "client/".substr($client,0,1)."/".$client."/nb-comm-mensuel.png";
$file = $img_root . $client."/nb-comm-mensuel.png";
$graphx = new GraphCommNbMensuel ($this->db, $file);
$graphx->client = $client;
@ -180,6 +182,7 @@ class Process
}
}
dolibarr_syslog("Fin client ".$this->ident);
}