<%@ Page Language="C#" MasterPageFile="~/masterpage/MasterPage.master" AutoEventWireup="true"
    CodeFile="IncomeReport.aspx.cs" Inherits="IncomeReport" Title="e Gen Service" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript" language="javascript">
        function newwindow1(page) {

            window.open(page, 'Website', 'height=400,width=500,status=no,scrollbars=no,resizable=yes, left=100,top=150,screenX=100,screenY=150');
        }
        
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="request">

        <script type="text/javascript" src="../Javascript/datetimepicker_css.js"></script>

        <script type="text/javascript" src="../Javascript/datetimepicker.js"></script>

        <script language="JavaScript" type="text/JavaScript" src="../JavaScript/CFunc.js"></script>

        <script src="../javascript/scriptvalidation.js" type="text/javascript"></script>

        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td colspan="4" class="hdr">
                    <a href="TransactionReport.aspx">Transaction Report </a><span style="padding-right: 100px;">
                        &nbsp;</span> <span>&nbsp;</span><a href="IncomeReport.aspx" class="active">Income Report</a>
                    <span style="padding-left: 100px;">&nbsp;</span><a href="AccountSummery.aspx">Account
                        Summary</a>
                </td>
            </tr>
            <tr>
                <td style="height: 30px" colspan="4">
                    
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="3%">
                            </td>
                            <td width="12%">
                                From Date
                            </td>
                            <td width="1%">
                                <strong>:</strong>
                            </td>
                            <td width="40%">
                                <asp:TextBox ID="txtFromDate" runat="server" Width="150px" onkeypress="return digitonly(this,event)"></asp:TextBox>
                                <%--<a id="ToDteImg" href="javascript:NewCal('ctl00_ContentPlaceHolder1_txtFromDate','ddmmmyyyy',false,24)">
                                    <img src="../Image/Date.JPG" alt="Pick a date" width="19" height="19" border="0"
                                        align="absmiddle" />
                                </a>--%>
                                <asp:RequiredFieldValidator ID="rfvFromDate" runat="server" ErrorMessage="Please Enter Date from"
                                    ControlToValidate="txtFromDate" Display="None">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" TargetControlID="rfvFromDate"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFromDate"
                                    PopupPosition="Right">
                                </cc1:CalendarExtender>
                            </td>
                            <td width="13%">
                                Select Service
                            </td>
                            <td width="1%">
                                <strong>:</strong>
                            </td>
                            <td width="30%">
                                <asp:DropDownList ID="ddlSelectService" runat="server" Width="185px">
                                    <asp:ListItem>Select</asp:ListItem>
                                    <asp:ListItem Value="1">Mobile Recharge</asp:ListItem>
                                    <asp:ListItem Value="2">DTH Recharge</asp:ListItem>
                                    <asp:ListItem Value="3">Data Card Recharge</asp:ListItem>
                                    <asp:ListItem Value="4">Bill Payment</asp:ListItem>
                                    <asp:ListItem Value="5">Premium Payment</asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvSelectService" runat="server" ErrorMessage="Please Select Service"
                                    ControlToValidate="ddlSelectService" InitialValue="Select" Display="None">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" TargetControlID="rfvSelectService"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7" style="height: 10px; padding-left: 300px" align="center">
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                To Date
                            </td>
                            <td>
                                <strong>:</strong>
                            </td>
                            <td>
                                <asp:TextBox ID="txtToDate" runat="server" Width="150px" onkeypress="return digitonly(this,event)"></asp:TextBox>
                                <%--<a id="A1" href="javascript:NewCal('ctl00_ContentPlaceHolder1_txtToDate','ddmmmyyyy',false,24)">
                                    <img src="../Image/Date.JPG" alt="Pick a date" width="19" height="19" border="0"
                                        align="absmiddle" />
                                </a>--%>
                                <asp:RequiredFieldValidator ID="rfvToDate" runat="server" ErrorMessage="Please Enter Date TO"
                                    ControlToValidate="txtToDate" Display="None">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" TargetControlID="rfvToDate"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtToDate"
                                    PopupPosition="Right">
                                </cc1:CalendarExtender>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td style="float: none; text-align: center; padding: 0 0 0 40px">
                                <asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="100" class="button"
                                    value="Submit" OnClick="btnSubmit_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td colspan="6">
                                <asp:Button ID="btndownload" runat="server"  Text="Download Report" 
                                    onclick="btndownload_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7" style="height: 10px; text-align:center">
                                <asp:Label ID="lblerror" runat="server" Font-Bold="true"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="7">
                   <div id="DIV_gvIncomeReport" runat="server">
                    <asp:GridView ID="gvIncomeReport" runat="server" AutoGenerateColumns="false" GridLines="None"
                        Width="100%" HorizontalAlign="Center" ShowFooter="True" OnRowDataBound="gvIncomeReport_RowDataBound"
                        DataKeyNames="OperatorName">
                        <PagerStyle HorizontalAlign="Center" />
                        <FooterStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                                    <PagerStyle BackColor="#dddee0" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <EmptyDataRowStyle HorizontalAlign="Center" />
                        <Columns>
                            <asp:TemplateField HeaderText="Sl.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Service" DataField="Type" />
                            <%--<asp:BoundField HeaderText="Operator" DataField="OperatorName" />--%>
                            <asp:TemplateField HeaderText="Operator">
                                <ItemTemplate>
                                    <asp:Label ID="lblOperator" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.OperatorName") %>'>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="No. Of Txn">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnNoOfTxn" runat="server" ForeColor="Black" Text='<%# DataBinder.Eval(Container, "DataItem.NumberOfTnx") %>'
                                        OnCommand="btnNoOfTxn_Command" ToolTip="Click To Get Transactions" OnClientClick="return newwindow1(GetDataAccOperators.aspx);"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--OnClientClick="return newwindow1(GetDataAccOperators.aspx);"--%>
                            <%-- OnClientClick="return OpenModelPopup('popupdiv')"--%>
                            <%--<asp:BoundField HeaderText="No. Of Txn" DataField="NumberOfTnx" />--%>
                            <asp:BoundField HeaderText="Amount" DataField="RequestAmount" SortExpression="RequestAmount" />
                            <asp:BoundField HeaderText="Margin" DataField="Margin" SortExpression="Margin" />
                            <asp:BoundField HeaderText="Net Amount" DataField="NetAmount" SortExpression="NetAmount" />
                        </Columns>
                        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView></div> <div id="DivGvTransactionReport" runat="server">
                    <%--<div id="DivGvTransactionReport" runat="server" visible="false" style="padding-top:10px"> --%>
                          <asp:GridView ID="GvTransactionReport" runat="server" AutoGenerateColumns="False" GridLines="None"
                        CellPadding="4" ForeColor="#333333" Width="100%" HorizontalAlign="Center" EmptyDataText="No Data Available">
                        <Columns>
                            <asp:TemplateField HeaderText="Sl.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="TRANSACTION_DATETIME" HeaderText="Txn Date & Time" />
                            <asp:BoundField DataField="SERVICE_NAME" HeaderText="Service Name" />
                            <asp:BoundField DataField="OperatorName" HeaderText="Operator" />
                            <asp:BoundField DataField="MobileNo" HeaderText="Mobile No." />
                            <asp:BoundField DataField="REQUEST_AMOUNT" HeaderText="Request Amount" />
                            <asp:BoundField DataField="TOTAL_COMMISSION" HeaderText="Margin" />
                            <asp:BoundField DataField="NET_AMOUNT" HeaderText="NET AMOUNT" />
                            <asp:BoundField DataField="STATUS" HeaderText="Status" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    </div><br />
                     
                    
                    
                </td>
            </tr>
       <%--     <tr>
                <td>
                    <div id="detail1" >
                        <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="border: solid 1px #666666;">
                            <tr bgcolor="#f5f5f5">
                                <td width="5%" class="style5">
                                    &nbsp;
                                </td>
                                <td width="4%" class="style5">
                                    <strong>Sl.</strong>
                                </td>
                                <td width="21%" class="style5">
                                    <strong>Txn Date & Time</strong>
                                </td>
                                <td width="10%" class="style5">
                                    <strong>Service</strong>
                                </td>
                                <td width="10%" class="style5">
                                    <strong>Operator</strong>
                                </td>
                                <td width="13%" class="style5">
                                    <strong>Mobile No. </strong>
                                </td>
                                <td width="12%" class="style5">
                                    <strong>Amount</strong>
                                </td>
                                <td width="12%" class="style5">
                                    <strong>Margin</strong>
                                </td>
                                <td width="13%" class="style5">
                                    <strong>Net Amount</strong>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    1
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Airtel
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    2
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Airtel
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    3
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Airtel
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    4
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Idea
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    5
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Aircel
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    6
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    BSNL
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    7
                                </td>
                                <td>
                                    21-Jun-12, 11:30.32
                                </td>
                                <td>
                                    Mobile
                                </td>
                                <td class="style4">
                                    Idea
                                </td>
                                <td class="style4">
                                    9999999999
                                </td>
                                <td class="style4">
                                    10.00
                                </td>
                                <td class="style4">
                                    0.20
                                </td>
                                <td class="style4">
                                    9.80
                                </td>
                            </tr>
                            <tr>
                                <td class="style6" colspan="6">
                                </td>
                                <td class="style6">
                                    <strong>70.00</strong>
                                </td>
                                <td class="style6">
                                    <strong>1.40</strong>
                                </td>
                                <td class="style6">
                                    <strong>68.60</strong>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>--%>
            <!--<tr>
  <td colspan="3"></td>
  <td style="padding:0 0 0 70px;"><input type="button" class="button"  value="Submit" style="margin:15px 0 0 0;" /></td>
   </tr>-->
            <tr>
                <td colspan="4" style="height: 30px">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
