<!--{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">
	  请保留ID为1的店铺风格
	</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>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="10%">ID</th>
		<th width="15%">预览图</th>
		<th width="15%">风格名称</th>
		<th width="30%">风格路径</th>
		<th width="10%">排序</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($shopskin)}-->
	  <tr>
	    <td class="text_center" colspan="6">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $shopskin as $volist}-->
	  <tr>
	    <td class="text_center">
		  <!--{if $volist.skinid > 1}-->
		  <input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.skinid}-->" />
		  <!--{/if}-->
		  <!--{$volist.skinid}-->
		</td>
		<td class="text_center">
		<!--{if !empty($volist.skinimg)}-->
		<img src="<!--{$urlpath}--><!--{$volist.skinimg}-->" width="80px" height="80px" f="viewimg" />
		<!--{else}-->
		<img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="80px" height="80px" />
		<!--{/if}-->
		</td>
		<td><!--{$volist.skinname}--></td>
		<td>tpl/shopskin/<!--{$volist.skin}-->/</td>
		<td class="text_center"><!--{$volist.orders}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.skinid}-->" class="oe_ico_blue">编辑</a>
		 <!--{if $volist.skinid > 1}-->
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.skinid}-->');" class="oe_ico_red">删除</a>
		 <!--{/if}-->
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>
	<div class="oe_page_box"><!--{$showpage}--></div>
  </div>
</div>
<!--{/if}-->

<!--{if $a == 'add'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>风格界面->店铺风格->添加
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>添加店铺风格</h6>
	<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="15%">风格名称：<span class="f_red">*</span></th>
		<td width="85%">
		  <input type="text" name="skinname" id="skinname" class="input-b" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>风格预览：<span class="f_red"></span></th>
		<td>
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="img_thumb" value="" />
					<input type="hidden" id="img_url" name="skinimg" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=upload&forbidcom=1&forbidwater=1");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="100px">
			    <img src="<!--{$urlpath}-->tpl/static/images/waitimg_s.jpg" width="30px" height="30px" id="img_preview" />

				<a href="javascript:;" class="_removeimg" f="removeimg" data-preview="img_preview" data-draw="img_url">移除</a>
			  </td>
			  <td></td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
	    <th>风格路径：<span class="f_red">*</span></th>
		<td>
		  tpl/shopskin/ <input type="text" name="skin" id="skin" class="input-100" /> /
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$orders}-->" /></td>
	  </tr>
	  <tr>
	    <td></td>
		<td>
		<input type="button" id="btn_save" class="button_2" value="添加保存" /> 
	    <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		if ($("#skinname").val().length == 0) {
			ToastShow("请填写风格名称", "skinname");
			return false;
		}
		$("#myform").submit();
	});

});
</script>

<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>风格界面->店铺风格->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑店铺风格</h6>
	<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="15%">风格名称：<span class="f_red">*</span></th>
		<td width="85%">
		  <input type="text" name="skinname" id="skinname" class="input-b" value="<!--{$shopskin.skinname}-->" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>风格预览：<span class="f_red"></span></th>
		<td>
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="img_thumb" value="" />
					<input type="hidden" id="img_url" name="skinimg" value="<!--{$shopskin.skinimg}-->" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=upload&forbidcom=1&forbidwater=1");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="100px">
			    <!--{if !empty($shopskin.skinimg)}-->
				<img src="<!--{$urlpath}--><!--{$shopskin.skinimg}-->" width="30px" height="30px" id="img_preview" />
				<!--{else}-->
			    <img src="<!--{$urlpath}-->tpl/static/images/waitimg_s.jpg" width="30px" height="30px" id="img_preview" />
				<!--{/if}-->
				<a href="javascript:;" class="_removeimg" f="removeimg" data-preview="img_preview" data-draw="img_url">移除</a>
			  </td>
			  <td></td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
	    <th>风格路径：<span class="f_red">*</span></th>
		<td>
		  tpl/shopskin/ <input type="text" name="skin" id="skin" class="input-100" value="<!--{$shopskin.skin}-->" /> /
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$shopskin.orders}-->" /></td>
	  </tr>
	  <tr>
	    <td></td>
		<td>
		  <input type="button" id="btn_save" class="button_2" value="编辑保存" /> 
		  <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		if ($("#skinname").val().length == 0) {
			ToastShow("请填写风格名称", "skinname");
			return false;
		}
		$("#myform").submit();
	});

});
</script>

<!--{/if}-->
</body>
</html>