<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>相册管理->相册列表</div>
  <div class="oe_content">
	
	<form id="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  分类：<!--{hook mod='activitycat' name='scatid' type='select' text='=默认=' value=$scatid}-->&nbsp;
	  相册名称：<input type="text" name="sname" id="sname" class="input-150" value="<!--{$sname}-->" />&nbsp;
	  所属店铺：<input type="text" name="sshopname" id="sshopname" class="input-150" value="<!--{$sshopname}-->" />&nbsp;
	  审核状态：
	  <select name="sflag" id="sflag">
	  <option value=""></option>
	  <option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>锁定</option>
	  <option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>通过</option>
	  </select>
	  &nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />
	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">全选/反选</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="15%">店铺</th>
		<th width="15%">相册名称</th>
		<th width="10%">分类</th>
		<th width="6%">封面</th>
		<th width="15%">创建时间</th>
		<th width="7%">状态</th>
		<th width="7%">人气</th>
		<th width="7%">照片数</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($gallery)}-->
	  <tr>
	    <td class="text_center" colspan="10">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $gallery as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.galleryid}-->" /><!--{$volist.galleryid}--></td>
		<td><!--{$volist.shopname}--></td>
		<td><a href="<!--{$urlpath}-->index.php?c=gallery&a=detail&id=<!--{$volist.galleryid}-->" target="_blank"><!--{$volist.name}--></a></td>
		<td><!--{$volist.catname}--></td>
		<td class="text_center">
		<!--{if !empty($volist.thumbimg)}-->
		<img src="<!--{$volist.thumbimg}-->" width="20px" height="20px" data-img="<!--{$volist.drawimg}-->" f="viewimg" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='1'}-->
			<input type="hidden" id="attr_flag<!--{$volist.actid}-->" value="flagclose" />
			<img id="flag<!--{$volist.actid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.actid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.actid}-->" value="flagopen" />
			<img id="flag<!--{$volist.actid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.actid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.hits}--></td>
		<td class="text_center"><!--{$volist.photos}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.galleryid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.galleryid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->

<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>相册管理->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑相册</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">所属店铺：<span class="f_red"></span></th>
		<td width="85%"><!--{$gallery.shopname}--></td>
	  </tr>
	  <tr>
	    <th>所属分类：<span class="f_red">*</span></th>
		<td><!--{hook mod='gallerycat' type='select' name='catid' text='=请选择=' value=$gallery.catid}--></td>
	  </tr>
	  <tr>
	    <th>相册名称：<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="name" id="name" class="input-b" value="<!--{$gallery.name}-->" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>点击次数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="hits" id="hits" class="input-100" value="<!--{$gallery.hits}-->" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>

	  <tr>
	    <th>审核状态：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="flag" id="flag" value="1"<!--{if $gallery.flag == '1'}--> checked<!--{/if}--> />通过，
		<input type="radio" name="flag" id="flag" value="0"<!--{if $gallery.flag == '0'}--> checked<!--{/if}--> />锁定
		</td>
	  </tr>
	  <tr>
	    <th>相册简介：<span class="f_red"></span> </th>
		<td><textarea name="intro" id="intro" style="width:60%;height:100px;"><!--{$gallery.intro}--></textarea></td>
	  </tr>

	  <tr>
	    <td></td>
		<td> <input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		if ($("#name").val().length == 0) {
			ToastShow("请填写相册名称", "name");
			return false;
		}
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>