get_$field_ie($type, $value, $param1, $param2, $display, $addtnl_params, $use_default_value)

An alternate "getter" method will output the form input element code for a variable

    - form element "types": textbox, password, textarea, select, radio, checkbox, hidden

    - textbox:  get_$field_ie('textbox'$default_value$sizeunused$display$addtnl_params$use_default_value); 
      <input type="textbox" name="$class_name[$field]" id="$field" size="$size" value="$default_value" $addtnl_params>

    - password:  get_$field_ie('password'$default_value$sizeunused$display$addtnl_params$use_default_value); 
      <input type="password" name="$class_name[$field]" id="$field" size="$size" value="$default_value" $addtnl_params>

    - textarea:  get_$field_ie('textarea'$default_value$rows$cols$display$addtnl_params$use_default_value); 
      <textarea name="$class_name[$field]" id="$field" rows="$rows" cols="$cols" $addtnl_params>$default_value</textarea>

    - select:  get_$field_ie('select'$default_value$list$multiple$display$addtnl_params$use_default_value); 
    - select:  get_$field_ie('select'"2""1|small||2|big||3|very big"$multiple$display$addtnl_params$use_default_value); 
    - if multiple is set to true, the field_name becomes $class[$field_name][] and MULTIPLE is added into <select >
    - the list can also be an array such as $list = array('1'=>'small','2'=>'big','3'=>'very big');
    - multiple elements can be selected by making $value an array, or by making $value a string of values seperated by ||
      for instance $value = 'val1||val3'
        <select name="$class_name[$field_name]" id="$field_name" $additional_params>
          <option value="1">small</option>
          <option value="2" selected>big</option>
          <option value="3">very big</option>
        </select>

    - option:  get_$field_ie('radio'$value$list$display_seperator$display$addtnl_params$use_default_value); 
    - option:  get_$field_ie('radio'"2""1|small||2|big||3|very big"'<br>'$display$addtnl_params$use_default_value); 
        <option name="$class_name[$field_name]" id="$field_name" value="1" $additional_params> small
        <option name="$class_name[$field_name]" id="$field_name" value="2" selected $additional_params> big
        <option name="$class_name[$field_name]" id="$field_name" value="3" $additional_params> very big

  * if "display" is true, the value will be displayed in plain text, and a hidden input element will be created to resubmit the form with the same value. for confirmation pages.
  * if "display" == 'hidden', the value will not be displayed, but the hidden input element will be. for confirmation pages with custom display to user.
  * if type is 'password', displayed value will be ********

  * if "use_default_value" is "GET" or "POST", the value will be set to $_"GET/POST"['table_name']['column_name'].
  * if "use_default_value" is "CURRENT", the value will be set to the current value of $this->{$column_name}


This is one function that can be used numerous ways

Examples:

example1.php
<?php
include("lib.php");
load("person");

$p = new person($_GET['person_id']);
if (
$person $_POST['person'])
{
    if (
$errors $p->set_from_array($person))
    {
        echo 
"Errors: ".impload(", "$errors);
    }
    else
    {
        if (!
$p->update())
        {
            echo 
"Failed to update person";
            return 
0;
        }
        echo 
"Person successfully updated";
        return 
0;
    }
}
else
{
    
$_POST['person'] = $p->set_to_array();
}
?>

<form method=post action=example1.php?person_id=<?=$_GET['person_id']?>>
<table>
 <tr><td>Name:     </td><td> <?=$p->get_name_ie('textbox'$_POST['person']['name'], 20)?>           </td></tr>
 <tr><td>Address:  </td><td> <?=$p->get_address_ie('textbox'$_POST['person']['address'], 20)?>     </td></tr>
 <tr><td>City:     </td><td> <?=$p->get_city_ie('textbox'$_POST['person']['city'], 20)?>           </td></tr>
 <tr><td>State:    </td><td> <?=$p->get_state_ie('select'$_POST['person']['state'], 'states')?>  </td></tr>
 <tr><td>Zip:      </td><td> <?=$p->get_zip_ie('textbox'$_POST['person']['zip'], 20)?>             </td></tr>
 <tr><td>Phone:    </td><td> <?=$p->get_phone_ie('textbox'$_POST['person']['phone'], 20)?>         </td></tr>
 <tr><td>Email:    </td><td> <?=$p->get_email_ie('textbox'$_POST['person']['email'], 20)?>         </td></tr>
 <tr><td>Age:      </td><td> <?=$p->get_age_ie('textbox'$_POST['person']['age'], 20)?>             </td></tr>
 <tr><td>Birthdate:</td><td> <?=$p->get_birthdate_ie('textbox'$_POST['person']['birthdate'], 20)?> </td></tr>
 <tr><td>Salary:   </td><td> <?=$p->get_salary_ie('textbox'$_POST['person']['salary'], 20)?>       </td></tr>
 <tr><td><input type=submit value=Submit>
</table>
</form>





example2.php - (uses $use_default_value variable)
<?php
include("lib.php");
load("person");

$p = new person($_GET['person_id']);
if (
$person $_POST['person'])
{
    if (
$errors $p->set_from_array($person))
    {
        echo 
"Errors: ".impload(", "$errors);
    }
    else
    {
        if (!
$p->update())
        {
            echo 
"Failed to update person";
            return 
0;
        }
        echo 
"Person successfully updated";
        return 
0;
    }
}
else
{
    
$_POST['person'] = $p->set_to_array();
}
?>

<form method=post action=example2.php?person_id=<?=$_GET['person_id']?>>
<table>
 <tr><td>Name:      </td><td> <?=$p->get_name_ie('textbox'null20nullnullnull'POST')?>         </td></tr>
 <tr><td>Address:   </td><td> <?=$p->get_address_ie('textbox'null20nullnullnull'POST')?>      </td></tr>
 <tr><td>City:      </td><td> <?=$p->get_city_ie('textbox'null20nullnullnull'POST')?>         </td></tr>
 <tr><td>State:     </td><td> <?=$p->get_state_ie('select'null'states'nullnullnull'POST')?> </td></tr>
 <tr><td>Zip:       </td><td> <?=$p->get_zip_ie('textbox'null20nullnullnull'POST')?>          </td></tr>
 <tr><td>Phone:     </td><td> <?=$p->get_phone_ie('textbox'null20nullnullnull'POST')?>        </td></tr>
 <tr><td>Email:     </td><td> <?=$p->get_email_ie('textbox'null20nullnullnull'POST')?>        </td></tr>
 <tr><td>Age:       </td><td> <?=$p->get_age_ie('textbox'null20nullnullnull'POST')?>          </td></tr>
 <tr><td>Birthdate: </td><td> <?=$p->get_birthdate_ie('textbox'null20nullnullnull'POST')?>    </td></tr>
 <tr><td>Salary:    </td><td> <?=$p->get_salary_ie('textbox'null20nullnullnull'POST')?>       </td></tr>
 <tr><td><input type=submit value=Submit>
</table>
</form>





example3.php (example of freezing the form to confirm values)
<?php
include("lib.php");
load("person");

$p = new person();
if (
$person $_POST['person'])
{
    if (
$errors $p->set_from_array($person))
    {
        echo 
"Errors: ".impload(", "$errors);
    }
    elseif(
$_POST["confirm"])
    {
        if (!
$p->insert())
        {
            echo 
"Failed to insert person";
            return 
0;
        }
        echo 
"Person successfully inserted";
        return 
0;
    }
}
$submit_button_name "check";
$display false;
if (
$_POST["confirm"])
{
    
$submit_button_name "confirm";
    
$display true;
    echo 
"Confirm that the values are correct";
}
?>

<form method=post action=example3.php>
<table>
 <tr><td>Name:      </td><td> <?=$p->get_name_ie('textbox'null20null$displaynull'POST')?>         </td></tr>
 <tr><td>Address:   </td><td> <?=$p->get_address_ie('textbox'null20null$displaynull'POST')?>      </td></tr>
 <tr><td>City:      </td><td> <?=$p->get_city_ie('textbox'null20null$displaynull'POST')?>         </td></tr>
 <tr><td>State:     </td><td> <?=$p->get_state_ie('select'null'states'null$displaynull'POST')?> </td></tr>
 <tr><td>Zip:       </td><td> <?=$p->get_zip_ie('textbox'null20null$displaynull'POST')?>          </td></tr>
 <tr><td>Phone:     </td><td> <?=$p->get_phone_ie('textbox'null20null$displaynull'POST')?>        </td></tr>
 <tr><td>Email:     </td><td> <?=$p->get_email_ie('textbox'null20null$displaynull'POST')?>        </td></tr>
 <tr><td>Age:       </td><td> <?=$p->get_age_ie('textbox'null20null$displaynull'POST')?>          </td></tr>
 <tr><td>Birthdate: </td><td> <?=$p->get_birthdate_ie('textbox'null20null$displaynull'POST')?>    </td></tr>
 <tr><td>Salary:    </td><td> <?=$p->get_salary_ie('textbox'null20null$displaynull'POST')?>       </td></tr>
 <tr><td><input type=submit name="<?=$submit_button_name?>" value="Add Person">
</table>
</form>