<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_right.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站后台管理</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
<style type="text/css">
ul.diyul{list-style:none; clear:both;width:450px}
ul.diyul li{float:left; width:140px; padding:4px; overflow:hidden}
</style>
</head>

<body>

	<form action="" method="post" name="myform" enctype="multipart/form-data">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="id" value="<?php echo $id;?>" />
	<table class="table-wrap" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">字段名称<span>*</span></td>
			<td><input type="text" title="请输入字段名称" name="info[name]" class="input-txt" size="18" /></td>
			<td class="tb-tips">请输入字段名称</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">字段变量<span>*</span></td>
			<td><input type="text" title="请输入字段变量" name="info[enname]" class="input-txt" size="18" /></td>
			<td class="tb-tips">字段变量由1-32位字母、数字、下划线组成</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">字段类型<span>*</span></td>
			<td colspan="2">
			<ul class="diyul">
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" checked="checked" value="text" />单行文本(text)</label></li>			
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="password" />密 码 框(password)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="textarea" />多行文本(textarea)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="number" />数 字 型(number)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').show();" value="radio" />单选按钮(radio)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').show();" value="checkbox" />多选按钮(checkbox)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').show();" value="select" />下 拉 框(select)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="video" />媒体文件(video)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="style" />颜色字体(style)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="image" />单张图片(image)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="images" />多张图片(images)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="attachment" />附件下载(attachment)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="datetime" />日期时间(datetime)</label></li>	
			  	<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="fckeditor" />编 辑 器(fckeditor)</label></li>		
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="map" />地图标注(map)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="area" />地区(area)</label></li>	
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="industy" />行业类型(industy)</label></li>
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="istop" />Top15(istop)</label></li>
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="isfocus" />加入幻灯(isfocus)</label></li>
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="istopic" />首页头版(istopic)</label></li>
				<li><label><input type="radio" class="radio" name="info[form]" onclick="$('#optiontbody').hide();" value="expire" />有效期限(expire)</label></li>
			  </ul>
			</td>
		</tr>
		<tbody id="optiontbody" style="display:none">
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">选项值<span>*</span></td>
			<td colspan="2"><textarea name="info[options]" class="input-txtarea"  cols="55" rows="4"><?php echo "选项值|选项\n选项值|选项";?></textarea></td>
		</tr>
		</tbody>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">字段长度<span>*</span></td>
			<td><input type="text" title="请输入字段长度" name="info[length]" value="255" class="input-txt" size="6" /></td>
			<td class="tb-tips">如果字段为小数,用 "," 表示小数位数。如:8,5</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">表单提示</td>
			<td><input type="text" title="请输入表单提示" name="info[tips]" class="input-txt" size="28" /></td>
			<td class="tb-tips">请输入表单提示</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">计量单位</td>
			<td><input type="text" title="请输入计量单位" name="info[unit]" class="input-txt" size="6" /></td>
			<td class="tb-tips">如：个，元，吨等，没有请留空</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">模板CSS</td>
			<td><input type="text" title="请输入模板CSS" name="info[css]" class="input-txt" size="6" /></td>
			<td class="tb-tips">请输入模板CSS</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">数据校验</td>
			<td>
			<select name="info[regex]">
				<option value="">不进行校验</option>
				<option value="limit">常用正则</option>
				<option value="limit3_50">3-50个字符</option>
				<option value="userName">用户名</option>
				<option value="usePsw">用户密码</option>
				<option value="number">数字</option>
				<option value="integer">整数</option>
				<option value="english">字母</option>
				<option value="chinese">中文</option>
				<option value="email">E-mail</option>
				<option value="qq">QQ</option>
				<option value="url">超级链接</option>
				<option value="mobile">手机号码</option>
				<option value="phone">电话号码</option>
				<option value="ip">IP地址</option>	
			</select>
			</td>
			<td class="tb-tips">请输入数据校验</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">必选项</td>
			<td>
			<label><input type="radio" value="1" name="info[notnull]" />开启</label>
			&nbsp;&nbsp;
			<label><input type="radio" checked="checked" value="0" name="info[notnull]" />关闭</label>
			</td>
			<td class="tb-tips">必选项则不能为空!</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">默认值</td>
			<td><input type="text" title="请输入默认值" name="info[default]" class="input-txt" size="28" /></td>
			<td class="tb-tips">如果字段类型有多个默认值用 "," 分开!</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">使用权限</td>
			<td colspan="2">
				<?php
				foreach($memgrade as $r)
				{
				?>
				<label title="选中<?php echo $r['name'];?>"><input type="checkbox" checked="checked" value="<?php echo $r['id'];?>" name="info[membergrade][]" /><?php echo $r['name'];?></label> &nbsp;&nbsp;
				<?php
					}
				?>
			</td>
		</tr>
		<tr>
			<td colspan="3" class="save-td"><input type="submit" class="save-btn" value="保存字段" /></td>
		</tr>
	</table>
	</form>
</body>
</html>
