PHP Classes
elePHPant
Icontem

File: class_textbox.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Frits Bergman  >  TextBox  >  class_textbox.php  >  Download  
File: class_textbox.php
Role: Class source
Content type: text/plain
Description: Textbox with odbc-support.
Class: TextBox
Author: By
Last change: name gone
Date: 10 years ago
Size: 1,184 bytes
 

Contents

Class file image Download
<?php

class TextBox extends Form_Element
{
   
// description: Use for example with class_textbox.php, class_selectbox.php.
    // Show a textbox filled with database-field.
    // version: 1.1
        // history: 13-02-2002 release first version
    // 20-08-2002 debuginfo gone.

   
var $Connection = 0;
    var
$SQL_Update_Query;
    var
$SQL_Show_Query;
    var
$Type = "text";

    function
TextBox($Name)
    {
       
$this->Set_Element_Name($Name);
    }

    function
Show()
    {
        if (
$this->Connection != 0)
        {
           
// update record
           
if (!empty($this->SQL_Update_Query))
            {
               
odbc_exec($this->Connection,$this->SQL_Update_Query);
            }

           
// get rescent field-value from database
           
$result = odbc_exec($this->Connection,$this->SQL_Show_Query);
            if (
odbc_fetch_row($result))
            {
               
$Show_Value = odbc_result($result,1);
               
$Value_String = " value='".$Show_Value."'";
            }
        }
        else
        {
        }
       
       
// show textbox
       
if (!empty($Value_String)) print"<input type=".$this->Type." name='".$this->Element_Name."'".$Value_String.">\n";
        else
        print
"<input type=".$this->Type." name='".$this->Element_Name."'>\n";
    }
}


?>