field_edit_form.inc.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php defined('IN_PHPCMS') or exit('No permission resources.');?>
  2. <table cellpadding="2" cellspacing="1" width="98%">
  3. <tr>
  4. <td width="100">选项列表</td>
  5. <td><textarea name="setting[options]" rows="2" cols="20" id="options" style="height:100px;width:200px;"><?php echo $setting['options'];?></textarea></td>
  6. </tr>
  7. <tr>
  8. <td>选项类型</td>
  9. <td>
  10. <input type="radio" name="setting[boxtype]" value="radio" <?php if($setting['boxtype']=='radio') echo 'checked';?> onclick="$('#setcols').show();$('#setsize').hide();"/> 单选按钮
  11. <input type="radio" name="setting[boxtype]" value="checkbox" <?php if($setting['boxtype']=='checkbox') echo 'checked';?> onclick="$('#setcols').show();$('setsize').hide();"/> 复选框
  12. <input type="radio" name="setting[boxtype]" value="select" <?php if($setting['boxtype']=='select') echo 'checked';?> onclick="$('#setcols').hide();$('setsize').show();" /> 下拉框
  13. <input type="radio" name="setting[boxtype]" value="multiple" <?php if($setting['boxtype']=='multiple') echo 'checked';?> onclick="$('#setcols').hide();$('setsize').show();" /> 多选列表框
  14. </td>
  15. </tr>
  16. <tr>
  17. <td>字段类型</td>
  18. <td>
  19. <select name="setting[fieldtype]" onchange="javascript:fieldtype_setting(this.value);">
  20. <option value="varchar" <?php if($setting['fieldtype']=='varchar') echo 'selected';?>>字符 VARCHAR</option>
  21. <option value="tinyint" <?php if($setting['fieldtype']=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
  22. <option value="smallint" <?php if($setting['fieldtype']=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
  23. <option value="mediumint" <?php if($setting['fieldtype']=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
  24. <option value="int" <?php if($setting['fieldtype']=='int') echo 'selected';?>>整数 INT(10)</option>
  25. </select> <span id="minnumber" style="display:none"><input type="radio" name="setting[minnumber]" value="1" <?php if($setting['minnumber']==1) echo 'checked';?>/> <font color='red'>正整数</font> <input type="radio" name="setting[minnumber]" value="-1" <?php if($setting['minnumber']==-1) echo 'checked';?>/> 整数</span>
  26. </td>
  27. </tr>
  28. <tbody id="setcols" style="display:">
  29. <tr>
  30. <td>每列宽度</td>
  31. <td><input type="text" name="setting[width]" value="<?php echo $setting['width'];?>" size="5" class="input-text"> px</td>
  32. </tr>
  33. </tbody>
  34. <tbody id="setsize" style="display:none">
  35. <tr>
  36. <td>高度</td>
  37. <td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="5" class="input-text"> 行</td>
  38. </tr>
  39. </tbody>
  40. <tr>
  41. <td>默认值</td>
  42. <td><input type="text" name="setting[defaultvalue]" size="40" class="input-text" value="<?php echo $setting['defaultvalue'];?>"></td>
  43. </tr>
  44. <tr>
  45. <td>输出格式</td>
  46. <td>
  47. <input type="radio" name="setting[outputtype]" value="1" <?php if($setting['outputtype']) echo 'checked';?> /> 输出选项值
  48. <input type="radio" name="setting[outputtype]" value="0" <?php if(!$setting['outputtype']) echo 'checked';?> /> 输出选项名称
  49. </td>
  50. </tr>
  51. <tr>
  52. <td>是否作为筛选字段</td>
  53. <td>
  54. <input type="radio" name="setting[filtertype]" value="1" <?php if($setting['filtertype']) echo 'checked';?> /> 是
  55. <input type="radio" name="setting[filtertype]" value="0" <?php if(!$setting['filtertype']) echo 'checked';?>/> 否
  56. </td>
  57. </tr>
  58. </table>
  59. <SCRIPT LANGUAGE="JavaScript">
  60. <!--
  61. function fieldtype_setting(obj) {
  62. if(obj!='varchar') {
  63. $('#minnumber').css('display','');
  64. } else {
  65. $('#minnumber').css('display','none');
  66. }
  67. }
  68. //-->
  69. </SCRIPT>