<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DisposalTickets.aspx.cs" Inherits="TruxWebPortal.DisposalTickets" %>

<%@ Register TagPrefix="ucHeader" TagName="truxHeader" Src="~/Header.ascx" %>
<%@ Register TagPrefix="ucfooter" TagName="truxfooter" Src="~/Footer.ascx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="HeadMyTickets" runat="server">
    <title>My Disposal Tickets</title>
    <link rel="stylesheet" type="text/css" href="_style/stylesheet.css" title="TRUX7" />
    <script src="styleswitch.js" type="text/javascript"> </script>
    <script src="js/jquery/jquery-1.11.2.min.js" type="text/javascript"> </script>
    <script src="js/jqueryUI/jquery-ui.min.js" type="text/javascript"> </script>
    <link rel="Stylesheet" href="_style/css/jquery-ui-1.8.24.custom.css" />
</head>
<body>
    <ucHeader:truxHeader ID="Hdr1" runat="server"></ucHeader:truxHeader>

    <div id="main_area">
        <div id="work_area">

            <form id="form1" runat="server" autocomplete="off" target="_blank">
                <h1>My Disposal Tickets</h1>
                <p>
                    <span id="Span19">
                        <asp:Label ID="lblDesc" runat="server"></asp:Label><a href="_help/my_disposaltickets.aspx" target="_blank"><img alt="help" style="margin-left: 5px; vertical-align: middle; width: 18px;" src="_images/help.png" /></a>

                    </span>
                </p>
                <%--Aging Backet--%>

                <asp:ScriptManager ID="ScriptManager1" runat="server" />

                <asp:UpdatePanel ID="UpdatePanel1" runat="server">

                    <ContentTemplate>
                        <asp:CheckBox ID="chkShowAllTickets" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowAllTickets_CheckedChanged"></asp:CheckBox>
                        <p style="display: inline">Show All Tickets</p>
                        <asp:Label ID="lblTicketPeriod" runat="server" Text="(* Months)"></asp:Label>

                        <%--Invoice List--%>


                        <asp:GridView ID="gvDisposalTicketList" runat="server" AutoGenerateColumns="False"
                            GridLines="None" CssClass="mGrid"
                            AllowSortng="True" ToolTip="Ticket List" EnableModelValidation="True" PageSize="3" DataKeyNames="Ticket Number,LM02_DSTE">
                            <Columns>
                                <asp:BoundField DataField="Ticket Number" HeaderText="Ticket Number" SortExpression="Ticket Number" />
                                <asp:BoundField DataField="Facility" HeaderText="Facility" SortExpression="Facility"></asp:BoundField>
                                <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" DataFormatString="{0:MM/dd/yyyy}" />
                                <asp:BoundField DataField="Material" HeaderText="Material" SortExpression="Material"></asp:BoundField>
                                <asp:BoundField DataFormatString="{0:F2}" DataField="Qty" HeaderText="Qty" ReadOnly="True" SortExpression="Qty"></asp:BoundField>
                                <asp:BoundField DataField="Rate" HeaderText="Rate" ReadOnly="True" SortExpression="Rate"></asp:BoundField>
                                <asp:BoundField DataFormatString="{0:C2}" DataField="Amount"
                                    HeaderText="Amount" ReadOnly="True" SortExpression="Amount">
                                    <ItemStyle CssClass="money"></ItemStyle>
                                </asp:BoundField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Image ID="Image1"  width="16" class="pdf" src="_images/pdf.png" ToolTip="Print Ticket" Visible='<%# !string.IsNullOrWhiteSpace(Eval("database").ToString()) %>' onclick='<%# @"window.open(""Handlers/DisposalTicket.ashx?ticketNumber=" + Eval("Ticket Number") + @"&disposalFacility=" + Eval("LM02_DSTE") + @""");return false" %>' runat="server"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="Download" runat="server" Visible='<%# Eval("hasAttachments") %>' CssClass="gridButton pdf" Text="See Ticket Attachment(s)" UseSubmitBehavior="False" OnClientClick='<%# @"window.open(""Handlers/DispoalTicketAttachments.ashx?ticketNumber=" + Eval("Ticket Number") + @"&disposalFacility=" + Eval("LM02_DSTE") + @""");return false" %>' CausesValidation="False" />
                                    </ItemTemplate>
                                    <ItemStyle CssClass="gridButtonColumn" />
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="col_headers"></HeaderStyle>
                            <AlternatingRowStyle CssClass="alt_row" />
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </form>
        </div>
        <!-- close work_area -->
    </div>
    <!-- close main_area -->


    <ucfooter:truxfooter ID="Ftr1" runat="server"></ucfooter:truxfooter>


</body>
</html>
