<?php

include_once("_dirinfo.php");
include_once(PATH_TO_ROOT."init.php");
include_once(PATH_TO_ROOT."CRM/class/class.Language-Pack.php");
include_once (PATH_TO_ROOT."CRM/_CRM_config.php");
include_once (PATH_TO_ROOT."CRM/class/class.Permissions.php");

$LangPack = new LanguagePack($db, $aLanguage);
$gridName = "visitorStatisticGrid";
$filterName = "visitorStatisticFilter";
$tabName = "visitorStatisticTab";

$ajax = CRM_RPATH."_forms/visitStatistic/_ajax/ajax.statistic.php";	
$export = CRM_RPATH."_forms/visitStatistic/export.statistic.php";

$permissions = new Permissions($db);
include(CRM_RPATH."_plugins/Ext.ux.MultiSelectField.js");;
include("forms.statisticGrid.php");

?>

var <?php echo $tabName;?> = new Ext.Panel({
	id:'<?php echo $tabName;?>',
	title:'<?php echo $LangPack->GetLabel("CRM_delivery_panel", "visitor_statistics_tab_title","Visitor Statistika");?>',
	defaults:{split:true, bodyStyle: 'padding: 10px'},
	layout:'border',
	autoSroll: true,
	closable:true,
	items:[
		<?php echo $gridName;?>
	]
});
Ext.getCmp('mainTabPanel').add(<?php echo $tabName; ?>).show();
