<%@ Page language="c#" Codebehind="CardNoAdd.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.CardNoAdd" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<!--#include file="../inc/head2.inc"-->
		<script type="text/javascript" src="../inc/commond.js"></script>
		<script type="text/javascript">
		    $(document).ready(function(){
		       $('#ddlAgent').change(function(){
		            $.ajax({
		                url:'CardNoAdd.aspx?NoCopyright=1&type=ajax&AgentMemberID='+$('#ddlAgent').val(),
		                cache:false,
		                async:false,
		                success:function(data){
		                    if(data.indexOf('<!DOCTYPE') != -1){alert('身份已过期,请重新登陆!');return false;};
		                    $('#ddlPeriod').html(data);
		                },
		                error:function(){alert('error');}
		            });
		       }); 
		    });
		</script>
	</head>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="../images/admin_title.jpg" height="9" width="8" align="absMiddle"><asp:label id="lblTitleInfo" Runat="server" CssClass="tableHeaderText">会员卡添加</asp:label></div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" >批量添加会员卡</asp:Label></div>
		        <div class="frame_content">
			        <table cellSpacing="0" cellPadding="0" class="ptable">
				        <tr>
					        <th class="tl">
						        推广员：</th>
					        <td class="tr"><asp:DropDownList id="ddlAgent" runat="server" Width="130px"><asp:ListItem Value="0"></asp:ListItem></asp:DropDownList></td>
				        </tr>
				        <tr>
				            <th class="tl">期号：</th>
				            <td class="tr"><select id="ddlPeriod" name="ddlPeriod" style="width:130px;"><%=BindPeriod(int.Parse(ddlAgent.SelectedValue)) %></select></td>
				        </tr>
				        <tr>
					        <th class="tl">
						        默认积分：</th>
					        <td class="tr"><asp:TextBox id="txtScore" runat="server"></asp:TextBox></td>
				        </tr>
				        <tr>
				            <th class="tl">所属会员组：</th>
				            <td class="tr">
				                <asp:dropdownlist id="ddlGroup" runat="server"></asp:dropdownlist>
				            </td>
				        </tr>
				        <%if (Request.QueryString["addtype"] == "xls"){%>
				        <tr>
					        <th class="tl">
						        Excel文件：</th>
					        <td class="tr"><input id="csv1" type="file" name="csv1" runat="server" class="file" /><a href="card.xls" target="_blank">&nbsp;下载Excel模板(点击右键另存为...)</a></td>
				        </tr>
				        <%}else{ %>
				        <tr>
					        <th class="tl">
						        起始号码：</th>
					        <td class="tr">
						        <asp:TextBox id="txtStartNum" runat="server"></asp:TextBox></td>
				        </tr>
				        <tr>
					        <th class="tl">
						        结束号码：</th>
					        <td class="tr">
						        <asp:TextBox id="txtEndNum" runat="server"></asp:TextBox></td>
				        </tr>
				        <%} %>
				        <tr>
					        <th class="tl">
					        </th>
					        <td class="tr">
						        <%if (Request.QueryString["addtype"] == "xls"){%>
						            <asp:Button id="btnAddExcel" OnClick="btnAddExcel_Click" runat="server" Text="导入会员卡" CssClass="inputbtn"></asp:Button>
						        <%}else{%> 
						            <asp:Button id="btnSave" OnClick="btnSave_Click" runat="server" Text="生成会员卡" CssClass="inputbtn"></asp:Button>
						        <%} %>
						    </td>
				        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</html>
