<td nowrap>Bowling Side</td> <td nowrap> <table width='100%'> <?php genRadios('bowlside', $arr_bowlside); ?> </table> </td> </tr> <tr> <td nowrap>Bowling Type</td> <td nowrap> <table width='100%'> <?php genRadios('bowltype', $arr_bowltype); ?> </table> </td> </tr> </table> <p> <input type='submit' name='bn_save' value='Save' /> <input type='button' value='Cancel' onclick="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?> '" />
/** * 生成表单域对应的html * @param array $input * @param array $field 字段信息 * @return string */ public function genHtml(&$input, $field) { $width = $input['width']; $height = $input['height']; $value = $input['value']; $type = $input['type']; $remark = $input['remark']; $class = 'input'; if ('file' == $type) { $fn = "{$field['name']}"; } else { $fn = "{$field['model']}[{$field['name']}]"; } $html = ''; if ('text' == $type) { $html = genText($fn, $width, $value, $class); } else { if ('password' == $type) { $html = genPassword($fn, $width, $value, $class); } else { if ('select' == $type) { $list = $this->optValueToArray($input['opt_value']); $html = genSelect($fn, $list['opt_value'], $list['selected']); } else { if ('radio' == $type) { $list = $this->optValueToArray($input['opt_value']); $html = genRadios($fn, $list['opt_value'], $list['selected']); } else { if ('checkbox' == $type) { $list = $this->optValueToArray($input['opt_value'], true); $html = genCheckboxs($fn, $list['opt_value'], $list['selected']); } else { if ('file' == $type) { $html = genFile($fn); } else { if ('textarea' == $type) { $html = genTextarea($fn, $value, $width, $height, $remark); } else { if ('date' == $type) { $html = genDate($fn, $value, $class); } else { if ('relation_select' == $type) { $relaOpts = $this->getRelationOpts($field); $input['opt_value'] = $this->optArrayToString($relaOpts); $html = genSelect($fn, $relaOpts['opt_value']); } else { if ('editor' == $type) { $html = genEditor($fn, empty($value) ? $remark : $value, $width, $height, $input['editor']); } } } } } } } } } } $input['html'] = $html; }