| ".$lang['admin']['stats_rank']." |
".$lang['admin']['stats_prod_name']." |
".$lang['admin']['stats_quan_sold']." |
".sprintf($lang['admin']['stats_percent_total'],$totalItemsSold[0]['totalProducts'])." |
\n";
for ($i=0; $i<$noResults; $i++){
$cellColor = cellColor($i);
$percentage = 100 * ($results[$i]['quan'] / $totalItemsSold[0]['totalProducts']);
$percentage = number_format($percentage, 2);
if ($percentage >= 1) {
$position = (($page*$rowsPerPage)+1)+$i;
$chartData[] = array($position,$percentage);
$keyStr .= "
| ".$position." |
".$results[$i]['name']." |
".$results[$i]['quan']." |
".$percentage."% |
\n";
}
}
$keyStr .= "
";
$imageNo++;
$filename = md5(CC_ROOT_DIR.$glob['license_key'].$imageNo).".png";
$graph = new PHPlot;
$graph->SetDataValues($chartData);
$graph->SetIsInline(true);
$graph->PHPlot(550,300,"cache".CC_DS.$filename);
$graph->SetPlotType("bars");
$graph->SetXLabelAngle("0");
$graph->skip_right_tick = TRUE;
$graph->SetNumXTicks(1);
$graph->SetTitle($lang['admin']['stats_product_pop_sales']." (".(($page*$rowsPerPage)+1)." - ".(($page*$rowsPerPage) + count($chartData)).")");
$graph->SetXTitle($lang['admin']['stats_product_name_key']);
$graph->SetYTitle($lang['admin']['stats_product_sales']);
$graph->DrawGraph();
//echo sprintf('