<?php
include_once("_dirinfo.php");
include_once(PATH_TO_ROOT."init.php");
include_once(PATH_TO_ROOT."CRM/class/class.checkString.php");

	
$db->ChangeDatabase(DB_WARPIT_WEBCATI_BASE);

$tabId = StringChecker::Check($_POST['uniqueTabId']);

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

$LangPack = new LanguagePack($db, $aLanguage);

$filterName = "FilterTabPanel";
$gridName = "LoggerGrid";

$ajax = "CRM/_forms/logger/_ajax/ajax.logger.php";
$title = $LangPack->GetLabel("CRM_logger_panel", "tab_title","Logger");
?>
var loggerPageLimit = 50;
var loggerStore = new Ext.data.Store({
	url: '<?php echo $ajax;?>',
	baseParams:{
		action: 'get',
		start: 0,
		limit: loggerPageLimit
	},
	reader: new Ext.data.JsonReader({		
			root:'rows',
			totalProperty : "results"
		},
		new Ext.data.Record.create([
			{ name:"id", type: 'id'},
		 	{ name:"Added", type: 'string' },
		 	{ name:"OldValue", type: 'string' },
		 	{ name:"NewValue", type: 'string' },
		 	{ name:"area", type: 'string' },
		 	{ name:"ChangeType", type: 'string' },
		 	{ name:"EditedField", type: 'string' },
		 	{ name:"EditedTable", type: 'string' },
		 	{ name:"UserId", type: 'string' },
		 	{ name:"fileName", type: 'string' },
		 	{ name:"POST", type: 'string' },
		 	{ name:"GET", type: 'string' },
		 	{ name:"SESSION", type: 'string'}
		])
	)
});
<?php
include('forms.filterTabPanel.php');
include('forms.loggerGrid.php');
?>
var <?php echo $tabId;?> = new Ext.Panel({
	id:'<?php echo $tabId;?>',
	title:'<?php echo $title;?>',
	defaults:{split:true,border:false},
	layout:'border',
	border: false,
	closable:true,
	items:[
	{
		layout:'fit',
		region:'west',
		items:[ <?php echo $filterName;?> ],
		width:300
	},
	new Ext.Panel({
		layout:'fit',
		border: false,
		region:'center',
		items:[ <?php echo $gridName;?> ]
	})
	]
});
Ext.getCmp('mainTabPanel').add(<?php echo $tabId;?>).show();