Location: PHPKode > projects > ConPortal > conportal/inc/forms.php
<?php
/*
 *  ConPortal - Pomona College ITS scheduling appplication
 *  Copyright (C) 2005-2006  Pomona College
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

function print_text_input_field($name, $extraOptions = "")
{
    $string = '<input type="text" name="'.$name.'" ';
    if (isset($_SESSION['formValues'][$name]) && $_SESSION['formValues'][$name] != "")
    {
        $string.= 'value="'.$_SESSION['formValues'][$name].'" ';
    }
    if (isset($extraOptions) && $extraOptions != "")
    {
        $string.= $extraOptions;
    }
    $string.= ' />';

    echo $string;
}

function print_textarea_field($name, $value = "", $extraOptions = "")
{
    $string = '<textarea name="'.$name.'" ';
    if (isset($extraOptions) && $extraOptions != "")
    {
        $string.= $extraOptions;
    }
    $string.= '>';
    if (isset($_SESSION['formValues'][$name]) && $_SESSION['formValues'][$name] != "")
    {
        $string.= $_SESSION['formValues'][$name];
    }
    $string.= '</textarea>';

    echo $string;
}

function print_submit_field($value, $extraOptions = "")
{
    $string = '<input type="submit" value="'.$value.'" ';
    if (isset($extraOptions) && $extraOptions != "")
    {
        $string.= $extraOptions;
    }
    $string.= ' />';

    echo $string;
}
?>
Return current item: ConPortal