<?php include 'header.tpl.php';?>
<div class="pMenu">
<li><a href="javascript:frmExecute('');">管理</a></li>
<li class="sel"><a href="javascript:frmExecute('add');">添加</a></li>
<li class="info"><a href="javascript:inc_show_help(192);" style="color:#ff0000">帮助</a></li>
</div>
<div>
<table class='pEditTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol' colspan="2"></td></tr>
<tr><td class="pTabColName">所属组：</td><td class="pTabColVal">
<select name="config_model_id">
<?php foreach($arr_model as $item){?>
<option value="<?php echo $item["model_id"];?>" <?php if($item["model_id"]==$get_model_id) echo " selected";?>><?php echo $item["model_name"];?></option>
<?php }?>
</select>
</td></tr>
<tr><td class="pTabColName">类　型：</td><td class="pTabColVal">
	<select name="config_type" onchange="changeType(this.value)">
	<option value="str">文本</option>
	<option value="textarea">多行文本</option>
	<option value="int">数字</option>
	<option value="date">日期</option>
	<option value="bool">布尔</option>
	<option value="list">列表</option>
	<option value="chk">多选</option>
	<option value="array">数组</option>
	</select>
	</td></tr>
<tr><td class="pTabColName">变量名：</td><td class="pTabColVal"><input type="input" name="config_name" value="" size=50></td></tr>
<tr style="display:none" id="obj_sel"><td class="pTabColName">值列表：</td><td class="pTabColVal"><textarea name='config_list' id="config_list" style='width:400px;height:120px' onpropertychange='this.style.posHeight=this.scrollHeight+2'></textarea></td>
	</tr>
<tr><td class="pTabColName">默认值：</td><td class="pTabColVal" id="obj_textarea"><input type="input" name="config_val" value="" size=50></td></tr>
<tr><td class="pTabColName">说　明：</td><td class="pTabColVal"><input type="input" name="config_intro" value="" size=50></td></tr>
<tr><td colspan=2 class="pTabSubmit"><input type="button" name="dosubmit" value="保存" class="pSubmit" onclick="frmExecute('save')"></td></tr>
</table>
<script>
function changeType(msgval)
{
	obj=document.getElementById("obj_sel");
	if(msgval=="list"||msgval=="chk")
	{
		obj.style.display="";
		areabox_autoheight("config_list");
	}else{
		obj.style.display="none";
	}
	obj=document.getElementById("obj_textarea");
	if(msgval=="textarea"||msgval=="array")
	{
		obj.innerHTML="<textarea name='config_val' id='config_val' style='width:400px;height:120px' onpropertychange='this.style.posHeight=this.scrollHeight+2'></textarea>";
		areabox_autoheight("config_val");
	}else{
		obj.innerHTML="<input type='input' name='config_val' value='' size=50>";
	}
}
</script>
</div>
<?php include 'footer.tpl.php';?>		