

<!DOCTYPE html>
<html>
<title>NTLOGIX</title>
  <link rel="icon" href="images/favicon.ico" type="image/ico"> 
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}

/* Full-width input fields */
input[type=text], input[type=password],input[type=email] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  box-sizing: border-box;
}


/* Set a style for all buttons */
button {
  background-color:rgb(78, 49, 238);
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
}

button:hover {
  opacity: 0.8;
}

/* Extra styles for the cancel button */
.cancelbtn {
  width: auto;
  padding: 10px 18px;
  background-color: #f44336;
}

/* Center the image and position the close button */
.imgcontainer {
  text-align: center;
  margin: 24px 0 12px 0;
  position: relative;
}
.container {
  padding: 30px;
}
img.avatar {
  width: 20%;
  border-radius: 50%;
}

.box {
    padding: 10px 0;
    text-align: center;
}

span.psw {
  float: right;
  padding-top: 16px;
}

/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  padding-top: 60px;
}

/* Modal Content/Box */
.modal-content {
  background-color: #fefefe;
  margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
  border: 1px solid #888;
  width: 40%; /* Could be more or less, depending on screen size */
}

/* The Close Button (x) */
.close {
  position: absolute;
  right: 25px;
  top: 0;
  color: #000;
  font-size: 35px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: red;
  cursor: pointer;
}

/* Add Zoom Animation */
.animate {
  -webkit-animation: animatezoom 0.6s;
  animation: animatezoom 0.6s
}

@-webkit-keyframes animatezoom {
  from {-webkit-transform: scale(0)} 
  to {-webkit-transform: scale(1)}
}
  
@keyframes animatezoom {
  from {transform: scale(0)} 
  to {transform: scale(1)}
}

/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
  span.psw {
     display: block;
     float: none;
  }
  .cancelbtn {
     width: 100%;
  }

}
@media screen and (max-width: 678px) {
    .modal-content {
  width: 80%; /* Could be more or less, depending on screen size */
}
}
</style>
</head>
<body onload="document.getElementById('id01').style.display='block'">
<div class="box">
        <h2 style="color:red;">* EXCILENT COMPUTER INSTITUTE *<hr></h2><br><br>

</div>

<div id="id01" class="modal"> 
     <div class="modal-content animate">
            <div class="imgcontainer">
            
                 <img src="./assets/images/logo.jpeg" alt="Avatar" class="avatar">
            </div>

                  <div class="container">
                    <label for="uname"><b>User ID</b></label>
                    <input type="text" placeholder="Enter User ID" name="email" id="id" required>

                    <label for="psw"><b>Password</b></label>
                    <input type="password" placeholder="Enter Password" maxlength="10" name="psw" id="psw" required>                       
                    <button  name="btn" id="btn">Login Here</button>                 
                  </div>
</div>
        
</div>

   <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="./assets/libs/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="./assets/libs/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="./assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js"></script>
    <script src="./assets/extra-libs/sparkline/sparkline.js"></script>
    <!--Wave Effects -->
    <script src="./dist/js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="./dist/js/sidebarmenu.js"></script>
    <!--Custom JavaScript -->
    <script src="./dist/js/custom.min.js"></script>
    <!-- this page js -->
    <script src="./assets/extra-libs/multicheck/datatable-checkbox-init.js"></script>
    <script src="./assets/extra-libs/multicheck/jquery.multicheck.js"></script>
    <script src="./assets/extra-libs/DataTables/datatables.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
   
   <script>
     var msg;
     var icon;
     
     function showAlert(msg,icon) {
         Swal.fire({
             title: msg,
             icon: icon,
             confirmButtonText: 'Close'
         });
     }
$(document).ready(function(){
       
              $('#btn').click(function(){
                   var id = $("#id").val();
                   var psw = $("#psw").val();
                               $.ajax({
                                      url:"assets/core/login.php",
                                      method:"post",
                                      data: {
                                          id:id,
                                          psw:psw,                                                                        
                                      },
                                      success: function(data){
                                       
                                      if(data[0]=='0')
                                      {
                                        showAlert('Wrong User ID and Password','warning');return 0;
                                      
                                      }
                                       else
                                       {
                                            $.each(data,function(key,value){  
                                              
                                              if(value['access_level']=='Staff')
                                              {
                                                window.location.replace('./staff/?url='+value['access_level']);
                                              }
                                              else if(value['access_level']=='Admin')
                                              {
                                                window.location.replace('./admin/?url='+value['access_level']);
                                              }
                                                                                                                                                           
                                          })
                                          }  
                                      
                                      }
                                  });
                                      
               });

           
        
        });
</script>
</body>
</html>
