Source for file DBMS_FIELD_FLOATFORMAT.phpclass

Documentation is available at DBMS_FIELD_FLOATFORMAT.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_FLOATFORMAT.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   real
  8.   *
  9.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   * 
  12.   ***/
  13.  
  14. /**
  15.  * requirements
  16.  */
  17.     require_once dirname(__FILE__)._OCSP_DIRSEP_."DBMS_FIELD_FLOAT.phpclass";
  18.  
  19. /**
  20.   * Class DBMS_FIELD_FLOATFORMAT
  21.   *
  22.   * @project    Open CSP-Management
  23.   * @package    dbms_field
  24.   * @category   real
  25.   *
  26.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  27.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  28.   *
  29.   ***/
  30.     protected $className     = "FloatFormat";
  31.  
  32.     /**
  33.       * source file of the class
  34.       *
  35.       * @var string $classSrcFile 
  36.       * @since pk-05-02-19
  37.       ***/
  38.     protected $classSrcFile=__FILE__;
  39.  
  40.     /**
  41.       * @var string $inputAdd overwrite default
  42.       * @since pk-06-09-01
  43.       * @version pk-06-12-04
  44.       ***/
  45.     protected $inputAdd="style=\"text-align:right;\"";
  46.  
  47.     // ###########################################################
  48.     // OBJECT SETTINGS METHODS
  49.     // ###########################################################
  50.  
  51.     // ###########################################################
  52.     // FIELD DEFINITION DATA METHODS
  53.     // ###########################################################
  54.  
  55.  
  56.     /**
  57.       * adds $this->unit to to parent::getInputTag()
  58.       *
  59.       * @param mixed $aValue the value to set
  60.       * @param string $arrName 
  61.       * @param string $nameAdd  append something to name like "[VALUE]" for search forms
  62.       * @param boolean $debug 
  63.       *
  64.       * @return string 
  65.       *
  66.       * @since pk-05-11-04
  67.       * @version pk-06-05-18 inputAdd added
  68.       * @version pk-06-09-06 align right by default
  69.       *
  70.       ***/
  71.     function getInputTag($aValue,$arrName,$nameAdd="",$debug=FALSE{
  72.         $tag  "<input ";
  73.         $tag .= "name=\"".$arrName."[".$this->myName."]".$nameAdd."\" ";
  74.         if ((!empty($aValue)) || $aValue === "0"{
  75.             $tag .= "value=\"".(pcf_formatCurrency(doubleval($aValue),2,$debug))."\" ";
  76.         }
  77.         if (intval($this->size))        $tag.= " size=\"".$this->size."\" ";
  78.         if (intval($this->maxlength))   $tag.= " maxlength=\"".$this->maxlength."\" ";        
  79.         if ($this->tabIndex)            $tag.= " tabindex=\"".$this->tabIndex."\" ";
  80.         if (!empty($this->inputAdd)) $tag.=" ".$this->inputAdd." ";
  81.         else $tag.=" align=\"right\""// <pk-06-09-06 />
  82.         $tag .= " style=\"text-align:right;\" />";
  83.         $tag .=" ".$this->unit;
  84.         return $tag;
  85.     }
  86.  
  87.  
  88.     /**
  89.       * returns the html representation of the field
  90.       *
  91.       * @param mixed $aValue the falue
  92.       * @param string $arrName name of the global array holding data values
  93.       * @param boolean $debug show debug info
  94.       *
  95.       * @return mixed   the html representation of the field
  96.       *
  97.       *
  98.       ***/
  99.     function getScreenValue($aValue=NULL,$arrName="DBVAL",$debug=FALSE{
  100.         if ($debugecho "<p><b>DBMS_FIELD_FLOATFORMAT::getScreenValue(".$aValue.",...)</b> (".get_class($this)."/".$this->myName.")</p>\n";
  101.         return trim("<nobr>".(pcf_formatCurrency(doubleval($aValue),2,$debug))." ".$this->unit."</nobr>");
  102.     }
  103.  
  104.  
  105. }
  106. ?>

Documentation generated on Thu, 08 Jan 2009 17:41:39 +0100 by phpDocumentor 1.4.0a2