<!--{include file="<!--{$oetplpath}-->widget_header.tpl"}-->
<div class="oe_content_layout">
  <!--{include file="<!--{$oetplpath}-->widget_menu.tpl"}-->

  <div class="oe_cont_rt">
    
	<div class="oe_content_widget">
	
	  <div class="oe_tab_list">
        <ul>
          <li class="current"><a href="<!--{$oefile}-->&c=gallery">相册管理</a></li>
        </ul>
      </div>

      <div class="oe_ser_block">
	    <p>相册和照片只有通过审核才能在店铺上显示</p>
		<h3>
		  您共上传照片：<i><!--{countdata type="shop" mod="photo"  value=$login.shop.shopid}--></i> 张&nbsp;&nbsp;&nbsp;
		  建立相册：<i><!--{countdata type="shop" mod="gallery"  value=$login.shop.shopid}--></i> 个 
		</h3>
        <div class="_ser_btn">
		  <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">新建相册</a>
		</div>
      </div>

	  <!--{if $a == "run"}-->

	  <div class="oe_mer_gallery">
	    <!--{if empty($gallery)}-->
		<h6>还没有相册！</h6>
		<!--{else}-->
		<!--{foreach $gallery as $volist}-->
		<dl>
          <dt>
		    <a href="<!--{$oefile}-->&c=photo&sgalleryid=<!--{$volist.galleryid}-->">
		    <!--{if !empty($volist.drawimg)}-->
		    <img src="<!--{$volist.drawimg}-->" />
			<!--{else}-->
			<img src="<!--{$urlpath}-->tpl/static/images/waitimg_160.jpg" />
			<!--{/if}-->
			</a>
		  </dt>
          <dd>
            <h4><a href="<!--{$oefile}-->&c=photo&a=add&sgalleryid=<!--{$volist.galleryid}-->"><!--{$volist.name}--></a></h4>
            <p>
			  <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.galleryid}-->">编辑</a>
			  <a href="<!--{$oefile}-->&c=photo&a=add&sgalleryid=<!--{$volist.galleryid}-->">上传照片</a>
			  <a href="javascript:;" onclick="oePopConfirm('确定要删除吗？', '<!--{$oefile}-->&c=<!--{$c}-->&a=del&id=<!--{$volist.galleryid}-->', 'url');">删除</a> 
			  <!--{if $volist.flag == '1'}-->
			  <font color="green">通过</font>
			  <!--{elseif $volist.flag == '2'}-->
			  <font color="red">未通过</font>
			  <!--{else}-->
			  <font color="gray">待审核</font>
			  <!--{/if}-->
			</p>
          </dd>
		  <span class="_nums"><!--{$volist.photos}--></span>
        </dl>
		<!--{/foreach}-->
		<div class="clear"></div>
		<!--{/if}-->
	  </div>

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


	  <!--{if $a == "add"}-->
	  <form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	  <input type="hidden" name="a" id="a" value="saveadd" />
	  <table class="oe_table_wrap">
		<tr>
		  <th width="18%"><font color="red">*</font> 相册名称：</th>
		  <td width="82%">
		    <input type="text" name="name" id="name" class="input-b" maxlength="30" /> （30个字以内）
		  </td>
		</tr>
		<tr>
		  <th><font color="red">*</font> 相册分类：</th>
		  <td><!--{hook mod="gallerycat" type="select" name="catid" text="=请选择="}--></td>
		</tr>

		<tr>
	      <th><font color="red"></font> 相册描述：</th>
		  <td>
		    <textarea name="intro" id="intro" style="width:70%;height:80px;"></textarea><br />
		  （500个字以内）
		  </td>
	    </tr>
		<tr>
		  <td></td>
		  <td>
			<input type="button" id="btn_post" class="submit_btn1" value="添加保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){

		$("#btn_post").bind("click", function(){ //提交
			if ($("#name").val().length == 0) {
				ToastShow("请填写名称", "title");
				return false;
			}

			if ($("#catid").val().length == 0) {
				ToastShow("请选择分类", "catid");
				return false;
			}
			$("#myform").submit();
		});
	  });
	  </script>
	  <!--{/if}-->

	  <!--{if $a == "edit"}-->
	  <form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" 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="18%"><font color="red">*</font> 相册名称：</th>
		  <td width="82%">
		    <input type="text" name="name" id="name" class="input-b" maxlength="30" value="<!--{$gallery.name}-->" /> （30个字以内）
		  </td>
		</tr>
		<tr>
		  <th><font color="red">*</font> 相册分类：</th>
		  <td><!--{hook mod="gallerycat" type="select" name="catid" text="=请选择=" value=$gallery.catid}--></td>
		</tr>

		<tr>
	      <th><font color="red"></font> 相册描述：</th>
		  <td>
		    <textarea name="intro" id="intro" style="width:70%;height:80px;"><!--{$gallery.intro}--></textarea><br />
		  （500个字以内）
		  </td>
	    </tr>
		<tr>
		  <td></td>
		  <td>
			<input type="button" id="btn_post" class="submit_btn1" value="编辑保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){

		$("#btn_post").bind("click", function(){ //提交
			if ($("#name").val().length == 0) {
				ToastShow("请填写名称", "title");
				return false;
			}

			if ($("#catid").val().length == 0) {
				ToastShow("请选择分类", "catid");
				return false;
			}
			$("#myform").submit();
		});
	  });
	  </script>
	  <!--{/if}-->


	</div>
	<!--//oe_content_widget End-->

  </div>
  <div class="clear"></div>
  <!--//oe_cont_rt End -->
</div>
<!--{include file="<!--{$oetplpath}-->widget_footer.tpl"}-->
</body>
</html>