<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title><?php echo $diy->name;?>-<?php echo $cfg_webname;?></title>
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/css/style.css">
		<script src="<?php echo $cfg_cmsurl;?>/static/web/js/jquery.min.js"></script>
	</head>
	<body>
		<?php pasterTempletDiy('top.htm');?>
		<main class="container py-3">
			<div class="row">
				<div class="col-md-12">
					<nav class="navbar navbar-expand-lg mb-3">
						<ul class="navbar-nav mr-auto">
							<li class="nav-item">
								<h3><?php echo $diy->name;?>文档列表</h3>
							</li>
						</ul>
						<span class="navbar-text"><a href="diy.php?action=post&diyid=<?php echo $diy->diyid;?>" class="btn btn-success">发布信息</a></span>
					</nav>
					{dede:datalist}
					<table class="table" cellspacing="1">
						<?php
						if (!empty($fields)) {
							echo '<tbody>';
							echo '<tr><td width="30%" bgcolor="#f5f5f5">id</td>';
							echo '<td bgcolor="#f5f5f5">'.$fields['id'].'<a href="diy.php?action=view&diyid='.$diy->diyid.'&id='.$fields['id'].'" target="_blank">详细</a></td></tr>';
							foreach($fieldlist as $field=>$fielddata)
							{
								if ($fields[$field]=='') continue;
								if ($fielddata[1]=='img') {
									$fields[$field] = "<a href='{$fields[$field]}' target='_blank' class='btn btn-light btn-sm'>图片附件</a>";
								} else if ($fielddata[1]=='addon') {
									$fields[$field] = "<a href='{$fields[$field]}' target='_blank' class='btn btn-light btn-sm'>其它附件</a>";
								} else {
									if ($fielddata[1]=='htmltext') $fields[$field] = html2text($fields[$field]);
									else $fields[$field] = dede_htmlspecialchars($fields[$field]);
									if (strlen($fields[$field]) > 250) {
										$fields[$field] = cn_substr( $fields[$field], 250).'';
									}
								}
								echo "<tr><td>{$fielddata[0]}</td><td>{$fields[$field]}</td></tr>";
							}
							echo '</tbody>';
						} else {
							echo "<tr><td>暂无记录</td></tr>";
						}
						?>
					</table>
					{/dede:datalist}
					<table class="listtable" cellspacing="2">
						<tr>
							<td>{dede:pagelist listsize='6'/}</td>
						</tr>
					</table>
				</div>
			</div>
		</main>
		<?php pasterTempletDiy('foot.htm');?>
	</body>
</html>