<%@ page language="VB" autoeventwireup="false" inherits="Reports_CustomReport, App_Web_dlzgh3qt" enableEventValidation="false" %>
<%@ Register TagPrefix="oem" Namespace="OboutInc.EasyMenu_Pro" Assembly="obout_EasyMenu_Pro" %>
<%@ Register TagPrefix="uctrl" Src="~/Header.ascx" TagName="header" %>
<%@ Register TagPrefix="owd" Namespace="OboutInc.window" Assembly="obout_Window_NET"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <uctrl:header ID="MyHeader" runat="server" />
     
     <owd:Window ID="ReportProtoType" runat="server" IsModal="true"  Height="370" Width="548"
            StyleFolder="~/Styles/mainwindow/blue" Title="Continuous Abnormality  Report"  
             VisibleOnLoad="true" ShowCloseButton="true"  Left="80"  Top="45" ShowStatusBar="False"> 
             
               
             <table width="100%" height="100%" cellpadding="1" class="Table" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none;">
              
             <tr></tr>
             <tr></tr>
             <tr >
             <td>&nbsp;From Date&nbsp;&nbsp;</td>
             <td style="width: 173px" >
               <asp:DropDownList ID="Drp_FromDateDD" runat="server" CssClass="WebControls"> </asp:DropDownList>
                <asp:DropDownList ID="Drp_FromDateMM" runat="server" CssClass="WebControls"></asp:DropDownList>
                <asp:DropDownList ID="Drp_FromDateYYYY" runat="server" CssClass="WebControls"> </asp:DropDownList>
             </td>
             <td></td>
             <td>&nbsp;To Date&nbsp;&nbsp;</td>
              <td>
              <asp:DropDownList ID="Drp_ToDateDD" runat="server" CssClass="WebControls"></asp:DropDownList>
              <asp:DropDownList ID="Drp_ToDateMM" runat="server" CssClass="WebControls"></asp:DropDownList>
              <asp:DropDownList ID="Drp_ToDateYYYY" runat="server" CssClass="WebControls"></asp:DropDownList> 
              </td>
              </tr>
              <tr></tr>
              <tr></tr>
              <tr></tr>
              
              <tr>
              <td colspan="2">&nbsp;Available Field&nbsp;&nbsp;</td>
              <td></td>
              <td  colspan="2" align="center">&nbsp;Export to Excel&nbsp;&nbsp;</td>
             </tr>
             
             <tr>
                 <td colspan="2">
                     <asp:ListBox ID="lst_AvailableField" runat="server" CssClass="WebControls" Width="150" Height="210" ></asp:ListBox>
                 </td>
             
                 <td> 
                 <table cellpadding="1">
                                  
                 <tr>
                 <td align="center"><input type="button" id="btn_next" runat="server" value=">"  style="font-size:11px; font-family:Verdana;height: 20px;width:50px"  onclick="btn_next_onclick();"/> </td>
                 
                 </tr>
                 <tr>
                 <td align="center"><input type="button" id="btn_NextAll" runat="server" value=">>"  style="font-size:11px; font-family:Verdana;height: 20px;width:50px"  onclick="NextAll();"/> </td>
                 </tr>
                 <tr>
                 <td align="center"><input type="button" id="btn_Previous" runat="server" value="<"  style="font-size:11px; font-family:Verdana;height: 20px;width:50px" onclick="btn_previous_onclick();"/> </td>
                 </tr>
                 <tr>
                 <td align="center"> <input type="button" id="btn_PreviousAll" runat="server" value="<<"  style="font-size:11px; font-family:Verdana;height: 20px;width:50px" onclick="PreviousAll();" /> </td>
                 </tr>
                 
                 </table>
                 </td>
                 <td colspan="2" align="right">
                     <asp:ListBox ID="lst_exportToCsv" EnableViewState="true" CssClass="WebControls" runat="server" Width="150" Height="210"  ></asp:ListBox>
                 
                 </td>
            </tr>
            <tr></tr>
            
             <tr>
                 <td colspan="2"><asp:Button ID="btn_SaveFormat" runat="server" CssClass="WebControls"  Text="Save Format"  OnClientClick="GetSelectedItem();"/>   </td>
                 <td colspan="3" align="right" >
                     <asp:HiddenField ID="Hdn_ExportName" runat="server" />
                     <asp:HiddenField ID="Hdn_SourceExportName" runat="server" />
                     <asp:HiddenField ID="Hdn_ExportValueName" runat="server" />
                     <asp:HiddenField ID="Hdn_SourceExportValueName" runat="server" />
                     
                     
                 <asp:Button ID="btn_GenerateReport"  runat="server" Text="Generate Report" CssClass="WebControls" OnClientClick="GetSelectedItem();javascript:document.getElementById('ReportProtoType_lblStatus').innerHTML='';"/>&nbsp;<input type="button" style="font-size:11px; font-family:Verdana;height: 20px;" value="Close" id="btn_Close" onclick="ReportProtoType.Close();" /></td> 
                 </tr>
                 
                 <tr>
                   <td colspan="5">
                   <hr />
                   <asp:Label ID="lblStatus" EnableViewState="false"    CssClass="WebControls" runat="server" Text=""  ForeColor="red" height="20"  ></asp:Label>
                   </td>
             </tr>         
              </table>            
          </owd:Window>      
    </div>
    </form>
</body>
</html>

<script type="text/javascript">

// ONLY NEXT BUTTON ON CLICK 

        function btn_next_onclick()
        
        {
        
        var ListViewObject=document.getElementById("<%=lst_AvailableField.ClientID %>");
        var ListExportObject=document.getElementById("<%=lst_exportToCsv.ClientID %>");
        var i=0
        for(var j=0;j<ListViewObject.options.length;j++)
            {
            if (ListViewObject.options[j].selected)
            {
            var Options=document.createElement("OPTION");
                    ListExportObject.add(new Option(ListViewObject.options[j].text,ListViewObject.options[j].value));
                    i=i+1
              }
            }
            removeOptionSelected(ListViewObject)
            }
            
            
  // NEXT ALL BUTTON ONCLICK      
      
            function NextAll()
            {
          
                var ListViewObject=document.getElementById("<%=lst_AvailableField.ClientID %>");
                var ListExportObject=document.getElementById("<%=lst_exportToCsv.ClientID %>");
                
                 for(var j=0;j<ListViewObject.options.length;j++)
                 {
                       
                     ListExportObject.add(new Option(ListViewObject.options[j].text,ListViewObject.options[j].value));
                 }
                removeAllOption(ListViewObject);
                
               
            }
            
            function GetSelectedItem()
            {
                document.getElementById("<%=Hdn_ExportName.ClientID %>").value='';
                document.getElementById("<%=Hdn_SourceExportName.ClientID %>").value='';
                var ListExportObject=document.getElementById("<%=lst_exportToCsv.ClientID %>");
                var ListViewObject=document.getElementById("<%=lst_AvailableField.ClientID %>");
                
                
                
                for(var j=0;j<ListExportObject.options.length;j++)
                 {
                       document.getElementById("<%=Hdn_ExportName.ClientID %>").value=document.getElementById("<%=Hdn_ExportName.ClientID %>").value+ListExportObject.options[j].text+',';
                       document.getElementById("<%=Hdn_ExportValueName.ClientID %>").value=document.getElementById("<%=Hdn_ExportValueName.ClientID %>").value+ListExportObject.options[j].value+',';
                 }
                 
                  for(var k=0;k<ListViewObject.options.length;k++)
                 {
                       document.getElementById("<%=Hdn_SourceExportName.ClientID %>").value=document.getElementById("<%=Hdn_SourceExportName.ClientID %>").value+ListViewObject.options[k].text+',';
                       document.getElementById("<%=Hdn_SourceExportValueName.ClientID %>").value=document.getElementById("<%=Hdn_SourceExportValueName.ClientID %>").value+ListViewObject.options[k].value+',';
                 }
                 
            }
            
           
            
            
   // REMOVE SELECTED OPTIONS         
            
            function removeOptionSelected(object)
                {
                  var k;
                  for (k = object.length - 1; k>=0; k--) {
                    if (object.options[k].selected) {
                      object.remove(k);
                    }
                  }
                }
                
     //REMOVE ALL OPTIONS           
                function removeAllOption(object)
                {
                  var k;
                  for (k = object.length - 1; k>=0; k--) {
                      object.remove(k);
                  }
                }



// PREVIOUS BUTTON ON CLICK


 function btn_previous_onclick()
        
        {
        
        var ListViewObject=document.getElementById("<%=lst_AvailableField.ClientID %>");
        var ListExportObject=document.getElementById("<%=lst_exportToCsv.ClientID %>");
        var i=0
        for(var j=0;j<ListExportObject.options.length;j++)
            {
            if (ListExportObject.options[j].selected)
            {
                ListViewObject.add(new Option(ListExportObject.options[j].text,ListExportObject.options[j].value));
            i=i+1
              }
            }
            removeOptionSelected(ListExportObject)
           
            }
            
            
            
            // PREVIOUS ALL BUTTON ONCLICK      
      
            function PreviousAll()
            {            
                var ListViewObject=document.getElementById("<%=lst_AvailableField.ClientID %>");
                var ListExportObject=document.getElementById("<%=lst_exportToCsv.ClientID %>");
                
                 for(var j=0;j<ListExportObject.options.length;j++)
                 {
                     ListViewObject.add(new Option(ListExportObject.options[j].text,ListExportObject.options[j].value));
                 }
                removeAllOption(ListExportObject);
            }
            
</script>
