<?php include $this->admin_tpl('meta', 'admin');?>
<title>自定义表单管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 模块管理 <span class="c-gray en">&gt;</span> 自定义表单 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <div class="cl tb-top"> 
	  <span class="l">  
	  <a class="btn btn-primary radius" onclick="yzm_open('添加表单','<?php echo U('add');?>','700','505')" href="javascript:;"><i class="yzm-iconfont yzm-icontianjia"></i> 添加表单</a>
	  </span> 
	  <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> 
  </div>
  <form method="post" action="<?php echo U('del');?>" id="myform">
  <table class="table table-border table-bg table-hover table-sort">
    <thead>
      <tr class="text-c">
		<th>表单名称(数据量)</th>
		<th>表名</th>
		<th>简介</th>
		<th>创建时间</th>
		<th>最后提交</th>
		<th>启用</th>
		<th>管理操作</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><a href="<?php echo U('diyform_info/init', array('modelid'=>$val['modelid']))?>" style="text-decoration:none"><?php echo $val['name'].' ('.$val['items'].'条数据)';?></a></td>
			<td><?php echo $val['tablename'];?></td>
			<td><?php echo $val['description'] ? str_cut($val['description'],30) : '无'; ?></td>
			<td><?php echo date('Y-m-d H:i:s',$val['inputtime'])?></td>
			<td><?php echo $val['lasttime'] ? date('Y-m-d H:i:s',$val['lasttime']) : '无'?></td>
			<td>
				<?php if(!$val['disabled']){ ?>
				<span class="yzm-status-enable" data-field="disabled" data-id="<?php echo $val['modelid']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe81f;</i>是</span>
				<?php }else{ ?>
				<span class="yzm-status-disable" data-field="disabled" data-id="<?php echo $val['modelid']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe601;</i>否</span>
				<?php } ?>
			</td>
			<td>
			<a href="<?php echo U('diyform_info/init', array('modelid'=>$val['modelid']))?>"  class="btn-mini btn-success" style="text-decoration:none">信息列表</a> 
			<a href="<?php echo U('index/show', array('modelid'=>$val['modelid']))?>" target="_blank"  class="btn-mini btn-secondary ml-5" style="text-decoration:none">前台浏览</a>
			<a href="<?php echo U('diyform_field/init', array('modelid'=>$val['modelid']))?>"  class="btn-mini btn-primary ml-5" style="text-decoration:none">字段管理</a>
			<a href="javascript:;" onclick="yzm_open('编辑表单','<?php echo U('edit', array('modelid'=>$val['modelid']));?>','700','505')"  class="btn-mini btn-secondary ml-5" style="text-decoration:none">修改</a>
			<a href="javascript:;" onclick="yzm_confirm('<?php echo U('del',array('modelid'=>$val['modelid']));?>', '确定要删除【<?php echo $val['name'];?>】吗？', 1)"  class="btn-mini btn-danger ml-5" style="text-decoration:none">删除</a>
			</td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></i> 暂无数据</div><?php } ?>
  </form>
  <div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer', 'admin');?>
</body>
</html>