<!--{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="sname" id="sname" class="input-150" value="<!--{$sname}-->" />&nbsp;
	  起始日期：<input type="text" name="sdate" id="sdate" class="input-100" readonly="only" value="<!--{$sdate}-->" />&nbsp;
	  结束日期：<input type="text" name="edate" id="edate" class="input-100" readonly="only" value="<!--{$edate}-->" />&nbsp;
	  &nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />

		<script>
		laydate({
			elem: '#sdate',
			format: 'YYYY-MM-DD',
			istime: false,
			choose: function(datas){}
		});
		</script>
		<script>
		laydate({
			elem: '#edate',
			format: 'YYYY-MM-DD',
			istime: false,
			choose: function(datas){}
		});
		</script>
	</div>
	</form>


    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="20%">店铺</th>
		<th width="13%">等级</th>
		<th width="10%">天数</th>
		<th width="10%">金额</th>
		<th width="15%">时间</th>
		<th>日志</th>
	  </tr>
	  <!--{if empty($shopvip)}-->
	  <tr>
	    <td class="text_center" colspan="6">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $shopvip as $volist}-->
	  <tr>
	    <td><!--{$volist.shopname}--></td>
		<td><!--{$volist.levelname}--></td>
		<td class="text_center"><!--{$volist.days}-->天</td>
		<td>¥ <!--{$volist.money}--></td>
		<td><!--{$volist.actiontime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td><!--{$volist.logcont}--></td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	<div class="oe_page_box"><!--{$showpage}--></div>

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

<!--{if $a == 'vip'}-->
<div class="oemarry_layout">
  <div class="oe_content">

     <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">店铺：<span class="f_red"></span></th>
		<td width="35%"><!--{$shop.shopname}--></td>
		<th width="15%">等级：</th>
		<td width="35%"><!--{$shop.levelname}--></td>
	  </tr>
	  <tr>
	    <th>帐户余额：<span class="f_red"></span></th>
		<td>￥<!--{$shop.money}--></td>
		<th>到期时间：</th>
		<td>
		<!--{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}-->
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
	  </tr>
	</table>
	
	<div class="oe_manage_but" id="but_list">
	  <span class="_current">购买等级</span>
	  <span>操作等级</span>
	  <span>取消等级</span>
	</div>

	<script type="text/javascript">
	$(function(){
		$obj_target = $("#but_list span");
		$obj_target.bind("click", function(){
			$(this).addClass("_current").siblings().removeClass("_current");
			$index = $obj_target.index(this);
			$(".span_list").hide();
			$("#span_"+$index).show();
		});
	});
	</script>

	<!--{assign var="levellist" value=vo_list("mod={shoplevel} where={v.levelid>1} orderby={v.levelid ASC}")}-->

	<form id="buy_form" action="<!--{$oefile}-->&c=<!--{$c}-->&shopid=<!--{$shopid}-->" method="post" />
	<input type="hidden" name="a" value="buy" />
	<table class="oe_table_wrap span_list" id="span_0">
	  <tr>
	    <td colspan="2">
		  选择要购买的店铺等级，请确保商家帐户有足够的余额（如果当前店铺的等级还在有效期内，系统将自动叠加时间或者补差价）
		</td>
	  </tr>
	  <tr>
	    <th width="15%">店铺等级：<span class="f_red">*</span></th>
		<td width="85%">
		  
		  <select name="levelid" id="buy_levelid">
		    <option value="">=请选择=</option>
			<!--{foreach $levellist as $volist}-->
			<option value="<!--{$volist.levelid}-->"><!--{$volist.levelname}--> - （￥<!--{$volist.money}--> 有效 <!--{$volist.days}-->天）</option>
			<!--{/foreach}-->
		  </select>

		</td>
	  </tr>
	  <tr>
	    <th>操作原因：<span class="f_red"></span></th>
		<td>
		  <textarea name="logcont" id="buy_logcont" style="width:80%;height:80px;"></textarea><br />
		  （简单描述操作原因，不填写则按照系统默认描述）
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_buy" class="button_2" value="确定购买" /></td>
	  </tr>
	</table>
	</form>
	<script type="text/javascript">
	$(function(){
		$("#btn_buy").bind("click", function(){
			if ($("#buy_levelid").find("option:selected").val() == 0) {
				ToastTips("请选择要购买的店铺等级");
				return false;
			}
			$("#buy_form").submit();
		});
	});
	</script>


	<form id="edit_form" action="<!--{$oefile}-->&c=<!--{$c}-->&shopid=<!--{$shopid}-->" method="post" />
	<input type="hidden" name="a" value="edit" />
	<table class="oe_table_wrap span_list" id="span_1" style="display:none;">
	  <tr>
	    <td colspan="2">选择要修改的店铺等级</td>
	  </tr>
	  <tr>
	    <th>店铺等级：<span class="f_red">*</span></th>
		<td colspan="3">
		  
		  <select name="levelid" id="edit_levelid">
		    <option value="">=请选择=</option>
			<!--{foreach $levellist as $volist}-->
			<option value="<!--{$volist.levelid}-->"<!--{if $shop.level == $volist.levelid}--> selected<!--{/if}-->><!--{$volist.levelname}--> - （￥<!--{$volist.money}--> 有效 <!--{$volist.days}-->天）</option>
			<!--{/foreach}-->
		  </select>

		</td>
	  </tr>
	  <tr>
	    <th width="15%">到期时间：<span class="f_red">*</span></th>
		<td width="35%">
		  <input type="text" name="vipetime" id="vipetime" class="input-200" value="<!--{if $shop.vipetime>0}--><!--{$shop.vipetime|date_format:"%Y-%m-%d %H:%M:%S"}--><!--{/if}-->" />

			<script>
				laydate({
					elem: '#vipetime',
					format: 'YYYY-MM-DD hh:mm:ss',
					istime: true,
					choose: function(datas){
					}
				});
			</script>
		</td>
		<th width="15%">扣除金额：<span class="f_red"></span></th>
		<td width="35%">
		  ￥<input type="text" name="money" id="edit_money" class="input-100" value="" />
		  （不扣除请填写0）
		</td>
	  </tr>
	  <tr>
	    <th>操作原因：<span class="f_red">*</span></th>
		<td colspan="3">
		  <textarea name="logcont" id="edit_logcont" style="width:50%;height:40px;"></textarea>
		  （请填写操作原因）
		</td>
	  </tr>
	  
	  <tr>
	    <td colspan="4">商家帐户可用数量</td>
	  </tr>
	  <tr>
	    <th>优惠券次数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="grcoupons" id="edit_grcoupons" class="input-100" value="<!--{$shop.grcoupons}-->" />
		</td>
		<th>发布活动次数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="gractivitys" id="edit_gractivitys" class="input-100" value="<!--{$shop.gractivitys}-->" />
		</td>
	  </tr>
	  <tr>
	    <th>发布商品次数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="grgoods" id="edit_grgoods" class="input-100" value="<!--{$shop.grgoods}-->" />
		</td>
		<th>发布相册张数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="grphotos" id="edit_grphotos" class="input-100" value="<!--{$shop.grphotos}-->" />
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_edit" class="button_2" value="确定修改" /></td>
	  </tr>
	</table>
	</form>
	<script type="text/javascript">
	$(function(){
		$("#btn_edit").bind("click", function(){
			if ($("#edit_levelid").find("option:selected").val() == 0) {
				ToastTips("请选择要店铺等级");
				return false;
			}
			if ($("#vipetime").val().length == 0) {
				ToastTips("请设置到期时间");
				return false;
			}
			if ($("#edit_logcont").val().length == 0) {
				ToastTips("请填写操作原因");
				return false;
			}
			$("#edit_form").submit();
		});
	});
	</script>


	<form id="cancel_form" action="<!--{$oefile}-->&c=<!--{$c}-->&shopid=<!--{$shopid}-->" method="post" />
	<input type="hidden" name="a" value="cancel" />
	<table class="oe_table_wrap span_list" id="span_2" style="display:none;">
	  <tr>
	    <td colspan="4">店铺必须是VIP以及以上等级才可以取消，取消后店铺等级恢复到免费店铺</td>
	  </tr>
	  <tr>
		<th>退回金额：<span class="f_red"></span></th>
		<td colspan="3">
		  ￥<input type="text" name="money" id="cancel_money" class="input-100" value="" />
		  （不退回金额请填写0）
		</td>
	  </tr>
	  <tr>
	    <th>取消原因：<span class="f_red">*</span></th>
		<td colspan="3">
		  <textarea name="logcont" id="cancel_logcont" style="width:60%;height:80px;"></textarea>
		  （请填写操作原因）
		</td>
	  </tr>
	  
	  <tr>
	    <td colspan="4">商家帐户可用数量</td>
	  </tr>
	  <tr>
	    <th width="15%">优惠券次数：<span class="f_red"></span></th>
		<td width="35%">
		  <input type="text" name="grcoupons" id="cancel_grcoupons" class="input-100" value="<!--{$shop.grcoupons}-->" />
		</td>
		<th width="15%">发布活动次数：<span class="f_red"></span></th>
		<td width="35%">
		  <input type="text" name="gractivitys" id="cancel_gractivitys" class="input-100" value="<!--{$shop.gractivitys}-->" />
		</td>
	  </tr>
	  <tr>
	    <th>发布商品次数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="grgoods" id="cancel_grgoods" class="input-100" value="<!--{$shop.grgoods}-->" />
		</td>
		<th>发布相册张数：<span class="f_red"></span></th>
		<td>
		  <input type="text" name="grphotos" id="cancel_grphotos" class="input-100" value="<!--{$shop.grphotos}-->" />
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_cancel" class="button_2" value="确定取消" /></td>
	  </tr>
	</table>
	</form>
	<script type="text/javascript">
	$(function(){
		$("#btn_cancel").bind("click", function(){
			if ($("#cancel_logcont").val().length == 0) {
				ToastTips("请填写取消原因");
				return false;
			}
			$("#cancel_form").submit();
		});
	});
	</script>


  </div>
</div>

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