<?php
/**
 * Created by PhpStorm.
 * User: Jure
 * Date: 8.5.2014
 * Time: 8:46
 */


include_once("_dirinfo.php");
include_once(PATH_TO_ROOT . "init.php");

$db->ChangeDatabase(DB_WARPIT_WEBCATI_BASE);



$tabId = "UniqueTabMainControlInterviewers" . $_POST['project_id'];

$controlInterviewerPanelId = "UniqueControlInterviewersId" . $_POST['project_id'];
$statisticInterviewerPanelId = "UniqueStatisticInterviewersId" . $_POST['project_id'];
$configControlPanelId = "UniqueConfigControlPanelId" . $_POST['project_id'];

include('forms.control_interviewers.php');
include('forms.statistic_interviewers.php');
include('forms.config_control.php');

?>

    var <?php echo $tabId; ?> =
    new Ext.Panel({
        id: '<?php echo $tabId; ?>',
        title: '<?php echo $_POST['project_text']; ?>',
        iconCls: 'icon_userspool_query',
        defaults: {split: true, border: false},
        layout: 'border',
        border: false,
        closable: true,
        items: [
            {
                region: 'west',
                id: '<?php echo $statisticInterviewerPanelId; ?>',
                xtype: 'panel',
                collapsible:true,
                collapsed: true,
                width: '320',

                layout: 'fit',
                flex: 1,
                items: [<?php echo $tabIdInterviewerStatistic; ?>]
            },
            {
                xtype: 'panel',
                id: '<?php echo $controlInterviewerPanelId; ?>',
                region: 'center',
                closable: true,
                layout: 'fit',
                flex: 1,
                items: <?php echo $tabIdInterviewerControl; ?>
            },
            {
            region: 'east',
            id: '<?php echo $configControlPanelId; ?>',
            xtype: 'panel',
            collapsible:true,
            collapsed: true,
            width: '320',

            layout: 'fit',
            flex: 1,
            items: <?php echo $tabIdConfigControl; ?>
            }
        ]});
    mainTabPanel.add(<?php echo $tabId; ?>).show();

