 boxAppuntamenti = function() {
 
    this.tpl = new Ext.XTemplate('<tpl for=".">',
                                '<b>Data: {Data}<br>',
                                '<tpl if = "Ora">',
                                    'Ore: {Ora} - </tpl>{Luogo}</b>',
                                '<br>{Appuntamento}<br>',
                                '</tpl>');
                  
    boxAppuntamenti.superclass.constructor.call(this, {
        header: false,
        border: false
    });
}

Ext.extend(boxAppuntamenti, Ext.Panel, {
    init: function() {
        Ext.Ajax.request({
            url: './php/getAppuntamenti.php',
            success: function(response, options)
            {
                data = eval(response.responseText);
                this.render('appuntamenti');
                this.tpl.overwrite(this.body, data);
            },
            scope: this
        });
    }
});
