$this->resultPunto("dojo.debug('MODULE: EVENT_BUTTON_CLICK WIDGETID: ".$PARAM[0]." FATHER: ".$PARAM[1]." TARGET: ".$PARAM[2]." NAME: ".$PARAM[3]." ACTION: ".$PARAM[4]." param5 ".$PARAM[5]."');");
// prendere parametri
$thisWidgetId = $PARAM[0];
$thisFather = $PARAM[1];
$thisTarget = $PARAM[2];
$thisName = $PARAM[3];
$thisAction = $PARAM[4];

// impostare content
switch ($thisFather)
{
case "APP":
	// appuntamento 
	switch ($thisAction)
	{
	case "ACTION_VALIDATE":
		// controlli necessari
		// prendere dati di validate
		$this->resultPunto("var tmpContent='$thisWidgetId:$thisFather:$thisTarget:$thisName:SAVE_VALIDATE:';");
		//$exist=0;
		// trovare la durata
		$this->resultPunto("var durataSplit=arrayData['AIP'][11]['DATA']['PERIOD']['NAME'][arrayData['AIP'][11]['DATA']['SPECSPEC']['PERIOD'][dojo.byId('APPSPECSPEC').value]].split(':');var IPTPSplit=dojo.byId('IPTP').value.split(':');var IPTPEndHour=IPTPSplit[0]*1+durataSplit[0]*1;var IPTPEndMin=IPTPSplit[1]*1+durataSplit[1]*1;if (IPTPEndMin>=60) {IPTPEndMin=IPTPEndMin-60;IPTPEndHour=IPTPEndHour+1;} var IPTPEnd=(IPTPSplit[0]*1+durataSplit[0]*1)+':'+(IPTPSplit[1]*1+durataSplit[1]*1);");
		$this->resultPunto("tmpContent+=dojo.widget.byId('APPSELCLIENT').getState().value+':'+dojo.byId('APPSPEC').value+':'+dojo.byId('APPSPECSPEC').value+':'+dojo.byId('APPPERSONAL').value+':'+dojo.byId('APPROOM').value+':'+dojo.byId('IPDP').value+':'+dojo.byId('IPTP').value+':'+IPTPEnd+':".$PARAM[5]."';");
		if ($PARAM[5]==3 || $PARAM[5]==4)
			$this->resultPunto("tmpContent+=':".$PARAM[6]."';");
		$this->resultPunto("dojo.debug('validate ".$PARAM[6]."');furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP',tmpContent);");
	break;
	case "SAVE_VALIDATE":
		$thisClient=$PARAM[5];
		$thisSpec=$PARAM[6];
		$thisSpecSpec=$PARAM[7];
		$thisPersonal=$PARAM[8];
		$thisRoom=$PARAM[9];
		$thisCalDate=$PARAM[10];
		$thisDateTmp=split("-",$PARAM[10]);
		$thisDate=$thisDateTmp[2]."-".$thisDateTmp[1]."-".$thisDateTmp[0];
		$thisTimeBegin=$PARAM[11].":".$PARAM[12];
		$thisTimeEnd=$PARAM[13].":".$PARAM[14];
		$status=$PARAM[15];
		if ($status==3 || $status==4)
			$id=$PARAM[16];
		$this->resultPunto("dojo.debug('ID APP: $id STATUS $status');");	
		//$this->resultPunto("dojo.debug('qwerty $thisClient $thisSpec $thisSpecSpec $thisPersonal $thisRoom $thisDate $thisTimeBegin $thisTimeEnd            ');");
		// verificare se e' disponibile l'orario e tutto il resto
		// aggiungere dati nella DB
		$mysql12 = new Mysql();
		$mysql12 ->Database='AID11';
		$mysql12 ->connect();
		switch ($status)
		{
		case 1: // aggiungere lo appuntamento da confermare
		case 2: // aggiungere lo appuntamento confermato
			$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_APP (CLIENT,SPEC,SPECSPEC,PERSONAL,ROOM,DATE,TIME_BEGIN,TIME_END,DATE_GET,STATUS) VALUES ($thisClient, $thisSpec, $thisSpecSpec, $thisPersonal, $thisRoom, '$thisDate', '$thisTimeBegin', '$thisTimeEnd',NOW(),$status)");
			$id=mysql_insert_id();
			$resMysql12 = $mysql12 -> query("SELECT ID,DATE_FORMAT(DATE,'%d-%m-%Y') AS DATE,CLIENT,SPEC,SPECSPEC,PERSONAL,ROOM,LEFT(TIME_BEGIN,5) AS TIME_BEGIN,LEFT(TIME_END,5) AS TIME_END,STATUS FROM OS_DATA_APP where ID=$id");
			while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
			{	
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]) arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."] = new Array();");
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']) arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'] = new Array();");
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]) arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."] = new Array();");
				$this->resultPunto("arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]['TIME_BEGIN'] = '".$linea12['TIME_BEGIN']."';");
				$this->resultPunto("arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]['TIME_END'] = '".$linea12['TIME_END']."';");
				$this->resultPunto("arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]['STATUS'] = ".$linea12['STATUS'].";");
				// visualizzazione
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."])arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."] = new Array();");
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'])arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']= new Array();");
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID'])arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID']= new Array();");
				$this->resultPunto("if (!arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME'])arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME']= new Array();");
				$this->resultPunto("if (arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID'].length==0) {arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID'][0]=".$linea12['ID'].";arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME'][0]='".$linea12['TIME_BEGIN']."';} else{var count=0;var put=0; for (var i in arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID']) {count++;if (arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME'][i]>'".$linea12['TIME_BEGIN']."') {arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID'].splice(i,0,".$linea12['ID'].");arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME'].splice(i,0,'".$linea12['TIME_BEGIN']."');put=1;break;}}if (put==0){arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['ID'][count]=".$linea12['ID'].";arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$linea12['PERSONAL']."]['".$linea12['DATE']."']['TIME'][count]='".$linea12['TIME_BEGIN']."';}}");
			}
			mysql_free_result($mysql12->Query_ID);
		break;
		case 3: // confermare lo appuntamento non confermato
			$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_APP SET STATUS=2,DATE_CONFIRM=NOW() WHERE ID=".$id);
			$resMysql12 = $mysql12 -> query("SELECT ID,DATE_FORMAT(DATE,'%d-%m-%Y') AS DATE,CLIENT,SPEC,SPECSPEC,PERSONAL,ROOM,LEFT(TIME_BEGIN,5) AS TIME_BEGIN,LEFT(TIME_END,5) AS TIME_END,STATUS FROM OS_DATA_APP where ID=$id");
			while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
			{
				$this->resultPunto("arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]['STATUS'] = ".$linea12['STATUS'].";");
			}
			mysql_free_result($mysql12->Query_ID);
		break;
		case 4: // eliminare lo appuntamento
			$resMysql12 = $mysql12 -> query("SELECT ID,DATE_FORMAT(DATE,'%d-%m-%Y') AS DATE,CLIENT,SPEC,SPECSPEC,PERSONAL,ROOM,LEFT(TIME_BEGIN,5) AS TIME_BEGIN,LEFT(TIME_END,5) AS TIME_END,STATUS FROM OS_DATA_APP where ID=$id");
			while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
			{
				$resonal=$linea12['PERSONAL'];
				$date=$linea12['DATE'];
				$timeBegin=$linea12['TIME_BEGIN'];
				// mettere lo stato
				$this->resultPunto("arrayData['AIP'][11]['CALENDAR']['APP'][".$linea12['PERSONAL']."]['".$linea12['DATE']."'][".$linea12['ID']."]['STATUS'] = -1;");
			}
			mysql_free_result($mysql12->Query_ID);
			$resMysql12 = $mysql12 ->query("DELETE FROM OS_DATA_APP WHERE ID=".$id);
			$this->resultPunto("for (var i in arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['ID']) {dojo.debug('COMPARE '+arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['TIME'][i]+' == $timeBegin');if (arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['TIME'][i]=='$timeBegin') {arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['TIME'].splice(i,1);arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['ID'].splice(i,1);break;} dojo.debug('VISUAL ID '+i+' TIME '+arrayData['AIP'][11]['CALENDAR']['APP']['VISUAL'][".$resonal."]['".$date."']['TIME'][i]);}");
			
		break;
		}
		
		$this->resultPunto("furoros.Runmodule('11','REFRESH_CALENDAR_MAIN','APP','');");
		$this->resultPunto("dojo.widget.byId('WIDAID11FPCONFIG').destroy();");
		
	break;
	}
break;
case "CONFIG": // menu configurazione
	switch ($thisTarget)
	{
	case "DATA":
		$mysql12 = new Mysql();
		$mysql12 ->Database='AID11';
		$mysql12 ->connect();
		$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName."_VALIDATE");
		$lineaValidate = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
		mysql_free_result($resMysql12);
		switch ($thisName)
		{
		case "PRIMANOTA":
			$this->resultPunto("$('IDAID11DIVCONFIG').innerHTML='sdf';dojo.widget.byId('".$thisWidgetId."').setContent(\\\"asdf\\\");");die();
		break;
		case "ROOMSPEC":
			// leggere categorie di specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['spec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['spec']++;
					$countTmp = $count['spec'];
					$array['specId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPECSPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['specspec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['specspec']++;
					$countTmp = $count['specspec'];
					$array['specspecId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specspecNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['CLIENT']=$linea['CLIENT'];
				$tmpValue['SPEC']=$linea['SPEC'];
				$tmpValue['POINT']=$linea['POINT'];
				
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:OPEN_ADD:".$thisId."')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE:".$thisId."')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 		
				//$thisAction = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisAction');");
				$thisId=0;		
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='';
				//$tmpValue['CLIENT']=$PARAM[5];
				$tmpValue['CLIENT']=$PARAM[5];
				$tmpValue['SPEC']='';
				$tmpValue['POINT']='';
				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
			break;
			}
				$tmpContent="<table style='border:0px;font-size:12px;' border='0'>";
				// select categorie
				$tmpContent.="<tr><td>Categoria di specialita</td><td><select id='IPSPEC' name='IPSPEC' onChange=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSPECSPEC','APP',document.getElementById('IPSPEC').value)\\\\\\\">";
					// select categoria specialita
					$tmpUltimoSpec=0;
					for ($i=1;$i<=$count['spec'];$i++)
					{
						$tmpContent.="<option ";
						if ($array['specId'.$i] == $tmpValue["SPEC"])
						{
							$tmpContent.=" selected ";
						}
						$_idOrari=$array['specId'.$i];
						$tmpContent.= " value=$_idOrari>".$array['specNome'.$_idOrari]."</option>";
					}
					$tmpContent.="</select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Preferenza</td></tr>";
				$tmpContent.="<tr><td>Specialita</td><td><div dojoType='contentPane' widgetId='SELECTSPECSPEC'><select id='IPSPECSPEC' name='IPSPECSPEC' style='font-size: 9px;' disabled></div>";
					// select specialita
				
					$tmpContent.="</select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><img id='STAR1'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','1')\\\\\\\" border='0' src='../framework/furoros/share/APP/AID11/star1On.gif' alt='Campo obbligatorio'><img id='STAR2' onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','2')\\\\\\\" border='0' src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img id='STAR3' border='0'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','3')\\\\\\\" src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img id='STAR4' border='0'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','4')\\\\\\\"  src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','5')\\\\\\\" id='STAR5' border='0' src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'></td><input type='hidden' id='IPPOINT' value='1'><input type='hidden' id='IPCLIENT' value='".$tmpValue['CLIENT']."'></tr>";
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;	
		case "PERSONALSPEC":
			// leggere categorie di specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['spec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['spec']++;
					$countTmp = $count['spec'];
					$array['specId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPECSPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['specspec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['specspec']++;
					$countTmp = $count['specspec'];
					$array['specspecId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specspecNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['CLIENT']=$linea['CLIENT'];
				$tmpValue['SPEC']=$linea['SPEC'];
				$tmpValue['POINT']=$linea['POINT'];
				
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:OPEN_ADD:".$thisId."')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE:".$thisId."')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 		
				//$thisAction = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisAction');");
				$thisId=0;		
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='';
				//$tmpValue['CLIENT']=$PARAM[5];
				$tmpValue['CLIENT']=$PARAM[5];
				$tmpValue['SPEC']='';
				$tmpValue['POINT']='';
				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;font-size:12px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPSPECSPEC').value+':'+document.getElementById('IPCLIENT').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPOINT').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
			break;
			}
				$tmpContent="<table style='border:0px;font-size:12px;' border='0'>";
				// select categorie
				$tmpContent.="<tr><td>Categoria di specialita</td><td><select id='IPSPEC' name='IPSPEC' onChange=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSPECSPEC','APP',document.getElementById('IPSPEC').value)\\\\\\\">";
					// select categoria specialita
					$tmpUltimoSpec=0;
					for ($i=1;$i<=$count['spec'];$i++)
					{
						$tmpContent.="<option ";
						if ($array['specId'.$i] == $tmpValue["SPEC"])
						{
							$tmpContent.=" selected ";
						}
						$_idOrari=$array['specId'.$i];
						$tmpContent.= " value=$_idOrari>".$array['specNome'.$_idOrari]."</option>";
					}
					$tmpContent.="</select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Preferenza</td></tr>";
				$tmpContent.="<tr><td>Specialita</td><td><div dojoType='contentPane' widgetId='SELECTSPECSPEC'><select id='IPSPECSPEC' name='IPSPECSPEC' style='font-size: 9px;' disabled></div>";
					// select specialita
				
					$tmpContent.="</select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><img id='STAR1'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','1')\\\\\\\" border='0' src='../framework/furoros/share/APP/AID11/star1On.gif' alt='Campo obbligatorio'><img id='STAR2' onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','2')\\\\\\\" border='0' src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img id='STAR3' border='0'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','3')\\\\\\\" src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img id='STAR4' border='0'  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','4')\\\\\\\"  src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'><img  onClick=\\\\\\\"furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSTAR','APP','5')\\\\\\\" id='STAR5' border='0' src='../framework/furoros/share/APP/AID11/star1Off.gif' alt='Campo obbligatorio'></td><input type='hidden' id='IPPOINT' value='1'><input type='hidden' id='IPCLIENT' value='".$tmpValue['CLIENT']."'></tr>";
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;	
		case "SPEC":
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 				
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='';
				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn=$tmpContent.="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$tmpContent="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td colspan='4'>&nbsp;</td></tr>";
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;	
			case "SPECSPEC":
				// leggere fassciaOrario
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['orari']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['orari']++;
					$countTmp = $count['orari'];
					$array['orariId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$specTmp = $linea12['SPEC'];
					$periodTmp = $linea12['PERIOD'];
					$array['orariNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere durata di appuntamento
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_PERIOD');
				if ($mysql12 -> numRows == 0)
				{
					$count['period']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['period']++;
					$countTmp = $count['period'];
					$array['periodId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$specTmp = $linea12['SPEC'];
					$periodTmp = $linea12['PERIOD'];
					$array['periodNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['SPEC']=$linea['SPEC'];
				$tmpValue['PERIOD']=$linea['PERIOD'];
				$tmpValue['PRICE']=$linea['PRICE'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPERIOD').value+':'+document.getElementById('IPPRICE').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPERIOD').value+':'+document.getElementById('IPPRICE').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 				
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='';
				$tmpValue['PRICE']='';
				$tmpValue['SPEC']=$specTmp;
				$tmpValue['PERIOD']=$periodTmp;

				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn=$tmpContent.="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSPEC').value+':'+document.getElementById('IPPERIOD').value+':'+document.getElementById('IPPRICE').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$tmpContent="<table style='border:0px;' border='0'>";
				// select categorie
				$tmpContent.="<tr><td>Categoria</td><td><select id='IPSPEC' name='IPSPEC' style='font-size: 9px;'>";
					// select
					for ($i=1;$i<=$count['orari'];$i++)
					{
						$tmpContent.="<option ";
						if ($array['orariId'.$i] == $tmpValue["SPEC"])
							$tmpContent.=" selected ";
						$_idOrari=$array['orariId'.$i];
						$tmpContent.= " value=$_idOrari>".$array['orariNome'.$_idOrari]."</option>";
					}
					$tmpContent.="</select></td></tr>";

				$tmpContent.="<tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				// select durata appuntamento
				$tmpContent.="<tr><td>Durata di trattamento</td><td><select id='IPPERIOD' name='IPPERIOD' style='font-size: 9px;'>";
					// select
					for ($i=1;$i<=$count['period'];$i++)
					{
						$tmpContent.="<option ";
						if ($array['periodId'.$i] == $tmpValue["SPEC"])
							$tmpContent.=" selected ";
						$_idOrari=$array['periodId'.$i];
						$tmpContent.= " value=$_idOrari>".$array['periodNome'.$_idOrari]."</option>";
					}
					$tmpContent.="</select></td></tr>";
				$tmpContent.="<tr><td>Prezzo di trattamento, &#8364;</td><td><input type='text' id='IPPRICE' name='IPPRICE' value='".$tmpValue['PRICE']."' ";
				if ($lineaValidate['PRICE']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;
		case "PERIOD":
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName." WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+dojo.widget.byId('WIDNAME').getValue().substr(0,5))\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+dojo.widget.byId('WIDNAME').getValue().substr(0,5))\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 				
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='01:00';
				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+dojo.widget.byId('WIDNAME').getValue().substr(0,5))\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$this->resultPunto("dojo.require('dojo.widget.DropdownDatePicker');");
				$tmpContent="<table style='border:0px;' border='0'><tr><td>Durata di appuntamento</td><td><input dojoType='dropdowntimepicker'  lang='it-it' widgetId='WIDNAME' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td colspan='4'>&nbsp;</td></tr>";
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
				$this->resultPunto("dojo.debug('sdf '+document.getElementById('IPNAME').value);");
			break;
		case "TIME_DAY":
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName." WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['AMBEGIN']=$linea['AMBEGIN'];
				$tmpValue['AMEND']=$linea['AMEND'];
				$tmpValue['PMBEGIN']=$linea['PMBEGIN'];
				$tmpValue['PMEND']=$linea['PMEND'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiate dati di INPUT
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+dojo.byId('IPNAME').value+':'+dojo.widget.byId('WIDAMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDAMEND').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMEND').getValue().substr(0,5))\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+dojo.byId('IPNAME').value+':'+dojo.widget.byId('WIDAMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDAMEND').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMEND').getValue().substr(0,5))\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD": 				
				$this->resultPunto("dojo.debug('quine');");
				$tmpValue['NAME']='';
				$tmpValue['AMBEGIN']='09:00';
				$tmpValue['AMEND']='13:00';
				$tmpValue['PMBEGIN']='14:00';
				$tmpValue['PMEND']='18:00';
				// LEGGIMI: cambiate dati di INPUT
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+dojo.byId('IPNAME').value+':'+dojo.widget.byId('WIDAMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDAMEND').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMBEGIN').getValue().substr(0,5)+':'+dojo.widget.byId('WIDPMEND').getValue().substr(0,5))\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$this->resultPunto("dojo.require('dojo.widget.DropdownDatePicker');");
				$tmpContent="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				// matina
				$tmpContent.="<tr><td><input type='checkbox' onclick=\\\\\\\"dojo.widget.byId('WIDAMBEGIN')[this.checked ? 'enable' : 'disable']();dojo.widget.byId('WIDAMEND')[this.checked ? 'enable' : 'disable']();_date= new Date();if (this.checked) {_date.setHours(9);_date.setMinutes(0);dojo.widget.byId('WIDAMBEGIN').setValue(_date);_date.setHours(13);dojo.widget.byId('WIDAMEND').setValue(_date);}else{_date.setHours(0);_date.setMinutes(0);dojo.widget.byId('WIDAMBEGIN').setValue(_date);dojo.widget.byId('WIDAMEND').setValue(_date);}\\\\\\\" ".(strcmp($tmpValue['AMBEGIN'],'00:00') !=0 ?  'checked' : '').">MATINA </td><td align='right'>DALLE<input dojoType='dropdowntimepicker'  lang='it-it' widgetId='WIDAMBEGIN' id='IPAMBEGIN' name='IPAMBEGIN' value='".$tmpValue['AMBEGIN']."' ";
				if ($lineaValidate['AMBEGIN']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr><tr><td>&nbsp;</td><td align='right'>ALLE<input dojoType='dropdowntimepicker'  lang='it-it' widgetId='WIDAMEND' id='IPAMEND' name='IPAMEND' value='".$tmpValue['AMEND']."' ";
				if ($lineaValidate['AMEND']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				// pomeriggio
				$tmpContent.="<tr><td><input type='checkbox' onclick=\\\\\\\"dojo.widget.byId('WIDPMBEGIN')[this.checked ? 'enable' : 'disable']();dojo.widget.byId('WIDPMEND')[this.checked ? 'enable' : 'disable']();_date= new Date();if (this.checked) {_date.setHours(14);_date.setMinutes(0);dojo.widget.byId('WIDPMBEGIN').setValue(_date);_date.setHours(18);dojo.widget.byId('WIDPMEND').setValue(_date);}else{_date.setHours(0);_date.setMinutes(0);dojo.widget.byId('WIDPMBEGIN').setValue(_date);dojo.widget.byId('WIDPMEND').setValue(_date);}\\\\\\\" ".(strcmp($tmpValue['PMBEGIN'],'00:00') !=0 ?  'checked' : '').">POMERIGGIO </td><td align='right'>DALLE<input dojoType='dropdowntimepicker'  lang='it-it' widgetId='WIDPMBEGIN' id='IPPMBEGIN' name='IPPMBEGIN' value='".$tmpValue['PMBEGIN']."' ";
				if ($lineaValidate['PMBEGIN']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr><tr><td>&nbsp;</td><td align='right'>ALLE<input dojoType='dropdowntimepicker'  lang='it-it' widgetId='WIDPMEND' id='IPPMEND' name='IPPMEND' value='".$tmpValue['PMEND']."' ";
				if ($lineaValidate['PMEND']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				
				$tmpContent.="</td><td colspan='4'>&nbsp;</td></tr>";
				
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
				//$this->resultPunto("dojo.debug('sdf '+document.getElementById('IPNAME').value);");
			break;
		case "CLIENT":
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				// prendere valori
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName." WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori automaticamente
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_CLIENT_DATA WHERE $thisName=1");
				while ($linea1 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
				{
					$tmpName=$linea1['NAME'];
					$tmpValue[$tmpName]=$linea[$tmpName];
				}
				mysql_free_result($resMysql12);
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPADDRESS').value+':'+document.getElementById('IPCAP').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('IPCITY').value+':'+document.getElementById('IPPROFESSION').value+':'+document.getElementById('IPSEX').value+':'+dojo.widget.byId('WIDBIRTHDAY').getValue()+':'+document.getElementById('IPSCOUNT').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPADDRESS').value+':'+document.getElementById('IPCAP').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('IPCITY').value+':'+document.getElementById('IPPROFESSION').value+':'+document.getElementById('IPSEX').value+':'+dojo.widget.byId('WIDBIRTHDAY').getValue()+':'+document.getElementById('IPSCOUNT').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD":
				// prendere valori automaticamente
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_CLIENT_DATA WHERE $thisName=1");
				while ($linea1 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
				{
					$tmpName=$linea1['NAME'];
					$tmpValue[$tmpName]='';
				}
				// preimpostazioni 
				$tmpValue['SEX']='F';
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPADDRESS').value+':'+document.getElementById('IPCAP').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('IPCITY').value+':'+document.getElementById('IPPROFESSION').value+':'+document.getElementById('IPSEX').value+':'+dojo.widget.byId('WIDBIRTHDAY').getValue()+':'+document.getElementById('IPSCOUNT').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$tmpContent="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Cognome</td><td><input type='text' id='IPSECONDNAME' name='IPSECONDNAME' value='".$tmpValue['SECONDNAME']."'  ";
				if ($lineaValidate['SECONDNAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>E-Mail</td><td><input type='text' id='IPMAIL' name='IPMAIL' value='".$tmpValue['MAIL']."'  ";
				if ($lineaValidate['MAIL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Sconto, %</td><td><input type='text' id='IPSCOUNT' name='IPSCOUNT' value='".$tmpValue['SCOUNT']."'  ";
				if ($lineaValidate['SCOUNT']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>Cellulare</td><td><input type='text' id='IPCEL' name='IPCEL' value='".$tmpValue['CEL']."'  ";
				if ($lineaValidate['CEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Telefono</td><td><input type='text' id='IPTEL' name='IPTEL' value='".$tmpValue['TEL']."'  ";
				if ($lineaValidate['TEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>Indirizzo</td><td><input type='text' id='IPADDRESS' name='IPADDRESS' value='".$tmpValue['ADDRESS']."'  ";
				if ($lineaValidate['ADDRESS']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>CAP</td><td><input type='text' id='IPCAP' name='IPCAP'  value='".$tmpValue['CAP']."' ";
				if ($lineaValidate['CAP']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>Data di nascita</td><td><div widgetId='WIDBIRTHDAY' dojoType='dropdowndatepicker' value='".$tmpValue['BIRTHDAY']."'";
				if ($lineaValidate['BIRTHDAY']) $tmpContent.=" style='background-color:#d8e7e0;' ></div><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" ></div>";
				$tmpContent.="</td><td>Sesso</td><td><SELECT id='IPSEX' name='IPSEX'><OPTION value='F' ";
				if ($tmpValue['SEX']=='F') $tmpContent.=" SELECTED ";
				$tmpContent.=">F</OPTION><OPTION value='M'";
				if ($tmpValue['SEX']=='M') $tmpContent.=" SELECTED ";
				$tmpContent.=">M</OPTION></SELECT>";
				if ($lineaValidate['SEX']) $tmpContent.="<img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.="";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>Professione</td><td><input type='text' id='IPPROFESSION' name='IPPROFESSION' value='".$tmpValue['PROFESSION']."'  ";
				if ($lineaValidate['PROFESSION']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Citta</td><td><input type='text' id='IPCITY' name='IPCITY'  value='".$tmpValue['CITY']."' ";
				if ($lineaValidate['CITY']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				/*foreach( $lineaData as $key => $value)
				{
					//echo "Name: $key, Age: $value <br />";
					$tmpContent.="<tr><td>$key $value</td></tr>";
				}
				*/
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;
		case "USER":
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['SECONDNAME']=$linea['SECONDNAME'];
				$tmpValue['MAIL']=$linea['MAIL'];
				$tmpValue['TEL']=$linea['TEL'];
				$tmpValue['CEL']=$linea['CEL'];
				$tmpValue['LOGIN']=$linea['LOGIN'];
				$tmpValue['PW']=$linea['PW'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiare gli campi di INPUT QUI
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPLOGIN').value+':'+document.getElementById('IPPW').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPLOGIN').value+':'+document.getElementById('IPPW').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table>";
				break;
				}
			break;
			case "OPEN_ADD":
				$tmpValue['NAME']='';
				$tmpValue['SECONDNAME']='';
				$tmpValue['MAIL']='';
				$tmpValue['TEL']='';
				$tmpValue['CEL']='';
				$tmpValue['ADDRESS']='';
				$tmpValue['CAP']='';
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPLOGIN').value+':'+document.getElementById('IPPW').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				$tmpContent.="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Cognome</td><td><input type='text' id='IPSECONDNAME' name='IPSECONDNAME' value='".$tmpValue['SECONDNAME']."'  ";
				if ($lineaValidate['SECONDNAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>E-Mail</td><td><input type='text' id='IPMAIL' name='IPMAIL' value='".$tmpValue['MAIL']."'  ";
				if ($lineaValidate['MAIL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				$tmpContent.="<tr><td>Cellulare</td><td><input type='text' id='IPCEL' name='IPCEL' value='".$tmpValue['CEL']."'  ";
				if ($lineaValidate['CEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Telefono</td><td><input type='text' id='IPTEL' name='IPTEL' value='".$tmpValue['TEL']."'  ";
				if ($lineaValidate['TEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>Login</td><td><input type='text' id='IPLOGIN' name='IPLOGIN' value='".$tmpValue['LOGIN']."'  ";
				if ($lineaValidate['LOGIN']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Password</td><td><input type='text' id='IPPW' name='IPPW'  value='".$tmpValue['PW']."' ";
				if ($lineaValidate['PW']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				/*foreach( $lineaData as $key => $value)
				{
					//echo "Name: $key, Age: $value <br />";
					$tmpContent.="<tr><td>$key $value</td></tr>";
				}
				*/
				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;
		case "PERSONAL":
				$tmpStrDay[1]="LUNEDI";
				$tmpStrDay[2]="MARTEDI";
				$tmpStrDay[3]="MERCOLEDI";
				$tmpStrDay[4]="GIOVEDI";
				$tmpStrDay[5]="VENERDI";
				$tmpStrDay[6]="SABATO";
				$tmpStrDay[0]="DOMENICA";
				// leggere fassciaOrario
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_TIME_DAY');
				if ($mysql12 -> numRows == 0)
				{
					$count['orari']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['orari']++;
					$countTmp = $count['orari'];
					$array['orariId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['orariNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
					$array['orariMatinaDalle'.$idTmp] =strftime('%H:%M', strtotime( $linea12['AMBEGIN']));//echo "as durataAppuntamentoNome".$countTmp;
					$array['orariMatinaAlle'.$idTmp] = strftime('%H:%M', strtotime( $linea12['AMEND']));
					$array['orariPomeriggioDalle'.$idTmp] = strftime('%H:%M', strtotime( $linea12['PMBEGIN']));
					$array['orariPomeriggioAlle'.$idTmp] = strftime('%H:%M', strtotime( $linea12['PMEND']));
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere categorie di specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['spec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['spec']++;
					$countTmp = $count['spec'];
					$array['specId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPECSPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['specspec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['specspec']++;
					$countTmp = $count['specspec'];
					$array['specspecId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specspecNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				$tmpValue['SECONDNAME']=$linea['SECONDNAME'];
				$tmpValue['MAIL']=$linea['MAIL'];
				$tmpValue['TEL']=$linea['TEL'];
				$tmpValue['CEL']=$linea['CEL'];
				$tmpValue['IMG']=$linea['IMG'];
				$tmpValue['D0']=$linea['D0'];
				$tmpValue['D1']=$linea['D1'];
				$tmpValue['D2']=$linea['D2'];
				$tmpValue['D3']=$linea['D3'];
				$tmpValue['D4']=$linea['D4'];
				$tmpValue['D5']=$linea['D5'];
				$tmpValue['D6']=$linea['D6'];

				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiare gli campi di INPUT QUI
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('D0').value+':'+document.getElementById('D1').value+':'+document.getElementById('D2').value+':'+document.getElementById('D3').value+':'+document.getElementById('D4').value+':'+document.getElementById('D5').value+':'+document.getElementById('D6').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('D0').value+':'+document.getElementById('D1').value+':'+document.getElementById('D2').value+':'+document.getElementById('D3').value+':'+document.getElementById('D4').value+':'+document.getElementById('D5').value+':'+document.getElementById('D6').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
				break;
				}
			break;
			case "OPEN_ADD":
				

				$thisId = 0;
				$tmpValue['NAME']='';
				$tmpValue['SECONDNAME']='';
				$tmpValue['MAIL']='';
				$tmpValue['TEL']='';
				$tmpValue['CEL']='';
				$tmpValue['COLOR']='';
				$tmpValue['IMG']='';
				$tmpValue['PERIOD']='';
				$tmpValue['D0']=$idTmp;
				$tmpValue['D1']=$idTmp;
				$tmpValue['D2']=$idTmp;
				$tmpValue['D3']=$idTmp;
				$tmpValue['D4']=$idTmp;
				$tmpValue['D5']=$idTmp;
				$tmpValue['D6']=$idTmp;

				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value+':'+document.getElementById('IPSECONDNAME').value+':'+document.getElementById('IPMAIL').value+':'+document.getElementById('IPTEL').value+':'+document.getElementById('IPCEL').value+':'+document.getElementById('D0').value+':'+document.getElementById('D1').value+':'+document.getElementById('D2').value+':'+document.getElementById('D3').value+':'+document.getElementById('D4').value+':'+document.getElementById('D5').value+':'+document.getElementById('D6').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				// ADD TAB CTRL
				$tmpContent="<table height='90%' style='border:0px;height:90%;' border='0' width='100%' ><tr height='80%'><td><div id='TABCTRLPERSONAL' dojoType='TabContainer' widgetId='tabstatistiche' labelPosition='top' style='width: 100%; height: 100%;'>";
				// ADD TAB ANAGRAFICA
				$tmpContent.="<div  id='TABPERSONAL1' dojoType='ContentPane' style='height: 100%;' label='ANAGRAFICA'>";
				$tmpContent.="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Cognome</td><td><input type='text' id='IPSECONDNAME' name='IPSECONDNAME' value='".$tmpValue['SECONDNAME']."'  ";
				if ($lineaValidate['SECONDNAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="<tr><td>E-Mail</td><td><input type='hidden' id='IPIDPERSONAL'><input type='text' id='IPMAIL' name='IPMAIL' value='".$tmpValue['MAIL']."'  ";
				if ($lineaValidate['MAIL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				$tmpContent.="<tr><td>Cellulare</td><td><input type='text' id='IPCEL' name='IPCEL' value='".$tmpValue['CEL']."'  ";
				if ($lineaValidate['CEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Telefono</td><td><input type='text' id='IPTEL' name='IPTEL' value='".$tmpValue['TEL']."'  ";
				if ($lineaValidate['TEL']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td></tr>";
				$tmpContent.="</td></tr></table>";
				// CHIUDERE TAB ANAGRAFICA
				$tmpContent.="</div>";
				// ADD TAB FASCE ORARIE
				$tmpContent.="<div  id='TABPERSONAL2' dojoType='ContentPane' style='height: 100%;' label='FASCE ORARIE'>";
				$this->resultPunto("dojo.require('dojo.widget.ColorPalette');");
				$this->resultPunto("dojo.require('dojo.event.*');");
				$this->resultPunto("dojo.event.connect(dojo.widget.byId('COLORPERSONAL'), 'onColorSelect', 'alert(7)');");
				

				$tmpContent.="<table style='border:0px;' border='0'>";
				for ($tmpDay=0;$tmpDay<7;$tmpDay++)
				{
					$tmpContent.="<tr><td>".$tmpStrDay[$tmpDay]."</td><td><select id='D".$tmpDay."' name='D".$tmpDay."' style='width: 300px;font-size: 9px;'>";
					// select
					for ($i=1;$i<=$count['orari'];$i++)
					{
						$tmpContent.="<option ";
						if ($array['orariId'.$i] == $tmpValue["D".$tmpDay])
							$tmpContent.=" selected ";
						$_idOrari=$array['orariId'.$i];
						$tmpContent.= " value=$_idOrari>".$array['orariNome'.$_idOrari]." ".$array['orariMatinaDalle'.$array['orariId'.$i]]."-".$array['orariMatinaAlle'.$array['orariId'.$i]]." / ".	$array['orariPomeriggioDalle'.$array['orariId'.$i]]."-".$array['orariPomeriggioAlle'.$array['orariId'.$i]]."</option>";
					}
					$tmpContent.="</select></td></tr>";
				}
				$tmpContent.="</table>";
				// CHIUDERE TAB FASCE ORARIE
				$tmpContent.="</div>";
				// ADD TAB LISTA TRATTAMENTI
				$tmpContent.="<div  id='TABPERSONAL3' dojoType='ContentPane' style='height: 100%;' label='LISTA TRATTAMENTI'>";				
				$tmpContent.="<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='CPCONFIGLISTPERSONALSPEC'></div><div id='divorari' widgetId='CPCONFIGEDITPERSONALSPEC' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>";
					
				// CHIUDERE TAB LISTA TRATTAMENTI
				$tmpContent.="</div>";
				// ADD TAB GRAFICA
				$tmpContent.="<div  id='TABPERSONAL4' dojoType='ContentPane' style='height: 100%;' label='GRAFICA'>";
				$this->resultPunto("dojo.require('dojo.widget.ColorPalette');");
				$this->resultPunto("dojo.require('dojo.event.*');");
				$this->resultPunto("dojo.event.connect(dojo.widget.byId('COLORPERSONAL'), 'onColorSelect', 'alert(7)');");
				$tmpContent.="<table style='border:0px;' border='0'><tr><td align='center'><img src='../framework/furoros/share/APP/AID11/PERSONAL/".$tmpValue['IMG']."' width='80' height='120' alt='FOTO assente' /></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><div dojoType='colorPalette' palette='7x10'  widgetId='COLORPERSONAL'></div></td></tr><tr><td><form id='upload_file' action='file_upload_script.php' method='post' enctype='multipart/form-data'><input type='hidden' name='MAX_FILE_SIZE' value='500000' /><input type='file' name='select_file' tabindex='1' size='10' /><button dojoType='Button' onClick=\\\\\\\"upload_file_submit()\\\\\\\">Spedisci</button></form></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Colore<input id='IPCOLORPERSONAL' size='10' value='ffffff'><SPAN id='SPCOLORPERSONAL'>&nbsp;&nbsp;&nbsp;</SPAN></td></tr></table>";
				//$tmpContent.="<table style='border:0px;' border='0'><tr><td colspan='3'><div dojoType='colorPalette' palette='7x10'  widgetId='COLORPERSONAL'></div></td></tr><tr><td>Colore</td><td><input id='IPCOLORPERSONAL' value='000000'></td><td><SPAN id='SPCOLORPERSONAL>&nbsp;&nbsp;&nbsp;</SPAN></td></tr></table>";
				// CHIUDERE TAB GRAFICA
				$tmpContent.="</div>";

				// CHIUDERE TAB CTRL
				$tmpContent.="</div></td></tr>";

				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;
/*****************************************

QUI

******************************************/
case "ROOM":
				// leggere categorie di specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['spec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['spec']++;
					$countTmp = $count['spec'];
					$array['specId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
				// leggere specialita
				$resMysql12 = $mysql12 -> query('SELECT * FROM OS_DATA_SPECSPEC');
				if ($mysql12 -> numRows == 0)
				{
					$count['specspec']=0;
				}
				while ($linea12 = mysql_fetch_array($resMysql12, MYSQL_ASSOC)) 
				{
					$count['specspec']++;
					$countTmp = $count['specspec'];
					$array['specspecId'.$countTmp] = $linea12['ID'];
					$idTmp = $linea12['ID'];
					$array['specspecNome'.$idTmp] = $linea12['NAME'];//echo "as durataAppuntamentoNome".$countTmp;
				}
				mysql_free_result($mysql12->Query_ID);
			switch ($thisAction)
			{
			case "OPEN_DEL":
			case "FT_CLICK":
				// prendere ID di selezzionato
				$thisId = $PARAM[5];
				//$this->resultPunto("dojo.debug('$thisId');");
				$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_$thisName WHERE ID=$thisId");
				$linea = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
				mysql_free_result($resMysql12);	
				// prendere valori
				$tmpValue['NAME']=$linea['NAME'];
				// button diversi
				switch ($thisAction)
				{
				case "OPEN_DEL":
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:DEL:$thisId')\\\\\\\">Conferma</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
				break;
				case "FT_CLICK":
					// LEGGIMI: cambiare gli campi di INPUT QUI
					$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:MOD:$thisId:'+document.getElementById('IPNAME').value)\\\\\\\">Modifica</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_DEL:$thisId:'+document.getElementById('IPNAME').value)\\\\\\\">Elimina</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
				break;
				}
			break;
			case "OPEN_ADD":
				

				$thisId = 0;
				$tmpValue['NAME']='';
				$tmpContentBtn="<tr><td colspan='4'><table style='border:0px;' border='0'><tr><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:ADD:0:'+document.getElementById('IPNAME').value)\\\\\\\">Aggiungi</button></td><td><button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:CLOSE')\\\\\\\">Indietro</button></td></tr></table></td></tr></table><div id='toasterInt'></div>";
			break;
			}
				// ADD TAB CTRL
				$tmpContent="<table height='90%' style='border:0px;height:90%;' border='0' width='100%' ><tr height='80%'><td><div id='TABCTRLPERSONAL' dojoType='TabContainer' widgetId='tabstatistiche' labelPosition='top' style='width: 100%; height: 100%;'>";
				// ADD TAB ANAGRAFICA
				$tmpContent.="<div  id='TABPERSONAL1' dojoType='ContentPane' style='height: 100%;' label='ANAGRAFICA'>";
				$tmpContent.="<table style='border:0px;' border='0'><tr><td>Nome</td><td><input type='hidden' id='IPIDPERSONAL'><input type='text' id='IPNAME' name='IPNAME' value='".$tmpValue['NAME']."' ";
				if ($lineaValidate['NAME']) $tmpContent.=" style='background-color:#d8e7e0;' /><img border='0' src='../framework/furoros/share/APP/AID11/validateOn.gif' alt='Campo obbligatorio'>"; else $tmpContent.=" />";
				$tmpContent.="</td><td>Cognome</td><td>&nbsp;";
				$tmpContent.="</td></tr></table>";
				// CHIUDERE TAB ANAGRAFICA
				$tmpContent.="</div>";
				// ADD TAB LISTA TRATTAMENTI
				$tmpContent.="<div  id='TABPERSONAL3' dojoType='ContentPane' style='height: 100%;' label='LISTA TRATTAMENTI'>";				
				$tmpContent.="<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='CPCONFIGLISTPERSONALSPEC'></div><div id='divorari' widgetId='CPCONFIGEDITPERSONALSPEC' dojoType='ContentPane'  style='height:100%; background-color:#e3edfa; overflow:auto;font-size:0.80em;' sizeMin='5' sizeShare='50'></div></div>";
				// CHIUDERE TAB LISTA TRATTAMENTI
				$tmpContent.="</div>";
				// ADD TAB GRAFICA
				$tmpContent.="<div  id='TABPERSONAL4' dojoType='ContentPane' style='height: 100%;' label='GRAFICA'>";
				$this->resultPunto("dojo.require('dojo.widget.ColorPalette');");
				$this->resultPunto("dojo.require('dojo.event.*');");
				$this->resultPunto("dojo.event.connect(dojo.widget.byId('COLORPERSONAL'), 'onColorSelect', 'alert(7)');");
				$tmpContent.="<table style='border:0px;' border='0'><tr><td align='center'><img src='../framework/furoros/share/APP/AID11/PERSONAL/".$tmpValue['IMG']."' width='80' height='120' alt='FOTO assente' /></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><div dojoType='colorPalette' palette='7x10'  widgetId='COLORPERSONAL'></div></td></tr><tr><td><form id='upload_file' action='file_upload_script.php' method='post' enctype='multipart/form-data'><input type='hidden' name='MAX_FILE_SIZE' value='500000' /><input type='file' name='select_file' tabindex='1' size='10' /><button dojoType='Button' onClick=\\\\\\\"upload_file_submit()\\\\\\\">Spedisci</button></form></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Colore<input id='IPCOLORPERSONAL' size='10' value='ffffff'><SPAN id='SPCOLORPERSONAL'>&nbsp;&nbsp;&nbsp;</SPAN></td></tr></table>";
				//$tmpContent.="<table style='border:0px;' border='0'><tr><td colspan='3'><div dojoType='colorPalette' palette='7x10'  widgetId='COLORPERSONAL'></div></td></tr><tr><td>Colore</td><td><input id='IPCOLORPERSONAL' value='000000'></td><td><SPAN id='SPCOLORPERSONAL>&nbsp;&nbsp;&nbsp;</SPAN></td></tr></table>";
				// CHIUDERE TAB GRAFICA
				$tmpContent.="</div>";

				// CHIUDERE TAB CTRL
				$tmpContent.="</div></td></tr>";

				// LEGGIMI: qui modificare campi di INPUT
				$tmpContent.=$tmpContentBtn;
			break;
			}
	break;
	}
break;
}

switch ($thisFather)
{
case "CONFIG": // menu configurazione
	switch ($thisTarget)
	{
	case "GUI":
	// riparto VALIDATE BEGIN
		$mysql11 = new Mysql();
		$mysql11 ->Database='AID11';
		$mysql11 ->connect();
		switch ($thisAction)
		{
		case "ACTION_VALIDATE":
			// prendere dati di validate
			$this->resultPunto("var tmpContent='$thisWidgetId:$thisFather:$thisTarget:$thisName:SAVE_VALIDATE:';");
			$exist=0;
			$this->resultPunto("tmpContent+=document.getElementById('IMG_PERSONAL').checked+':'+document.getElementById('IMG_ROOM').checked+':'+document.getElementById('TYPE_SPEC_MENU').value;");
			$this->resultPunto("furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP',tmpContent);");
		break;
		case "SAVE_VALIDATE":
			// generare 
			//$this->resultPunto("dojo.debug('".$PARAM[3]."');");
			$resMysql11 = $mysql11 ->query("UPDATE OS_DATA_CONFIG SET IMG_PERSONAL=".$PARAM[5].",IMG_ROOM=".$PARAM[6].",TYPE_SPEC_MENU='".$PARAM[7]."'");
			// rimettere dati nel arrayData
			$this->resultPunto("arrayData['AIP'][11]['CONFIG']['IMG_PERSONAL']='".$PARAM[5]."';");
			$this->resultPunto("arrayData['AIP'][11]['CONFIG']['IMG_ROOM']='".$PARAM[6]."';");
			$this->resultPunto("arrayData['AIP'][11]['CONFIG']['TYPE_SPEC_MENU']='".$PARAM[7]."';");
			


			$this->resultPunto("furoros.Runmodule('11','REFRESH_PERSONAL','APP','');");
			$this->resultPunto("setTimeout(\\\"furoros.Runmodule('11','REFRESH_ROOM','APP','')\\\",500);");
			$this->resultPunto("setTimeout(\\\"furoros.Runmodule('11','REFRESH_SPEC','APP','')\\\",1000);");
			// visualizzare la conferma di buon fine
			//$this->resultPunto("dojo.debug('resmysql: ".$resMysql11." errno: ".$mysql11->Errno." error: ".$mysql11->Error."');");
			//$this->resultPunto("dojo.debug('query: UPDATE OS_DATA_CONFIG SET ".$PARAM[5]."');");
		break;
		}
	break;
	case "DATA_VALIDATE":
		// riparto VALIDATE BEGIN
		$mysql11 = new Mysql();
		$mysql11 ->Database='AID11';
		$mysql11 ->connect();
		switch ($thisAction)
		{
		case "ACTION_VALIDATE":
			// prendere dati di validate
			$this->resultPunto("var tmpContent='$thisWidgetId:$thisFather:$thisTarget:$thisName:SAVE_VALIDATE:';");
			$exist=0;
			$resMysql11 = $mysql11 ->query("SELECT * FROM  OS_DATA_CLIENT_DATA WHERE $thisName=1 ORDER BY ID");
			while (	$linea11 = mysql_fetch_array($resMysql11, MYSQL_ASSOC))
			{
				if ($exist==1)
					$this->resultPunto("tmpContent+=',';");
				$this->resultPunto("tmpContent+='".$linea11['NAME']."='+document.getElementById('CB".$linea11['NAME']."').checked;");
				$exist=1;
			}
			mysql_free_result($resMysql11);	
			$this->resultPunto("furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP',tmpContent);");
		break;
		case "SAVE_VALIDATE":
			// generare 
			//$this->resultPunto("dojo.debug('".$PARAM[3]."');");
			$resMysql11 = $mysql11 ->query("UPDATE OS_DATA_".$thisName."_VALIDATE SET ".$PARAM[5]);
			// visualizzare la conferma di buon fine
			$this->resultPunto("dojo.debug('resmysql: ".$resMysql11." errno: ".$mysql11->Errno." error: ".$mysql11->Error."');");
			$this->resultPunto("dojo.debug('query: UPDATE OS_DATA_".$thisName."_VALIDATE SET ".$PARAM[5]."');");
		break;
		}
	break;
	// riparto VALIDATE END
	case "DATA": // cambiamento dei dati
		switch ($thisAction)
		{
		case "DEL": // aggiungere dati
			$thisData['ID'] = $PARAM[5];
			// inserire dati nel mysql
			$mysql12 = new Mysql();
			$mysql12 ->Database='AID11';
			$mysql12 ->connect();
			$resMysql12 = $mysql12 ->query("DELETE FROM OS_DATA_$thisName  WHERE ID=".$thisData['ID']);
			if ($resMysql12 !=1)
			{
				// errore DbMysql
				// toaster
				$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Errore Database &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
			}
			else
			{
				// refresh di quello che sia bisogno
					switch ($thisName)
					{
					case "PERSONAL":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_PERSONAL','APP','');");
					break;
					case "ROOM":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_ROOM','APP','');");
					break;
					case "SPEC":
					case "SPECSPEC":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_SPEC','APP','');");
					break;

					}
				// rimettere a posto CP
				switch ($thisName)
			{
			case "PERSONALSPEC":
			case "ROOMSPEC":
				//$this->resultPunto("dojo.debug('CLOSE: '+document.getElementById('IPCLIENT').value);");
				//$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:OPEN_ADD:'+document.getElementById('IPIDPERSONAL').value)\\\\\\\">Aggiungi</button>\\\");");
				$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:OPEN_ADD:'+document.getElementById('IPIDPERSONAL').value)\\\\\\\">Aggiungi</button>\\\");");
			break;
			default:
				$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");
			break;
			}
				// toaster
				$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxgreen';status.innerHTML = '&nbsp;&nbsp;Dati eliminati &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
				// MODIFICARE I DATI NELLA TABELLA
				switch ($thisName)
				{
				case "PERSONALSPEC":
				case "ROOMSPEC":
					$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.removeDataByKey(".$thisData['ID'].");");
				break;
				default:	
					$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.removeDataByKey(".$thisData['ID'].");");
				break;
				}
			}
		break;
		case "MOD": // aggiungere dati
			switch ($thisName)
			{
			case "CLIENT":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['ADDRESS'] = $PARAM[9];
				$thisData['CAP'] = $PARAM[10];
				$thisData['TEL'] = $PARAM[11];
				$thisData['CEL'] = $PARAM[12];
				$thisData['CITY'] = $PARAM[13];
				$thisData['PROFESSION'] = $PARAM[14];
				$thisData['SEX'] = $PARAM[15];
				$thisData['BIRTHDAY'] = $PARAM[16];
				$thisData['SCOUNT'] = $PARAM[17];
			break;
			case "PERSONALSPEC":
			case "ROOMSPEC":
				$thisData['ID'] = $PARAM[5];
				$thisData['SPECSPEC'] = $PARAM[6];
				$thisData['CLIENT'] = $PARAM[7];
				$thisData['SPEC'] = $PARAM[8];
				$thisData['POINT'] = $PARAM[9];
			break;
			case "PERSONAL":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['TEL'] = $PARAM[9];
				$thisData['CEL'] = $PARAM[10];
				$thisData['D0'] = $PARAM[11];
				$thisData['D1'] = $PARAM[12];
				$thisData['D2'] = $PARAM[13];
				$thisData['D3'] = $PARAM[14];
				$thisData['D4'] = $PARAM[15];
				$thisData['D5'] = $PARAM[16];
				$thisData['D6'] = $PARAM[17];
			break;
			case "ROOM":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
			break;
			case "USER":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['LOGIN'] = $PARAM[9];
				$thisData['PW'] = $PARAM[10];
				$thisData['TEL'] = $PARAM[11];
				$thisData['CEL'] = $PARAM[12];
			break;
			case "SPEC":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
			break;
			case "SPECSPEC":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
				$thisData['SPEC'] = $PARAM[7];
				$thisData['PERIOD'] = $PARAM[8];
				$thisData['PRICE'] = $PARAM[9];
			break;
			case "PERIOD":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6].":".$PARAM[7];
			break;
			case "TIME_DAY":
				$thisData['ID'] = $PARAM[5];
				$thisData['NAME'] = $PARAM[6];
				$thisData['AMBEGIN'] = $PARAM[7].":".$PARAM[8];
				$thisData['AMEND'] = $PARAM[9].":".$PARAM[10];
				$thisData['PMBEGIN'] = $PARAM[11].":".$PARAM[12];
				$thisData['PMEND'] = $PARAM[13].":".$PARAM[14];
			break;
			}
			// funczione validate
			$mysql12 = new Mysql();
			$mysql12 ->Database='AID11';
			$mysql12 ->connect();
			$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName."_VALIDATE");
			$lineaValidate = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
			$vatidateExist=0;
			foreach( $lineaValidate as $key => $value)
			{
				if ($lineaValidate[$key] && strcmp($thisData[$key],'')==0)
				{
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Aggiungere dati obbligatori &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
					$vatidateExist=1;
					break;
				}
			}
			if ($vatidateExist == 0) // controllare validate
			{
				// inserire dati nel mysql
				switch ($thisName)
				{
				case "CLIENT":
					//echo "UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SECONDNAME='".$thisData['SECONDNAME']."',MAIL='".$thisData['MAIL']."',ADDRESS='".$thisData['ADDRESS']."',CAP='".$thisData['CAP']."',TEL='".$thisData['TEL']."',CEL='".$thisData['CEL']."',CITY='".$thisData['CITY']."',BIRTHDAY='".$thisData['BIRTHDAY']."',PROFESSION='".$thisData['PROFESSION']."',SEX='".$thisData['SEX']."' WHERE ID=".$thisData['ID'];
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SECONDNAME='".$thisData['SECONDNAME']."',MAIL='".$thisData['MAIL']."',ADDRESS='".$thisData['ADDRESS']."',CAP='".$thisData['CAP']."',TEL='".$thisData['TEL']."',CEL='".$thisData['CEL']."',CITY='".$thisData['CITY']."',BIRTHDAY='".$thisData['BIRTHDAY']."',PROFESSION='".$thisData['PROFESSION']."',SEX='".$thisData['SEX']."',SCOUNT='".$thisData['SCOUNT']."' WHERE ID=".$thisData['ID']);
				break;
				case "PERSONALSPEC":
				case "ROOMSPEC":
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET SPECSPEC='".$thisData['SPECSPEC']."',CLIENT='".$thisData['CLIENT']."',SPEC='".$thisData['SPEC']."',POINT='".$thisData['POINT']."'  WHERE ID=".$thisData['ID']);
				break;
				case "PERSONAL":
					//echo "UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SECONDNAME='".$thisData['SECONDNAME']."',MAIL='".$thisData['MAIL']."',TEL='".$thisData['TEL']."',CEL='".$thisData['CEL']."',D0='".$thisData['D0']."',D1='".$thisData['D1']."',D2='".$thisData['D2']."',D3='".$thisData['D3']."',D4='".$thisData['D4']."',D5='".$thisData['D5']."',D6='".$thisData['D6']."' WHERE ID=".$thisData['ID'];
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SECONDNAME='".$thisData['SECONDNAME']."',MAIL='".$thisData['MAIL']."',TEL='".$thisData['TEL']."',CEL='".$thisData['CEL']."',D0='".$thisData['D0']."',D1='".$thisData['D1']."',D2='".$thisData['D2']."',D3='".$thisData['D3']."',D4='".$thisData['D4']."',D5='".$thisData['D5']."',D6='".$thisData['D6']."'  WHERE ID=".$thisData['ID']);
				break;
				case "ROOM":
					//echo "UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."' WHERE ID=".$thisData['ID'];
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."' WHERE ID=".$thisData['ID']);
				break;
				case "USER":
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SECONDNAME='".$thisData['SECONDNAME']."',MAIL='".$thisData['MAIL']."',LOGIN='".$thisData['LOGIN']."',PW='".$thisData['PW']."',TEL='".$thisData['TEL']."',CEL='".$thisData['CEL']."' WHERE ID=".$thisData['ID']);
				break;
				case "SPEC":
				case "PERIOD":
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."' WHERE ID=".$thisData['ID']);	
				break;
				case "SPECSPEC":
					//echo "UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SPEC='".$thisData['SPEC']."',PERIOD='".$thisData['PERIOD']."' WHERE ID=".$thisData['ID'];
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',SPEC='".$thisData['SPEC']."',PERIOD='".$thisData['PERIOD']."',PRICE='".$thisData['PRICE']."' WHERE ID=".$thisData['ID']);	
				break;
				case "TIME_DAY":
					$resMysql12 = $mysql12 ->query("UPDATE OS_DATA_".$thisName." SET NAME='".$thisData['NAME']."',AMBEGIN='".$thisData['AMBEGIN']."',AMEND='".$thisData['AMEND']."',PMBEGIN='".$thisData['PMBEGIN']."',PMEND='".$thisData['PMEND']."' WHERE ID=".$thisData['ID']);
				break;
				}
				if ($resMysql12 !=1)
				{
					// errore DbMysql
					// toaster
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Errore Database &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
				}
				else
				{
					// rimettere a posto CP
					switch ($thisName)
					{
					case "PERSONALSPEC":
					case "ROOMSPEC":
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD:'+document.getElementById('IPIDPERSONAL').value)\\\\\\\">Aggiungi</button>\\\");");
					break;
					default:
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','AID11CPCONFIGEDIT:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");
					break;
					}

					// toaster
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxgreen';status.innerHTML = '&nbsp;&nbsp;Dati modificati &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
					// MODIFICARE I DATI NELLA TABELLA
					switch ($thisName)
					{
					case "PERSONALSPEC":
					case "ROOMSPEC":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.update(dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.getDataByKey(".$thisData['ID']."),'SPECSPEC','".$array['specspecNome'.$thisData['SPECSPEC']]."');");
//						$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.update(dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.getDataByKey(".$thisData['ID']."),'CLIENT','".$thisData['CLIENT']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.update(dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.getDataByKey(".$thisData['ID']."),'SPEC','".$array['specNome'.$thisData['SPEC']]."');");
						//$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.update(dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.getDataByKey(".$thisData['ID']."),'POINT','".$thisData['POINT']."');");
						
							$tmpPoint = "";
							for($i=1;$i<=$thisData['POINT'];$i++)
							{
								$tmpPoint.= "<img src=\\\\\\\"../framework/furoros/share/APP/AID11/star1On.gif\\\\\\\">";
							}
						$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.update(dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.getDataByKey(".$thisData['ID']."),'POINT','".$tmpPoint."');");
					break;
					case "CLIENT":
					case "PERSONAL":
					case "USER":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'NAME','".$thisData['NAME']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'SECONDNAME','".$thisData['SECONDNAME']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'TEL','".$thisData['TEL']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'CEL','".$thisData['CEL']."');");					
					break;
					case "SPEC":
					case "ROOM":
					case "PERIOD":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'NAME','".$thisData['NAME']."');");
					break;
					case "SPECSPEC":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'NAME','".$thisData['NAME']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'SPEC','".$array['orariNome'.$thisData['SPEC']]."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'PERIOD','".$array['periodNome'.$thisData['PERIOD']]."');");
					break;
					case "TIME_DAY":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'NAME','".$thisData['NAME']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'AMBEGIN','".$thisData['AMBEGIN']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'AMEND','".$thisData['AMEND']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'PMBEGIN','".$thisData['PMBEGIN']."');");
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.update(dojo.widget.byId('FTCONFIGLIST').store.getDataByKey(".$thisData['ID']."),'PMEND','".$thisData['PMEND']."');");
					break;
					}					
					// refresh di quello che sia bisogno
					switch ($thisName)
					{
					case "PERSONALSPEC":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_CALENDAR_MAIN','APP','');");
					break;
					case "PERSONAL":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_PERSONAL','APP','');");
					break;
					case "ROOM":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_ROOM','APP','');");
					break;
					case "SPEC":
					case "SPECSPEC":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_SPEC','APP','');");
					break;

					}
				}
			}
		break;
		case "ADD": // aggiungere dati
			switch ($thisName)
			{
			case "CLIENT":
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['ADDRESS'] = $PARAM[9];
				$thisData['CAP'] = $PARAM[10];
				$thisData['TEL'] = $PARAM[11];
				$thisData['CEL'] = $PARAM[12];
				$thisData['CITY'] = $PARAM[13];
				$thisData['PROFESSION'] = $PARAM[14];
				$thisData['SEX'] = $PARAM[15];
				$thisData['BIRTHDAY'] = $PARAM[16];
				$thisData['SCOUNT'] = $PARAM[17];
			break;
			case "PERSONAL":
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['TEL'] = $PARAM[9];
				$thisData['CEL'] = $PARAM[10];
				$thisData['D0'] = $PARAM[11];
				$thisData['D1'] = $PARAM[12];
				$thisData['D2'] = $PARAM[13];
				$thisData['D3'] = $PARAM[14];
				$thisData['D4'] = $PARAM[15];
				$thisData['D5'] = $PARAM[16];
				$thisData['D6'] = $PARAM[17];
				$thisData['D0'] = $PARAM[11];
				$thisData['D1'] = $PARAM[12];
				$thisData['D2'] = $PARAM[13];
				$thisData['D3'] = $PARAM[14];
				$thisData['D4'] = $PARAM[15];
				$thisData['D5'] = $PARAM[16];
				$thisData['D6'] = $PARAM[17];
			break;
			case "PERSONALSPEC":
			case "ROOMSPEC":
				$thisData['SPECSPEC'] = $PARAM[6];
				$thisData['CLIENT'] = $PARAM[7];
				$thisData['SPEC'] = $PARAM[8];
				$thisData['POINT'] = $PARAM[9];
			break;
			case "USER":
				$thisData['NAME'] = $PARAM[6];
				$thisData['SECONDNAME'] = $PARAM[7];
				$thisData['MAIL'] = $PARAM[8];
				$thisData['LOGIN'] = $PARAM[9];
				$thisData['PW'] = $PARAM[10];
				$thisData['TEL'] = $PARAM[11];
				$thisData['CEL'] = $PARAM[12];
			break;
			case "SPEC":			
			case "ROOM":
				$thisData['NAME'] = $PARAM[6];
			break;
			case "SPECSPEC":
				$thisData['NAME'] = $PARAM[6];
				$thisData['SPEC'] = $PARAM[7];
				$thisData['PERIOD'] = $PARAM[8];
				$thisData['PRICE'] = $PARAM[9];
			break;
			case "PERIOD":
				$thisData['NAME'] = $PARAM[6].":".$PARAM[7];
			break;
			case "TIME_DAY":
				$thisData['NAME'] = $PARAM[6];
				$thisData['AMBEGIN'] = $PARAM[7].":".$PARAM[8];
				$thisData['AMEND'] = $PARAM[9].":".$PARAM[10];
				$thisData['PMBEGIN'] = $PARAM[11].":".$PARAM[12];
				$thisData['PMEND'] = $PARAM[13].":".$PARAM[14];
			break;
			}
			// funczione validate
			$mysql12 = new Mysql();
			$mysql12 ->Database='AID11';
			$mysql12 ->connect();
			$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_".$thisName."_VALIDATE");
			$lineaValidate = mysql_fetch_array($resMysql12, MYSQL_ASSOC);
			$vatidateExist=0;
			foreach( $lineaValidate as $key => $value)
			{
				if ($lineaValidate[$key] && strcmp($thisData[$key],'')==0)
				{
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Aggiungere dati obbligatori &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
					$vatidateExist=1;
					break;
				}
			}
			if ($vatidateExist == 0) // controllare validate
			{
				// inserire dati nel mysql
				switch ($thisName)
				{
				case "CLIENT":
					//echo "PHP: INSERT INTO OS_DATA_".$thisName." (NAME,SECONDNAME,MAIL,ADDRESS,CAP,TEL,CEL,CITY,PROFESSION,SEX,BIRTHDAY) VALUES ('".$thisData['NAME']."','".$thisData['SECONDNAME']."','".$thisData['MAIL']."','".$thisData['ADDRESS']."','".$thisData['CAP']."','".$thisData['TEL']."','".$thisData['CEL']."','".$thisData['CITY']."','".$thisData['PROFESSION']."','".$thisData['SEX']."','".$thisData['BIRTHDAY']."')";
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME,SECONDNAME,MAIL,ADDRESS,CAP,TEL,CEL,CITY,PROFESSION,SEX,BIRTHDAY,SCOUNT) VALUES ('".$thisData['NAME']."','".$thisData['SECONDNAME']."','".$thisData['MAIL']."','".$thisData['ADDRESS']."','".$thisData['CAP']."','".$thisData['TEL']."','".$thisData['CEL']."','".$thisData['CITY']."','".$thisData['PROFESSION']."','".$thisData['SEX']."','".$thisData['BIRTHDAY']."','".$thisData['SCOUNT']."')");
				break;
				case "PERSONAL":
					//echo "PHP:INSERT INTO OS_DATA_".$thisName." (NAME,SECONDNAME,MAIL,TEL,CEL,IMG,COLOR,D0,D1,D2,D3,D4,D5,D6) VALUES ('".$thisData['NAME']."','".$thisData['SECONDNAME']."','".$thisData['MAIL']."','".$thisData['TEL']."','".$thisData['CEL']."','sun1.jpg','ffffff','".$thisData['D0']."','".$thisData['D1']."','".$thisData['D2']."','".$thisData['D3']."','".$thisData['D4']."','".$thisData['D4']."','".$thisData['D5']."','".$thisData['D6']."')"; 
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME,SECONDNAME,MAIL,TEL,CEL,IMG,COLOR,D0,D1,D2,D3,D4,D5,D6) VALUES ('".$thisData['NAME']."','".$thisData['SECONDNAME']."','".$thisData['MAIL']."','".$thisData['TEL']."','".$thisData['CEL']."','sun1.jpg','ffffff','".$thisData['D0']."','".$thisData['D1']."','".$thisData['D2']."','".$thisData['D3']."','".$thisData['D4']."','".$thisData['D5']."','".$thisData['D6']."')");
				break;
				case "PERSONALSPEC":
				case "ROOMSPEC":
					//echo "PHP:INSERT INTO OS_DATA_".$thisName." (NAME,CLIENT,SPEC,POINT) VALUES ('".$thisData['NAME']."','".$thisData['CLIENT']."','".$thisData['SPEC']."','".$thisData['POINT']."')"; 
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (SPECSPEC,CLIENT,SPEC,POINT) VALUES ('".$thisData['NAME']."','".$thisData['CLIENT']."','".$thisData['SPEC']."','".$thisData['POINT']."')");
				break;
				case "SPEC":
				case "PERIOD":
				case "ROOM":
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME) VALUES ('".$thisData['NAME']."')");
				break;
				case "SPECSPEC":
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME,SPEC,PERIOD,PRICE) VALUES ('".$thisData['NAME']."','".$thisData['SPEC']."','".$thisData['PERIOD']."','".$thisData['PRICE']."')");				
				break;
				case "TIME_DAY":
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME,AMBEGIN,AMEND,PMBEGIN,PMEND) VALUES ('".$thisData['NAME']."','".$thisData['AMBEGIN']."','".$thisData['AMEND']."','".$thisData['PMBEGIN']."','".$thisData['PMEND']."')");
				break;
				case "USER":
					$resMysql12 = $mysql12 ->query("INSERT INTO OS_DATA_".$thisName." (NAME,SECONDNAME,MAIL,LOGIN,PW,TEL,CEL) VALUES ('".$thisData['NAME']."','".$thisData['SECONDNAME']."','".$thisData['MAIL']."','".$thisData['LOGIN']."','".$thisData['PW']."','".$thisData['TEL']."','".$thisData['CEL']."')");				
				break;
				}
				$thisData['ID']=mysql_insert_id();
				//$this->resultPunto("dojo.debug('id ".mysql_insert_id()."');");
				if ($resMysql12 !=1)
				{
					// errore DbMysql
					// toaster
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Errore Database &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
				}
				else
				{
					// rimettere a posto CP
					switch ($thisName)
					{
					case "PERSONALSPEC":
					case "ROOMSPEC":
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','".$thisWidgetId.":$thisFather:$thisTarget:$thisName:OPEN_ADD:'+document.getElementById('IPIDPERSONAL').value)\\\\\\\">Aggiungi</button>\\\");");
					break;
					default:
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','".$thisWidgetId.":$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button><br/><div id='toasterInt'></div>\\\");");
					break;
					}

					// toaster
					$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxgreen';status.innerHTML = '&nbsp;&nbsp;Dati aggiunti &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 2000).play();");
					// AGGIUNGERE I DATI NELLA TABELLA
					switch ($thisName)
					{
					case "PERSONALSPEC":
					case "ROOMSPEC":
						$tmpPoint = "";
							for($i=1;$i<=$thisData['POINT'];$i++)
							{
								$tmpPoint.= "<img src=\\\\\\\"../framework/furoros/share/APP/AID11/star1On.gif\\\\\\\">";
							}
							
						$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.addData({N:".$thisData['ID'].",SPECSPEC:'".$array['specspecNome'.$thisData['SPECSPEC']]."',CLIENT:'".$thisData['CLIENT']."',SPEC:'".$array['specNome'.$thisData['SPEC']]."',POINT:'".$tmpPoint."'});");				
					break;
					case "CLIENT":
					case "PERSONAL":
					case "USER":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$thisData['ID'].",NAME:'".$thisData['NAME']."',SECONDNAME:'".$thisData['SECONDNAME']."',TEL:'".$thisData['TEL']."',CEL:'".$thisData['CEL']."'});");				
					break;
					case "SPEC":
					case "PERIOD":
					case "ROOM":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$thisData['ID'].",NAME:'".$thisData['NAME']."'});");				
					break;
					case "SPECSPEC":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$thisData['ID'].",NAME:'".$thisData['NAME']."',SPEC:'".$array['orariNome'.$thisData['SPEC']]."',PERIOD:'".$array['periodNome'.$thisData['PERIOD']]."'});");									
					break;
					case "TIME_DAY":
						$this->resultPunto("dojo.widget.byId('FTCONFIGLIST').store.addData({N:".$thisData['ID'].",NAME:'".$thisData['NAME']."',AMBEGIN:'".$thisData['AMBEGIN']."',AMEND:'".$thisData['AMEND']."',PMBEGIN:'".$thisData['PMBEGIN']."',PMEND:'".$thisData['PMEND']."'});");				
					break;
					}
					// refresh di quello che sia bisogno
					switch ($thisName)
					{
					case "PERSONAL":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_PERSONAL','APP','');");
					break;
					case "ROOM":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_ROOM','APP','');");
					break;
					case "SPEC":
					case "SPECSPEC":
						$this->resultPunto("furoros.Runmodule('11','REFRESH_SPEC','APP','');");
					break;

					}
				}
			}
		break;
			
		case "CLOSE":
			switch ($thisName)
			{
			case "PERSONALSPEC":
			case "ROOMSPEC":
				$this->resultPunto("dojo.debug('CLOSE: '+document.getElementById('IPCLIENT').value);");
				$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:OPEN_ADD:'+document.getElementById('IPIDPERSONAL').value)\\\\\\\">Aggiungi</button>\\\");");
			break;
			default:
				$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','$thisWidgetId:$thisFather:$thisTarget:$thisName:OPEN_ADD')\\\\\\\">Aggiungi</button><div id='toasterInt'></div>\\\");");
			break;
			}
		break;
		case "OPEN_ADD":
		case "OPEN_DEL":
		case "FT_CLICK":
			// post content + validate
			switch ($thisName)
					{
					case "PERSONAL":
						// cambiare content 
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"$tmpContent\\\");");
						// rimettere ID
						$this->resultPunto("dojo.byId('IPIDPERSONAL').value=".$thisId.";");
						$this->resultPunto("dojo.widget.byId('CPCONFIGEDITPERSONALSPEC').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:".$PARAM[1].":".$PARAM[2].":PERSONALSPEC:OPEN_ADD:".$thisId ."')\\\\\\\">Aggiungi</button>\\\");");
						$this->resultPunto("dojo.widget.byId('CPCONFIGLISTPERSONALSPEC').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N' onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:CONFIG:DATA:PERSONALSPEC:FT_CLICK:'+idSelect)\\\\\\\" width='100%' widgetId='FTCONFIGLISTPERSONALSPEC' 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='SPECSPEC' dataType='String' align='center' valign='top'>NOME</th><th field='POINT' dataType='html' align='center' valign='top'>POINT</th></tr></thead><tbody></tbody></table>\\\");");
						$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_PERSONALSPEC WHERE CLIENT=".$thisId);
						while (	$linea11 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
						{
							$tmpPoint = "";
							for($i=1;$i<=$linea11['POINT'];$i++)
							{
								$tmpPoint.= "<img src=\\\\\\\"../framework/furoros/share/APP/AID11/star1On.gif\\\\\\\">";
							}
							$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.addData({N:".$linea11['ID'].",SPECSPEC:'".$array['specspecNome'.$linea11['SPECSPEC']]."',SPEC:'".$array['specNome'.$linea11['SPEC']]."',POINT:'".$tmpPoint."'});");
						}
						mysql_free_result($resMysql12);
					break;
					case "ROOM":
						// cambiare content 
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"$tmpContent\\\");");
						// rimettere ID
						$this->resultPunto("dojo.byId('IPIDPERSONAL').value=".$thisId.";");
						$this->resultPunto("dojo.widget.byId('CPCONFIGEDITPERSONALSPEC').setContent(\\\"<button dojoType='Button' onClick=\\\\\\\"furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:".$PARAM[1].":".$PARAM[2].":ROOMSPEC:OPEN_ADD:".$thisId ."')\\\\\\\">Aggiungi</button>\\\");");
						$this->resultPunto("dojo.widget.byId('CPCONFIGLISTPERSONALSPEC').setContent(\\\"<table bgcolor='#ffffff' dojoType='filteringTable' valueField= 'N' onSelect=\\\\\\\"var idSelect=dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').getSelectedData().N;furoros.Runmodule('11','EVENT_BUTTON_CLICK','APP','CPCONFIGEDITPERSONALSPEC:CONFIG:DATA:ROOMSPEC:FT_CLICK:'+idSelect)\\\\\\\" width='100%' widgetId='FTCONFIGLISTPERSONALSPEC' 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='SPECSPEC' dataType='String' align='center' valign='top'>NOME</th><th field='POINT' dataType='html' align='center' valign='top'>POINT</th></tr></thead><tbody></tbody></table>\\\");");
						$resMysql12 = $mysql12 ->query("SELECT * FROM  OS_DATA_ROOMSPEC WHERE CLIENT=".$thisId);
						while (	$linea11 = mysql_fetch_array($resMysql12, MYSQL_ASSOC))
						{
							$tmpPoint = "";
							for($i=1;$i<=$linea11['POINT'];$i++)
							{
								$tmpPoint.= "<img src=\\\\\\\"../framework/furoros/share/APP/AID11/star1On.gif\\\\\\\">";
							}
							$this->resultPunto("dojo.widget.byId('FTCONFIGLISTPERSONALSPEC').store.addData({N:".$linea11['ID'].",SPECSPEC:'".$array['specspecNome'.$linea11['SPECSPEC']]."',SPEC:'".$array['specNome'.$linea11['SPEC']]."',POINT:'".$tmpPoint."'});");
						}
						mysql_free_result($resMysql12);
					break;
					case "PERSONALSPEC":
					case "ROOMSPEC":
						// controllo: non aprire personalspec se in modalita add e non ha id di personal
						$this->resultPunto("dojo.debug('VALID: ".$PARAM[5]."');");
						if ($PARAM[5]==0)
						{
							$this->resultPunto("var top = dojo.byId('toasterInt');for (var i = 0; i < top.childNodes.length; i++){var currentNode = top.childNodes[i];if (currentNode.nodeType == dojo.dom.ELEMENT_NODE ){top.removeChild(currentNode);}}var status = document.createElement('span');status.style['background-color']='#222222';status.className = 'boxred';status.innerHTML = '&nbsp;&nbsp;Salvare personale prima &nbsp;&nbsp;';top.appendChild(status);dojo.lfx.fadeOut(status, 5000).play();");
						}
						else
						{
							// cambiare content 
							$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"$tmpContent\\\");");
							$this->resultPunto("furoros.Runmodule('11','REFRESH_CONFIG_PERSONALSPECSPEC','APP',document.getElementById('IPSPEC').value);");
						}
					break;
					default:
						// cambiare content 
						$this->resultPunto("dojo.widget.byId('".$thisWidgetId."').setContent(\\\"$tmpContent\\\");");
					break;
					}
		break;
		}
	break;
	}
break;
}