<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $cfg_soft_lang; ?>">
<title><?php echo $diy->name; ?></title>
<link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/base.css">
<style>
.btn+.btn{margin-left:10px}
</style>
</head>
<body background="images/allbg.gif" leftmargin="8" topmargin="8">
	<div class="bodytitle mt-3">
		<div class="bodytitleleft"></div>
		<div class="bodytitletxt"><?php echo $diy->name; ?>列表</div>
	</div>
	<form action="diy_list.php" method="post">
		<input type="hidden" name="diyid" value="<?php echo $diyid; ?>">
		<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="table maintable" style="margin-top:10px;background:#CFCFCF">
			<tr>
				<td colspan="3" height="26" background="images/tbg.gif">
					<div style="float:left"><a href="diy_main.php">自定义表单管理</a> &gt; <?php echo $diy->name; ?></div>
					<div style="float:right;padding-right:10px"><a href="/apps/diy.php?action=list&diyid=<?php echo $diy->diyid; ?>" target="_blank"><img src="images/gtk-tmp.png" align="left" title="前台预览">前台预览</a></div>
				</td>
			</tr>
			{dede:datalist}
			<?php 
			if(!empty($fields))
			{
				$allowhtml = array('htmltext');
				$fields['sta'] = $fields['ifcheck'] == 1 ? '已审核':'未审核';
				echo '<tr bgcolor="#F8FDE3" height="26"><td width="18%"><input type="checkbox" name="id[]" value="'.$fields['id'].'" class="np"></td><td><a href="diy_list.php?action=edit&diyid='.$diy->diyid.'&id='.$fields['id'].'">'.$fields['id'].'</a> '.$fields['sta'].'</td><td width="12%" align="center"><a href="diy_list.php?action=edit&diyid='.$diy->diyid.'&id='.$fields['id'].'"><img src="images/feedback-edit.gif" border="0" width="46" height="18"></a></td></tr>';
				foreach($fieldlist as $field=>$fielddata)
				{
					if($fields[$field]=='') continue;
					if($fielddata[1]=='img'){
					$fields[$field] = "<a href='{$fields[$field]}' target='_blank'><img src='images/channeladd.gif' border='0'>图片附件</a>\r\n";
					}
					else if($fielddata[1]=='addon'){
					$fields[$field] = "<a href='{$fields[$field]}' target='_blank'><img src='images/channeladd.gif' border='0'>其它附件</a>";
					} else {
						if(!in_array($fielddata[1],$allowhtml)){
							$fields[$field] = dede_htmlspecialchars($fields[$field]);
						}
					}
					echo '<tr height="26"><td bgcolor="#fff">'.$fielddata[0].'</td><td bgcolor="#fff" colspan="2">'.$fields[$field].'</td></tr>';
				}
			} else {
				echo '<tr height="26"><td bgcolor="#fff">暂无记录</td></tr>';
			}
			?>
			{/dede:datalist}
			<tr>
				<td colspan="3" bgcolor="#fff">{dede:pagelist listsize='6'/}</td>
			</tr>
			<tr>
				<td colspan="3" height="36" bgcolor="#f6f6f6">
					<input type="button" name="select" onClick="selAll()" class="btn btn-success btn-sm" value="全选">
					<input type="button" name="select" onClick="noSelAll()" class="btn btn-success btn-sm" value="取消">&nbsp;
					<label><input type="radio" name="action" value="check">&nbsp;审核</label>
					<label><input type="radio" name="action" value="delete">&nbsp;删除</label>
					<input type="submit" name="submit" class="btn btn-success btn-sm" value="提交">
				</td>
			</tr>
		</table>
	</form>
	<script>
	function selAll(){
    	var a = document.getElementsByTagName("input");
    	for (var i = 0; i < a.length; i++){
        	if (a[i].type == "checkbox") a[i].checked = true;
    	}
	}
	function noSelAll(){
    	var a = document.getElementsByTagName("input");
    	for (var i = 0; i < a.length; i++){
        	if (a[i].type == "checkbox") a[i].checked = false;
    	}
	}
	</script>
</body>
</html>