Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once('class_itext.php');
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class INum extends IText
00041 {
00042 function __construct($name='',$value='')
00043 {
00044 parent::__construct($name,$value);
00045
00046 $this->size=9;
00047 $this->style='class="inum"';
00048 $this->javascript= 'onchange="format_number(this,2);"';
00049 }
00050
00051 public function display()
00052 {
00053
00054 $readonly=" readonly ";
00055 $this->id=($this->id=="")?$this->name:$this->id;
00056
00057
00058 $style=' class="inum input_text_ro"';
00059 $this->value=str_replace('"','',$this->value);
00060 $r='<INPUT '.$style.' TYPE="TEXT" id="'.
00061 $this->id.'"'.
00062 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
00063 'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";
00064
00065
00066 if ( $this->table == 1 ) $r='<td>'.$r.'</td>';
00067
00068 return $r;
00069
00070 }
00071
00072 public function input($p_name=null,$p_value=null)
00073 {
00074 if ( isset ($this->prec)) {
00075 $this->javascript= 'onchange="format_number(this,'.$this->prec.');"';
00076 }
00077 $this->name=($p_name==null)?$this->name:$p_name;
00078 $this->value=($p_value==null)?$this->value:$p_value;
00079 $this->id=($this->id=="")?$this->name:$this->id;
00080
00081 if ( $this->readOnly==true) return $this->display();
00082
00083 $t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
00084
00085 $extra=(isset($this->extra))?$this->extra:"";
00086
00087 $this->value=str_replace('"','',$this->value);
00088 if ( ! isset ($this->css_size))
00089 {
00090 $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00091 $this->id.'"'.$t.
00092 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
00093 'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
00094
00095 } else {
00096 $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00097 $this->id.'"'.$t.
00098 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
00099 ' style="width:'.$this->css_size.';" '.$this->javascript." $this->extra >";
00100
00101 }
00102
00103 if ( $this->table == 1 ) $r='<td>'.$r.'</td>';
00104
00105 return $r;
00106
00107 }
00108
00109 }
00110
00111