<!--{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：<input type="text" name="suserid" id="suserid" class="input-120" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />&nbsp;
	  预约人手机：<input type="text" name="smobile" id="smobile" class="input-150" value="<!--{$smobile}-->" />&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>
	  <option value="3"<!--{if $sflag == '3'}--> 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="15%">店铺</th>
		<th width="8%">预约会员</th>
		<th width="8%">联系人</th>
		<th width="10%">手机</th>
		<th width="10%">预约时间</th>
		<th width="6%">处理状态</th>
		<th>留言</th>
		<th width="10%">操作</th>
	  </tr>
	  <!--{if empty($bespoke)}-->
	  <tr>
	    <td class="text_center" colspan="9">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $bespoke as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.bskid}-->" /><!--{$volist.bskid}--></td>
		<td><!--{$volist.shopname}--></td>
		<td>
		<!--{if ($volist.userid > 0)}-->
		<!--{$volist.username}-->(<!--{$volist.userid}-->)
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td><!--{$volist.contname}--></td>
		<td><!--{$volist.mobile}--></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">
		<!--{if $volist.flag=='1'}-->
			<font color="green">预约成功</font>	
		<!--{elseif $volist.flag == '2'}-->
			<font color="red">预约失败</font>
		<!--{else}-->
		    <font color="gray">待处理</font>
		<!--{/if}-->
		</td>
		<td><!--{$volist.words}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.bskid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.bskid}-->&<!--{$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="35%"><!--{$bespoke.shopname}--></td>
		<th width="15%">预约会员：<span class="f_red"></span></th>
		<td width="35%">
		  <!--{if $bespoke.userid > 0}-->
		  <!--{$bespoke.username}-->(<!--{$bespoke.userid}-->)
		  <!--{else}-->
		  ~
		  <!--{/if}-->
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>联系人：<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="contname" id="contname" class="input-b" value="<!--{$bespoke.contname}-->" />
		  <span class="oe_trap"></span>
		</td>
		<th>手机号码：<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="mobile" id="mobile" class="input-b" value="<!--{$bespoke.mobile}-->" />
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>留言：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="words" id="words" style="width:40%;height:80px;"><!--{$bespoke.words}--></textarea></td>
	  </tr>
	  <tr>
	    <th>处理状态：<span class="f_red"></span> </th>
		<td>
		  <select name="flag" id="flag">
		    <option value="0"<!--{if $bespoke.flag == '0'}--> selected<!--{/if}-->>待处理</option>
			<option value="1"<!--{if $bespoke.flag == '1'}--> selected<!--{/if}-->>预约成功</option>
			<option value="2"<!--{if $bespoke.flag == '2'}--> selected<!--{/if}-->>预约失败</option>
		  </select>
		</td>
		<th>预约时间：</th>
		<td><!--{$bespoke.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
	  </tr>
	  <tr>
		<th>商家备注：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="remark" id="remark" style="width:40%;height:80px;"><!--{$bespoke.remark}--></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(){

	$("#btn_save").bind("click", function(){

		if ($("#contname").val().length == 0) {
			ToastShow("请填写联系人", "contname");
			return false;
		}
		if ($("#mobile").val().length == 0) {
			ToastShow("请填写手机号码", "mobile");
			return false;
		}

		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>