<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" Inherits="site_HITS_CallRecording_Default" Title="Brightstar Device Protection: Call Recordings Master"
    Theme="eMain" Culture="auto" UICulture="auto" Codebehind="Default.aspx.cs" %>

<%@ Register Src="~/Controls/PhoneNumber.ascx" TagName="PhoneNumber" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/HITSCalendar.ascx" TagName="HITSCalendar" TagPrefix="uc" %>
<%@ Register Src="~/Controls/ScriptingHelper.ascx" TagName="ScriptingHelper"
    TagPrefix="uc" %>
<%@ Register Src="~/Controls/DefaultHeader.ascx" TagName="DefaultHeader" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components"
    TagPrefix="cc1" %>
<%@ Register Src="~/Controls/CustomSorter.ascx" TagName="CustomSorter" TagPrefix="uc" %>
<%@ Register Src="~/Controls/CheckBoxListEx.ascx" TagName="CheckBoxListEx" TagPrefix="uc" %>


<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">


    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>
    <script src="../../../script/eGridHelper.js" type="text/javascript"></script>
    
<uc:ScriptingHelper ID="ScriptingHelper1" runat="server" />     

    <h1>
        <asp:Literal ID="m_litHeader" runat="server" Text="<%$ Resources: CallRecordingManagement, CallRecordingsLabel %>" />
    </h1>
    
    <uc:DefaultHeader ID="DefaultHeader1" runat="server" />
    
    <div class="mastersearch">
            <table cellspacing="0" cellpadding="0"><tr><td style="padding-right:0px">
            <img id="m_imgSearchCriteria" runat="server" src="../../../images/Collapse_13x13.jpg" class="showstate"
                onclick="expandMasterSearch(this, 'm_pnlMasterSearchCriteria')" alt="contract" />
            </td><td width="100%" valign="middle"><asp:Literal ID="m_litSearchCallRecordingsHeader" runat="server" Text="<%$ Resources: Default, LabelSearchCriteria %>" /></td></tr></table>
        </div>

    
   
    <div id="m_pnlMasterSearchCriteria" style="background-color: #DBDCDE">
    <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
        <tr>
            <td align="right" style="width: 145px">
                <asp:Literal ID="m_litCarriers" runat="server" Text="<%$ Resources: OrganizationManagement, ClientsLabelColon %>" /></td>
            <td align="left">
                <asp:DropDownList ID="m_ddlCarriers" runat="server" Width="220px">
                </asp:DropDownList>
            </td>
            <td align="right" style="width: 145px">
                <asp:Literal ID="m_litSize" runat="server" Text="<%$ Resources: CallRecordingManagement, SizeMbLabel %>" />
            </td>
            <td>
                <asp:TextBox ID="m_txtSize" runat="server" Width="100px"></asp:TextBox>
                <asp:RegularExpressionValidator ID = "m_revSize" runat = "server" ControlToValidate = "m_txtSize" ErrorMessage="*" EnableClientScript="true" ValidationGroup="SearchCreateriaGroup"
                Display="Dynamic" Text="<%$ Resources:Default, ValidatorText %>" ToolTip="Value must contain ['<' '>' '<=' '>=' '=' ''] followed by an integer or floating point number. " ValidationExpression="^\s*(>|<|=|<=|>=)?\s*0*[0-9]*\.?[0-9]{0,2}$" />
            </td>           
        </tr>
        <tr>
            <td align = "right" style="width:145px;" >
                <asp:Literal ID="m_litSubscriber" runat="server" Text="<%$ Resources: SubscriberManagement, LabelSubscriberColon %>" 
					/>
            </td>
            <td align="left" >
                <asp:TextBox ID="m_txtSubscriber" runat="server" />                        
                <SmartAjaxToolkit:SmartAutoCompleteExtender ID="m_sacexSubscriber" runat="server"
                TargetControlID="m_txtSubscriber"
                UpdateMode="Callback" EnableCaching="false" MinimumPrefixLength="2" OnAutoCompleteCallback="SearchSubscribers" />
            </td>
            <td nowrap align="right" style="width: 145px" >
                <asp:Literal ID="m_litLength" runat="server" Text="<%$ Resources: CallRecordingManagement, LengthMinLabel %>" />
            </td>
            <td align="left" >
                <asp:TextBox ID="m_txtLength" runat="server" Width="100px"></asp:TextBox>
                <asp:RegularExpressionValidator ID = "m_revLength" runat = "server" ControlToValidate = "m_txtLength" ErrorMessage="*" EnableClientScript="true" ValidationGroup="SearchCreateriaGroup"
                Display="Dynamic" Text="<%$ Resources:Default, ValidatorText %>" ToolTip="Value must contain ['<' '>' '<=' '>=' '=' ''] followed by an integer or floating point number. " ValidationExpression="^\s*(>|<|=|<=|>=)?\s*0*[0-9]*\.?[0-9]{0,2}$" />
            </td>           
        </tr>
        <tr>  
            <td nowrap align="right" style="width:145px;">
                <asp:Literal ID="m_litClaimID" runat="server" Text="<%$ Resources: ClaimsManagement, LabelClaimIDColon %>" /></td>
            <td align="left">
                <asp:TextBox ID="m_txtClaimID" runat="server" ></asp:TextBox>
                <SmartAjaxToolkit:SmartAutoCompleteExtender ID="m_sacexClaimID" runat="server"
                TargetControlID="m_txtClaimID"
                UpdateMode="Callback" EnableCaching="false" MinimumPrefixLength="2" CompletionSetCount="20" OnAutoCompleteCallback="SearchClaimIDs"/> 
            </td>
            <td align = "right" style="width: 145px">
                <asp:Literal ID="m_litAnnotator" runat="server" 
                Text="<%$ Resources: CallRecordingManagement, AnnotatorLabel %>" />
            </td>
            <td align="left" >
                <asp:TextBox ID="m_txtAnnotator" runat="server" />                        
                <SmartAjaxToolkit:SmartAutoCompleteExtender ID="m_sacexAnnotator" runat="server"
                TargetControlID="m_txtAnnotator"
                UpdateMode="Callback" EnableCaching="false" MinimumPrefixLength="2" OnAutoCompleteCallback="SearchUsers" />
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 145px">
                <asp:Literal ID="m_litMDN" runat="server" Text="<%$ Resources: HandsetManagement, LabelMDNColon %>" />
            </td>
            <td align="left">
               <uc1:PhoneNumber ID="m_ucMDN" runat="server" Required="false" /> 
            </td>
            <td align="right" style="width: 145px">
                <asp:Literal ID="m_litAnnotation" runat="server" Text="<%$ Resources: CallRecordingManagement, AnnotationLabel %>" />
            </td>
            <td align="left">
                <asp:TextBox ID="m_txtAnnotation" runat="server" Width="200px"></asp:TextBox>
            </td>                         
        </tr>
        <tr>
            <td nowrap align="right" style="width: 145px;">
                <asp:Literal ID="m_litDateFrom" runat="server" Text="<%$ Resources: Default, DateFromLabel %>" /></td>
            <td nowrap align="left">
                <uc:HITSCalendar ID="m_calDateFrom" runat="server" />
            </td>
            <td nowrap align="right" style="width: 145px">
                <asp:Literal ID="m_litDateTo" runat="server" Text="<%$ Resources: Default, DateToLabel %>" /></td>
            <td nowrap align="left">
                <uc:HITSCalendar ID="m_calDateTo" runat="server" />
            </td>                
        </tr> 
        <tr>
            <td  nowrap align="right" style="width: 145px;">
            <asp:Literal ID="m_litRange" runat="server" Text="<%$ Resources: CallRecordingManagement, ApplyDatesToLabel %>" />
            </td>
            <td nowrap align="justify">
               <%-- <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
                    <td nowrap align="left" style="width: 100px">
                        <asp:CheckBox ID="m_cbCalls" runat="server" Text="Calls" />
                    </td>
                    <td nowrap align="left" style="width: 100px">
                        <asp:CheckBox ID="m_cbAnnotations" runat="server" Text="Annotations" />
                    </td>
                    <td nowrap align="left">
                    <asp:CheckBox ID="m_cbBoth" runat="server" Text="Both" />
                    </td>   
                </table>--%>
                <uc:CheckBoxListEx ID="m_chblApplyDatesTo" RepeatDirection="Horizontal" TextForAll="Both" DefaultValue="Calls" runat="server" />
            </td>  
            <td nowrap align="right" style="width: 145px;">
                <asp:Literal ID="m_litPageSize" runat="server" Text="<%$ Resources: Default, RecordsperpageLabel %>" />
            </td>
            <td align="left">
                <asp:DropDownList ID="m_ddlPageSize" runat="server">
                        <asp:ListItem Text="20" Value="20"></asp:ListItem>
                        <asp:ListItem Text="50" Value="50"></asp:ListItem>
                        <asp:ListItem Text="100" Value="100"></asp:ListItem>
                        <asp:ListItem Text="<%$ Resources: Default, ListItemAll %>" Value="0"></asp:ListItem>
                </asp:DropDownList>
            </td>              
        </tr>       
    </table>   
    </div>
    
    <div style="padding-left: 25%">
                <asp:Button ID="m_btnSearch" runat="server" Text="<%$ Resources: Default, ButtonSearch %>" CssClass="pagebutton" Font-Bold="False"
                     OnClick="m_btnSearch_Click" CausesValidation="True" />
                <input id="m_btnClear" type="button" runat="server" value="<%$ Resources: Default, ButtonClear %>" class="pagebutton" />
    </div>
            
            
      <asp:Panel ID="m_pnlSearchResults" runat="server"> 
        <h2>
            <asp:Literal ID = "m_litSearchResultsHeader" runat = "server" Text = "<%$ Resources: Default, LabelSearchResults %>" />
        </h2>
            <asp:Label ID="m_lblSuccess" runat="server"  CssClass="successmessage"></asp:Label>
      </asp:Panel>
      
     <asp:Panel ID="m_pnlCallsGrid" Visible="False" runat="server" Width="100%">
        <h3>
            <asp:Literal ID="m_litSummary" runat="server" Text="<%$ Resources: CallRecordingManagement, CallSummaryLabel %>" />
        </h3>
        <asp:GridView ID="m_gvCallSummary" runat="server" AutoGenerateColumns="False"  ShowFooter="False" Width="70%"
            OnRowDataBound="m_gvCallSummary_RowDataBound">
            <Columns>                
                <asp:TemplateField HeaderText="<%$ Resources: OrganizationManagement, HeaderCarrier %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Wrap="false">
                    <ItemTemplate>
                        <asp:HyperLink ID="m_hlnkCarrier_sum" runat="server" Font-Underline="True" />
                    </ItemTemplate>
                </asp:TemplateField>              
                <asp:TemplateField HeaderText="<%$ Resources: ClaimsManagement, ClaimsLabel %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Literal ID="m_litClaims_sum" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, CallsLabel %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Literal ID="m_litCalls_sum" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources: ClaimsManagement, HeaderTextPercentOfClaims %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Literal ID="m_litPercent_sum" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, TotalTimeLabel %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Literal ID="m_litTotalTime_sum" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, SpaceMbLabel %>" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Literal ID="m_litSpace_sum" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle HorizontalAlign="Right" />
            <HeaderStyle HorizontalAlign="Center" />
        </asp:GridView>
        
        <h3>
            <asp:Literal ID="m_litSummaryFooter" runat="server" Text="<%$ Resources: Default, ResultsLabel %>" />
        </h3>
    
        <cc1:HitsSearchGridView ID="m_gvCallRecording" runat="server" AutoGenerateColumns="False"
            Width="100%" AllowPaging="True"            
            ShowMenu="True" ShowSelectField="True"
            ShowActivateMenu="False" ShowDeActivateMenu="False" ShowEmailMenu="False" ShowPrintMenu="True"
            ShowHotlineMenu="False" ShowDeHotlineMenu="False" CustomPagerID="HitsPager1"
            ClientFunctionPrint="window.print();" 
            ShowDeleteMenu="False"
            ShowDeSelectMenu="True" ShowExportMenu="False" ShowSelectMenu="True" 
            AtlasScriptManagerID="" ClientFunctionActivateSelected="" ClientFunctionDeActivateSelected=""
            ClientFunctionDeHotline="" ClientFunctionDelete="" ClientFunctionEmailSelected=""
            ClientFunctionExportSelected="" ClientFunctionHotline="" ClientFunctionSetStatus=""
            CssClassCustomPaging="" CssClassMenu="" PropagateActionToChildID="" ShowExportCSV="False"
            ShowExportCSVWithSummary="False" ShowExportXML="False" ShowExportXMLWithSummary="False"
            ShowSetStatus="False" OnRowDataBound="m_gvCallRecording_RowDataBound" OnPageIndexChanged="m_gvCallRecording_PageIndexChanged" OnPageIndexChanging="m_gvCallRecording_PageIndexChanging" OnMenuItemCommand="m_gvCallRecording_MenuItemCommand" OnCustomPageIndexChanged="m_gvCallRecording_PageIndexChanged" OnCustomPageIndexChanging="m_gvCallRecording_PageIndexChanging">
            <Columns>
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, EditTable %>"> 
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litEdit" Text="<%$ Resources: CallRecordingManagement, EditTable %>" ></asp:Literal>                         
                        <br /><br />
                     </headertemplate>
                    <itemstyle width="40px" VerticalAlign="Top"/>
                    <itemtemplate>
                        <asp:HyperLink runat="server" ID="m_hlnkEdit" Font-Underline="True"></asp:HyperLink>
                        <asp:HiddenField ID="m_hfCallRecordingId" runat="server" />
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, CallTable %>">
                      <headertemplate>
                            <asp:Literal runat="server" ID="m_litCall" Text="<%$ Resources: CallRecordingManagement, CallTable %>" ></asp:Literal>                           
                            <br /><br />
                      </headertemplate>
                      <itemstyle width="40px" VerticalAlign="Top"/>
                      <itemtemplate>
                            <asp:HyperLink runat="server" ID="m_hlnkCall" Font-Underline="True"></asp:HyperLink>                            
                            <asp:HyperLink runat="server" ID="m_hlnkClaim" Font-Underline="True"></asp:HyperLink>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: OrganizationManagement, HeaderCarrier %>" >
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litCarrier" Text="<%$ Resources: OrganizationManagement, HeaderCarrier %>" ></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csCarrier" SortExpression="CarrierName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                            <asp:HyperLink runat="server" ID="m_hlnkCarrier" Font-Underline="True"></asp:HyperLink>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, TableSubscriber %>">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_lit_gvSubscriber" Text="<%$ Resources: SubscriberManagement, TableSubscriber %>" ></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csSubscriber" SortExpression="SubscriberName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                        <asp:HyperLink runat="server" ID="m_hlnkSubscriber" Font-Underline="True"></asp:HyperLink>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: HandsetManagement, LabelMDN %>" >
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_lit_gvMDN" Text="<%$ Resources: HandsetManagement, LabelMDN %>" ></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csMDN" SortExpression="MDN" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                            <asp:Label runat="server" ID="m_lblMDN"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: Default, DateTimeLabel %>">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litDateCreate" Text="<%$ Resources: Default, DateTimeLabel %>" ></asp:Literal>
                        <br/>
                        <uc:CustomSorter runat="server" ID="m_csDateCreate" SortExpression="CallDateTime" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                            <asp:Label runat="server" ID="m_lblDateCreate"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
            
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, LatestAnnotationTable %>">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litLatestAnnotation" Text="<%$ Resources: CallRecordingManagement, LatestAnnotationTable %>"></asp:Literal>
                            <br /><br />
                    </headertemplate>   
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                        <asp:Label runat="server" ID="m_lblLatestAnnotation"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: Default, DateTimeLabel %>">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litDateLastAnnotation" Text="<%$ Resources: Default, DateTimeLabel %>"></asp:Literal>
                        <br/>
                        <uc:CustomSorter runat="server" ID="m_csDateLastAnnotation" SortExpression="AnnotationDateTime" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                            <asp:Label runat="server" ID="m_lblDateLastAnnotation"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="<%$ Resources: CallRecordingManagement, AnnotatorTable %>">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_lit_gvAnnotator" Text="<%$ Resources: CallRecordingManagement, AnnotatorTable %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csAnnotator" SortExpression="AnnotatorName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle VerticalAlign="Top" />
                    <itemtemplate>
                        <asp:HyperLink runat="server" ID="m_hlnkAnnotator" Font-Underline="True"></asp:HyperLink>
                    </itemtemplate>
                </asp:TemplateField>
                
            </Columns>
            
            <PagerTemplate>
                <cc1:HitsPager ID="HitsPager1" runat="server" GoButtonText="<%$ Resources: Default, GoButtonText %>"/>
            </PagerTemplate>
            <PagerSettings Mode="NumericFirstLast" />            
            <HeaderStyle HorizontalAlign = "Center" />
            <RowStyle HorizontalAlign = "Left" VerticalAlign="Top"/>
            <EditRowStyle HorizontalAlign="Left" VerticalAlign="Top"/>
        </cc1:HitsSearchGridView>  
      
    </asp:Panel>
    
    <asp:Label ID="m_lblNoCallRecordingFound" Font-Bold="True" ForeColor="Red" runat="server"
        Visible="False" Text="<%$ Resources: Default, LabelNoResultsFound %>" />
        
    <asp:ObjectDataSource ID="m_odsCallRecordingSource" runat="server" EnablePaging="True" SelectCountMethod="SelectCount" SelectMethod="Select" TypeName="CallRecordingDataSource" >
        <SelectParameters>        
            <asp:SessionParameter DefaultValue="null" Name="CallData" SessionField="CallRecordingSearchCriteria" Type="Object" />
            <asp:ControlParameter ControlID="m_gvCallRecording" DefaultValue="" Name="startRowIndex" PropertyName="PageIndex" Type="Int32" />
            <asp:Parameter DefaultValue="10" Name="maximumRows" Type="Int32" />               
            <asp:SessionParameter Name="CallRecordingSortExpression" SessionField="CallRecordingSortExpression" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>      
   
</asp:Content>