
<!DOCTYPE html>

<html lang="en">
<head>
    <base href="./">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta name="description" content="Rapor Digital Madrasah">
    <meta name="author" content="Kementerian Agama">
	<meta name="theme-color" content="#317EFB"/>
    <meta name="keyword" content="Madrasah, Rapor, RDM, mts,ma,mi,madrasah">
    <title>Rapor Digital Madrasah</title>
    <link rel="apple-touch-icon" sizes="57x57" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="https://rdm.hdmadrasah.id/assets/images/favicon/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192" href="https://rdm.hdmadrasah.id/assets/images/favicon/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="https://rdm.hdmadrasah.id/assets/images/favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="https://rdm.hdmadrasah.id/assets/images/favicon/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="https://rdm.hdmadrasah.id/assets/images/favicon/favicon-16x16.png">
    <link rel="icon" type="image/png" sizes="512x512" href="https://rdm.hdmadrasah.id/assets/images/favicon/ms-icon-512x512.png">
    <link rel="manifest" href="https://rdm.hdmadrasah.id/assets/images/favicon/manifest.json">
	<meta name="msapplication-navbutton-color" content="#4285f4">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="https://rdm.hdmadrasah.id/assets/images/favicon/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">

<link rel="stylesheet" type="text/css" href="../rdm/assets/vendors/bootstrap/css/bootstrap.min.css">
 <link rel="stylesheet" href="../assets/modules/fontawesome/css/all.min.css">



<link rel="stylesheet" type="text/css" href="../assets/css/util.css">
<link rel="stylesheet" type="text/css" href="../assets/css/main.css">
<style>
@media screen and (max-width: 360px){
#rc-imageselect, .g-recaptcha {transform:scale(0.66);-webkit-transform:scale(0.66);transform-origin:0 0;-webkit-transform-origin:0 0;}
}
@media screen and (min-width: 361px,max-width: 720px){
#rc-imageselect, .g-recaptcha {transform:scale(0.88);-webkit-transform:scale(0.88);transform-origin:0 0;-webkit-transform-origin:0 0;}
}
</style> 
	<script src="../rdm/jquery.min.js"></script>
		<style >
.pre-loader {
    background: #fff;
    background-position: center center;
    background-size: 13%;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 12345;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center
}

.pre-loader .loader-logo {
    padding-bottom: 15px;
}

.pre-loader .loader-progress {
    height: 8px;
    border-radius: 15px;
    max-width: 200px;
    margin: 0 auto;
    display: block;
    background: #ecf0f4;
    overflow: hidden
}

.pre-loader .bar {
    width: 0%;
    height: 8px;
    display: block;
    background: #1b00ff
}

.pre-loader .percent {
    text-align: center;
    font-size: 24px;
}

.pre-loader .loading-text {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    padding-top: 15px
}

		</style>
			<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-99897280-1', 'auto');
  ga('send', 'pageview', window.location.href);
	</script>
</head>
<body style="background-color: #666666;">
	<noscript><form action="" style="background-color:#fff;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999"><div style="font-size:18px;font-family:Helvetica,sans-serif;line-height:24px;margin:10%;width:80%"><p>Oh no! It looks like JavaScript is not enabled in your browser.</p><p style="margin:20px 0"><button type="submit" style="background-color:#4630eb;border-radius:100px;border:none;box-shadow:none;color:#fff;cursor:pointer;font-weight:700;line-height:20px;padding:6px 16px">Reload</button></p></div></form></noscript>

  	<div class="pre-loader">
		<div class="pre-loader-box">
			<div class="loader-logo"><img src="https://rdm.hdmadrasah.id/assets/images/brand/round-logo.png" alt=""></div>
			<div class="loader-progress" id="progress_div">
				<div class="bar" id="bar1" style="width: 100%;"></div>
			</div>
			<div class="percent" id="percent1">100%</div>
			<div class="loading-text">
				Loading...
			</div>
		</div>
	</div>

	<div class="limiter">
		<div class="container-login100">
			<div class="wrap-login100">
							<form id="login" class="login100-form validate-form">
				<div class="card p-4">
              <div class="card-body">
                <div class="d-lg-none mb-3 text-center" >
          			<img width="110px" height="110px" src="assets/images/brand/round-logo.png" alt="RDM">
            
          			</img></div>
			  	<h5 >Aplikasi PPDB Online</h5>
                <p class="text-muted">Portal khusus administrator</p>
                <p class="text-muted mb-3">Silahkan login menggunakan akun anda.</p>
                <div class="input-group mb-3">
                  <div class="input-group-append">
						<span class="input-group-text"><i class="fa fa-user"></i></span>
					</div>
                  <input class="form-control" type="email" id="username" name="username" placeholder="Username" required>
                </div>
                <div class="input-group mb-3">
                  <div class="input-group-append">
						<span class="input-group-text"><i class="fa fa-key"></i></span>
					</div>
                  <input class="form-control" id="password" name="password" type="password" placeholder="Password" required>
                </div>
				                
                <div class="row">
                  <div class="col-md-12">
                    <button class="btn btn-primary px-4" type="submit">Login</button>
                  </div>
                </div>
                <div class="row mt-3">
                  <div class="col-md-12 text-right">
                    <a class="btn btn-link px-2" target="__downloadpage" href="https://hdmadrasah.id/download">Download Aplikasi</a>
                  </div>
                </div>
              </div>
            </div>
			</form>
			
			<div class="login100-more" style="background-image: url('https://rdm.hdmadrasah.id/assets/images/bg-01.png');">
			</div>
			</div>
		</div>
	</div>

	

</body>
<script type="text/javascript">
function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}
 $(document).on('submit', 'form#login', function (event, messages) {
	event.preventDefault()
	var form   = $(this);
	var urlnya = "login/dologin";              
    $.ajax({
		 type: "POST",
		 url: urlnya,
		 data: form.serialize(),
		 success: function (response, status, xhr) {
			var ct = xhr.getResponseHeader("content-type") || "";
			if (ct == "application/json") {
				if(response.success){
					Swal.fire({
						type: 'success',
						title: 'Proses Authentication Berhasil ',
						showConfirmButton: false,
						 html: 'Akun anda berhasil diverifikasi',
						 timer: 1000,
					}).then((result) => {
						if (result.dismiss === Swal.DismissReason.timer) {
							var login = JSON.parse(getCookie("rdmData"));
							if(login.status !==""){
								window.location.href="https://rdm.hdmadrasah.id/"+login.status;
							}
							//location.reload();
						}
					})
				}else{
					if(response.lock){
						window.location.href="https://rdm.hdmadrasah.id/login";
					}else{
						Swal.fire({
							type: 'error',
							title: 'Proses Authentication Gagal ',
							showConfirmButton: false,
							 html: response.message,
							 timer: 1500
						})
					}
				}
			} else {
				Swal.fire({
					type: 'error',
					title: 'Proses Authentication Gagal ',
					showConfirmButton: false,
					 html: 'Koneksi Server Gagal',
					 timer: 1000,

				})
				    
			}   
		},
		error: function () {
			  Swal.fire({
				type: 'error',
				title: 'Proses Authentication Gagal ',
				showConfirmButton: false,
				 html: 'Koneksi Server Gagal',
				 timer: 1000,

			  })
		}
	}); 
	return false;
});
$(document).ready(function() {
	var elapsedTime = 0;
	var interval = setInterval(function() {
	  timer()
	}, 10);

	function progressbar(percent) {
	  document.getElementById("bar1").style.width = percent + '%';
	  document.getElementById("percent1").innerHTML = percent + '%';
	}

	function timer() {
	  if (elapsedTime > 100) {
		if (elapsedTime >= 107) {
			clearInterval(interval);
			$(".pre-loader").hide();
		}
	  } else {
		progressbar(elapsedTime);
	  }
	  elapsedTime++;
	}
	//setTimeout(function(){ $(".pre-loader").hide(); }, 2000);
	
	try{
		var login = JSON.parse(getCookie("rdmData"));
		if(login.status !==""){
			window.location.href="https://rdm.hdmadrasah.id/"+login.status;
		}
	}catch(Err){
		
	}
});
$('a[href$="#"]').click(function (event) {
            event.preventDefault ? event.preventDefault() : event.returnValue = false;

        });
  if('serviceWorker' in navigator) {

        navigator.serviceWorker.register('https://rdm.hdmadrasah.id/rdm-sw.js?ver=1.0.3&revision=202103090147', { scope: 'https://rdm.hdmadrasah.id/' })
          .then(function(registration) {
              
                console.log('Service Worker Registered');
          });

        navigator.serviceWorker.ready.then(function(registration) {
           console.log('Service Worker Ready');
        });

    }
</script>	
</html>
