<!DOCTYPE HTML>
<html>
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>triple A</title>
      <link rel="favicon" href="/img/logo.ico">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
      <link rel="stylesheet" type="text/css" href="/css/common.css">
      <link rel="stylesheet" type="text/css" href="/css/login.css">
      <script src="/js/jquery.min.js"></script>
      <script>
    	
			var code = "[[${code}]]";
	    	
	    	if(code=="1")alert("아이디 혹은 비밀번호가 맞지않습니다");
    		/* function checkAdmin(id){
    			if(id!="") {
    			$.ajax({
    				type: "POST",
    				url: "/Admin/checkAdmin/"+id,			
    				dataType: "json",
    				success:function(data) {			
    					ad = data.RES;
    					if(data.RES=="SUCCESS"){
    						$('.opts').show();
    					}else{
    						$('#optnum').val("");
    					}
    					ac = true;
    				},
    				error:function(xhr, textStatus) {
    					alert(xhr.status + " 오류가 발생했습니다.");   			
    					
    				}
    			});  
    			}
    		} */	
    		function enterKey(evt){
        		if(event.keyCode == 13){
        			login();
        		}
        			
        	}
    	function login(){
    
     	    
     		var ac = false;
     		var ad = "FAIL";
     		
			if($('#id').val()==""){
				alert("아이디를 입력해주세요.");
				return null;
			}
			
			if($('#pw').val()==""){
				alert("비밀번호를 입력해주세요.");
				return null;
			}
		
			/*
			if(!ac){
				alert("관리자 확인중입니다.잠시후 로그인해주세요.");
				return null;
			}
			*/
		
			$('.login-form').submit();
		}
		function getParameterByName(name) {
		  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
		      results = regex.exec(location.search);
		  return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
		}
	</script>
    </head>
    <body class="loginBg">
      <div class="loginWrap">
        <div class="login">
          <div>
            <h1 class="name">SuperOperator Login</h1>
            <form class="login-form" method="post" action="/authenticate" >
            <input class="input" type="text" name="id" placeholder="Username" />
            <input class="input" type="password" name="pw" placeholder="Password" onkeydown="javascript:enterKey()"/>
            <input class="input" type="text" name="code" placeholder="OTP" />
            <a href = "javascript:login()" class="btn">Login</a>
            </form>
          </div>
          <p class="foot"><img src="/img/logo_tripleA.svg" /><span>TripleA Api Service BackOfficePage</span></p>          
        </div>
      </div>
    </body>
</html>
