Location: PHPKode > scripts > easyForm > easyform/Otibi_Form.php
<?php
/*-------------------------------------------------
# @Class Form
# @Version : Form_2
# @Author  : Abdullah Al-Otibi
#-------------------------------------------------*/

class OtibiForm
{

    var $num = 0;
    var $field  = array();
    var $select = array();
    var $radio  = array();
    var $checkbox = array();
    var $textarea = array();
    
    function _Field($type,$field,$f_name)
    {
        $field = explode(".",$field);
        $type  = explode(".",$type);
        $f_name = explode(".",$f_name);
        $this->num = count($field);
        for($i = 0; $i <($this->num); $i++)
        {
            $this->field.='<input type="'.$type[$i].'" name="'.$field[$i].'"> ' .$f_name[$i]. '<br>';
        }
        return(substr($this->field,5));
    }
    function _Select($select,$s_name)
    {
        $select = explode(".",$select);
        $this->num = count($select);
        $this->select .= '<select name="'.$s_name.'">';
        for($i = 0; $i <($this->num); $i++)
        {
            $this->select.='<option value='.$select[$i].'>'.$select[$i].'</option>';
        }
        $this->select.='</select>';
        return(substr($this->select,5));
    }
    function _Radio($radio,$r_value)
    {
        $radio = explode(".",$radio);
        $r_value = explode(".",$r_value);
        $this->num = count($radio);
        for ($i = 0; $i <($this->num); $i++)
        {
            $this->radio.='<input type="radio" name="'.$radio[$i].'" value="'.$r_value[$i].'">'.$r_value[$i].'';
        }
        return(substr($this->radio,5));
    }
    function _Checkbox($checkbox)
    {
        $checkbox = explode(".",$checkbox);
        $this->num = count($checkbox);
        for ($i = 0; $i <($this->num); $i++)
        {
            $this->checkbox.='<input type="checkbox" name="'.$checkbox[$i].'">'.$checkbox[$i];
        }
        return(substr($this->checkbox,5));
    }
    function _Textarea($textarea,$rows,$cols)
    {
        $textarea = explode(".",$textarea);
        $this->num = count($textarea);
        for ($i = 0; $i <($this->num); $i++)
        {
            $this->textarea.='<textarea name="'.$textarea[$i].'" rows="'.$rows.'" cols="'.$cols.'"></textarea>';
        }
        return(substr($this->textarea,5));
    }
    function _Submit($submit)
    {
        return '<input type="'.$submit.'" name="submit" value="ãæÇÝÞ">';
    }
}



?>
Return current item: easyForm