<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
<meta http-equiv="Content-Disposition" content="attachment;">
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 220px;
	}
	.date_width{
	     width: 150px;
	}
	
	.tablelist th,td{
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	.tablelist td a{
    	text-decoration: underline;
	}
	
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">活动海报</a></li>
		<li><a href="#">活动海报生成详情</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/poster/activityJoin/list.html}" method="post">
	<input type="hidden" name="pageSize" id="pageSize" value="10" />
	<input name="id" type="hidden" id="id" class="scinput" th:value="${search.id}"  />
	<ul class="seachform">
		<li>
		  <label>机构名称</label>

		  <input name="name" type="text" class="scinput" th:value="${search.name}"  />
		</li>
		<li>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
			<ul class="toolbar">
				<a th:href="@{/sys/poster/activity/list.html}">
					<input type="button" class="scbtn" value="返回" />
				</a>
			</ul>
		</li>
		<li>
			<ul class="toolbar">
				<li class="click" onclick="edit('')"><span><img th:src="@{/static/sys/images/t01.png}"></span>新增海报</li>
			</ul>
		</li>
	</ul>
	</form>

	<table class="tablelist">
		<thead>
		    <tr>
		    	<th style="width: 50px;">序号</th>
		    	<th >活动名称 </th>
		    	<th >机构名称 </th>
				<th >创建时间</th>
		    	<th >海报</th>
		    	<th >联系方式</th>
		    	<th >LOGO1</th>
		    	<th >LOGO2</th>
		    	<th >二维码1</th>
		    	<th >二维码2</th>
		    	<th >操作</th>
		    </tr> 
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count+((page.pageNo-1)*page.pageSize) }"></td>
				<td th:text="${item.name}"></td>
				<td th:text="${item.join_name}"></td>
				<td th:text="${item.create_time}"></td>
				<td class="imgtd">
					<img  th:if="${item.poster_img!=null && item.poster_img!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.poster_img}">
				</td>
				<td th:text="${item.phone}"></td>

				<td class="imgtd">
					<img  th:if="${item.logo_img!=null && item.logo_img!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img}">
				</td>
				<td class="imgtd">
					<img  th:if="${item.logo_img2!=null && item.logo_img2!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img2}">
				</td>
				<td class="imgtd">
					<img th:if="${item.qrcode_img1!=null && item.qrcode_img1!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.qrcode_img1}">
				</td>
				<td class="imgtd">
					<img th:if="${item.qrcode_img2!=null && item.qrcode_img2!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.qrcode_img2}">
				</td>
				<td >
					<a th:href="${imgUrl+item.poster_img}" download  class="tablelink">下载</a>
					<a th:href="${'javascript:joinDel(''' + item.id + ''')'}"  class="tablelink">删除</a>
				</td>
			</tr>
		</tbody>
	</table>

	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>
</body>

<script type="text/javascript">
	function edit(id){
		var title="添加海报";
		var content = '[[${sysUrl}]]/sys/poster/activityJoin/add.html?&id='+$("#id").val();
		if(id!=null && id!='' && id!=undefined){
			title="编辑海报";
			content = '[[${sysUrl}]]/sys/poster/activityJoin/edit.html?&id='+id;
		}
		parent.layer.open({
		    type: 2,
		    title: title,
		    closeBtn: 1, //不显示关闭按钮
		    shift: 0.8,
		    offset: '100px',
		    area: ['50%', '60%'],
		    content: content
		});
	}
	
	function joinDel(id){
		parent.layer.confirm("您确定要删除机构?", {
			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
		}, function(){
			var url="[[${sysUrl}]]/sys/poster/activityJoin/del?id="+id;
			var params ={};
			$.post(url,params,function(data){
				if(data.meta.success){
					parent.layer.msg("删除成功",{icon:1});
					$(".selectbtu").click();
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
				}
			});
		});
	}
	
	
</script>

</html>