<!--{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">
	  
	  <span style="display:none;">
	  查看范围：
	  <select name="viewtype" id="viewtype" onchange="changeGetAdmin();">
	    <option value='0'>所有数据</option>
	    <option value='1'<!--{if $viewtype == '1'}--> selected<!--{/if}-->>我的数据</option>
	    <option value='2'<!--{if $viewtype == '2'}--> selected<!--{/if}-->>下属数据</option>
	  </select>
	  <span id='json_sadminid'>
	  <!--{if $viewtype == '2'}-->
	  <!--{hook mod='subadmin' type='select' name='sadminid' text='=全部=' value=$sadminid}-->
	  <!--{/if}-->
	  </span>
	  <script type="text/javascript">
	  function changeGetAdmin() {
		  $type = $('#viewtype').val();
		  if ($type == 2) {
			  oemarrySelectSubAdmin("sadminid", "<!--{$sadminid}-->", "=全部=");
		  }
		  else {
			  $("#json_sadminid").html("");
		  }
	  }
	  </script>
	  &nbsp;&nbsp;
	  </span>

	  类型：
	  <select name="stype" id="stype">
	    <option value="">=不限=</option>
		<option value="1"<!--{if $stype == '1'}--> selected<!--{/if}-->>个人</option>
		<option value="2"<!--{if $stype == '2'}--> selected<!--{/if}-->>企业</option>
	  </select>&nbsp;
	  分类：<!--{hook mod='shopcat' type='select' name='scatid' text='=请选择=' value=$scatid}-->&nbsp;
	  
	  店铺名称：<input type="text" name="sname" id="sname" class="input-200" value="<!--{$sname}-->" />&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>
		<option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>未通过</option>
		</select>
	  &nbsp;
	  <br />
		店铺认证：
		<select name="srz" id="srz">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $srz == '1'}--> selected<!--{/if}-->>已认证</option>
		  <option value="2"<!--{if $srz == '2'}--> selected<!--{/if}-->>未认证</option>
		</select>
		&nbsp;
		LOGO状态：
		<select name="slogo" id="slogo">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $slogo == '1'}--> selected<!--{/if}-->>待审核</option>
		  <option value="2"<!--{if $slogo == '2'}--> selected<!--{/if}-->>已通过</option>
		</select>
		&nbsp;
		店铺等级：<!--{hook mod='shoplevel' type='select' name='slevel' text='=不限=' value=$slevel}-->
		&nbsp;
		推荐：<input type="checkbox" name="selite" id="selite" value="1" />&nbsp;

		
		会员ID：<input type="text" name="suserid" id="suserid" class="input-150" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />&nbsp;
		<br />
	    所在地区：
		<!--{area type='select' name='sarea' depth='1' child='1' text='=请选择=' value=$sarea1}-->
		<span id="json_sarea2">
		  <!--{if $sarea1 > 0}-->
		  <!--{area type='select' name='sarea' depth='2' child='1' text='=请选择=' parentid=$sarea1 value=$sarea2}-->
		  <!--{else}-->
		  <select name="sarea2" id="sarea2"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_sarea3">
		  <!--{if $sarea2 > 0}-->
		  <!--{area type='select' name='sarea' depth='3' child='1' text='=请选择=' parentid=$sarea2 value=$sarea3}-->
		  <!--{else}-->
		  <select name="sarea3" id="sarea3"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_sarea4">
		  <!--{if $sarea3 > 0}-->
		  <!--{area type='select' name='sarea' depth='4' text='=请选择=' parentid=$sarea3 value=$sarea4}-->
		  <!--{/if}-->
		</span>

		&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>
      <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="8%">店铺ID</th>
		<th width="20%">店铺名称</th>
		<th width="8%">所属会员</th>
		<th width="8%">分类</th>
		<th width="7%">等级</th>
		<th width="6%">LOGO</th>
		<th width="8%">地区</th>
		<th width="4%">状态</th>
		<th width="4%">认证</th>
		<th width="4%">推荐</th>
		<th width="8%">入驻时间</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($shop)}-->
	  <tr>
	    <td class="text_center" colspan="12">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $shop as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.shopid}-->" /><!--{$volist.shopid}--></td>
	    <td>
		<a href="<!--{$urlpath}-->index.php?c=shop&a=detail&id=<!--{$volist.shopid}-->" target="_blank"><!--{$volist.shopname}--></a>
		<!--{if $volist.shoptype == '2'}-->
		<font color="blue">(企业)</font>
		<!--{else}-->
		<font color="orange">(个人)</font>
		<!--{/if}-->
		</td>
		<td>
			<!--{if $volist.userid == '0'}-->
			~
			<!--{else}-->
			<!--{$volist.username}-->
			<!--{/if}-->
		</td>
		<td><!--{$volist.catname}--></td>
		<!--{if $volist.level > 1 && $volist.vipetime > $time}-->
		<td class="text_center" title="到期：<!--{$volist.vipetime|date_format:"%Y-%m-%d %H:%M:%S"}-->"><!--{$volist.levelname}--></td>
		<!--{else}-->
		<td class="text_center"><!--{$volist.levelname}--></td>
		<!--{/if}-->
		<td class="text_center">
		<!--{if !empty($volist.logo)}-->
		<img src="<!--{$urlpath}--><!--{$volist.logo}-->" width="20px" height="20px" f="viewimg" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.province}--> <!--{$volist.city}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='1'}-->
			<input type="hidden" id="attr_flag<!--{$volist.shopid}-->" value="flagclose" />
			<img id="flag<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.shopid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.shopid}-->" value="flagopen" />
			<img id="flag<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.shopid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.shoprz=='0'}-->
			<input type="hidden" id="attr_rz<!--{$volist.shopid}-->" value="rzopen" />
			<img id="rz<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('rz', '<!--{$volist.shopid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_rz<!--{$volist.shopid}-->" value="rzclose" />
			<img id="rz<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('rz', '<!--{$volist.shopid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.elite=='0'}-->
			<input type="hidden" id="attr_elite<!--{$volist.shopid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.shopid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.shopid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.shopid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.shopid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.addtime|date_format:"%Y/%m/%d"}--><br /><!--{$volist.addtime|date_format:"%H:%M:%S"}--></td>
		<td class="text_center">
         <a class="oe_ico_orange" href="<!--{$oefile}-->&c=user&a=loginuser&id=<!--{$volist.userid}-->" target="_blank">登录</a>
         <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$volist.shopid}-->&<!--{$comeurl}-->&from=list" class="oe_ico_green">管理</a>
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.shopid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.shopid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</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="13%">店铺类型：<span class="f_red">*</span></th>
		<td width="37%">
		  <select name="shoptype" id="shoptype">
		    <option value="">=请选择=</option>
			<option value="1">个人</option>
			<option value="2" selected>企业</option>
		  </select>
		</td>
		<th width="13%">所在地区：<span class="f_red"></span></th>
		<td width="37%">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择='}-->
		<span id="json_area2">
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area3">
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area4">
		
		</span>
		</td>
	  </tr>
	  <tr>
	    <th>店铺名称：(唯一)<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="shopname" id="shopname" class="input-200" />
		  <span class="oe_trap"></span>
		</td>
		<th>详细地址：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="address" id="address" class="input-b" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>店铺分类：<span class="f_red">*</span></th>
		<td>
		  <!--{hook mod='shopcat' type='select' name='catid' text='=请选择='}-->
		  <span class="oe_trap"></span>
		</td>
	    <th>所属会员：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="userid" id="userid" readonly="only" class="input-100" /> 
		  <span id="userid_tips"></span>
		  <a href="###" onclick="oemarry_varpop_user('userid');" style="color:blue;">选择会员</a>
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>营业时间：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="worktime" id="worktime" class="input-200" />
		  <span class="oe_trap"></span>
		</td>
	    <th>浏览次数：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="hits" id="hits" class="input-s" />
		</td>
	  </tr>
	  <tr>
		<th>联系电话：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="phone" id="phone" class="input-200" />
		  <span class="oe_trap"></span>
		</td>
		<th>联系QQ：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="qq" id="qq" class="input-200" />
		</td>
	  </tr>

	  <tr>
	    <th>审核状态：<span class="f_red">*</span> </th>
		<td>
		  <select name="flag" id="flag">
			<option value="0">待审核</option>
			<option value="1" selected>已通过</option>
			<option value="2">未通过</option>
		  </select> （只有审核通过的店铺才可以进行登录和展示）
		</td>
		<th>是否推荐：<span class="f_red"></span></th>
		<td>
		<input type="radio" name="elite" id="elite" value="1" />是，
		<input type="radio" name="elite" id="elite" value="0" checked />否
		</td>
	  </tr>

	  <tr>
		<th>店铺LOGO：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="logoimg" id="logoimg" value="" /></label>
					<label class="_uploading" id="logoimg_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="logoimg_thumb" name="logoimg_thumb" value="" />
					<input type="hidden" id="logoimg_url" name="logo" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#logoimg").live("change", function(){
						oemarryUploadImg("logoimg", "<!--{$oefile}-->&c=index&a=uploadimg&module=shoplogo");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="30px">
			    <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="logoimg_preview" />
			  </td>
			  <td>
				  LOGO状态：
				  <select name="logoflag" id="logoflag">
					<option value="0">=未上传=</option>
					<option value="-2">待审核</option>
					<option value="-1">未通过</option>
					<option value="1">通过</option>
				  </select>
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>

	  <tr>
		<th>个人/企业证件：<br />身份证/营业执照<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="paperimg" id="paperimg" value="" /></label>
					<label class="_uploading" id="paperimg_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="paperimg_thumb" name="paperimg_thumb" value="" />
					<input type="hidden" id="paperimg_url" name="paper" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#paperimg").live("change", function(){
						oemarryUploadImg("paperimg", "<!--{$oefile}-->&c=index&a=uploadimg&module=shop");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="30px">
			  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="paperimg_preview" />
			  </td>
			  <td>
			    证件号码：
				<input type="text" name="idnumber" id="idnumber" class="input-150" />&nbsp;
				 店铺认证 ：
				  <select name="shoprz" id="shoprz">
					<option value="0">=请选择=</option>
					<option value="1">是</option>
					<option value="0">否</option>
				  </select>
				  （根据上传的证件进行认证）
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
		<th>备注说明：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="remark" id="remark" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
	    <th>店铺简介：</th>
		<td colspan="3">
		<textarea name="intro" id="intro" style="width:50%;height:60px;"></textarea>
		（200字以内）
		</td>
	  </tr>
	  <tr>
	    <th>店铺详情：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"></textarea>
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="添加保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
	
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#shopname").bind("blur", function(){ //检测名称
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"shopname", name:$(this).val(), r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("shopname", "该店铺名称可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该店铺名称已存在";
						}
						oemarryCheckError("shopname", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	

	$("#btn_save").bind("click", function(){
		if ($("#shoptype").val() == "") {
			ToastShow("请选择店铺类型", "type");
			return false;
		}
		if ($("#shopname").val().length == 0) {
			ToastShow("请填写店铺名称", "shopname");
			return false;
		}
		if ($("#catid").val() == "") {
			ToastShow("请选择分类", "catid");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});

});
</script>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>店铺管理->编辑店铺
	<!--{if $from == "view"}-->
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$shop.shopid}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
	<!--{else}-->
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
	<!--{/if}-->
  </div>
  <div class="oe_content">
    <h6>编辑店铺</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->&from=<!--{$from}-->" 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="13%">店铺类型：<span class="f_red">*</span></th>
		<td width="37%">
		  <select name="shoptype" id="shoptype">
		    <option value="">=请选择=</option>
			<option value="1"<!--{if $shop.shoptype == '1'}--> selected<!--{/if}-->>个人</option>
			<option value="2"<!--{if $shop.shoptype == '2'}--> selected<!--{/if}-->>企业</option>
		  </select>
		</td>
		<th width="13%">所在地区：<span class="f_red"></span></th>
		<td width="37%">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择=' value=$shop.area1}-->
		<span id="json_area2">
		  <!--{if $shop.area1 > 0}-->
		  <!--{area type='select' name='area' depth='2' child='1' text='=请选择=' parentid=$shop.area1 value=$shop.area2}-->
		  <!--{else}-->
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area3">
		  <!--{if $shop.area2 > 0}-->
		  <!--{area type='select' name='area' depth='3' child='1' text='=请选择=' parentid=$shop.area2 value=$shop.area3}-->
		  <!--{else}-->
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area4">
		  <!--{if $shop.area3 > 0}-->
		  <!--{area type='select' name='area' depth='4' text='=请选择=' parentid=$shop.area3 value=$shop.area4}-->
		  <!--{/if}-->
		</span>
		</td>
	  </tr>
	  <tr>
	    <th>店铺名称：(唯一)<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="shopname" id="shopname" class="input-200" value="<!--{$shop.shopname}-->" />
		  <span class="oe_trap"></span>
		</td>
		<th>详细地址：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="address" id="address" class="input-b" value="<!--{$shop.address}-->" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>店铺分类：<span class="f_red">*</span></th>
		<td>
		  <!--{hook mod='shopcat' type='select' name='catid' text='=请选择=' value=$shop.catid}-->
		  <span class="oe_trap"></span>
		</td>
	    <th>所属会员：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="userid" id="userid" readonly="only" class="input-100" value="<!--{if $shop.userid>0}--><!--{$shop.userid}--><!--{/if}-->" /> 
		  <span id="userid_tips"><!--{$shop.username}--></span>
		  <a href="###" onclick="oemarry_varpop_user('userid');" style="color:blue;">选择会员</a>
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>营业时间：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="worktime" id="worktime" class="input-200" value="<!--{$shop.worktime}-->" />
		  <span class="oe_trap"></span>
		</td>
	    <th>浏览次数：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="hits" id="hits" class="input-s" value="<!--{$shop.hits}-->" />
		</td>
	  </tr>
	  <tr>
		<th>联系电话：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="phone" id="phone" class="input-200" value="<!--{$shop.phone}-->" />
		  <span class="oe_trap"></span>
		</td>
		<th>联系QQ：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="qq" id="qq" class="input-200" value="<!--{$shop.qq}-->" />
		</td>
	  </tr>

      <tr>
          <th>活动发布数：<span class="f_red"></span></th>
          <td>
              <input type="text" name="gractivitys" id="gractivitys" class="input-s" value="<!--{$shop.gractivitys}-->" />
              <span class="oe_trap">（默认为店铺等级规定的数量）</span>
          </td>
          <th>商品发布数：<span class="f_red"></span></th>
          <td>
              <input type="text" name="grgoods" id="grgoods" class="input-s" value="<!--{$shop.grgoods}-->" />
              <span class="oe_trap">（默认为店铺等级规定的数量）</span>
          </td>
      </tr>
      <tr>
          <th>优惠券发布数：<span class="f_red"></span></th>
          <td>
              <input type="text" name="grcoupons" id="grcoupons" class="input-s" value="<!--{$shop.grcoupons}-->" />
              <span class="oe_trap">（默认为店铺等级规定的数量）</span>
          </td>
          <th>相册发布数：<span class="f_red"></span></th>
          <td>
              <input type="text" name="grphotos" id="grphotos" class="input-s" value="<!--{$shop.grphotos}-->" />
              <span class="oe_trap">（默认为店铺等级规定的数量）</span>
          </td>
      </tr>

	  <tr>
	    <th>审核状态：<span class="f_red">*</span> </th>
		<td>
		  <select name="flag" id="flag">
			<option value="0">待审核</option>
			<option value="1"<!--{if $shop.flag == '1'}--> selected<!--{/if}-->>已通过</option>
			<option value="2"<!--{if $shop.flag == '2'}--> selected<!--{/if}-->>未通过</option>
		  </select>
		  （只有审核通过的店铺才可以进行登录和展示）
		</td>
		<th>是否推荐：<span class="f_red"></span></th>
		<td>
		<input type="radio" name="elite" id="elite" value="1"<!--{if $shop.elite == '1'}--> checked<!--{/if}--> />是，
		<input type="radio" name="elite" id="elite" value="0"<!--{if $shop.elite == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>

	  <tr>
		<th>店铺LOGO：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="logoimg" id="logoimg" value="" /></label>
					<label class="_uploading" id="logoimg_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="logoimg_thumb" name="logoimg_thumb" value="" />
					<input type="hidden" id="logoimg_url" name="logo" value="<!--{$shop.logo}-->" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#logoimg").live("change", function(){
						oemarryUploadImg("logoimg", "<!--{$oefile}-->&c=index&a=uploadimg&module=shoplogo");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="80px">
			  <!--{if !empty($shop.logo)}-->
			  <img src="<!--{$urlpath}--><!--{$shop.logo}-->" width="30px" height="30px" id="logoimg_preview" f="viewimg" />
			  <!--{else}-->
			  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="logoimg_preview" />
			  <!--{/if}-->
			  <a href="javascript:;" class="_removeimg" f="removeimg" data-preview="logoimg_preview" data-draw="logoimg_url">移除</a>
			  </td>
			  <td>
				  LOGO状态：
				  <select name="logoflag" id="logoflag">
					<option value="0">=未上传=</option>
					<option value="-2"<!--{if $shop.logoflag == '-2'}--> selected<!--{/if}-->>待审核</option>
					<option value="-1"<!--{if $shop.logoflag == '-1'}--> selected<!--{/if}-->>未通过</option>
					<option value="1"<!--{if $shop.logoflag == '1'}--> selected<!--{/if}-->>通过</option>
				  </select>
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>

	  <tr>
		<th>个人/企业证件：<br />身份证/营业执照<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">点击上传<input type="file" name="paperimg" id="paperimg" value="" /></label>
					<label class="_uploading" id="paperimg_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="paperimg_thumb" name="paperimg_thumb" value="" />
					<input type="hidden" id="paperimg_url" name="paper" value="<!--{$shop.paper}-->" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#paperimg").live("change", function(){
						oemarryUploadImg("paperimg", "<!--{$oefile}-->&c=index&a=uploadimg&module=shop");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="80px">
			    <!--{if !empty($shop.paper)}-->
				<img src="<!--{$urlpath}--><!--{$shop.paper}-->" width="30px" height="30px" id="paperimg_preview" f="viewimg" />
				<!--{else}-->
			    <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="paperimg_preview" />
				<!--{/if}-->
			  </td>
			  <td>
			    证件号码：
				<input type="text" name="idnumber" id="idnumber" class="input-150" value="<!--{$shop.idnumber}-->" />&nbsp;
				 店铺认证 ：
				  <select name="shoprz" id="shoprz">
					<option value="0">=请选择=</option>
					<option value="1"<!--{if $shop.shoprz == '1'}--> selected<!--{/if}-->>是</option>
					<option value="0"<!--{if $shop.shoprz == '0'}--> selected<!--{/if}-->>否</option>
				  </select>
				  （根据上传的证件进行认证）
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
		<th>备注说明：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="remark" id="remark" style="width:50%;height:40px;"><!--{$shop.remark}--></textarea></td>
	  </tr>
	  <tr>
		<th>店铺简介：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="intro" id="intro" style="width:50%;height:60px;"><!--{$shop.intro}--></textarea>（200个字以内）</td>
	  </tr>
	  <tr>
	    <th>店铺介绍：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"><!--{$shop.content}--></textarea>
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#shopname").bind("blur", function(){ //检测帐号
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"shopname", name:$(this).val(), shopid:"<!--{$id}-->", r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("shopname", "该店铺名可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该店铺名已存在";
						}
						oemarryCheckError("shopname", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});


	$("#btn_save").bind("click", function(){
		if ($("#shoptype").val() == "") {
			ToastShow("请选择店铺类型", "type");
			return false;
		}
		if ($("#shopname").val().length == 0) {
			ToastShow("请填写店铺名称", "shopname");
			return false;
		}
		if ($("#catid").val() == "") {
			ToastShow("请选择分类", "catid");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});

});
</script>
<!--{/if}-->


<!--{if $a == 'view'}-->
<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">
    <div class="_cont_left">
    <h6>查看/管理店铺</h6>
    <table class="oe_table_wrap">
	  <tr>
	    <th width="13%">店铺名称：<span class="f_red"></span></th>
		<td width="37%">
		  <!--{$shop.shopname}-->
		  <!--{if $shop.shoptype=='1'}-->
		  <font color="orange">(个人)</font>
		  <!--{else}-->
		  <font color="blue">(企业)</font>
		  <!--{/if}-->
		</td>
		<th width="13%">所属会员：<span class="f_red"></span></th>
		<td width="37%">
		<!--{if $shop.userid == '0'}-->
		~~
		<!--{else}-->
		<!--{$shop.username}-->
		<!--{/if}-->
		</td>
	  </tr>
	  <tr>
	    <th>所属地区：<span class="f_red"></span></th>
		<td>
		<!--{area type='text' value=$shop.area1}--> <!--{area type='text' value=$shop.area2}-->
		<!--{area type='text' value=$shop.area3}--> <!--{area type='text' value=$shop.area4}-->
		</td>
		<th>详细地址：<span class="f_red"></span></th>
		<td><!--{$shop.address}--></td>
	  </tr>
	  <tr>
	    <th>店铺分类：<span class="f_red"></span></th>
		<td>
		  <!--{hook mod='shopcat' type='text' value=$shop.catid}-->
		  <span class="oe_trap"></span>
		</td>
	    <th>营业时间：<span class="f_red"></span></th>
		<td>
		  <!--{$shop.worktime}-->
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
		<th>联系电话：<span class="f_red"></span></th>
		<td><!--{$shop.phone}--></td>
		<th>联系QQ：<span class="f_red"></span></th>
		<td><!--{$shop.qq}--></td>
	  </tr>

	  <tr>
	    <th>审核状态：<span class="f_red"></span> </th>
		<td>
		  <!--{if $shop.flag == '1'}-->
		  <font color="green">通过</font>
		  <!--{elseif $shop.flag == '2'}-->
		  <font color="red">未通过</font>
		  <!--{else}-->
		  <font color="gray">待审核</font>
		  <!--{/if}-->
		</td>
		<th>是否推荐：<span class="f_red"></span></th>
		<td>
		<!--{if $shop.elite == '1'}-->
		是
		<!--{else}-->
		否
		<!--{/if}-->
		</td>
	  </tr>

	  <tr>
	    <th>浏览次数：<span class="f_red"></span> </th>
		<td><!--{$shop.hits}--> 次</td>
		<th>入驻时间：<span class="f_red"></span> </th>
		<td><!--{$shop.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
	  </tr>

	  <tr>
		<th>店铺LOGO：<span class="f_red"></span> </th>
		<td>
		  <!--{if !empty($shop.logo)}-->
		  <img src="<!--{$urlpath}--><!--{$shop.logo}-->" width="30px" height="30px" id="logoimg_preview" f="viewimg" />
		  <!--{else}-->
		  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="logoimg_preview" />
		  <!--{/if}-->
		  状态：
		  <!--{if $shop.logoflag == '1'}-->
		  通过
		  <!--{elseif $shop.logoflag == '-2'}-->
		  待审核
		  <!--{elseif $shop.logoflag == '-1'}-->
		  未通过
		  <!--{else}-->
		  未上传
		  <!--{/if}-->
		</td>
		<th>店铺等级：</th>
		<td>
		  <!--{$shop.levelname}-->&nbsp;&nbsp;&nbsp;
		  <!--{if $shop.level > 1}-->
		  <!--{if $shop.vipetime>$time}-->
			<font color="green"><!--{$shop.vipetime|date_format:"%Y-%m-%d %H:%M:%S"}-->（有效期内）</font>
		  <!--{else}-->
			<font color="red"><!--{$shop.vipetime|date_format:"%Y-%m-%d %H:%M:%S"}-->（已过期）</font>
		  <!--{/if}-->
		  <!--{/if}-->
		</td>
	    
	  </tr>

	  <tr>
		<th>个人/企业证件：<br />身份证/营业执照<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="50px">证件：</td>
			  <td width="30px">
			    <!--{if !empty($shop.paper)}-->
				<img src="<!--{$urlpath}--><!--{$shop.paper}-->" width="30px" height="30px" id="paperimg_preview" f="viewimg" />
				<!--{else}-->
			    <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="paperimg_preview" />
				<!--{/if}-->
			  </td>
			  <td>
			    证件号码：<!--{$shop.idnumber}-->&nbsp;
				 店铺认证 ：
				 <!--{if $shop.shoprz == '1'}-->
				 已认证
				 <!--{else}-->
				 未认证
				 <!--{/if}-->
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
		<th>备注说明：<span class="f_red"></span> </th>
		<td colspan="3"><!--{$shop.remark}--></td>
	  </tr>

	  <tr>
		<th>帐户余额：<span class="f_red"></span> </th>
		<td>¥<!--{doubleval($shop.money)}--></td>
		<th>冻结资金：<span class="f_red"></span> </th>
		<td>¥<!--{doubleval($shop.freeze)}--></td>
	  </tr>
	  <tr>
		<th>店铺点评：<span class="f_red"></span> </th>
		<td><!--{$shop.comments}--> 个</td>
		<th>店铺评分：<span class="f_red"></span> </th>
		<td><!--{$shop.score}--> 分</td>
	  </tr>
	  <tr>
		<th>店铺预约：<span class="f_red"></span> </th>
		<td><!--{$shop.bespokes}--> 个</td>
		<th>店铺收藏：<span class="f_red"></span> </th>
		<td><!--{$shop.collects}--> 次</td>
	  </tr>
	</table>
	</div>

	<div class="_cont_right">
	  <div class="_inner_list">
	    <h3>操作</h3>
		<ul>
		  <li><a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$id}-->&<!--{$comeurl}-->&from=view">编辑/审核</a></li>

		  <!--{if $shop.userid > 0}-->
		  <li><a href="javascript:;" onclick="oemarry_varpop_shopvip('<!--{$shop.shopid}-->');">升级店铺</a></li>
		  <!--{else}-->
		  <li><a href="javascript:;" onclick="ToastShow('请先绑定会员帐号');">升级店铺</a></li>
		  <!--{/if}-->

		  <!--{if $shop.userid > 0}-->
		  <li><a href="javascript:;" onclick="oemarry_varpop_money('<!--{$shop.userid}-->');">商家余额</a></li>
		  <!--{else}-->
		  <li><a href="javascript:;" onclick="ToastShow('请先绑定会员帐号');">商家余额</a></li>
		  <!--{/if}-->

		  <!--{if $shop.userid > 0}-->
		  <li><a href="<!--{$oefile}-->&c=user&a=loginuser&id=<!--{$shop.userid}-->&to=shop" target="_blank">登录商家</a></li>
		  <!--{else}-->
		  <li><a href="javascript:;" onclick="ToastShow('请先绑定会员帐号');">登录商家</a></li>
		  <!--{/if}-->

		  <li>发站内消息</li>
		  <li>发邮件提醒</li>
		  <li>发短信提醒</li>
		</ul>
	  </div>	
	</div>

	<div class="clear"></div>

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

</body>
</html>