<?php
defined('IN_DESTOON') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form method="post" action="?" id="dform" onsubmit="return check();">
<input type="hidden" name="moduleid" value="1"/>
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>

<input type="hidden" name="catid" value="<?php echo $catid;?>"/>
<input type="hidden" name="post[catid]" value="<?php echo $catid;?>"/>
<input type="hidden" name="id" value="<?php echo $id;?>"/>

<input type="hidden" name="forward" value="<?php echo $forward;?>"/>
<div class="tt"><?php echo $action=='add' ? '添加' : '修改';?>属性</div>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 属性名称</td>
<td><input name="post[title]" type="text"  size="30" id="title" value="<?php echo $title;?>"/> <span id="dtitle" class="f_red"></span></td>
</tr>



<tr>
<td class="tl"><span class="f_red">*</span> 属性单位</td>
<td><input name="post[unit]" type="text"  size="30" id="unit" value="<?php echo $unit;?>"/> <span id="dunit" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> 发布模板</td>
<td>
<input name="post[type]" value="0"  checked=""  type="radio"><label for="t_0"> 普通模板</label>
<input name="post[type]" value="1" type="radio"><label for="t_1"> 账号模板</label>
</td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> 扣费费率</td>
<td>
<input name="post[money]" type="text"  size="30" id="money" value="<?php echo $money;?>"/> 请填入0-100间的数字，如15%的费率，则填15
</td>
</tr>

</table>
<div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value=" 关 闭 " class="btn" onclick="window.parent.location.reload();"/></div>
</form>
<script type="text/javascript">
function c(id) {
	if(id == 1) {
		Dd('v_l').innerHTML = '<span class="f_red">*</span> 备选值';
		Dd('v_r').innerHTML = '多个选项用 | 分隔，例如 红色|绿色(*)|蓝色 (*)表示默认选中';
		Ds('s_c');
	} else if(id == 0) {
		Dd('v_l').innerHTML = '<span class="f_hid">*</span> 默认值';
		Dd('v_r').innerHTML = '';
		Dh('s_c');
	}
}
c(<?php echo $type;?>);
function check() {
	var l;
	var f;
	f = 'title';
	l = Dd(f).value.length;
	if(l < 1) {
		Dmsg('请填写属性名称', f);
		return false;
	}
	f = 'unit';
	l = Dd(f).value.length;
	if(l < 1) {
		Dmsg('请填写属性单位', f);
		return false;
	}
	return true;
}
</script>

<script type="text/javascript">Menuon( <?php echo $on ?>);</script>
<?php include tpl('footer');?>