<form action="shop_pay.manage.php" method="get" name="form_search" id="form_search" onsubmit="return ajax_search_list();">
<input type="hidden" name="action" id="action" value="detail_list" />
<table width="680" border="0" cellpadding="0" cellspacing="0" class="from_table2" style="border-bottom:6px solid #E6F5FF">
	<tr>
		<th align="left" style="width:150px"><tpl> $langSysShopPayMemberName </tpl>：</th><td><input type="text" name="search_member_name" class="txtinput_short"  id="search_member_name" /></td>
		<th align="left" style="width:150px"><tpl> $langSysShopPayDate </tpl>：</th>
		<td colspan="2" ><input type="text" name="search_start_date" class="txtinput_short" id="search_start_date" size="15"  readonly="readonly" style="cursor:pointer" /><tpl> $langSysShopPaySearchTo </tpl><input type="text" name="search_end_date" class="txtinput_short" id="search_end_date" size="15" style="cursor:pointer"  readonly="readonly" /> </td>
	</tr>
	<tr>
	  <th width="150" align="left" style="width:150px"><tpl> $langSysShopPayName </tpl>：</th>
	  <td>
	  	<select name="search_pay" id="search_pay">
			<option value=""><tpl> $langSysShopPayModeSearchSel </tpl></option>
			<option value="alipay"><tpl> $langSysShopPayAlipay </tpl></option>
			<option value="tenpay"><tpl> $langSysShopPayTenpay </tpl></option>
			<tpl> section name=loop loop=$offline_pay </tpl>
			<option value="<tpl> $offline_pay[loop].pay_name </tpl>"><tpl> $offline_pay[loop].pay_name </tpl></option>
			<tpl> /section </tpl>
		</select>
	  </td>
      <th align="left" style="width:150px"><tpl> $langSysShopPayModeName </tpl>:</th>
	  <td width="100">
	  	<select name="search_mode_id" id="search_mode_id">
			<option value=""><tpl> $langSysShopPayModeSearchSel </tpl></option>
			<tpl> section name=loop loop=$mode_array </tpl>
			<option value="<tpl> $mode_array[loop].mode_id </tpl>"><tpl> $mode_array[loop].mode_name </tpl></option>
			<tpl> /section </tpl>
		</select>	
	  </td>
      <td width="200" align="left">
	  	<span class="btn_left" style="float:right">
		<input name="submit3" value="<tpl> $langSysShopPaySearch </tpl>" type="submit" class="btn_submit"/>
	  </span>
	  </td>
	</tr>
</table>
</form>
<form action="shop_pay.manage.php" id="form_del" name="form_del" method="post">
	<input type="hidden" name="action" id="action" value="detail_del" />
<table width="680" border="0" cellpadding="0" cellspacing="0" class="from_table2">
	<thead>
		<tr>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayDel </tpl></th>
		  <th width="300" align="center" valign="middle"><tpl> $langSysShopPayModeName </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayModeMoney </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayMemberName </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayName </tpl></th>
		  <th width="25%" align="center" valign="middle"><tpl> $langSysShopPayDate </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayState </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayModeOperate </tpl></th>
		</tr>
	</thead>
	<tpl> if $detail_array[0].pay_detail_id neq '' </tpl>
		<tpl> section name=i loop=$detail_array </tpl>
		<tr>
			<td width="10%" align="left" valign="middle">
				<input type="checkbox" name="pay_detail_id[]" value="<tpl> $detail_array[i].pay_detail_id </tpl>" />
		  </td>
		  <td width="250" align="left" valign="middle"><tpl> $detail_array[i].pay_mode_name </tpl></td>	
		  <td width="10%" align="left" valign="middle"><tpl> $detail_array[i].pay_mode_money </tpl></td>
		  <td width="10%" align="left" valign="middle"><tpl> $detail_array[i].login_name </tpl></td>
		  <td width="10%" align="left" valign="middle">
			  <tpl> if $detail_array[i].pay_type eq '1' </tpl>
				<tpl> if $detail_array[i].pay_name eq 'alipay' </tpl>
					<tpl> $langSysShopPayAlipay </tpl>
				<tpl> /if </tpl>
				<tpl> if $detail_array[i].pay_name eq 'tenpay' </tpl>
					<tpl> $langSysShopPayTenpay </tpl>
				<tpl> /if </tpl>
			  <tpl> /if </tpl>
			  <tpl> if $detail_array[i].pay_type eq '2' </tpl>
				<tpl> $detail_array[i].pay_name </tpl>
			  <tpl> /if </tpl>
		  </td>
		  <td width="25%" align="left" valign="middle"><tpl> $detail_array[i].date_line </tpl></td>
		  <td width="10%" align="left" valign="middle">
		  	<tpl> if $detail_array[i].pay_sign eq '0' </tpl>
				<tpl> $langSysShopPayDetailPayStateZero </tpl>
			<tpl> /if </tpl>
			<tpl> if $detail_array[i].pay_sign eq '1' </tpl>
				<tpl> $langSysShopPayDetailPayStateOne </tpl>
			<tpl> /if </tpl>
			<tpl> if $detail_array[i].pay_sign eq '2' </tpl>
				<tpl> $langSysShopPayDetailPayStateTwo </tpl>
			<tpl> /if </tpl>
			<tpl> if $detail_array[i].pay_sign eq '3' </tpl>
				<tpl> $langSysShopPayDetailPayStateThree </tpl>
			<tpl> /if </tpl>
		  </td>
		  <td width="10%" align="left" valign="middle"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $detail_array[i].pay_detail_id </tpl>');" >
	      <tpl> $langSysShopPayModeOperate </tpl></a></td>
		</tr>
		<tpl> /section </tpl>
	<tr>
		<td colspan="7">
		<div style="float:left; padding-left:20px">
		<span class="btn_left">
			<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langSysShopPaySelAll </tpl>" />
		  </span>
			<span class="btn_left">
			<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langSysShopPaySelNav </tpl>" />
			</span>
			<span class="btn_left">
			<input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langSysShopPayDel </tpl>" />
			</span>		</div>
		<div style="float:right; padding-right:20px">
			<tpl> $page_list </tpl>		
		</div>		
	</td>
	</tr>
	<tpl> else  </tpl>
	<tr>
		<td colspan="6"><tpl> $langSysCNoThing </tpl></td>
	</tr>
	<tpl> /if </tpl>
</table>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
	<b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langCConfirmDelete </tpl></b> <br />
	<input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
	<input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px;margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
</div>
<script>
$(document).ready(function() {
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
		);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("shop_pay.manage.php?action=detail_list<tpl>if $detail_array|@count neq 1</tpl>&curpage=<tpl> $curpage </tpl><tpl>/if</tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
		$.unblockUI();
		$('#form_del').ajaxSubmit(options_del);	
		return false;
	});
	$('#no').click($.unblockUI);
});
$(function(){
	$("#search_start_date").datepicker();
	$("#search_end_date").datepicker();
})
//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("shop_pay.manage.php?action=detail_modi&id="+id+"&curpage=<tpl> $curpage </tpl>&search_member_name=<tpl> $condition.search_member_name </tpl>&search_pay=<tpl> $condition.search_pay </tpl>&search_mode_id=<tpl> $condition.search_mode_id </tpl>&search_start_date=<tpl> $condition.search_start_date </tpl>&search_end_date=<tpl> $condition.search_end_date </tpl>");
}
//搜索
function ajax_search_list(){
	//取表单参数
	var queryString=$("#form_search").formSerialize();
	
	$.ajax({
		url: "shop_pay.manage.php",
		<tpl> if $NCharset eq 'UTF-8' </tpl>
		data: queryString,
		<tpl> else </tpl>
		data: escape(queryString),
		<tpl> /if </tpl>
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			$("#result_content").html(msg);
			hideLoading();
		}
	});
	return false;
}
</script>