Location: PHPKode > projects > Stelib > stelib-1.2.1/stelib_form.php
<?php
/*
	stelib_form.php [ Libreria Form ]
	Stefano Sangalli
	01 novembre 2004
*/
//!  Form(): oggetto per la costruzione di un form.
/*!
	Questo oggetto permette di costruire un form con tutti i campi di input:<BR>
	- text
	- date
	- time
	- password
	- textarea
	- select
	- list
	- radiobutton
	- checkbox
	- button
	- submit
	- reset
	- hidden
	- link
	- code: codice aggiuntivo libero
*/

class Form extends Page{
		/// Nome dell'elemento (window.document.<B>FormName</B>)
		var $NAME;
		/// File al quale inviare i dati raccolti nel form
		var $ACTION;
		/// Finestra dove ricevere la risposta ('_self','_blank','...')
		var $TARGET;
		/// Metodo di invio delle variabili ('GET','POST')
		var $METHOD;
		/// Connessione di riferimento
		var $CONNECTION;

		var $FORM_ELEMENT_LIST =array();
		var $FORM_ELEMENT_COUNT=-1;
		var $TMP				=array();

	function Form(
				/// Nome dell'elemento (window.document.<B>FormName</B>)
				$name,
				/// File al quale inviare i dati raccolti nel form
				$action,
				/// Finestra dove ricevere la risposta ('_self','_blank','...')
				$target,
				/// Metodo di invio delle variabili ('GET','POST')
				$method,
				/// Connessione di riferimento
				$connection
				) {
			$this->NAME	=$name;
			$this->ACTION	=$action;
			if ($target) 		{ $this->TARGET=$target; } 			else { $this->TARGET="_self"; }
			if ($method) 		{ $this->METHOD=$method; } 			else { $this->METHOD="POST"; }
			if ($connection) 	{ $this->CONNECTION=$connection; } 	else { $this->CONNECTION="myData1"; }
		}

	function formHeader() {
		# Carica il foglio di stile
		if ($GLOBALS["mosConfig_live_site"] && $GLOBALS["cur_template"]) {
			$css_file=$GLOBALS["mosConfig_live_site"]."/templates/".$GLOBALS["cur_template"]."/css/template_css.css";
		} else {
			$css_file=THEME."/css.css";
			echo "<link href=\"".$css_file."\" rel=\"stylesheet\" type=\"text/css\" />";
		}

 		echo "<script type=\"text/javascript\" charset=\"".DEF_CHARSET."\" src=\"".URL_STELIB_PUBLIC."/date-picker.js\"></script>";

		echo "<form
					name=\"".$this->NAME."\"
					action=\"".$this->ACTION."\"
					target=\"".$this->TARGET."\"
					method=\"".$this->METHOD."\"
					enctype=\"text/html\" accept-charset=\"".DEF_CHARSET."\"
		";
		if ($this->NAME<>"frmMain") {
			echo " onkeypress=\"if (event.keyCode==13) { javascript:window.document.forms['".$this->NAME."'].submit(); } \"";
		}
		echo ">";
		if ($GLOBALS["mosConfig_live_site"] && $GLOBALS["cur_template"]) {
			echo "<TABLE class=\"adminform\">";
		} else {
			echo "<TABLE class=\"form_table\">";
		}
	}

	function formFooter() {
		echo "</table>";
		echo "</form>";
	}
	
	function addText() {
		
	}
	
	function formAddText(
				/// Nome del campo di testo
				$name,
				/// Valore contenuto nel campo di testo
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Lunghezza massima di caratteri del campo di testo
				$size,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="text";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']	=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['size']		=$size;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}

	function formAddSearch(
				/// Nome del campo di testo
				$name,
				/// Valore contenuto nel campo di testo
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Lunghezza massima di caratteri del campo di testo
				$size,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="search";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']	=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['size']		=$size;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}

	function formAddOmniSearch(
				/// Nome del campo di testo
				$name,
				/// Valore contenuto nel campo di testo
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Lunghezza massima di caratteri del campo di testo
				$size,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="omnisearch";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']	=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['size']		=$size;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}

	function formAddDate(
				/// Nome del campo date
				$name,
				/// Valore contenuto nel campo date
				$value,
				/// Etichetta del campo date
				$caption,
				/// Posizione completa nel DOM della pagina: formName.fieldDateName, dove verr�restituita la selezione del calendario
				$return,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class ) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="date";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['return']	=$return;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly'] =$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}
	function formAddPassword(
				/// Nome del campo password
				$name,
				/// Valore contenuto nel campo di testo
				$value,
				/// Etichetta del campo password
				$caption,
				/// Lunghezza massima di caratteri del campo di testo
				$size,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="password";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']	=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['size']		=$size;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}
	function formAddTextArea(
				/// Nome dell'area di testo
				$name,
				/// Valore contenuto nel campo di testo
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Numero di righe
				$rows,
				/// Numero di colonne
				$cols,
				/// Se impostato a <B>true</B> il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class ) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="textarea";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']	=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['rows']		=$rows;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['cols']		=$cols;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class'] 	=$class;
	}
	function formAddSelect(
				/// Nome del campo di testo
				$name,
				/// Valore da comparare sulla quale posizionarsi
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Array bidimensionale dove nella riga 0 ci sono i titoli:<BR>myArray[x]['ID'] : chiave primaria del record<BR> myArray[x]['LABEL'] : etichetta da mostrare nel comboBox
				$dataset,
				/// Funzioni javascript da eseguire all'evento onChange del comboBox: separare le funzioni con ; (punto e virgola)
				$onChange,
				/// Se impostato a true il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']			="select";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']			=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']		=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['dataset']		=$dataset;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['onChange']	=$onChange;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']	=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']		=$class;
	}
	function formAddCheckbox(
				/// Nome del campo di testo
				$name,
				/// Etichetta del pulsante
				$value,
				/// Etichetta del campo di testo
				$caption,
				/// Funzioni javascript da eseguire all'evento onChange del comboBox: separare le funzioni con ; (punto e virgola)
				$onChange,
				/// Se impostato a <B>true</B> il campo e' di sola lettura
				$readonly,
				/// Stile contenuto nel tema grafico da utilizzare
				$class ) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="checkbox";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']		=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['onChange']	=$onChange;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['readonly']	=$readonly;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']		=$class;
	}
	function formAddButton(
				/// Etichetta del pulsante
				$value,
				/// Funzioni javascript da eseguire all'evento onClick
				$onClick,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="button";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['onClick']	=$onClick;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']		=$class;
	}
	function formAddSubmit(
				/// Etichetta del pulsante
				$value,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="submit";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']		=$class;
	}
	function formAddReset(
				/// Etichetta del pulsante
				$value,
				/// Stile contenuto nel tema grafico da utilizzare
				$class) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="reset";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']		=$class;
	}
	function formAddHidden(
				/// Nome del campo
				$name,
				/// Valore del campo
				$value,
				/// Funzioni javascript da eseguire all'evento onChange del comboBox: separare le funzioni con ; (punto e virgola)
				$onChange) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']			="hidden";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['name']			=$name;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['value']		=$value;
			if ($onChange) { $this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['onChange']	=$onChange; }
	}
	function formAddLink(
				/// Testo da visualizzare
				$caption,
				/// URL di destinazione
				$href,
				/// Finestra dove redirigere l'output
				$target,
				/// Metodo di invio delle variabili
				$method,
				/// Classe di stile da applicare al link
				$class ) {
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="link";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['caption']	=$caption;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['href']		=$href;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['target']	=$target;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['method']	=$method;
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['class']	=$class;
	}
	function formAddCode($code) {
		/// Aggiunge del codice nel form
		$this->FORM_ELEMENT_COUNT++;
		$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]= array();
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['type']		="code";
			$this->FORM_ELEMENT_LIST[$this->FORM_ELEMENT_COUNT]['code']		=$code;
	}
	function formDesignElement($ELEMENT_NUMBER) {
		switch ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['type']) {
			case "text":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
					include_once(PATH."/stelib_inputText.php");
					$inputText = new inputText($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['size'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']);
					$inputText->designInputText();
				echo "</TD></TR>";
			break;
			case "search":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
					include_once(PATH."/stelib_inputSearch.php");
					$inputSearch = new inputSearch($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['size'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']);
					$inputSearch->designInputSearch();
				echo "</TD></TR>\n";
			break;
			case "omnisearch":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
					include_once(PATH."/stelib_inputOmniSearch.php");
					$inputOmniSearch = new inputOmniSearch($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['size'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']);
					$inputOmniSearch->designInputOmniSearch();
				echo "</TD></TR>\n";
			break;
			case "date":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']==false) {
					echo "	<INPUT type=\"text\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\" size=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['size']."\">";
					echo "	<INPUT type=\"button\" value=\"Calendar\" onClick=\"javascript:show_calendar('".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['return']."');\" style=\"cursor: pointer;\">";
				} else {
					echo $this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'];
					echo "	<INPUT type=\"hidden\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\">";
				}
				echo "</TD></TR>\n";
			break;
			case "password":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
					include_once(PATH."/stelib_inputPassword.php");
					$inputText = new inputPassword($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['size'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly'],$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']);
					$inputText->designinputPassword();
				echo "</TD></TR>\n";
			break;
			case "textarea":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
				echo "<TEXTAREA name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" dir=\"ltr\" lang=\"it\" charset=\"".DEF_CHARSET."\" ";
				echo " rows=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['rows']."\" ";
				echo " cols=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['cols']."\" ";
				echo " class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\" ";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']) {
					echo " readonly";
				}
				echo ">";
				//echo trim($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']);
				//echo urldecode(trim($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']));
				//echo htmlspecialchars(trim($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']));
				
				
				//echo (trim($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']));
				echo (trim(stripslashes($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'])));
				
				
				//echo decode($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']);
				//echo html_entity_decode($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],ENT_QUOTES,DEF_CHARSET);
	
				//echo trim(htmlspecialchars($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']));
				//echo htmlentities($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'],ENT_QUOTES);
//echo ereg_replace("\r\n"," ",$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']);
// echo $this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'];
				//$tmpstring=$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'];
				//$tmpstring=trim($tmpstring);
				//$tmpstring=html_entity_decode($tmpstring);
				//echo $tmpstring;

				// 	if (!empty($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'])) {
				// 		 $prev_tmpstring = urldecode($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']);
				// 		 if ($tmpstring == trim(htmlspecialchars($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']))) {
				// 			  $tmpstring  = $this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value'];
				// 		 }
				// 	}
				//		echo $tmpstring;
				echo "</TEXTAREA>";
				echo "</TD></TR>\n";
			break;
			case "select":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
				echo "<SELECT name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" onChange=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['onChange']."\" charset=\"".DEF_CHARSET."\" ";
				echo " class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\" ";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']==true) { echo " disabled"; }
				echo ">";
				echo "	<OPTION value=\"\">NULL</OPTION>";
				for ($cont=1;$cont<count($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset']);$cont++) {
					echo "<OPTION value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][$cont][$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][0][0]]."\" ";
					if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][$cont][$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][0][0]]==$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']) {
						echo " selected";
					}
					echo ">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][$cont][$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['dataset'][0][1]]."</OPTION>";
				}
				echo "</SELECT>";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']==true) {
					echo "<INPUT type=\"hidden\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\">";
				}
				echo "</TD></TR>\n";
			break;
			case "checkbox":
				echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD><span class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."_caption\">".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption']."</span></TD><TD>";
				echo "<INPUT type=\"checkbox\" class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" onClick=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['onChange']."\"";
				if (($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']=="true")||($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']==1)) {
					echo " checked";
				}
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']==true) {
					echo " disabled";
				}
				echo ">";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['readonly']==true) {
					echo "<INPUT type=\"hidden\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\">";
				}
				echo "</TD></TR>\n";
			break;
			case "button":
				//echo "<TR class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\"><TD></TD><TD>";
				echo "<TR><TD></TD><TD>";
				echo "<INPUT type=\"button\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\" class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\" onClick=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['onClick']."\">";
				echo "</TD></TR>\n";
			break;
			case "submit":
				echo "<TR><TD></TD><TD>";
				echo "<INPUT type=\"submit\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\" class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\">";
				echo "</TD></TR>\n";
			break;
			case "reset":
				echo "<TR><TD></TD><TD>";
				echo "<INPUT type=\"reset\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\" class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\">";
				echo "</TD></TR>\n";
			break;
			case "hidden":
				echo "<INPUT type=\"hidden\" name=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['name']."\" value=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['value']."\"";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['onChange']) {
					echo "onChange=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['onChange']."\"";
				}
				echo ">\n";
			break;
			case "link":
				echo "<TR".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."><TD></TD><TD align=\"right\">";
				echo "<A href=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['href']."\"";
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['target']<>"")	{ echo " target=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['target']."\""; }
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['method']<>"")	{ echo " method=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['method']."\""; }
				if ($this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']<>"")		{ echo " class=\"".$this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['class']."\""; 	}
				echo ">";
				echo $this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['caption'];
				echo "</A>";
				echo "</TD></TR>\n";
			break;
			case "code":
				echo $this->FORM_ELEMENT_LIST[$ELEMENT_NUMBER]['code'];
				echo "\n";
			break;
		}
	}
	function formDesign() {
		/// Disegna gli elementi aggiunti alla classe form
		$this->formHeader();
		for ($cont=0;$cont<=count($this->FORM_ELEMENT_LIST)-1;$cont++) {
			$this->formDesignElement($cont);
		}
		$this->formFooter();
	}
}
?>
Return current item: Stelib