Qual: Some change to have graph lib able to use img disk generation
libraries like javascript libraries.
This commit is contained in:
parent
484d0c82bf
commit
cda132ea8c
@ -22,7 +22,6 @@
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php");
|
||||
|
||||
$graphwidth = 700;
|
||||
|
||||
@ -73,31 +73,31 @@ $filenamenb = $dir.'/subscriptionsnbinyear-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=memberstats&file=subscriptionsnbinyear-'.$year.'.png';
|
||||
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px1->SetData($data);
|
||||
$px1->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("NbOfSubscriptions"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("NbOfSubscriptions"));
|
||||
$px1->SetLegend($legend);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue(min(0,$px1->GetFloorMinValue()));
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetYLabel($langs->trans("NbOfSubscriptions"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->mode='depth';
|
||||
$px1->SetTitle($langs->trans("NbOfSubscriptions"));
|
||||
|
||||
$px->draw($filenamenb);
|
||||
$px1->draw($filenamenb,$fileurlnb);
|
||||
}
|
||||
|
||||
// Build graphic amount of object
|
||||
@ -108,31 +108,31 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
$filenameamount = $dir.'/subscriptionsamountinyear-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=memberstats&file=subscriptionsamountinyear-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px2->SetData($data);
|
||||
$px2->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("AmountOfSubscriptions"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("AmountOfSubscriptions"));
|
||||
$px2->SetLegend($legend);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue(min(0,$px2->GetFloorMinValue()));
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetYLabel($langs->trans("AmountOfSubscriptions"));
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->mode='depth';
|
||||
$px2->SetTitle($langs->trans("AmountOfSubscriptions"));
|
||||
|
||||
$px->draw($filenameamount);
|
||||
$px2->draw($filenameamount,$fileurlamount);
|
||||
}
|
||||
|
||||
|
||||
@ -214,9 +214,9 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfSubscriptions").'" alt="'.$langs->trans("NbOfSubscriptions").'">';
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
||||
print $px2->show();
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
@ -79,31 +79,31 @@ else
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px1->SetData($data);
|
||||
$px1->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("NbOfProposals"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("NumberOfProposalsByMonth"));
|
||||
$px1->SetLegend($legend);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue(min(0,$px1->GetFloorMinValue()));
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetYLabel($langs->trans("NbOfProposals"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->mode='depth';
|
||||
$px1->SetTitle($langs->trans("NumberOfProposalsByMonth"));
|
||||
|
||||
$px->draw($filenamenb);
|
||||
$px1->draw($filenamenb,$fileurlnb);
|
||||
}
|
||||
|
||||
// Build graphic amount of object
|
||||
@ -122,31 +122,31 @@ else
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px2->SetData($data);
|
||||
$px2->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("AmountOfProposals"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
|
||||
$px2->SetLegend($legend);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue(min(0,$px2->GetFloorMinValue()));
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetYLabel($langs->trans("AmountOfProposals"));
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->mode='depth';
|
||||
$px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
|
||||
|
||||
$px->draw($filenameamount);
|
||||
$px2->draw($filenameamount,$fileurlamount);
|
||||
}
|
||||
|
||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||
@ -213,9 +213,9 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfProposals").'" alt="'.$langs->trans("NbOfProposals").'">';
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
||||
print $px2->show();
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
@ -70,19 +70,19 @@ else
|
||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnb-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename);
|
||||
$px1->SetData($data);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue());
|
||||
$px1->SetWidth($GRAPHWIDTH);
|
||||
$px1->SetHeight($GRAPHHEIGHT);
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->draw($filename,$fileurl);
|
||||
}
|
||||
|
||||
|
||||
@ -100,20 +100,20 @@ else
|
||||
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamount-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_amount);
|
||||
$px2->SetData($data);
|
||||
$px2->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue());
|
||||
$px2->SetWidth($GRAPHWIDTH);
|
||||
$px2->SetHeight($GRAPHHEIGHT);
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->draw($filename_amount,$fileurl_amount);
|
||||
}
|
||||
|
||||
|
||||
@ -137,38 +137,38 @@ else
|
||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px3 = new DolGraph();
|
||||
$mesg = $px3->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_avg);
|
||||
$px3->SetData($data);
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue());
|
||||
$px3->SetWidth($GRAPHWIDTH);
|
||||
$px3->SetHeight($GRAPHHEIGHT);
|
||||
$px3->SetShading(3);
|
||||
$px3->SetHorizTickIncrement(1);
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->draw($filename_avg,$fileurl_avg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td align="center">'.$langs->trans("NumberOfProposalsByMonth").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl.'">'; }
|
||||
else { print $px1->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_amount.'">'; }
|
||||
else { print $px2->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_avg.'">'; }
|
||||
else { print $px3->show(); }
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -94,30 +94,31 @@ else
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px1->SetData($data);
|
||||
$px1->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("NbOfOrder"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("NumberOfOrdersByMonth"));
|
||||
$px->draw($filenamenb);
|
||||
$px1->SetLegend($legend);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue(min(0,$px1->GetFloorMinValue()));
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetYLabel($langs->trans("NbOfOrder"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->mode='depth';
|
||||
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
|
||||
|
||||
$px1->draw($filenamenb,$fileurlnb);
|
||||
}
|
||||
|
||||
// Build graphic amount of object
|
||||
@ -138,30 +139,30 @@ else
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px2->SetData($data);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("AmountOfOrders"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
|
||||
$px2->SetLegend($legend);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue(min(0,$px2->GetFloorMinValue()));
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetYLabel($langs->trans("AmountOfOrders"));
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->mode='depth';
|
||||
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
|
||||
|
||||
$px->draw($filenameamount);
|
||||
$px2->draw($filenameamount,$fileurlamount);
|
||||
}
|
||||
|
||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||
@ -228,15 +229,15 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfOrders").'" alt="'.$langs->trans("NbOfOrders").'">';
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
||||
print $px2->show();
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -86,20 +86,20 @@ else
|
||||
if ($mode == 'supplier') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnb-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetYLabel($langs->trans("NbOfOrders"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename);
|
||||
$px1->SetData($data);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue());
|
||||
$px1->SetWidth($GRAPHWIDTH);
|
||||
$px1->SetHeight($GRAPHHEIGHT);
|
||||
$px1->SetYLabel($langs->trans("NbOfOrders"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->draw($filename,$fileurl);
|
||||
}
|
||||
|
||||
|
||||
@ -118,20 +118,20 @@ else
|
||||
if ($mode == 'supplier') $fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamount-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_amount);
|
||||
$px2->SetData($data);
|
||||
$px2->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue());
|
||||
$px2->SetWidth($GRAPHWIDTH);
|
||||
$px2->SetHeight($GRAPHHEIGHT);
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->draw($filename_amount,$fileurl_amount);
|
||||
}
|
||||
$res = $stats->getAverageByMonth($year);
|
||||
|
||||
@ -155,37 +155,37 @@ else
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px3 = new DolGraph();
|
||||
$mesg = $px3->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_avg);
|
||||
$px3->SetData($data);
|
||||
$px3->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue());
|
||||
$px3->SetWidth($GRAPHWIDTH);
|
||||
$px3->SetHeight($GRAPHHEIGHT);
|
||||
$px3->SetShading(3);
|
||||
$px3->SetHorizTickIncrement(1);
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->draw($filename_avg,$fileurl_avg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td align="center">'.$langs->trans("NumberOfOrdersByMonth").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl.'">'; }
|
||||
else { print $px1->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_amount.'">'; }
|
||||
else { print $px2->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_avg.'">'; }
|
||||
else { print $px3->show(); }
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -222,6 +222,7 @@ else
|
||||
|
||||
// Fabrication tableau 1
|
||||
$file= $conf->banque->dir_temp."/balance".$account."-".$year.$month.".png";
|
||||
$fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/balance".$account."-".$year.$month.".png";
|
||||
$title=$langs->transnoentities("Balance").' - '.$langs->transnoentities("Month").': '.$month.' '.$langs->transnoentities("Year").': '.$year;
|
||||
$graph_datas=array();
|
||||
foreach($datas as $i => $val)
|
||||
@ -230,25 +231,26 @@ else
|
||||
else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]);
|
||||
}
|
||||
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px->SetLegendWidthMin(180);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->setBgColor('onglet');
|
||||
$px->setBgColorGrid(array(255,255,255));
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($file);
|
||||
$px1 = new DolGraph();
|
||||
$px1->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px1->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px1->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px1->SetLegendWidthMin(180);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue());
|
||||
$px1->SetTitle($title);
|
||||
$px1->SetWidth($width);
|
||||
$px1->SetHeight($height);
|
||||
$px1->SetType('lines');
|
||||
$px1->setBgColor('onglet');
|
||||
$px1->setBgColorGrid(array(255,255,255));
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->draw($file,$fileurl);
|
||||
|
||||
$show1=$px1->show();
|
||||
unset($graph_datas);
|
||||
unset($px);
|
||||
unset($px1);
|
||||
unset($datas);
|
||||
unset($datamin);
|
||||
unset($labels);
|
||||
@ -351,6 +353,7 @@ else
|
||||
|
||||
// Fabrication tableau 2
|
||||
$file= $conf->banque->dir_temp."/balance".$account."-".$year.".png";
|
||||
$fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/balance".$account."-".$year.".png";
|
||||
$title=$langs->transnoentities("Balance").' - '.$langs->transnoentities("Year").': '.$year;
|
||||
$graph_datas=array();
|
||||
foreach($datas as $i => $val)
|
||||
@ -358,25 +361,27 @@ else
|
||||
if ($acct->min_desired) $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i],$datamin[$i]);
|
||||
else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px->SetLegendWidthMin(180);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->setBgColor('onglet');
|
||||
$px->setBgColorGrid(array(255,255,255));
|
||||
$px->SetHideXGrid(true);
|
||||
//$px->SetHorizTickIncrement(30.41); // 30.41 jours/mois en moyenne
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($file);
|
||||
$px2 = new DolGraph();
|
||||
$px2->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px2->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px2->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px2->SetLegendWidthMin(180);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue());
|
||||
$px2->SetTitle($title);
|
||||
$px2->SetWidth($width);
|
||||
$px2->SetHeight($height);
|
||||
$px2->SetType('lines');
|
||||
$px2->setBgColor('onglet');
|
||||
$px2->setBgColorGrid(array(255,255,255));
|
||||
$px2->SetHideXGrid(true);
|
||||
//$px2->SetHorizTickIncrement(30.41); // 30.41 jours/mois en moyenne
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->draw($file,$fileurl);
|
||||
|
||||
unset($px);
|
||||
$show2=$px2->show();
|
||||
|
||||
unset($px2);
|
||||
unset($graph_datas);
|
||||
unset($datas);
|
||||
unset($datamin);
|
||||
@ -457,6 +462,7 @@ else
|
||||
|
||||
// Fabrication tableau 3
|
||||
$file= $conf->banque->dir_temp."/balance".$account.".png";
|
||||
$fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/balance".$account.".png";
|
||||
$title=$langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime");
|
||||
$graph_datas=array();
|
||||
foreach($datas as $i => $val)
|
||||
@ -464,22 +470,25 @@ else
|
||||
if ($acct->min_desired) $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i],$datamin[$i]);
|
||||
else $graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px->SetLegendWidthMin(180);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->setBgColor('onglet');
|
||||
$px->setBgColorGrid(array(255,255,255));
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($file);
|
||||
$px3 = new DolGraph();
|
||||
$px3->SetData($graph_datas);
|
||||
if ($acct->min_desired) $px3->SetLegend(array($langs->transnoentities("Balance"),$langs->transnoentities("BalanceMinimalDesired")));
|
||||
else $px3->SetLegend(array($langs->transnoentities("Balance")));
|
||||
$px3->SetLegendWidthMin(180);
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue()<0?0:$px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue()>0?0:$px3->GetFloorMinValue());
|
||||
$px3->SetTitle($title);
|
||||
$px3->SetWidth($width);
|
||||
$px3->SetHeight($height);
|
||||
$px3->SetType('lines');
|
||||
$px3->setBgColor('onglet');
|
||||
$px3->setBgColorGrid(array(255,255,255));
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->draw($file,$fileurl);
|
||||
|
||||
$show3=$px3->show();
|
||||
|
||||
unset($px3);
|
||||
unset($graph_datas);
|
||||
unset($datas);
|
||||
unset($datamin);
|
||||
@ -582,31 +591,34 @@ else
|
||||
|
||||
// Fabrication tableau 4a
|
||||
$file= $conf->banque->dir_temp."/movement".$account."-".$year.$month.".png";
|
||||
$fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/movement".$account."-".$year.$month.".png";
|
||||
$title=$langs->transnoentities("BankMovements").' - '.$langs->transnoentities("Month").': '.$month.' '.$langs->transnoentities("Year").': '.$year;
|
||||
$graph_datas=array();
|
||||
foreach($data_credit as $i => $val)
|
||||
{
|
||||
$graph_datas[$i]=array($labels[$i],$data_credit[$i],$data_debit[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->transnoentities("Credit"),$langs->transnoentities("Debit")));
|
||||
$px->SetLegendWidthMin(180);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('bars');
|
||||
$px->SetShading(3);
|
||||
$px->setBgColor('onglet');
|
||||
$px->setBgColorGrid(array(255,255,255));
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($file);
|
||||
$px4 = new DolGraph();
|
||||
$px4->SetData($graph_datas);
|
||||
$px4->SetLegend(array($langs->transnoentities("Credit"),$langs->transnoentities("Debit")));
|
||||
$px4->SetLegendWidthMin(180);
|
||||
$px4->SetMaxValue($px4->GetCeilMaxValue()<0?0:$px4->GetCeilMaxValue());
|
||||
$px4->SetMinValue($px4->GetFloorMinValue()>0?0:$px4->GetFloorMinValue());
|
||||
$px4->SetTitle($title);
|
||||
$px4->SetWidth($width);
|
||||
$px4->SetHeight($height);
|
||||
$px4->SetType('bars');
|
||||
$px4->SetShading(3);
|
||||
$px4->setBgColor('onglet');
|
||||
$px4->setBgColorGrid(array(255,255,255));
|
||||
$px4->SetHorizTickIncrement(1);
|
||||
$px4->SetPrecisionY(0);
|
||||
$px4->draw($file,$fileurl);
|
||||
|
||||
$show4=$px4->show();
|
||||
|
||||
unset($graph_datas);
|
||||
unset($px);
|
||||
unset($px4);
|
||||
unset($debits);
|
||||
unset($credits);
|
||||
}
|
||||
@ -688,31 +700,34 @@ else
|
||||
|
||||
// Fabrication tableau 4b
|
||||
$file= $conf->banque->dir_temp."/movement".$account."-".$year.".png";
|
||||
$fileurl=DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/movement".$account."-".$year.".png";
|
||||
$title=$langs->transnoentities("BankMovements").' - '.$langs->transnoentities("Year").': '.$year;
|
||||
$graph_datas=array();
|
||||
foreach($data_credit as $i => $val)
|
||||
{
|
||||
$graph_datas[$i]=array($labels[$i],$data_credit[$i],$data_debit[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->transnoentities("Credit"),$langs->transnoentities("Debit")));
|
||||
$px->SetLegendWidthMin(180);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('bars');
|
||||
$px->SetShading(3);
|
||||
$px->setBgColor('onglet');
|
||||
$px->setBgColorGrid(array(255,255,255));
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($file);
|
||||
$px5 = new DolGraph();
|
||||
$px5->SetData($graph_datas);
|
||||
$px5->SetLegend(array($langs->transnoentities("Credit"),$langs->transnoentities("Debit")));
|
||||
$px5->SetLegendWidthMin(180);
|
||||
$px5->SetMaxValue($px5->GetCeilMaxValue()<0?0:$px5->GetCeilMaxValue());
|
||||
$px5->SetMinValue($px5->GetFloorMinValue()>0?0:$px5->GetFloorMinValue());
|
||||
$px5->SetTitle($title);
|
||||
$px5->SetWidth($width);
|
||||
$px5->SetHeight($height);
|
||||
$px5->SetType('bars');
|
||||
$px5->SetShading(3);
|
||||
$px5->setBgColor('onglet');
|
||||
$px5->setBgColorGrid(array(255,255,255));
|
||||
$px5->SetHorizTickIncrement(1);
|
||||
$px5->SetPrecisionY(0);
|
||||
$px5->draw($file,$fileurl);
|
||||
|
||||
$show5=$px5->show();
|
||||
|
||||
unset($graph_datas);
|
||||
unset($px);
|
||||
unset($px5);
|
||||
unset($debits);
|
||||
unset($credits);
|
||||
}
|
||||
@ -800,6 +815,7 @@ else
|
||||
print '<br><br></td></tr>';
|
||||
|
||||
|
||||
// Graphs
|
||||
if ($mode == 'standard')
|
||||
{
|
||||
$prevyear=$year;$nextyear=$year;
|
||||
@ -813,11 +829,11 @@ if ($mode == 'standard')
|
||||
|
||||
print '<tr><td align="center">';
|
||||
$file = "movement".$account."-".$year.$month.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print $show4;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td align="center">';
|
||||
$file = "balance".$account."-".$year.$month.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print $show1;
|
||||
print '</td></tr>';
|
||||
|
||||
// For year
|
||||
@ -826,21 +842,18 @@ if ($mode == 'standard')
|
||||
print '<tr><td align="right">'.$lien.'</td></tr>';
|
||||
|
||||
print '<tr><td align="center">';
|
||||
$file = "movement".$account."-".$year.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print $show5;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td align="center">';
|
||||
$file = "balance".$account."-".$year.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print $show2;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($mode == 'showalltime')
|
||||
{
|
||||
print '<tr><td align="center">';
|
||||
$file = "balance".$account.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print $show3;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -74,30 +74,30 @@ $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||
$filenamenb = $dir."/tripsexpensesnbinyear-".$year.".png";
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=tripsexpensesstats&file=tripsexpensesnbinyear-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px1->SetData($data);
|
||||
$px1->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("Number"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("NumberByMonth"));
|
||||
$px1->SetLegend($legend);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetYLabel($langs->trans("Number"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->mode='depth';
|
||||
$px1->SetTitle($langs->trans("NumberByMonth"));
|
||||
|
||||
$px->draw($filenamenb);
|
||||
$px1->draw($filenamenb,$fileurlnb);
|
||||
}
|
||||
|
||||
// Build graphic amount of object
|
||||
@ -108,30 +108,30 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
$filenameamount = $dir."/tripsexpensesamountinyear-".$year.".png";
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=tripsexpensesstats&file=tripsexpensesamountinyear-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px2->SetData($data);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("Amount"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("AmountTotal"));
|
||||
$px2->SetLegend($legend);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue(min(0,$px2->GetFloorMinValue()));
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetYLabel($langs->trans("Amount"));
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->mode='depth';
|
||||
$px2->SetTitle($langs->trans("AmountTotal"));
|
||||
|
||||
$px->draw($filenameamount);
|
||||
$px2->draw($filenameamount,$fileurlamount);
|
||||
}
|
||||
|
||||
|
||||
@ -201,13 +201,15 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("Number").'" alt="'.$langs->trans("Number").'">';
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("Amount").'" alt="'.$langs->trans("Amount").'">';
|
||||
print $px2->show();
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -69,19 +69,19 @@ $data = $stats->getNbByMonth($year);
|
||||
$filename = $dir."/tripsexpensesnb-".$year.".png";
|
||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=tripsexpensesstats&file=tripsexpensesnb-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename);
|
||||
$px1->SetData($data);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue());
|
||||
$px1->SetWidth($GRAPHWIDTH);
|
||||
$px1->SetHeight($GRAPHHEIGHT);
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->draw($filename,$fileurl);
|
||||
}
|
||||
|
||||
|
||||
@ -91,20 +91,20 @@ $data = $stats->getAmountByMonth($year);
|
||||
$filename_amount = $dir."/tripsexpensesamount-".$year.".png";
|
||||
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=tripsexpensesstats&file=tripsexpensesamount-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_amount);
|
||||
$px2->SetData($data);
|
||||
$px2->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue());
|
||||
$px2->SetWidth($GRAPHWIDTH);
|
||||
$px2->SetHeight($GRAPHHEIGHT);
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->draw($filename_amount,$fileurl_amount);
|
||||
}
|
||||
|
||||
|
||||
@ -121,37 +121,37 @@ for ($i = 1 ; $i < 13 ; $i++)
|
||||
$filename_avg = $dir."/tripsexpensesaverage-".$year.".png";
|
||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=tripsexpensesstats&file=tripsexpensesaverage-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px3 = new DolGraph();
|
||||
$mesg = $px3->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_avg);
|
||||
$px3->SetData($data);
|
||||
$px3->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue());
|
||||
$px3->SetWidth($GRAPHWIDTH);
|
||||
$px3->SetHeight($GRAPHHEIGHT);
|
||||
$px3->SetShading(3);
|
||||
$px3->SetHorizTickIncrement(1);
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->draw($filename_avg,$fileurl_avg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td align="center">'.$langs->trans("NumberByMonth").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl.'">'; }
|
||||
else { print $px1->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_amount.'">'; }
|
||||
else { print $px2->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_avg.'">'; }
|
||||
else { print $px3->show(); }
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -82,30 +82,30 @@ $filenamenb = $dir."/invoicesnbinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetPrecisionY(0);
|
||||
$px1->SetData($data);
|
||||
$px1->SetPrecisionY(0);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("NumberOfBills"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("NumberOfBillsByMonth"));
|
||||
$px1->SetLegend($legend);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetYLabel($langs->trans("NumberOfBills"));
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->mode='depth';
|
||||
$px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
|
||||
|
||||
$px->draw($filenamenb);
|
||||
$px1->draw($filenamenb,$fileurlnb);
|
||||
}
|
||||
|
||||
// Build graphic amount of object
|
||||
@ -117,30 +117,30 @@ $filenameamount = $dir."/invoicesamountinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesamountinyear-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px2->SetData($data);
|
||||
$i=$startyear;
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
$legend[]=$i;
|
||||
$i++;
|
||||
}
|
||||
$px->SetLegend($legend);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetYLabel($langs->trans("AmountOfBills"));
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->mode='depth';
|
||||
$px->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
|
||||
$px2->SetLegend($legend);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue(min(0,$px2->GetFloorMinValue()));
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetYLabel($langs->trans("AmountOfBills"));
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->mode='depth';
|
||||
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
|
||||
|
||||
$px->draw($filenameamount);
|
||||
$px2->draw($filenameamount,$fileurlamount);
|
||||
}
|
||||
|
||||
|
||||
@ -202,8 +202,6 @@ foreach ($data as $val)
|
||||
print '</table>';
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
print '</td>';
|
||||
print '<td align="center" valign="top">';
|
||||
|
||||
@ -211,13 +209,15 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NumberOfBills").'" alt="'.$langs->trans("NumberOfBills").'">';
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountOfBills").'" alt="'.$langs->trans("AmountOfBills").'">';
|
||||
print $px2->show();
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -78,19 +78,20 @@ $filename = $dir."/invoicesnb-".$year.".png";
|
||||
if ($mode == 'customer') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnb-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnb-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename);
|
||||
$px1->SetData($data);
|
||||
$px1->SetYLabel($langs->trans("NumberOfBillsByMonth"));
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue());
|
||||
$px1->SetWidth($GRAPHWIDTH);
|
||||
$px1->SetHeight($GRAPHHEIGHT);
|
||||
$px1->SetShading(3);
|
||||
$px1->SetHorizTickIncrement(1);
|
||||
$px1->SetPrecisionY(0);
|
||||
$px1->draw($filename,$fileurl);
|
||||
}
|
||||
|
||||
|
||||
@ -101,20 +102,20 @@ $filename_amount = $dir."/invoicesamount-".$year.".png";
|
||||
if ($mode == 'customer') $fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamount-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesamount-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_amount);
|
||||
$px2->SetData($data);
|
||||
$px2->SetYLabel($langs->trans("AmountTotal"));
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue());
|
||||
$px2->SetWidth($GRAPHWIDTH);
|
||||
$px2->SetHeight($GRAPHHEIGHT);
|
||||
$px2->SetShading(3);
|
||||
$px2->SetHorizTickIncrement(1);
|
||||
$px2->SetPrecisionY(0);
|
||||
$px2->draw($filename_amount,$fileurl_amount);
|
||||
}
|
||||
|
||||
|
||||
@ -132,40 +133,40 @@ $filename_avg = $dir."/invoicesaverage-".$year.".png";
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesaverage-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesaverage-'.$year.'.png';
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
$px3 = new DolGraph();
|
||||
$mesg = $px3->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px->SetData($data);
|
||||
$px->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetWidth($GRAPHWIDTH);
|
||||
$px->SetHeight($GRAPHHEIGHT);
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename_avg);
|
||||
$px3->SetData($data);
|
||||
$px3->SetYLabel($langs->trans("AmountAverage"));
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue());
|
||||
$px3->SetWidth($GRAPHWIDTH);
|
||||
$px3->SetHeight($GRAPHHEIGHT);
|
||||
$px3->SetShading(3);
|
||||
$px3->SetHorizTickIncrement(1);
|
||||
$px3->SetPrecisionY(0);
|
||||
$px3->draw($filename_avg,$fileurl_avg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td align="center">'.$langs->trans("NumberOfBillsByMonth").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl.'">'; }
|
||||
else { print $px1->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_amount.'">'; }
|
||||
else { print $px2->show(); }
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else { print '<img src="'.$fileurl_avg.'">'; }
|
||||
else { print $px3->show(); }
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (c) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (c) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -19,7 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/core/class/dolgraph.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe mere de gestion des graph
|
||||
* \brief File for class to generate graph
|
||||
*
|
||||
* Usage:
|
||||
* $graph_data = array(array('labelA',yA),array('labelB',yB));
|
||||
@ -48,6 +48,7 @@ class DolGraph
|
||||
|
||||
//! Tableau de donnees
|
||||
var $data; // array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...)
|
||||
var $title;
|
||||
var $width=380;
|
||||
var $height=200;
|
||||
var $MaxValue=0;
|
||||
@ -76,6 +77,8 @@ class DolGraph
|
||||
var $bgcolorgrid; // array(R,G,B)
|
||||
var $datacolor; // array(array(R,G,B),...)
|
||||
|
||||
private $stringtoshow; // To store string to output graph into HTML page
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -117,7 +120,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Set Y precision
|
||||
*
|
||||
*
|
||||
* @param float $which_prec
|
||||
* @return string
|
||||
*/
|
||||
@ -129,7 +132,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
|
||||
*
|
||||
*
|
||||
* @param float $xi
|
||||
*/
|
||||
function SetHorizTickIncrement($xi)
|
||||
@ -140,7 +143,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
|
||||
*
|
||||
*
|
||||
* @param float $xt
|
||||
*/
|
||||
function SetNumXTicks($xt)
|
||||
@ -151,7 +154,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Set label interval to reduce number of labels
|
||||
*
|
||||
*
|
||||
* @param float $x
|
||||
*/
|
||||
function SetLabelInterval($x)
|
||||
@ -179,7 +182,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param unknown_type $label
|
||||
*/
|
||||
function SetYLabel($label)
|
||||
@ -188,7 +191,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $w
|
||||
*/
|
||||
function SetWidth($w)
|
||||
@ -197,7 +200,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $title
|
||||
*/
|
||||
function SetTitle($title)
|
||||
@ -206,7 +209,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $data
|
||||
*/
|
||||
function SetData($data)
|
||||
@ -215,7 +218,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $type
|
||||
*/
|
||||
function SetType($type)
|
||||
@ -224,16 +227,16 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $legend
|
||||
*/
|
||||
function SetLegend($legend)
|
||||
{
|
||||
$this->Legend = $legend;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $legendwidthmin
|
||||
*/
|
||||
function SetLegendWidthMin($legendwidthmin)
|
||||
@ -242,16 +245,16 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $max
|
||||
*/
|
||||
function SetMaxValue($max)
|
||||
{
|
||||
$this->MaxValue = $max;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function GetMaxValue()
|
||||
{
|
||||
@ -259,16 +262,16 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $min
|
||||
*/
|
||||
function SetMinValue($min)
|
||||
{
|
||||
$this->MinValue = $min;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function GetMinValue()
|
||||
{
|
||||
@ -276,7 +279,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $h
|
||||
*/
|
||||
function SetHeight($h)
|
||||
@ -285,7 +288,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param $s
|
||||
*/
|
||||
function SetShading($s)
|
||||
@ -294,7 +297,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function ResetBgColor()
|
||||
{
|
||||
@ -302,7 +305,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function ResetBgColorGrid()
|
||||
{
|
||||
@ -310,7 +313,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function isGraphKo()
|
||||
{
|
||||
@ -320,7 +323,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Definie la couleur de fond de l'image complete
|
||||
*
|
||||
*
|
||||
* @param array $bg_color array(R,G,B) ou 'onglet' ou 'default'
|
||||
* @return void
|
||||
*/
|
||||
@ -347,7 +350,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Definie la couleur de fond de la grille
|
||||
*
|
||||
*
|
||||
* @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default'
|
||||
*/
|
||||
function SetBgColorGrid($bg_colorgrid = array(255,255,255))
|
||||
@ -372,7 +375,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function ResetDataColor()
|
||||
{
|
||||
@ -380,7 +383,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function GetMaxValueInData()
|
||||
{
|
||||
@ -403,7 +406,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function GetMinValueInData()
|
||||
{
|
||||
@ -472,34 +475,36 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Build a graph onto disk using correct library
|
||||
*
|
||||
* @param string $file Image file name on disk to generate
|
||||
*
|
||||
* @param string $file Image file name to use if we save onto disk
|
||||
* @param string $fileurl Url path to show image if saved onto disk
|
||||
* @return void
|
||||
*/
|
||||
function draw($file)
|
||||
function draw($file,$fileurl='')
|
||||
{
|
||||
if (! is_array($this->data) || count($this->data) < 1)
|
||||
{
|
||||
$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
|
||||
dol_syslog("DolGraph::draw ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
$call = "draw_".$this->library;
|
||||
$this->$call($file);
|
||||
$this->$call($file,$fileurl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a graph onto disk using Artichow library
|
||||
*
|
||||
* @param string $file Image file name on disk to generate
|
||||
*
|
||||
* @param string $file Image file name to use if we save onto disk
|
||||
* @param string $fileurl Url path to show image if saved onto disk
|
||||
* @return void
|
||||
*/
|
||||
private function draw_artichow($file)
|
||||
private function draw_artichow($file,$fileurl)
|
||||
{
|
||||
global $artichow_defaultfont;
|
||||
|
||||
dol_syslog("DolGraph.class::draw_artichow this->type=".$this->type);
|
||||
|
||||
dol_syslog(get_class($this)."::draw_artichow this->type=".$this->type);
|
||||
|
||||
if (! defined('SHADOW_RIGHT_TOP')) define('SHADOW_RIGHT_TOP',3);
|
||||
if (! defined('LEGEND_BACKGROUND')) define('LEGEND_BACKGROUND',2);
|
||||
@ -662,8 +667,20 @@ class DolGraph
|
||||
|
||||
// Generate file
|
||||
$graph->draw($file);
|
||||
|
||||
$this->stringtoshow='<img src="'.$fileurl.'" title="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'" alt="'.dol_escape_htmltag($this->title?$this->title:$this->YLabel).'">';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output HTML string to show graph
|
||||
*
|
||||
* @return string HTML string to show graph
|
||||
*/
|
||||
function show()
|
||||
{
|
||||
return $this->stringtoshow;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -29,6 +29,10 @@ require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||
$langs->load("sendings");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
|
||||
@ -64,7 +68,7 @@ print '</table>';
|
||||
print '<br>';
|
||||
print '<i>'.$langs->trans("StatsOnShipmentsOnlyValidated").'</i>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -28,6 +28,10 @@ require_once(DOL_DOCUMENT_ROOT."/expedition/class/expeditionstats.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$WIDTH=500;
|
||||
@ -35,7 +39,7 @@ $HEIGHT=200;
|
||||
|
||||
$mesg = '';
|
||||
|
||||
print_fiche_titre('Statistiques expeditions '.$_GET["year"], $mesg);
|
||||
print_fiche_titre($langs->trans("StatisticsOfSendings").' '.$_GET["year"], $mesg);
|
||||
|
||||
$stats = new ExpeditionStats($db);
|
||||
$data = $stats->getNbExpeditionByMonth($_GET["year"]);
|
||||
@ -57,17 +61,17 @@ if (! $mesg)
|
||||
$px->SetShading(3);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->draw($filename);
|
||||
$px->draw($filename,$fileurl);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td align="center">Nombre d expedition par mois</td>';
|
||||
print '<td align="center">';
|
||||
print '<img src="'.$fileurl.'">';
|
||||
print $px->show();
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -1480,7 +1480,7 @@ class Product extends CommonObject
|
||||
|
||||
for ($j = 0 ; $j < 12 ; $j++)
|
||||
{
|
||||
$idx=ucfirst(substr(dol_print_date(dol_mktime(12,0,0,$month,1,$year),"%b"),0,3) );
|
||||
$idx=ucfirst(dol_trunc(dol_print_date(dol_mktime(12,0,0,$month,1,$year),"%b"),3));
|
||||
$monthnum=sprintf("%02s",$month);
|
||||
|
||||
$result[$j] = array($idx,isset($tab[$year.$month])?$tab[$year.$month]:0);
|
||||
|
||||
@ -89,23 +89,6 @@ if (! empty($id) || ! empty($ref))
|
||||
print $object->getLibStatut(2,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Graphs additionels generes pas le script product-graph.php
|
||||
$year = strftime('%Y',time());
|
||||
$file = get_exdir($object->id, 3) . "ventes-".$year."-".$object->id.".png";
|
||||
if (file_exists (DOL_DATA_ROOT.'/product/temp/'.$file) )
|
||||
{
|
||||
print '<tr><td>Ventes</td><td>';
|
||||
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_product&file='.$file;
|
||||
print '<img src="'.$url.'" alt="Ventes">';
|
||||
$file = get_exdir($object->id, 3) . "ventes-".$object->id.".png";
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_product&file='.$file;
|
||||
print '<img src="'.$url.'" alt="Ventes">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -141,20 +124,16 @@ if (! empty($id) || ! empty($ref))
|
||||
$graphfiles=array(
|
||||
'propal' =>array('modulepart'=>'productstats_proposals',
|
||||
'file' => $object->id.'/propal12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsProposals"):$langs->trans("NumberOfProposals"))),
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals"))),
|
||||
'orders' =>array('modulepart'=>'productstats_orders',
|
||||
'file' => $object->id.'/orders12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsCustomerOrders"):$langs->trans("NumberOfCustomerOrders"))),
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders"))),
|
||||
'invoices' =>array('modulepart'=>'productstats_invoices',
|
||||
'file' => $object->id.'/invoices12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsCustomerInvoices"):$langs->trans("NumberOfCustomerInvoices"))),
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))),
|
||||
'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers',
|
||||
'file' => $object->id.'/invoicessuppliers12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsSupplierInvoices"):$langs->trans("NumberOfSupplierInvoices"))),
|
||||
|
||||
// 'orderssuppliers' =>array('modulepart'=>'productstats_orderssuppliers', 'file' => $object->id.'/orderssuppliers12m.png', 'label' => $langs->trans("Nombre commande fournisseurs sur les 12 derniers mois")),
|
||||
// 'contracts' =>array('modulepart'=>'productstats_contracts', 'file' => $object->id.'/contracts12m.png', 'label' => $langs->trans("Nombre contrats sur les 12 derniers mois")),
|
||||
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))),
|
||||
);
|
||||
|
||||
$px = new DolGraph();
|
||||
@ -175,9 +154,11 @@ if (! empty($id) || ! empty($ref))
|
||||
if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode);
|
||||
if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode);
|
||||
if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode);
|
||||
|
||||
if (is_array($graph_data))
|
||||
{
|
||||
$px->SetData($graph_data);
|
||||
$px->SetYLabel($graphfiles[$key]['label']);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetWidth($WIDTH);
|
||||
@ -187,7 +168,10 @@ if (! empty($id) || ! empty($ref))
|
||||
$px->SetShading(3);
|
||||
//print 'x '.$key.' '.$graphfiles[$key]['file'];
|
||||
|
||||
$px->draw($dir."/".$graphfiles[$key]['file']);
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&file='.urlencode($graphfiles[$key]['file']);
|
||||
$px->draw($dir."/".$graphfiles[$key]['file'],$url);
|
||||
|
||||
$graphfiles[$key]['output']=$px->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -223,16 +207,14 @@ if (! empty($id) || ! empty($ref))
|
||||
print '</td></tr>';
|
||||
// Image
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
//print $graphfiles[$key]['modulepart']."x".urlencode($graphfiles[$key]['file']);
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&file='.urlencode($graphfiles[$key]['file']);
|
||||
//print $url;
|
||||
print '<img src="'.$url.'" alt="'.$graphfiles[$key]['label'].'">';
|
||||
print $graphfiles[$key]['output'];
|
||||
print '</td></tr>';
|
||||
// Date generation
|
||||
print '<tr>';
|
||||
if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file']) && ! $px->isGraphKo())
|
||||
if ($graphfiles[$key]['output'] && ! $px->isGraphKo())
|
||||
{
|
||||
print '<td>'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
|
||||
if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) print '<td>'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
|
||||
else print '<td>'.$langs->trans("GeneratedOn",dol_print_date(dol_now()),"dayhour").'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -264,8 +246,7 @@ else
|
||||
dol_print_error();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -238,16 +238,16 @@ foreach ($accounts as $account)
|
||||
{
|
||||
$graph_datas[$i]=array("$labels[$i]",$datas[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->trans("Balance")));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->draw($file);
|
||||
$px1 = new DolGraph();
|
||||
$px1->SetData($graph_datas);
|
||||
$px1->SetLegend(array($langs->trans("Balance")));
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue());
|
||||
$px1->SetTitle($title);
|
||||
$px1->SetWidth($width);
|
||||
$px1->SetHeight($height);
|
||||
$px1->SetType('lines');
|
||||
$px1->draw($file,'');
|
||||
|
||||
|
||||
// Chargement du tableau $amounts
|
||||
@ -333,15 +333,15 @@ foreach ($accounts as $account)
|
||||
{
|
||||
$graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->trans("Balance")));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->draw($file);
|
||||
$px2 = new DolGraph();
|
||||
$px2->SetData($graph_datas);
|
||||
$px2->SetLegend(array($langs->trans("Balance")));
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue());
|
||||
$px2->SetTitle($title);
|
||||
$px2->SetWidth($width);
|
||||
$px2->SetHeight($height);
|
||||
$px2->SetType('lines');
|
||||
$px2->draw($file,'');
|
||||
|
||||
|
||||
// Chargement du tableau $amounts
|
||||
@ -408,16 +408,16 @@ foreach ($accounts as $account)
|
||||
{
|
||||
$graph_datas[$i]=array(isset($labels[$i])?$labels[$i]:'',$datas[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->trans("Balance")));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('lines');
|
||||
$px->draw($file);
|
||||
$px3 = new DolGraph();
|
||||
$px3->SetData($graph_datas);
|
||||
$px3->SetLegend(array($langs->trans("Balance")));
|
||||
$px3->SetMaxValue($px3->GetCeilMaxValue());
|
||||
$px3->SetMinValue($px3->GetFloorMinValue());
|
||||
$px3->SetTitle($title);
|
||||
$px3->SetWidth($width);
|
||||
$px3->SetHeight($height);
|
||||
$px3->SetType('lines');
|
||||
$px3->draw($file,'');
|
||||
|
||||
|
||||
// Chargement du tableau $credits, $debits
|
||||
@ -488,17 +488,17 @@ foreach ($accounts as $account)
|
||||
{
|
||||
$graph_datas[$i]=array($labels[$i],$data_credit[$i],$data_debit[$i]);
|
||||
}
|
||||
$px = new DolGraph();
|
||||
$px->SetData($graph_datas);
|
||||
$px->SetLegend(array($langs->trans("Debit"),$langs->trans("Credit")));
|
||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue());
|
||||
$px->SetTitle($title);
|
||||
$px->SetWidth($width);
|
||||
$px->SetHeight($height);
|
||||
$px->SetType('bars');
|
||||
$px->SetShading(3);
|
||||
$px->draw($file);
|
||||
$px4 = new DolGraph();
|
||||
$px4->SetData($graph_datas);
|
||||
$px4->SetLegend(array($langs->trans("Debit"),$langs->trans("Credit")));
|
||||
$px4->SetMaxValue($px4->GetCeilMaxValue());
|
||||
$px4->SetMinValue($px4->GetFloorMinValue());
|
||||
$px4->SetTitle($title);
|
||||
$px4->SetWidth($width);
|
||||
$px4->SetHeight($height);
|
||||
$px4->SetType('bars');
|
||||
$px4->SetShading(3);
|
||||
$px4->draw($file,'');
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user