<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentDrawing.aspx.cs" Inherits="XpShop.Manage.AgentDrawing" %>

<!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/head.inc"-->
		<title>AgencyFinanceAdd</title>		
        <link type="text/css" rel="stylesheet" href="style/ui.datepicker.css" />
		<script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
        <script type="text/javascript">
        	$(document).ready(function(){
				$("#txtDateFrom").datepicker();
				$("#txtDateTo").datepicker();
                //同意发放
                drawingid=""

                $('.doAgree').click(function(){
                    var drawingid=$(this).siblings(':input').val();
                    if(confirm('确认发放吗？')){
                        var postdata = 'NoCopyRight=1&type=ajax&Action=DoAgentDrawing&drawingid='+drawingid+'&status=1';
                        $.ajax({
                            url:'AgentDrawing.aspx',
                            type:'POST',
                            data:postdata,
                            success:function(data){
                                if(data==='ok'){
                                    alert('操作成功');
                                    window.location.reload();
                                }else{
                                    alert('操作失败');
//                                    alert(data);
                                }
                            },
                            error:function(XMLHttpRequest,textStatus){if(textStatus=='parsererror'){alert('身份已过期,请重新登陆!')}else{alert('error')};}
                        });//end ajax
                    };//end if
                });	
                //不同意发放
                $('.doRefuse').click(function(){
                    var drawingid=$(this).siblings(':input').val();
                    if(confirm('确认不发放吗？')){
                        var postdata = 'NoCopyRight=1&type=ajax&Action=DoAgentDrawing&drawingid='+drawingid+'&status=-1';
                        $.ajax({
                            url:'AgentDrawing.aspx',
                            type:'POST',
                            data:postdata,
                            success:function(data){
                                if(data==='ok'){
                                    alert('操作成功');
                                    window.location.reload();
                                }else{
                                    alert('操作失败');
//                                    alert(data);
                                }
                            },
                            error:function(XMLHttpRequest,textStatus){if(textStatus=='parsererror'){alert('身份已过期,请重新登陆!')}else{alert('error')};}
                        });//end ajax
                    };//end if
                });
            });
        </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=9px width=8px 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="lblAction" runat="server" CssClass="tableHeaderText">结算提成</asp:Label></div>
		        <div class="frame_content">
			        <table class="tableBorder" cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
				        <tr>
                            <td align="Left">
                                <span>
                                    时间：从
                                    <asp:textbox id="txtDateFrom" name="txtDateFrom" runat="server" style="height:18px;line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;"></asp:textbox>
									至
									<asp:textbox id="txtDateTo" name="txtDateTo" runat="server" style="height:18px;line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;"></asp:textbox>
									<asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="查看" CssClass="inputbtn"></asp:Button>
                                    <br />
                                </span>
                            </td>
				        </tr>
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgAgentDrawing" runat="server" AllowPaging="true" PagerStyle-Mode="NumericPages" PageSize="20"
						            AutoGenerateColumns="False" DataKeyField="DrawingID" Width="100%" HorizontalAlign="Center" OnPageIndexChanged="dgAgentDrawing_PageIndexChanged"
						            HeaderStyle-CssClass="summary-title" Visible="true">
						            <HeaderStyle Font-Bold="True"></HeaderStyle>
						            <Columns>
                                         <asp:TemplateColumn HeaderText="推广员名称">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left" Width="120px"></ItemStyle>
								            <ItemTemplate>
									            <%# DataBinder.Eval(Container.DataItem, "AgentName")%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="会员帐号">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left" Width="120px"></ItemStyle>
								            <ItemTemplate>
									            <%# DataBinder.Eval(Container.DataItem, "MemberName")%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="提现金额">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left"></ItemStyle>
								            <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "DrawFinance")%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="申请时间">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left"></ItemStyle>
								            <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "AppTime")%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="银行账号">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left"></ItemStyle>
								            <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "BankAccount")%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="处理时间">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left"></ItemStyle>
								            <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "DrawTime").ToString()==""?"未处理":DataBinder.Eval(Container.DataItem, "DrawTime").ToString()%>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="操作">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="160px"></ItemStyle>
									        <ItemTemplate>
									        <input type="hidden" value="<%# DataBinder.Eval(Container.DataItem, "DrawingID").ToString()%>" />
									        <%# DataBinder.Eval(Container.DataItem, "Status").ToString() == "1" ? "已发放" : DataBinder.Eval(Container.DataItem, "Status").ToString() == "-1" ? "不发放" : " <a class=\"doAgree\" style=\"cursor:pointer;color:blue\">发放</a> <a class=\"doRefuse\" style=\"cursor:pointer;color:blue\">不发放</a> "%>
                                            </ItemTemplate>
								        </asp:TemplateColumn>					            
							        </Columns>
						            <PagerStyle Mode="NumericPages"></PagerStyle>
					            </asp:datagrid>
					        </td>
				        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</html>
