Graph de tous les entrepots
This commit is contained in:
parent
d868049844
commit
acaf1a4996
@ -41,6 +41,39 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++)
|
|||||||
$verbose = 3;
|
$verbose = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$sql = "SELECT distinct(fk_entrepot)";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot_valorisation";
|
||||||
|
|
||||||
|
$resql = $db->query($sql) ;
|
||||||
|
$entrepots = array();
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
while ($row = $db->fetch_row($resql))
|
||||||
|
{
|
||||||
|
$entrepots[$row[0]] = $row[0];
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $sql;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
for ($i = 0 ; $i < 366 ; $i++)
|
||||||
|
{
|
||||||
|
foreach ($entrepots as $key => $ent)
|
||||||
|
{
|
||||||
|
$values[$key][$i] = 0;
|
||||||
|
}
|
||||||
|
$legends[$i] = strftime('%b',mktime(12,12,12,1,1,2006) + ($i * 3600 * 24));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -50,16 +83,6 @@ $sql .= " ORDER BY date_calcul ASC";
|
|||||||
|
|
||||||
$resql = $db->query($sql) ;
|
$resql = $db->query($sql) ;
|
||||||
|
|
||||||
for ($i = 0 ; $i < 366 ; $i++)
|
|
||||||
{
|
|
||||||
for ($e = 0 ; $e < 8 ; $e++)
|
|
||||||
{
|
|
||||||
$values[$e][$i] = 0;
|
|
||||||
}
|
|
||||||
$legends[$i] = strftime('%b',mktime(12,12,12,1,1,2006) + ($i * 3600 * 24));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -82,15 +105,15 @@ else
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/LinePlot.class.php";
|
require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/LinePlot.class.php";
|
||||||
|
|
||||||
$file = DOL_DATA_ROOT."/graph/entrepot/entrepot.png";
|
foreach ($entrepots as $key => $ent)
|
||||||
$title = 'Valorisation du stock (euros HT)';
|
{
|
||||||
|
|
||||||
graph_datas($file, $title, $values[0], $legends);
|
$file = DOL_DATA_ROOT."/graph/entrepot/entrepot-".$key.".png";
|
||||||
|
$title = 'Valorisation du stock (euros HT)';
|
||||||
|
|
||||||
$file = DOL_DATA_ROOT."/graph/entrepot/entrepot-7.png";
|
graph_datas($file, $title, $values[$key], $legends);
|
||||||
$title = 'Valorisation du stock (euros HT)';
|
}
|
||||||
|
|
||||||
graph_datas($file, $title, $values[7], $legends);
|
|
||||||
|
|
||||||
|
|
||||||
function graph_datas($file, $title, $values, $legends)
|
function graph_datas($file, $title, $values, $legends)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user