$this->resultPunto("dojo.debug('MODULE: EVENT_MENUTREE_SELECT WIDGETID: ".$PARAM[0]." FATHER: ".$PARAM[1]." TARGET: ".$PARAM[2]." NAME: ".$PARAM[3]."  ACTION: ".$PARAM[4]." ');");
// distruggere FP se esiste
// prendere il nome della finestra
$thisParentId = $PARAM[0];
$thisFather = $PARAM[1];
$thisTarget = $PARAM[2];
$thisName = $PARAM[3];
$thisAction = $PARAM[4];
switch ($thisTarget )
{
case "GUI":
	$nameFP="Interfaccia grafica";
break;
case "DATA":
	switch ($thisName )
	{
	case "CLIENT":
		$nameFP="Clienti";
	break;
	case "USER":
		$nameFP="Utenti";
	break;
	case "PERSONAL":
		$nameFP="Personale";
	break;
	case "SPEC":
		$nameFP="Categorie di specialita";
	break;
	case "SPECSPEC":
		$nameFP="Specialita";
	break;
	case "ROOM":
		$nameFP="Stanze";
	break;
	case "PERSONAL":
		$nameFP="Personale";
	break;
	case "PERIOD":
		$nameFP="Durata appuntamento";
	break;
	case "TIME_DAY":
		$nameFP="Fasce orarie";
	break;
	}
break;
case "DATA_VALIDATE":
		$nameFP="Dati obbligatori";
		switch ($thisName)
		{
		case "CLIENT":
		case "CLIENT_APP":
			$nameFP.=" per cliente";
		break;
		case "USER":
			$nameFP.=" per utente";
		break;
		case "PERSONAL":
			$nameFP.=" per personale";
		break;
		}
	break;
}

//$this->resultPunto("if (dojo.widget.byId('WIDAID11FPCONFIG')) dojo.widget.byId('WIDAID11FPCONFIG').destroy();");
//$this->resultPunto("if (dojo.widget.byId('WIDAID11CPCONFIGINT')) dojo.widget.byId('WIDAID11CPCONFIGINT').destroy();");
// creare FP
//$this->resultPunto("if (Ext.getCmp('IDAID11DIVCONFIG')) Ext.getCmp('IDAID11DIVCONFIG').destroy();");
$this->resultPunto("if (!Ext.getCmp('IDAID11DIVCONFIG')) Ext.getCmp('MAIN_TP').add({id:'IDAID11DIVCONFIG',title: 'Configurazione',iconCls: 'tabs',html: '',closable:true}).show();");


//Ext.state.Manager.setProvider(new Ext.state.CookieProvider());var viewport = new Ext.Viewport({layout:'border',items:[new Ext.BoxComponent({ region:'north',el: 'MAIN_NORTH',height:32}),{region:'south',contentEl: 'MAIN_SOUTH',split:true,height: 100,minSize: 100,maxSize: 200,collapsible: true,title:'South',margins:'0 0 0 0'}, {region:'east',title: 'Anagrafica',collapsible: true,split:true,width: 225,minSize: 175,maxSize: 400,layout:'fit',margins:'0 5 0 0',items:new Ext.TabPanel({border:false,activeTab:1,tabPosition:'bottom',items:[{html:'<p>A TabPanel component can be a region.</p>',title: 'A Tab',autoScroll:true},new Ext.grid.PropertyGrid({title: 'Proprieta',closable: true,source: {'(name)': 'Properties Grid','grouping': false,'autoFitColumns': true,'productionQuality': false,'created': new Date(Date.parse('10/15/2006')),'tested': false,'version': .01,'borderWidth': 1}})]})},{region:'west',id:'west-panel',title:'Promemoria',split:true,width: 320,minSize: 175,maxSize: 400,collapsible: true,margins:'0 0 0 5',layout:'accordion',layoutConfig:{animate:true},items: [{contentEl: 'MAIN_WEST',title:'Organizer',border:false,iconCls:'nav'}]},new Ext.TabPanel({id:'MAIN_TP',region:'center',deferredRender:false,activeTab:0,items:[{contentEl:'MAIN_CENTER1',html:'<br/><br/><br/><table align=center border=0 width=70%><tr><td><h2>Benvenuto.</h2><br/><p><font size=4 color=#376CAD>G</font><b>estione appuntamenti On Line</b> &egrave; un gestionale on-line che permette ...</p></td></tr></table>',title: 'Benvenuto',closable:true,autoScroll:true},{contentEl:'IDAID11DIVCALENDAR',html:'',title: 'Calendario',closable:false,autoScroll:true}]})]});

//$this->resultPunto("var AID11DIVCONFIG = document.createElement('div');");
$this->resultPunto("var AID11DIVCONFIG = $('IDAID11DIVCONFIG');");
//$this->resultPunto("AID11DIVCONFIG.id='IDAID11DIVCONFIG';");
//$this->resultPunto("AID11DIVCONFIG.setAttribute('id','IDAID11DIVCONFIG');");
//$this->resultPunto("AID11DIVCONFIG.style['width']='640px';");
//$this->resultPunto("AID11DIVCONFIG.style['height']='600px';");
//$this->resultPunto("AID11DIVCONFIG.style['left']='340px';");
//$this->resultPunto("AID11DIVCONFIG.style['top']='10px';");
//$this->resultPunto("AID11DIVCONFIG.style['id']='IDAID11DIVCONFIG';");
//$this->resultPunto("document.getElementById('DIVAID11BIDKERNEL').appendChild(AID11DIVCONFIG);");
$this->resultPunto("var AID11FPCONFIG = dojo.widget.createWidget('ContentPane',{id:'IDAID11FPCONFIG', widgetId:'WIDAID11FPCONFIG'},AID11DIVCONFIG);");
$this->resultPunto("AID11FPCONFIG.setContent(\\\"<div dojoType='ContentPane' id='IDAID11CPCONFIGINT' widgetId='WIDAID11CPCONFIGINT'></div>\\\");");
// mysql collegamento
$mysql11 = new Mysql();
$mysql11 ->Database='AID11';
$mysql11 ->connect();

switch ($thisFather)
{
case "CONFIG": // menu config
	switch ($thisTarget)
	{
	case "GUI":
			$tmpContent="<table style='border:0px;' border='0'>";
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"\\\");");
			$mysql11 = new Mysql();
			$mysql11 ->Database='AID11';
			$mysql11 ->connect();
			$resMysql11 = $mysql11 ->query("SELECT * FROM  OS_DATA_CONFIG");
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$tmpContent.="<tr><td>FOTO per il personale</td><td><input type='checkbox' name='IMG_PERSONAL' id='IMG_PERSONAL' ";
				if ($linea11['IMG_PERSONAL'] == 1)
					$tmpContent.="CHECKED ";
				$tmpContent.="/></td></tr>";
				$tmpContent.="<tr><td>FOTO per le stanze</td><td><input type='checkbox' name='IMG_ROOM' id='IMG_ROOM' ";
				if ($linea11['IMG_ROOM'] == 1)
					$tmpContent.="CHECKED ";
				$tmpContent.="/></td></tr>";


				$tmpContent.="<tr><td>MENU per trattamento</td><td><SELECT name='TYPE_SPEC_MENU' id='TYPE_SPEC_MENU'><option value='TREE' ";
				if ($linea11['TYPE_SPEC_MENU'] == "TREE")
					$tmpContent.="SELECTED ";
				$tmpContent.=">ALBERO</option><option value='BUTTON' ";
				if ($linea11['TYPE_SPEC_MENU'] == "BUTTON")
					$tmpContent.="SELECTED ";
				$tmpContent.=">TASTI</option></select></td></tr>";
			}
			mysql_free_result($resMysql11);	
			$tmpContent.="<tr><td colspan='2'><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','WIDAID11CPCONFIGINT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":ACTION_VALIDATE')\\\\\\\">Salva</button></td></tr></table>";
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"".$tmpContent."\\\");");
	break;
	case "DATA":
		switch ($thisName)
		{
		case "EXT":
		case "INT":
		case "SYSTEM":
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"In stadi di sviluppo\\\");");
		break;
		case "PRIMANOTA":
			// GroupSummary.js
			$this->resultPunto("Ext.grid.GroupSummary = function(config){Ext.apply(this, config);};Ext.extend(Ext.grid.GroupSummary, Ext.util.Observable, {init : function(grid){this.grid = grid;this.cm = grid.getColumnModel();this.view = grid.getView();var v = this.view;v.doGroupEnd = this.doGroupEnd.createDelegate(this);v.afterMethod('onColumnWidthUpdated', this.doWidth, this);v.afterMethod('onAllColumnWidthsUpdated', this.doAllWidths, this);v.afterMethod('onColumnHiddenUpdated', this.doHidden, this);v.afterMethod('onUpdate', this.doUpdate, this);v.afterMethod('onRemove', this.doRemove, this);if(!this.rowTpl){this.rowTpl = new Ext.Template(\\\"<div class='x-grid3-summary-row' style='{tstyle}'>\\\",\\\"<table class='x-grid3-summary-table' border='0' cellspacing='0' cellpadding='0' style='{tstyle}'>\\\",'<tbody><tr>{cells}</tr>','</table></div>');this.rowTpl.disableFormats = true;}this.rowTpl.compile();if(!this.cellTpl){this.cellTpl = new Ext.Template(\\\"<td class='x-grid3-col x-grid3-cell x-grid3-td-{id} {css}' style='{style}'>\\\",\\\"<div class='x-grid3-cell-inner x-grid3-col-{id}' unselectable='on'>{value}</div>\\\",\\\"</td>\\\");this.cellTpl.disableFormats = true;}this.cellTpl.compile();},toggleSummaries : function(visible){var el = this.grid.getGridEl();if(el){if(visible === undefined){visible = el.hasClass('x-grid-hide-summary');}el[visible ? 'removeClass' : 'addClass']('x-grid-hide-summary');}},renderSummary : function(o, cs){cs = cs || this.view.getColumnData();var cfg = this.cm.config;var buf = [], c, p = {}, cf, last = cs.length-1;for(var i = 0, len = cs.length; i < len; i++){c = cs[i];cf = cfg[i];p.id = c.id;p.style = c.style;p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');if(cf.summaryType || cf.summaryRenderer){p.value = (cf.summaryRenderer || c.renderer)(o.data[c.name], p, o);}else{p.value = '';}if(p.value == undefined || p.value === \\\"\\\") p.value = \\\"&#160;\\\";buf[buf.length] = this.cellTpl.apply(p);}return this.rowTpl.apply({tstyle: 'width:'+this.view.getTotalWidth()+';',cells: buf.join('')});},calculate : function(rs, cs){var data = {}, r, c, cfg = this.cm.config, cf;for(var j = 0, jlen = rs.length; j < jlen; j++){r = rs[j];for(var i = 0, len = cs.length; i < len; i++){c = cs[i];cf = cfg[i];if(cf.summaryType){data[c.name] = Ext.grid.GroupSummary.Calculations[cf.summaryType](data[c.name] || 0, r, c.name, data);}}}return data;},doGroupEnd : function(buf, g, cs, ds, colCount){var data = this.calculate(g.rs, cs);buf.push('</div>', this.renderSummary({data: data}, cs), '</div>');},doWidth : function(col, w, tw){var gs = this.view.getGroups(), s;for(var i = 0, len = gs.length; i < len; i++){s = gs[i].childNodes[2];s.style.width = tw;s.firstChild.style.width = tw;s.firstChild.rows[0].childNodes[col].style.width = w;}},doAllWidths : function(ws, tw){var gs = this.view.getGroups(), s, cells, wlen = ws.length;for(var i = 0, len = gs.length; i < len; i++){s = gs[i].childNodes[2];s.style.width = tw;s.firstChild.style.width = tw;cells = s.firstChild.rows[0].childNodes;for(var j = 0; j < wlen; j++){cells[j].style.width = ws[j];}}},doHidden : function(col, hidden, tw){var gs = this.view.getGroups(), s, display = hidden ? 'none' : '';for(var i = 0, len = gs.length; i < len; i++){s = gs[i].childNodes[2];s.style.width = tw;s.firstChild.style.width = tw;s.firstChild.rows[0].childNodes[col].style.display = display;}},refreshSummary : function(groupValue){return this.refreshSummaryById(this.view.getGroupId(groupValue));},getSummaryNode : function(gid){var g = Ext.fly(gid, '_gsummary');if(g){return g.down('.x-grid3-summary-row', true);}return null;},refreshSummaryById : function(gid){var g = document.getElementById(gid);if(!g){return false;}var rs = [];this.grid.store.each(function(r){if(r._groupId == gid){rs[rs.length] = r;}});var cs = this.view.getColumnData();var data = this.calculate(rs, cs);var markup = this.renderSummary({data: data}, cs);var existing = this.getSummaryNode(gid);if(existing){g.removeChild(existing);}Ext.DomHelper.append(g, markup);return true;},doUpdate : function(ds, record){this.refreshSummaryById(record._groupId);},doRemove : function(ds, record, index, isUpdate){if(!isUpdate){this.refreshSummaryById(record._groupId);}},showSummaryMsg : function(groupValue, msg){var gid = this.view.getGroupId(groupValue);var node = this.getSummaryNode(gid);if(node){node.innerHTML = \\\"<div class='x-grid3-summary-msg'>\\\" + msg + '</div>';}}});");
			$this->resultPunto("Ext.grid.GroupSummary.Calculations = {'sum' : function(v, record, field){return v + (record.data[field]||0);},'count' : function(v, record, field, data){return data[field+'count'] ? ++data[field+'count'] : (data[field+'count'] = 1);},'max' : function(v, record, field, data){var v = record.data[field];var max = data[field+'max'] === undefined ? (data[field+'max'] = v) : data[field+'max'];return v > max ? (data[field+'max'] = v) : max;},'min' : function(v, record, field, data){var v = record.data[field];var min = data[field+'min'] === undefined ? (data[field+'min'] = v) : data[field+'min'];return v < min ? (data[field+'min'] = v) : min;},'average' : function(v, record, field, data){var c = data[field+'count'] ? ++data[field+'count'] : (data[field+'count'] = 1);var t = (data[field+'total'] = ((data[field+'total']||0) + (record.data[field]||0)));return t === 0 ? 0 : t / c;}};Ext.grid.HybridSummary = Ext.extend(Ext.grid.GroupSummary, {calculate : function(rs, cs){var gcol = this.view.getGroupField();var gvalue = rs[0].data[gcol];var gdata = this.getSummaryData(gvalue);return gdata || Ext.grid.HybridSummary.superclass.calculate.call(this, rs, cs);},updateSummaryData : function(groupValue, data, skipRefresh){var json = this.grid.store.reader.jsonData;if(!json.summaryData){json.summaryData = {};}json.summaryData[groupValue] = data;if(!skipRefresh){this.refreshSummary(groupValue);}},getSummaryData : function(groupValue){var json = this.grid.store.reader.jsonData;if(json && json.summaryData){return json.summaryData[groupValue];}return null;}});");
			// aggiungere dati
			

			$resMysql11 = $mysql11 ->query("SELECT OS_DATA_APP.DATE AS DATE,OS_DATA_CLIENT.NAME AS CLIENT_NAME,OS_DATA_SPECSPEC.NAME AS SPECSPEC_NAME,OS_DATA_SPECSPEC.PRICE AS SPECSPEC_PRICE,OS_DATA_SPECSPEC.ID AS SPECSPEC_ID,OS_DATA_PERSONAL.NAME AS PERSONAL_NAME,OS_DATA_ROOM.NAME AS ROOM_NAME FROM  OS_DATA_SPECSPEC,OS_DATA_APP,OS_DATA_PERSONAL,OS_DATA_CLIENT,OS_DATA_ROOM WHERE OS_DATA_APP.PERSONAL=OS_DATA_PERSONAL.ID AND OS_DATA_APP.SPECSPEC=OS_DATA_SPECSPEC.ID AND OS_DATA_APP.CLIENT=OS_DATA_CLIENT.ID AND OS_DATA_ROOM.ID=OS_DATA_APP.ROOM");
			$tmpContent_dummyProjects="";
			$tmpContent_dummyData="";
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				if ($tmpContent_dummyProjects=='')
					$tmpContent_dummyProjects="Ext.grid.dummyProjects = [";
				else
					$tmpContent_dummyProjects.=",";
				$tmpContent_dummyProjects.="{projectId: ".$linea11['SPECSPEC_ID'].", project: '".$linea11['SPECSPEC_NAME']."'}";
				
				if ($tmpContent_dummyData=='')
					$tmpContent_dummyData="Ext.grid.dummyData = [";
				else
					$tmpContent_dummyData.=",";
				$tmpContent_dummyData.="{projectId: ".$linea11['SPECSPEC_ID'].", project: '".$linea11['SPECSPEC_NAME']."', client: '".$linea11['CLIENT_NAME']." ".$linea11['CLIENT_SECONDNAME']."', personal: '".$linea11['PERSONAL_NAME']."', taskId: 112, description: '".$linea11['ROOM_NAME']."', estimate: 1, rate: ".$linea11['SPECSPEC_PRICE'].", due:'".$linea11['DATE']."'}";
			}
			mysql_free_result($resMysql11);	
			$tmpContent_dummyProjects.="];";
			$tmpContent_dummyData.="];";
			
			$this->resultPunto($tmpContent_dummyProjects);

			$this->resultPunto($tmpContent_dummyData);
			$this->resultPunto("Ext.QuickTips.init();var xg = Ext.grid;var reader = new Ext.data.JsonReader({idProperty:'taskId',fields: [{name: 'projectId', type: 'int'},{name: 'project', type: 'string'},{name: 'client', type: 'string'},{name: 'personal', type: 'string'},{name: 'taskId', type: 'int'},{name: 'description', type: 'string'},{name: 'estimate', type: 'float'},{name: 'rate', type: 'float'},{name: 'cost', type: 'float'},{name: 'due', type: 'date', dateFormat:'Y-m-d'}]});Ext.grid.GroupSummary.Calculations['totalCost'] = function(v, record, field){return v + (record.data.estimate * record.data.rate);};var summary = new Ext.grid.GroupSummary(); var grid = new xg.EditorGridPanel({tbar:[{text:'OGGI'},{xtype:'datefield',displayField:'state',typeAhead: true,mode: 'local',triggerAction: 'all',emptyText:'Da..',selectOnFocus:true,width:135},{xtype:'datefield',displayField:'state',typeAhead: true,mode: 'local',triggerAction: 'all',emptyText:'A..',selectOnFocus:true,width:135},{text:'PERIODO'},{xtype:'combo',displayField:'state',typeAhead: true,mode: 'local',triggerAction: 'all',emptyText:'Scegli cliente...',selectOnFocus:true,width:135}],ds: new Ext.data.GroupingStore({reader: reader,data: xg.dummyData,sortInfo:{field: 'due', direction: 'ASC'},groupField:'project'}),columns: [{id: 'description',header: 'Task',width: 40,sortable: true,dataIndex: 'description',summaryType: 'count',hideable: false,summaryRenderer: function(v, params, data){return ((v === 0 || v > 1) ? '(' + v +' Trattamenti)' : '(1 Trattamento)');},editor: new Ext.form.TextField({allowBlank: false})},{header: 'Trattamento',width: 20,sortable: true,dataIndex: 'project'},{header: 'Cliente',width: 20,sortable: true,dataIndex: 'client'},{header: 'Personale',width: 20,sortable: true,dataIndex: 'personal'},{header: 'Data',width: 25,sortable: true,dataIndex: 'due',summaryType:'max',renderer: Ext.util.Format.dateRenderer('d-m-Y'),editor: new Ext.form.DateField({format: 'd-m-Y'})},{header: 'Durata',width: 20,sortable: true,dataIndex: 'estimate',summaryType:'sum',renderer : function(v){return v +' ore';},editor: new Ext.form.NumberField({allowBlank: false,allowNegative: false,style: 'text-align:left'})},{header: 'Prezzo',width: 20,sortable: true,renderer: Ext.util.Format.euMoney,dataIndex: 'rate',summaryType:'average',editor: new Ext.form.NumberField({allowBlank: false,allowNegative: false,style: 'text-align:left'})},{id: 'cost',header: 'Costo',width: 20,sortable: false,groupable: false,renderer: function(v, params, record){return Ext.util.Format.euMoney(record.data.estimate * record.data.rate);},dataIndex: 'cost',summaryType:'totalCost',summaryRenderer: Ext.util.Format.euMoney}],view: new Ext.grid.GroupingView({forceFit:true,showGroupName: false,enableNoGroups:false, hideGroupedColumn: true}),plugins: summary,frame:true,height: 600,clicksToEdit: 1,collapsible: true,animCollapse: false,trackMouseOver: false,iconCls: 'icon-grid',renderTo: 'IDAID11CPCONFIGINT'});");
			//$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"asdf\\\");");//die();

		break;
		case "CLIENT":
		case "USER":
		case "PERSONAL":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N' onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\" width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='NAME' dataType='String' align='center' valign='top'>NOME</th><th field='SECONDNAME' dataType='String' align='center' valign='top'>COGNOME</th><th field='TEL' dataType='String' align='center' valign='top'>TELEFONO</th><th field='CEL' dataType='String' align='center' valign='top'>CELLULARE</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query("SELECT * FROM  OS_DATA_".$thisName);
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",NAME:'".$linea11['NAME']."',SECONDNAME:'".$linea11['SECONDNAME']."',TEL:'".$linea11['TEL']."',CEL:'".$linea11['CEL']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		case "SPEC":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N'  onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\"  width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='NAME' dataType='String' align='center' valign='top'>SPECIALITA</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query('SELECT * FROM OS_DATA_SPEC ORDER BY ID');
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",NAME:'".$linea11['NAME']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		case "SPECSPEC":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N'  onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\"  width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='SPEC' dataType='String' align='center' valign='top'>CATEGORIA</th><th field='NAME' dataType='String' align='center' valign='top'>SPECIALITA</th><th field='PERIOD' dataType='String' align='center' valign='top'>DURATA TRATTAMENTO</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query('SELECT OS_DATA_SPECSPEC.ID AS ID,OS_DATA_SPECSPEC.NAME AS NAME,OS_DATA_SPEC.NAME AS SPEC,OS_DATA_PERIOD.NAME as PERIOD  FROM OS_DATA_SPECSPEC,OS_DATA_SPEC,OS_DATA_PERIOD WHERE OS_DATA_SPECSPEC.SPEC=OS_DATA_SPEC.ID AND OS_DATA_SPECSPEC.PERIOD=OS_DATA_PERIOD.ID ORDER BY ID');
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",SPEC:'".$linea11['SPEC']."',NAME:'".$linea11['NAME']."',PERIOD:'".$linea11['PERIOD']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		case "PERIOD":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N'  onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\"  width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='NAME' dataType='String' align='center' valign='top'>SPECIALITA</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query('SELECT * FROM OS_DATA_PERIOD ORDER BY ID');
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",NAME:'".$linea11['NAME']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		case "TIME_DAY":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N'  onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\"  width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='NAME' dataType='String' align='center' valign='top'>NOME</th><th field='AMBEGIN' dataType='String' align='center' valign='top'>MATINA DALLE</th><th field='AMEND' dataType='String' align='center' valign='top'>MATINA ALLE</th><th field='PMBEGIN' dataType='String' align='center' valign='top'>POMERIGGIO DALLE</th><th field='PMEND' dataType='String' align='center' valign='top'>POMERIGGIO ALLE</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query('SELECT ID,NAME,LEFT(AMBEGIN,5) AS AMBEGIN,LEFT(AMEND,5) AS AMEND,LEFT(PMBEGIN,5) AS PMBEGIN,LEFT(PMEND,5) AS PMEND FROM OS_DATA_TIME_DAY ORDER BY ID');
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",NAME:'".$linea11['NAME']."',AMBEGIN:'".$linea11['AMBEGIN']."',AMEND:'".$linea11['AMEND']."',PMBEGIN:'".$linea11['PMBEGIN']."',PMEND:'".$linea11['PMEND']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		case "ROOM":
			// splitcontainer
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"<div dojoType='SplitContainer' orientation='vertical' sizerWidth='3' activeSizing='false' style='border: 2px solid black; float: left; margin-right: 0px;  width: 100%; height: 100%;'><div  dojoType='ContentPane'  style='height:100%; font-size:0.9em; overflow:auto;' sizeMin='10' sizeShare='50' widgetId='CPCONFIGLIST'></div><div id='divorari' widgetId='AID11CPCONFIGEDIT' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>\\\");");
			// button
			$this->resultPunto("dojo.widget.byId('AID11CPCONFIGEDIT').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");

			$this->resultPunto("dojo.widget.byId('CPCONFIGLIST').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N' width='100%' widgetId='FTCONFIGLIST' multiple='false' alternateRows='true' maxSortable='2' cellpadding='0' cellspacing='0' border='0'  onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLIST').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:CONFIG:DATA:$thisName:FT_CLICK:'+idSelect)\\\\\\\"  ><thead><tr><th field='N' dataType='number' valign='top'  sort='asc'>N</th><th field='NAME' dataType='String' align='center' valign='top'>NOME</th></tr></thead><tbody></tbody></table>\\\");");
			$resMysql11 = $mysql11 ->query('SELECT * FROM OS_DATA_ROOM ORDER BY ID');
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$linea11['ID'].",NAME:'".$linea11['NAME']."'});");
			}
			mysql_free_result($resMysql11);	
		break;
		}
	break;
	case "DATA_VALIDATE":
		switch ($thisName)
		{
		case "ALL":
	
		break;
		case "CLIENT":
		case "CLIENT_APP":
		case "USER":
		case "PERSONAL":
			$tmpContent="<table style='border:0px;' border='0'>";
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"\\\");");
			// prendere nome del colonna
			$mysql10 = new Mysql();
			$mysql10 ->Database='AID11';
			$mysql10 ->connect();
			$resMysql10 = $mysql10 ->query("SELECT * FROM  OS_DATA_".$thisName."_VALIDATE");
			$linea10 = mysql_fetch_array($resMysql10, MYSQL_ASSOC);
			mysql_free_result($resMysql10);
			$mysql11 = new Mysql();
			$mysql11 ->Database='AID11';
			$mysql11 ->connect();
			$resMysql11 = $mysql11 ->query("SELECT * FROM  OS_DATA_CLIENT_DATA WHERE ".$thisName."=1 ORDER BY ID");
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				$tmpContent.="<tr><td><input type='checkbox' name='CB".$linea11['NAME']."' id='CB".$linea11['NAME']."' ";
				if ($linea10[$linea11['NAME']] == 1)
					$tmpContent.="CHECKED ";
				$tmpContent.="/></td><td>".$linea11['DESC']."</td></tr>";
			}
			mysql_free_result($resMysql11);	
			$tmpContent.="<tr><td colspan='2'><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','WIDAID11CPCONFIGINT:".$PARAM[1].":".$PARAM[2].":".$PARAM[3].":ACTION_VALIDATE')\\\\\\\">Salva</button></td></tr></table>";
			$this->resultPunto("dojo.widget.byId('WIDAID11CPCONFIGINT').setContent(\\\"".$tmpContent."\\\");");
		break;
		}
	break;
	}
break;
}
