<?php if (!defined('APP_PATH')) exit;?><!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=utf-8" />
<title></title>
<link href="http://127.0.0.5/Magic/Data/Public/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://127.0.0.5/Magic/Data/Public/js/jquery.js"></script>
<script src="http://127.0.0.5/Magic/Data/Public/js/main.js"></script>
</head>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li>首页</li>
		<li>系统设置</li>
		<li>扩展字段管理</li>
	</ul>
</div>
<div class="rightinfo">
    <div class="tools">
		<ul class="toolbar">
			<li><a href="?r=fields-index-edit&type=<?php echo Q('get.type');?>&value=<?php echo Q('get.value');?>"><span><img src="http://127.0.0.5/Magic/Data/Public/images/t01.png" /></span>添加字段</a></li>
			<li><a href="<?php echo $_SERVER['HTTP_REFERER'];?>"><span><img src="http://127.0.0.5/Magic/Data/Public/images/t02.png" /></span>返回列表</a></li>
		</ul>
    </div>  
   <div class="formtitle1"><span>扩展字段列表</span></div>
   <iframe id="blank" name="blank"  style="display:none" ></iframe>
    <table class="tablelist">
		<thead>
    	<tr>
				<th width="120">排序</th>
				<th width="150">&nbsp;&nbsp;字段名</th>
				<th width="120" >&nbsp;&nbsp;别名</th>
				<th width="150" >类型</th>
				<th width="120" >系统</th>
				<th width="100" >状态</th>
				<th align="center">操作</th>
			</tr>
		</thead>
		<tbody>
			<?php if (empty($list)){ ?>
				<tr><td colspan="7" align="center" style="color:#f00">暂无记录!</td></tr>
			<?php }else{ ?>
			<tbody>
			<?php foreach ($list as $k=>$vo){?>
			<tr>
				<td height="40" width="120" align="center">
					<input type="text" name="sorter" value="<?php echo $vo['sorter'];?>" class="insty"  size="5" style="text-indent:0;height:22px;line-height:22px;text-align:center"   onblur="$('#blank').attr('src','?r=fields-index-sorter&sorter='+this.value+'&fieldid=<?php echo $vo['fieldid'];?>')">
				</td>
				<td height="40" width="150" align="center" ><?php if (empty($vo['field'])){ ?>无字段<?php }else{ ?><?php echo $vo['field'];?><?php }?></td>
				<td height="40" width="120" align="center"><?php echo $vo['name'];?></td>
				<td height="40" width="150" align="center"><?php echo $vo['formtype'];?></td>
				<td height="40" width="120" align="center"><img src="http://127.0.0.5/Magic/Data/Public/images/ico-0<?php echo $vo['issystem'];?>.png" width="15" height="15"></td>
				<td height="40" width="100" align="center"><img src="http://127.0.0.5/Magic/Data/Public/images/ico-0<?php echo $vo['status'];?>.png" width="15" height="15"></td>
				<td height="40" align="center">
				<?php if($vo['issystem']==1){ ?>
					<a href="?r=fields-index-edit&type=<?php echo Q('get.type');?>&value=<?php echo Q('get.value');?>&fieldid=<?php echo $vo['fieldid'];?>">编辑</a> | <i style="color:#ccc;font-style:normal">禁用</i> | <i style="color:#ccc;font-style:normal">删除</i>
				<?php }else{ ?>
					<a href="?r=fields-index-edit&type=<?php echo Q('get.type');?>&value=<?php echo Q('get.value');?>&fieldid=<?php echo $vo['fieldid'];?>">编辑</a> | 
					<?php if($vo['status']==1){ ?>
					<a href="?r=fields-index-status&status=0&id=<?php echo $vo['fieldid'];?>" target="blank">禁用</a>
					<?php }else{ ?>
					<a href="?r=fields-index-status&status=1&id=<?php echo $vo['fieldid'];?>" target="blank">启用</a>
					<?php }?>
					| <a href="javascript:" onclick="confirms('字段删除后将无法恢复，<br>请谨慎操作，确认删除？','?r=fields-index-del&type=<?php echo Q('get.type');?>&model=<?php echo $vo['model'];?>&value=<?php echo $value;?>&field=<?php echo $vo['field'];?>&id=<?php echo $vo['fieldid'];?>')" >删除</a>
				<?php }?>
				</td>
			</tr>
			<?php }?>
			<?php }?>
		</tbody>
	</table>
</div>
 <script type="text/javascript">$('.tablelist tbody tr:odd').addClass('odd');</script>
</body>
</html>
