function xtra_field_build_entry($param_array, $cInfo)
{
    $output = '<tr><td>' . $param_array['description'] . '</td>';
    $params = unserialize($param_array['params']);
    switch ($params['type']) {
        case 'text':
            if ($params['length'] < 256) {
                $length = $params['length'] > 120 ? 'size="120"' : 'size="' . $params['length'] . '"';
                $output .= '<td>' . html_input_field($param_array['field_name'], $cInfo->{$param_array}['field_name'], $length) . '</td></tr>';
            } else {
                $output .= '<td>' . html_textarea_field($param_array['field_name'], DEFAULT_INPUT_FIELD_LENGTH, 4, $cInfo->{$param_array}['field_name']) . '</td></tr>';
            }
            break;
        case 'html':
            $output .= '<td>' . html_htmlarea_field($param_array['field_name'], DEFAULT_INPUT_FIELD_LENGTH, 4, $cInfo->{$param_array}['field_name']) . '</td></tr>';
            break;
        case 'data_list':
            $length = $params['length'] > 120 ? 'size="120"' : 'size="' . $params['length'] . '"';
            $output .= '<td>' . html_input_field($param_array['field_name'], $cInfo->{$param_array}['field_name'], $length . " list='{$param_array['field_name']}'") . '</td>';
            $output .= "<datalist id='{$param_array['field_name']}'>";
            $choices = explode(',', $params['default']);
            while ($choice = array_shift($choices)) {
                $values = explode(':', $choice);
                if ($values[0] != '') {
                    $output .= "<option value='{$values['0']}'>";
                }
            }
            $output .= '</datalist></tr>';
            break;
        case 'hyperlink':
        case 'image_link':
        case 'inventory_link':
            $output .= '<td>' . html_input_field($param_array['field_name'], $cInfo->{$param_array}['field_name'], 'size="' . DEFAULT_INPUT_FIELD_LENGTH . '"') . '</td></tr>';
            break;
        case 'integer':
        case 'decimal':
            $output .= '<td>' . html_input_field($param_array['field_name'], $cInfo->{$param_array}['field_name'], 'size="13" maxlength="12" style="text-align:right"') . '</td></tr>';
            break;
        case 'date':
        case 'time':
        case 'date_time':
            $output .= '<td>' . html_input_field($param_array['field_name'], $cInfo->{$param_array}['field_name'], 'size="21" maxlength="20"') . '</td></tr>';
            break;
        case 'drop_down':
        case 'enum':
            $choices = explode(',', $params['default']);
            $pull_down_selection = array();
            $default_selection = '';
            while ($choice = array_shift($choices)) {
                $values = explode(':', $choice);
                $pull_down_selection[] = array('id' => $values[0], 'text' => $values[1]);
                if ($cInfo->{$param_array}['field_name'] == $values[0]) {
                    $default_selection = $values[0];
                }
            }
            $output .= '<td>' . html_pull_down_menu($param_array['field_name'], $pull_down_selection, $default_selection) . '</td></tr>';
            break;
        case 'radio':
            $output .= '<td>';
            $choices = explode(',', $params['default']);
            while ($choice = array_shift($choices)) {
                $values = explode(':', $choice);
                $output .= html_radio_field($param_array['field_name'], $values[0], $cInfo->{$param_array}['field_name'] == $values[0] ? true : false);
                $output .= '<label for="' . $param_array['field_name'] . '_' . $values[0] . '"> ' . $values[1] . '</label>';
            }
            $output .= '</td></tr>';
            break;
        case 'multi_check_box':
            $output .= '<td>';
            $output .= '<table frame="border"><tr>';
            $choices = explode(',', $params['default']);
            $selected = explode(',', $cInfo->{$param_array}['field_name']);
            $i = 1;
            while ($choice = array_shift($choices)) {
                $values = explode(':', $choice);
                $output .= '<td>';
                $output .= html_checkbox_field($param_array['field_name'] . $values[0], $values[0], in_array($values[0], $selected) ? true : false);
                $output .= '<label for="' . $param_array['field_name'] . $values[0] . '"> ' . $values[1] . '</label>';
                $output .= '</td>';
                if ($i == 4) {
                    $output .= '</tr><tr>';
                    $i = 0;
                }
                $i++;
            }
            $output .= '</tr></table>';
            $output .= '</td></tr>';
            break;
        case 'check_box':
            $output .= '<td>' . html_checkbox_field($param_array['field_name'], '1', $cInfo->{$param_array}['field_name'] == 1 ? true : false) . '</td></tr>';
            break;
        case 'time_stamp':
        default:
            $output = '';
    }
    return $output;
}
		  <td align="right"><?php 
echo TEXT_MESSAGE_SUBJECT;
?>
</td>
		  <td><?php 
echo html_input_field('message_subject', $message_subject, 'size="75"');
?>
</td>
	    </tr>
	    <tr>
		  <td align="right" valign="top"><?php 
echo TEXT_MESSAGE_BODY;
?>
</td>
		  <td><?php 
echo html_htmlarea_field('message_body', '60', '8', $message_body);
?>
</td>
	    </tr>
	   </tbody>
	  </table>
	</div>
<?php 
if (sizeof($r_list) > 1) {
    ?>
	<div id="frm_select">
	<p><?php 
    echo GEN_HEADING_PLEASE_SELECT;
    ?>
</p>
	  <?php