type=$p_type; $this->readonly=false; $this->size=20; $this->width=50; $this->heigh=20; $this->value=""; $this->selected=""; $this->table=0; $this->label=""; $this->disabled=false; $this->tabindex=32767; } function SetReadOnly($p_read) { $this->readonly=$p_read; } /*! function IOValue($p_name,$p_value="",$p_label="") ***************************************************** * \brief create the corresponding INPUT tag * * \param $p_name is the INPUT NAME * \param $p_value is the INPUT VALUE or an array for select * \param $p_label is the label of the INPUT * \return string containing the tag */ function IOValue($p_name=null,$p_value=null,$p_label="") { if ( $p_name != null) $this->name=$p_name; $this->value=($p_value===null)?$this->value:$p_value; $this->label=($p_label == "")?$this->label:$p_label; // Input text type $disabled = $this->disabled ? "DISABLED" : ""; if (strtoupper($this->type)=="TEXT") { if ( $this->readonly==false) { $r="name\" VALUE=\"$this->value\" TABINDEX=\"$this->tabindex\" SIZE=\"$this->size\" ".$disabled.">";} else { $r=sprintf('%s', $this->value,$this->name,$this->value); } if ($this->table==1) { if ( $this->label != "") { $r="".$this->label."".$r.""; }else { $r="".$r.""; } } return $r; } // Hidden field if (strtoupper($this->type)=="HIDDEN") { $r=''; if ( $this->readonly==true) return ""; return $r; } // Select value if ( strtoupper($this->type) == "SELECT") { if ($this->readonly==false ){ //echo "Selected ".$this->selected; $r=""; } else { echo_debug('class_widget.php',__LINE__,"this->selected = ".$this->selected); for ( $i=0;$ivalue);$i++) { echo_debug('class_widget.php',__LINE__,"check for ".$this->value[$i]['value']); if ($this->selected==$this->value[$i]['value'] ) { $r=$this->value[$i]['label']; } } } if ( $this->table==1) { $r=" $r "; if ( $this->label != "") $r=" $this->label".$r; } return $r; } // Password if (strtoupper($this->type)=="PASSWORD") { if ( $this->readonly==true) return ""; $r=''; if ($this->table==1) { $r=" $this->label $r "; } return $r; } // Checkbox if (strtoupper($this->type)=="CHECKBOX") { if ( $this->readonly == true) { $check=( $this->selected==true )?"checked":"unchecked"; $r='selected==true )?"checked":"unchecked"; $r=''; } if ($this->table==1) { $r=" $this->label $r "; } else { $r=$r." $this->label"; } return $r; } //radio if (strtoupper($this->type)=="RADIO") { if ( $this->readonly == true) { $check=( $this->selected==true || $this->selected=='t' )?"Yes":"no"; $r=$check; } else { $check=( $this->selected==true||$this->selected=='t' )?"checked":"unchecked"; $r='value\""; $r.=" $check"; $r.=' '.$disabled.'>'; } if ($this->table==1) { $r=" $this->label $r "; } else { $r=$this->label.$r; } return $r; } //textarea if (strtoupper($this->type)=="TEXTAREA") { if ( $this->readonly == false ) { $r=""; $r.='"; } else { $r='

'; $r.=$this->value; $r.=sprintf('', $this->name,urlencode($this->value)); $r.='

'; } if ($this->table==1) { $r=" $this->label $r "; } return $r; } //file if (strtoupper($this->type)=="FILE") { if ( $this->readonly == false ) { $r=''; } if ( $this->table==1) $r="$this->label$r"; return $r; } // input type == js_search_poste => button search for the account if ( strtolower($this->type)=="js_search_poste") { $l_sessid=$_REQUEST['PHPSESSID']; if ( $this->readonly == false ) { // Do we need to filter ?? if ( $this->extra2 == null ) { $r=sprintf(' %s ', $l_sessid, $this->name, $this->extra, $this->label, $this->name, $this->value ); } else { // $p_list is not null, so we have a filter $r=sprintf(' %s ', $l_sessid, $this->name, $this->extra2, $this->extra, $this->label, $this->name, $this->value ); } //else } else { $r=sprintf(' %s ', $this->name, $this->value , $this->value ); } //else if readonly == true return $r; } // end js_search_poste // input type == js_search => button search for card if ( strtolower($this->type)=="js_search") { $l_sessid=$_REQUEST['PHPSESSID']; if ( $this->readonly == false ) { $r=sprintf(' %s ', $l_sessid, $this->extra, // deb or cred $this->name, $this->extra2, //jrn $l_sessid, $this->extra, $this->name, $this->extra2, $this->label, $this->name, $this->value, $this->tabindex ); } else { // readonly == true $r=sprintf(' %s ', $this->label, $this->name, $this->value ); } return $r; }// poste==js_search // type=span if ( strtolower($this->type)=="span") { $r=sprintf('%s', $this->name, $this->value); return $r; }// end type = span // input type == js_tva if ( strtolower($this->type)=="js_tva") { $id=sprintf("",$this->label); $r=sprintf('%s ', $id, $this->name, $this->value, $this->label, $this->name); $l_sessid=$_REQUEST['PHPSESSID']; $r.=sprintf("", $l_sessid,$this->name); return $r; } // input type == js_concerned => button search for the concerned operations if ( strtolower($this->type)=="js_concerned") { if ( $this->readonly == false) { $l_sessid=$_REQUEST['PHPSESSID']; $r=sprintf(' %s ', $l_sessid, $this->name, $this->label, $this->name, $this->value ); } else { $r=sprintf("%s",$this->value); $r.=sprintf('', $this->name,$this->value); } return $r; }// end js_concerned return "INVALID WIDGET "; } //end function /* Debug */ function debug() { echo "Type ".$this->type."
"; echo "name ".$this->name."
"; echo "value". $this->value."
"; $readonly=($this->readonly==false)?"false":"true"; echo "read only".$readonly."
"; } function Submit ($p_name,$p_value) { return ''; } function Reset ($p_value) { return ''; } }