<?php
include_once "../../../../tools/inc.php";
$page = include("../../../common.php");
$n_id=intval($n_id);

$graph_list=array();
$graph_list['subscribers']=array(
	'SUBSCRIBES'	=> array (
				'title'		=> '{rs:LEGEND_SUBSCRIBES}',
				'color'		=> '#FF8A00',

			),
	'UNSUBSCRIBES'	=> array (
				'title'		=> '{rs:LEGEND_UNSUBSCRIBES}',
				'color'		=> '#8080FF',

			),
);
$graph_list['sent']=array(
	'SEND'	=> array (
				'title'		=> '{rs:LEGEND_SENT}',
				'color'		=> '#FF8A00',

			),
	'UNDELIVERED'	=> array (
				'title'		=> '{rs:LEGEND_UNDELIVERED}',
				'color'		=> '#8080FF',

			),
);
$graph_list['click']=array(
	'CLICK'	=> array (
				'title'		=> '{rs:LEGEND_CLICK}',
				'color'		=> '#FF8A00',

			),
);
$graph_source=(isset($graph_list[$graph_source]) ? $graph_source : 'subscribers');

$db->close();
$page=new Template('templates/statistics/charts/amstock/settings.tpl');
$page->dictionary("common/dict.ru");
$i=0;
foreach($graph_list[$graph_source] as $key => $graph) {
	$graph['id']=$i;
	$graph['name']=$key;
	$graph['width']=3;
	$page->addrow('GRAPH', $graph);
	$i++;
}
$page->assign(array(
	'title'		=> '',
	'short'		=> '',
	'dataUrl'	=> "topChartData.php?n_id={$n_id}&graph_source={$graph_source}",
	'scrollerData'	=> key($graph_list[$graph_source]),
));
header('Content-type: text-xml');
print $page->evaluate(false);
?>