<?php include 'header.tpl.php';?>
<style>
.me_menu{float:left;width:100%}
.me_menu li{float:left;padding:5px 10px 3px 10px;margin-top:10px;cursor:pointer;}
.me_menu .sel{color:#0000ff}
</style>
<script>
function me_set_lab(msgid){
	var obj_x,obj_y;
	for(var i=1;i<4;i++){
		obj_x=document.getElementById("id_label_"+i);
		obj_y=document.getElementById("id_menu_"+i);
		if(i==msgid){
			obj_x.style.display="";
			obj_y.className="sel";
		}else{
			obj_x.style.display="none";
			obj_y.className="";
		}
	}
}
</script>
<div class="pMenu">
<li><a href="javascript:frmExecute('');">管理</a></li>
<?php if($get_id>0):?>
<li><a href="javascript:frmSet('id',0);frmExecute('edit');">添加</a></li>
<li class="sel"><a href="javascript:frmExecute('edit');">编辑</a></li>
<?php else:?>
<li class="sel"><a href="javascript:frmSet('id',0);frmExecute('edit');">添加</a></li>
<?php endif;?>
<li class="info"><a href="javascript:inc_show_help(214);" style="color:#ff0000">帮助</a></li>
</div>
<div class="me_menu">
<li class="sel" onclick="me_set_lab(1);" id="id_menu_1">基本信息</li>
<li onclick="me_set_lab(2);" id="id_menu_2">字段管理</li>
</div>
<div style="float:left;width:100%" id="id_label_1">
	<table class='pEditTable'>
	<tr class='pTabTitRow'><td class='pTabTitCol' colspan="2"></td></tr>
	<tr><td class="pTabColName">行业：</td><td class="pTabColVal">
		<select name="temp_industry">
		<?php foreach($arr_industry as $item){
				$str_sel="";
				if($item==$arr_temp["temp_industry"]) $str_sel=" selected";
				echo "<option value='".$item."'".$str_sel.">".$item."</option>";
			}?>
		</select></td></tr>
	<tr><td class="pTabColName" width="100px">名称：</td><td class="pTabColVal"><input type="text" name="temp_title" value="<?php echo $arr_temp["temp_title"];?>" size=15>　<span class="pBetainfo"></span></td></tr>
	<tr><td class="pTabColName">期限：</td><td class="pTabColVal"><input type="text" name="temp_limit" value="<?php echo $arr_temp["temp_limit"];?>" size=15> 年 (0表示不限)</td></tr>
	<tr><td class="pTabColName">允许多人使用：</td><td class="pTabColVal"><input type="radio" name="temp_unique" value="0" checked>是&nbsp;&nbsp;<input type="radio" name="temp_unique" value="1"<?php if($arr_temp["temp_unique"]==1) echo " checked";?>>否</td></tr>
	<tr><td class="pTabColName">价格：</td><td class="pTabColVal"><input type="text" name="temp_price" value="<?php echo $arr_temp["temp_price"];?>" size=50></td></tr>
	<tr><td class="pTabColName">模板目录：</td><td class="pTabColVal"><input type="text" name="temp_path" value="<?php echo $arr_temp["temp_path"];?>" size=50></td></tr>
	<tr><td class="pTabColName">略图：</td><td class="pTabColVal"><input type="text" id="id_temp_pic" name="temp_pic" value="<?php echo $arr_temp["temp_pic"];?>" size=50>&nbsp;<input type="button" name="btnpic" value="选择" style="border:1px #000000 solid" onclick="dialog_winPic('id_temp_pic');"><br><iframe name="frm_upload_pic" src="<?php echo WEB_URL;?>/plus/dialog/upload_attatch.php?obj_id=id_temp_pic" width="300px" height="30px" frameborder=0 scrolling="no"></iframe></td></tr>
	<tr><td class="pTabColName">状态：</td><td class="pTabColVal">
		<select name="temp_state">
		<?php foreach($arr_state as $item=>$key){
				$str_sel="";
				if(intval($key)==$arr_temp["temp_state"]) $str_sel=" selected";
				echo "<option value='".$key."'".$str_sel.">".$item."</option>";
			}?>
		</select></td></tr>
	<tr><td class="pTabColName">&nbsp;</td><td class="pTabSubmit">
	<?php if($obj_ctl_limit->chk_act("save")){?><input type="button" name="subok" value="保 存" class="pSubmit" onclick="frmExecute('save')"><?php }else{?>
	<font color="red">没有保存权限！</font>
	<?php }?>
	　<input type="button" name="subok" value="取　消" class="pCancel" onclick="frmExecute('')"></td></tr>
	</table>
</div>
<div style="float:left;width:100%;display:none" id="id_label_2">
	<table class='pTable' id="id_tab_2">
	<tr class='pTabTitRow'>
		<td class='pTabTitCol'>名</td><td class='pTabTitCol'>类型</td><td class='pTabTitCol'>长度</td><td class='pTabTitCol'>必填</td><td class='pTabTitCol'>默认值</td>
		<td class='pTabTitCol'>操作</td></tr>
	<tr class='pTabRow' style="display:none">
		<td class='pTabCol'><input type="input" name="fields_name[]" value="" size="20"></td><td class='pTabCol'>
		<select name="fields_type[]">
		<?php foreach($arr_fields_type as $item=>$key){
					echo "<option value='".$key."'>".$item."</option>";
			}
		?>
		</select></td><td class='pTabCol'><input type="input" name="fields_len[]" value="" size="5"></td>
		<td class='pTabCol'><select name="fields_notnull[]"><option value="0">否</option><option value="1">是</option></td>
		<td class='pTabCol'><input type="text" name="fields_value[]" value=""></td>
		<td class='pTabCol'><a href="javascript:table_row_del('id_tab_2','THISID')">删除</a></td></tr>
	<?php foreach($arr_temp["fields_cont"] as $field){
			$str_id=$field["name"];
		?>
		<tr class='pTabRow' id="id_<?php echo $str_id;?>">
			<td class='pTabCol'><input type="input" name="fields_name[]" value="<?php echo $field["name"];?>" size="20"></td><td class='pTabCol'>
			<select name="fields_type[]">
			<?php foreach($arr_fields_type as $item=>$key){
					$str_sel="";
					if($field["type"]==$key) $str_sel=" selected";
						echo "<option value='".$key."'".$str_sel.">".$item."</option>";
				}
			?>
			</select></td><td class='pTabCol'><input type="input" name="fields_len[]" value="<?php echo $field["len"];?>" size="5"></td>
			<td class='pTabCol'><select name="fields_notnull[]"><option value="0">否</option><option value="1"<?php if($field["notnull"]=="1") echo " selected";?>>是</option></td>
			<td class='pTabCol'><input type="text" name="fields_value[]" value="<?php echo $field["value"];?>"></td>
			<td class='pTabCol'><a href="javascript:table_row_del('id_tab_2','id_<?php echo $str_id;?>')">删除</a></td></tr>
	<?php }?>
	</table>
	<div class="pFootAct" id="id_test">
	<li>　　　<a href="javascript:table_row_insert('id_tab_2')" style="color:#ff6600"> + 添加分类</a></li>
	</div>
</div>
<?php include 'footer.tpl.php';?>		
