<!--{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">
	  标题：<input type="text" name="stitle" id="stitle" class="input-150" value="<!--{$stitle}-->" />&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="10%">图片</th>
		<th width="16%">标题</th>
		<th width="16%">所属店铺</th>
		<th width="16%">所属相册</th>
		<th width="15%">上传时间</th>
		<th width="7%">状态</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($photo)}-->
	  <tr>
	    <td class="text_center" colspan="8">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $photo as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.photoid}-->" /><!--{$volist.photoid}--></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><!--{$volist.title}--></td>
		<td><!--{$volist.shopname}--></td>
		<td><!--{$volist.name}--></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.photoid}-->" value="flagclose" />
			<img id="flag<!--{$volist.photoid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.photoid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.photoid}-->" value="flagopen" />
			<img id="flag<!--{$volist.photoid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.photoid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.photoid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.photoid}-->&<!--{$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%"><!--{$photo.shopname}--></td>
	  </tr>
	  <tr>
		<th>相片：</th>
		<td colspan="3">
		  <div class="oe_gallery_list">
		    <dl>
			  <dt>
			    <!--{if !empty($photo.thumbimg)}-->
			    <img id="img_preview" src="<!--{$urlpath}--><!--{$photo.thumbimg}-->" f="viewimg" data-img="<!--{$photo.drawimg}-->" />
				<!--{else}-->
				<img id="img_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" f="viewimg" />
				<!--{/if}-->
			  </dt>
			  <dd>
			    <label>上传相片<input type="file" name="img" id="img" value="" /></label>
				<span style="cursor:pointer;" f="removeimg" data-preview="img_preview" data-thumb="img_thumb" data-draw="img_url">移除</span>
				<i id="img_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" /></i>
				<input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$photo.thumbimg}-->" />
				<input type="hidden" id="img_url" name="drawimg" value="<!--{$photo.drawimg}-->" />
				<script type="text/javascript">
				$(function(){
				  $("#img").live("change", function(){
					oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=photo&thumbfiles=1");
				  });
				});
				</script>
			  </dd>
			</dl>
			<div class="clear"></div>
		  </div>
		</td>
	  </tr>

	  <tr>
	    <th>相片标题：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="title" id="title" class="input-b" value="<!--{$photo.title}-->" />
		  <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 $photo.flag == '1'}--> checked<!--{/if}--> />通过，
		<input type="radio" name="flag" id="flag" value="0"<!--{if $photo.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;"><!--{$photo.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 ($("#img_url").val().length == 0) {
			ToastShow("请上传相片");
			return false;
		}
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>