<!--
<?php
print <<<EOT
--> 
<table id="top_menu" width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth">
  <tr> 
    <td>[<a href="index.php?lfj=$lfj&job=editsort&id=$id">字段列表</a>] [<a href="?lfj=$lfj&job=addfield&id=$id"><font color="#FF0000"><b>添加字段</b></font></a>] 
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth">
  <form name="form1" method="post" action="?lfj=$lfj&action=$job">
    <tr class="head" align="left"> 
      <td colspan="2">字段管理</td>
    </tr>
    <tr> 
      <td width="37%">字段名稱:<font color="#FF0000">(*)</font></td>
      <td width="63%"> 
        <input type="text" name="postdb[title]" value="$_rs[title]">
      </td>
    </tr>
    <tr> 
      <td width="37%">數據庫字段ID:<font color="#FF0000">(*)</font></td>
      <td width="63%"> 
        <input type="text" name="postdb[field_name]" value="$_rs[field_name]" $readonly>
        (必須為3個字母以上,字母後面可以跟數字) </td>
    </tr>
    <tr> 
      <td width="37%">數據庫字段存放數據類型:<font color="#FF0000">(*)</font></td>
      <td width="63%"> 
        <select name="postdb[field_type]"  onChange="field_choose(this.options[this.selectedIndex].value)">
          <option value="varchar" {$field_type[varchar]}>255個字符串以內</option>
          <option value="int" {$field_type[int]}>10位以內純數字</option>
          <option value="mediumtext" {$field_type[mediumtext]}>文本文檔</option>
        </select>
      </td>
    </tr>
    <tr id="field_leng_tr"> 
      <td width="37%">數據庫字段長度:<font color="#FF0000">(*)</font></td>
      <td width="63%"> 
        <input type="text" name="postdb[field_leng]" value="$_rs[field_leng]">
      </td>
    </tr>
    <tr> 
      <td width="37%">用戶填寫的表單類型:<font color="#FF0000">(*)</font></td>
      <td width="63%"> 
        <select name="postdb[form_type]"  onChange="form_choose(this.options[this.selectedIndex].value)">
          <option value="text" {$form_type[text]}>單行文本框</option>
          <option value="textarea" {$form_type[textarea]}>多行文本框</option>
          <option value="select" {$form_type[select]}>下拉菜單</option>
          <option value="radio" {$form_type[radio]}>單選框</option>
          <option value="checkbox" {$form_type[checkbox]}>復選框</option>
          <option value="time" {$form_type[time]}>日期選擇框</option>
        </select>
      </td>
    </tr>
    <tr id="field_inputleng_tr"> 
      <td width="37%">表單輸入框長度:</td>
      <td width="63%"> 
        <input type="text" name="postdb[field_inputleng]" value="$_rs[field_inputleng]" size="5">
        個字 </td>
    </tr>
    <tr id="form_set_tr"> 
      <td width="37%">表單參數選項:<br>
        (適用下拉菜單/單選框/復選框,每個值換一行) </td>
      <td width="63%"> 
        <textarea name="postdb[form_set]" cols="50" rows="5">$_rs[form_set]</textarea>
      </td>
    </tr>
    <tr> 
      <td width="37%">表單默認值:<br>
        (一般為空,如果是多選框多個的話,用<b><font color="#FF0000">/</font></b>線隔開,不能換行) </td>
      <td width="63%"> 
        <textarea name="postdb[form_value]" cols="50" rows="3">$_rs[form_value]</textarea>
      </td>
    </tr>
    <tr> 
      <td width="37%">表單字段單位名稱︰<br>
        (一般為空) </td>
      <td width="63%"> 
        <input type="text" name="postdb[form_units]" size="5" value="$_rs[form_units]">
      </td>
    </tr>
    <tr> 
      <td width="37%">表單附注文字:<br>
        (一般為空) </td>
      <td width="63%"> 
        <textarea name="postdb[form_title]" cols="50" rows="4">$_rs[form_title]</textarea>
      </td>
    </tr>
    <tr> 
      <td width="37%">是否為必填選項:<br>
      </td>
      <td width="63%"> 
        <input type="radio" name="postdb[mustfill]" value="0" $mustfill[0]>
        不限制 
        <input type="radio" name="postdb[mustfill]" value="1" $mustfill[1]>
        必填 
        <!--
        <input type="radio" name="postdb[mustfill]" value="2" $mustfill[2]>
        隱藏(不提供給用戶填寫，可作為二次開發使用) -->
      </td>
    </tr>
    <tr>
      <td width="37%">同意哪些用戶組查看:<br>
        (不選擇的話,都有權限,管理員與本人默認有權限)</td>
      <td width="63%">$group_view</td>
    </tr>
    <tr align="center"> 
      <td colspan="2"> 
        <input type="submit" name="Submit" value="提交">
        <input type="hidden" name="field_name" value="$field_name">
        <input type="hidden" name="list" value="$_rs[list]">
        <input type="hidden" name="postdb[orderlist]" value="$_rs[orderlist]">
      </td>
    </tr>
  </form>
</table> 
<SCRIPT LANGUAGE="JavaScript">
<!--
function field_choose(t){
	if(t=='mediumtext'){
		get_obj('field_leng_tr').style.display='none';
	}else{
		get_obj('field_leng_tr').style.display='';
	}
}
field_choose('$_rs[field_type]');


function form_choose(t){
	if(t=='select'||t=='radio'||t=='checkbox'||t=='select'||t=='pingfen'){
		get_obj('form_set_tr').style.display='';
	}else{
		get_obj('form_set_tr').style.display='none';
	}
	if(t=='text'){
		get_obj('field_inputleng_tr').style.display='';
	}else{
		get_obj('field_inputleng_tr').style.display='none';
	}
}
form_choose('$_rs[form_type]');
//-->
</SCRIPT>
<!--
EOT;
?>
-->
