<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="ALPHA.SiteMaster" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<!DOCTYPE html>

<html lang="en">
<head runat="server">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><%: Page.Title %> - Alphar Pokayoke System</title>

  

    <script type="text/javascript" src="Scripts/jquery-1.8.9.js"></script> 
    <script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"></script> 
    <script type="text/javascript" src="Scripts/main.js?v=1"></script> 
    <script type="text/javascript" src="Scripts/simplepicker.js"></script> 
    <link rel="stylesheet" type="text/css" href="css/Site.css?v=12345"/>
    <link rel="stylesheet" href="fonts/stylesheet.css?v=002" type="text/css" charset="utf-8" />
    <link rel="stylesheet" type="text/css" href="css/form-basic.css?v=1234"/>
    <link rel="stylesheet" type="text/css" href="css/simplepicker.css?v=009"/> 
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <script src="Scripts/sweetalert2.all.min.js"></script>
    <link rel="stylesheet" type="text/css" href="css/sweetalert2.min.css"/> 

     <script type="text/javascript">
         $(document).ready(function () {
             $("#loader").hide();

            


         });


         function exit() {
             if (confirm("Do you want to log out?") == true) {
                 window.location.href = "default.aspx";

                 return false;
             } else {
                 return false;
             }

 
         }

         </script>
   
</head>
<body style="overflow:no-display;">
    <form runat="server" class="form-basic" >


        <div id="Hd" class="hdpage" style="background-color:white;margin-left:-12px;"><img src="image/alpha.gif" style="height:30px;position:fixed;margin-top:-15px;left:20px;">
         
     <span class="headmenu">
      <div id="wrap">
           <div id="mainMenu">
               <ul class="main-navigation">
                      <li><main><a runat="server" href="~/UserMaster"><span><img src="image/userid.png"><text>User Master</text></span></a></main></li>
                      <li><main><a runat="server" href="~/LineMaster"><span><img src="image/datalist.png"><text>Line Master</text></span></a></main></li>
                      
                   </ul>
             </div>  
                            
       </div>
     </span>
          <span class="headmenu">

            
          <list id="userdetail" style="margin-right:50px;"><img src="image/userid.png" width="30"><asp:Label ID="lbluserdetail" style="position:fixed;margin-top:5px;"  runat="server" Text=""></asp:Label></list>
          <list id="exit" style="margin-right:50px;cursor:pointer;"><a href="#" onclick="javascript:exit();return false;"><img src="image/logout.png" width="30"><asp:Label ID="lblexit" style="position:fixed;margin-top:5px;"  runat="server" Text="Logout"></asp:Label></a></list>

          </span>
          </div>
         
       
      

        <ajax:ToolkitScriptManager runat="server" ID="ToolkitScriptManager" 
    ScriptMode="Release"  EnableScriptGlobalization="true" 
    EnableScriptLocalization="true" AsyncPostBackTimeout="0" >
    </ajax:ToolkitScriptManager> 
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                  

        <div class="container body-content">
              <div id="loader" style="position:fixed;margin-top:15%;margin-left:45%;"><img src="loader.gif" /></div>
            <asp:ContentPlaceHolder ID="MainContent" runat="server">
            </asp:ContentPlaceHolder>
         
        </div>

         
       </ContentTemplate>
    </asp:UpdatePanel>
    
        
    <script type="text/javascript">
        var d="";
        var m="";
        var y="";
        var simplepicker = new SimplePicker({
            zIndex: 10
        });
       
       
        function date(sd,sm,sy)
        {
            d=sd;
            m=sm;
            y=sy;

            simplepicker.open();
        }

        simplepicker.on('submit', function (date, readableDate) {
        
            var ad = readableDate.toString().split(" ");
            var month = ad[1].toString();
            var monthstr="";
            if(month.toLowerCase()=="january")
            {
                monthstr = "01";
            }
            else if(month.toLowerCase()=="febuary")
            {
                monthstr = "02";

            }
            else if(month.toLowerCase()=="march")
            {
                monthstr = "03";
            }
            else if(month.toLowerCase()=="april")
            {
                monthstr = "04";
            }
            else if(month.toLowerCase()=="may")
            {
                monthstr = "05";
            }
            else if(month.toLowerCase()=="june")
            {
                monthstr = "06";
            }
            else if(month.toLowerCase()=="july")
            {
                monthstr = "07";
            }
            else if(month.toLowerCase()=="august")
            {
                monthstr = "08";
            }
            else if(month.toLowerCase()=="september")
            {
                monthstr = "09";
            }
            else if(month.toLowerCase()=="october")
            {
                monthstr = "10";
            }
            else if(month.toLowerCase()=="november")
            {
                monthstr = "11";
            }
            else if(month.toLowerCase()=="december")
            {
                monthstr = "12";
            }
    
            if(ad[0].toString().length==1)
            {
                ad[0] = "0"+ad[0].toString();

            }

            $("#"+d).val(ad[0].toString());
            $("#"+m).val(monthstr);
            //$("#"+y).val((parseFloat(ad[2].toString())+543).toString());
            $("#"+y).val((parseFloat(ad[2].toString())).toString());
            $("#"+m).focus();
         
    
       
        });

        simplepicker.on('close', (date) => {
            $eventLog.innerHTML += 'Picker Closed'  + '\n';
        });
             



        function controlpage() {





            $("textarea").keydown(function (event) {
                if (event.keyCode == 13 || event.keyCode == 9) {
                    var s = $(this).val();

                }
            });


   
            $("select").keydown(function (event) {


                if (event.keyCode == 13 || event.keyCode == 9) {

                    var fields = $(this).parents('form:eq(0),body').find('button,input[type="text"],textarea,select:not([disabled])');
                    var index = fields.index(this);
                    if (index > -1 && (index + 1) < fields.length) {



                        fields.eq(index + 1).focus();
                        fields.eq(index + 1).select();




                    }
                    return false;


                }


            });
            $("select").keydown(function (event) {


                if (event.keyCode == 13 || event.keyCode == 9) {

                    var fields = $(this).parents('form:eq(0),body').find('button,input[type="text"],textarea,select:not([disabled])');
                    var index = fields.index(this);
                    if (index > -1 && (index + 1) < fields.length) {



                        fields.eq(index + 1).focus();
                        fields.eq(index + 1).select();




                    }
                    return false;


                }


            });



            $("input").not($(":button")).keydown(function (evt) {


                if (evt.keyCode == 13 || evt.keyCode == 9) {
                    evt.preventDefault();


                    iname = $(this).val();

                    if (iname !== 'Submit') {
                        //var fields = $(this).parents('form:eq(0),body').find('button,input[type="text"]:not([readonly]),textarea,select:not([disabled])');
                        var fields = $(this).parents('form:eq(0),body').find('button,input[type="text"],textarea,select:not([disabled])');
                        var index = fields.index(this);
                        if (index > -1 && (index + 1) < fields.length) {


                            fields.eq(index + 1).focus();
                            fields.eq(index + 1).select();


                        }
                        return false;
                    }


                }
                else if (evt.keyCode == 8) {

                    //$(this).val("");             
                    //$(this).focus();
                    //$(this).select();

                }


            });

           


        }


      

</script>     

    </form>
</body>
</html>
