

<!DOCTYPE html>

<html lang="en">



<head> 
<link rel='icon' type='img/png' href='gpib1.png'>



  <meta charset="utf-8">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <meta name="description" content="">

  <meta name="author" content="">



  <title>Login Cloud PKA GPIB CINERE</title>



  <!-- Custom fonts for this template-->

  <link href="<?=base_url("assets")?>/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

    <link href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css">

  <!-- Custom styles for this template-->

  <link href="<?=base_url("assets")?>/css/sb-admin-2.min.css" rel="stylesheet">



</head>



<body class="bg-gradient-primary">



  <div class="container">

    <!-- loading-->

        <div id="loading" class="modal" tabindex="-1" role="dialog">

          <div class="modal-dialog" role="document">

            <div class="modal-content">

              <div class="modal-body">

                <p><p><i class="fa fa-spin fa-spinner"></i> Loading...</p></p>

              </div>

            </div>

          </div>

        </div>

  <!--End loading-->

    <div class="card o-hidden border-0 shadow-lg my-5">

      <div class="card-body p-0">

        <!-- Nested Row within Card Body -->

        <div class="row">

          <div class="col-lg-5 d-none d-lg-block"><img src="<?=base_url("assets/img/gpib1.png")?>"></div>

          <div class="col-lg-7 mt-5">

            <div class="p-5">

              <div class="text-center">

                <h1 class="h2 text-gray-900 mb-4"><font face="candara"><marquee><b>Cloud PKA GPIB Cinere 2.0 Version Login</marquee></font></b></h2>

              </div>

              <form class="user" id="login">

                <div class="form-group row">

                  <div class="col-sm-12 mb-6 mb-sm-0">

                    <input type="text" class="form-control form-control-user" id="username" name="username" placeholder="Username/Email" required>

                  </div>

                </div>

                <div class="form-group">

                    <input type="password" class="form-control form-control-user" id="password" name="password" placeholder="Password" required>

                </div>

                <button  type="submit" class="btn btn-primary btn-user btn-block" ><i class="fas fa-sign-in-alt fa-fw"></i> Masuk</button>

                 

                <hr>

                <a href="<?=base_url('register.aspx')?>" class="btn btn-success btn-user btn-block">

                  <i class="fas fa-user-plus fa-fw"></i> Mendaftar

                </a>

                <!--<a href="index.html" class="btn btn-facebook btn-user btn-block">

                  <i class="fab fa-facebook-f fa-fw"></i> Register with Facebook

                </a> -->

              </form>

              <!-- <hr>

              <div class="text-center">

                <a class="small" href="forgot-password.html">Forgot Password?</a>

              </div> -->

              <!-- <div class="text-center">

                <a class="small" href="login.html">Belum Punya Akun? Silahkan Mendaftar!</a>

              </div> -->

            </div>

          </div>

        </div>

      </div>

     

      <footer class="sticky-footer bg-white">

          <div class="container my-auto">

            <div class="copyright text-center my-auto">

                <hr color='black'>

              <span><h7><b>Copyright<a target = '_blank' href="https://www.gpibcinere.org/"> ©GPIB CINERE</a> 2021-2022<br><br>Developer <a target = '_blank' href="https://www.instagram.com/maschris25/">@Natal</a></b></h7></span>

            </div>

          </div>

      </footer>

    </div>



  </div>



  <!-- Bootstrap core JavaScript-->

  <script src="<?=base_url("assets")?>/vendor/jquery/jquery.min.js"></script>

    <!-- <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> -->

  <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>



  <!-- Core plugin JavaScript-->

  <script src="<?=base_url("assets")?>/vendor/jquery-easing/jquery.easing.min.js"></script>

  <script src=" //cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"/>

  <script src="<?=base_url('assets/')?>vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

  <!-- Custom scripts for all pages-->

  <script src="<?=base_url("assets")?>/js/sb-admin-2.min.js"></script>

  <script type="text/javascript">

    $(document).ready(function(){

      var base_url = "<?=base_url()?>";

      $("#login").submit(function(){

        var form_data = new FormData($('#login')[0]);

          $.ajax({

                url             : base_url + 'log/login', 

                type            : "POST",

                dataType        : 'json',

                mimeType        : 'multipart/form-data',

                data            : form_data,

                contentType     : false,

                cache           : false,

                processData     : false,

                success         : function(response){



                    // alert(JSON.stringify(response))

                    $('#loading').modal('hide');

                    if (response == true) {

                      setTimeout(function(){ location.href = "<?=base_url()?>";  }, 1500);

                      Command: toastr["success"]("Selamat Anda Berhasil Masuk", "Sukses");

                      $("#form")[0].reset();      

                      

                    }else{

                      Command: toastr["info"]("Kombinasi Nama User Dan Kata Sandi Salah", "Info");

                    }

                },

                error: function(jqXHR, textStatus, errorThrown) {

                  $('#loading').modal('hide');

                  Command: toastr["error"](errorThrown, "Error");

                },

                beforeSend: function () {

                  $('#loading').modal('show');

                },

                complete: function () {

                    $('#loading').modal('hide');

                }

          });

        return false;

      });

    });

  </script>

  <script type="text/javascript">

    toastr.options = {

          "closeButton": false,

          "debug": false,

          "newestOnTop": false,

          "progressBar": true,

          "positionClass": "toast-top-right",

          "preventDuplicates": false,

          "onclick": null,

          "showDuration": "300",

          "hideDuration": "1000",

          "timeOut": "5000",

          "extendedTimeOut": "1000",

          "showEasing": "swing",

          "hideEasing": "swing",

          "showMethod": "slideDown",

          "hideMethod": "slideUp"

    }

  </script>

  <?php

function getClientIP() {



    if (isset($_SERVER)) {



        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))

            return $_SERVER["HTTP_X_FORWARDED_FOR"];



        if (isset($_SERVER["HTTP_CLIENT_IP"]))

            return $_SERVER["HTTP_CLIENT_IP"];



        return $_SERVER["REMOTE_ADDR"];

    }



    if (getenv('HTTP_X_FORWARDED_FOR'))

        return getenv('HTTP_X_FORWARDED_FOR');



    if (getenv('HTTP_CLIENT_IP'))

        return getenv('HTTP_CLIENT_IP');



    return getenv('REMOTE_ADDR');

}

function get_client_browser() {

    $browser = '';

    if(strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape'))

        $browser = 'Netscape';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox'))

        $browser = 'Firefox';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome'))

        $browser = 'Chrome';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera'))

        $browser = 'Opera';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))

        $browser = 'Internet Explorer';

    else

        $browser = 'Other';

    return $browser;

}



echo "<h6 align=\"center\">Your IP Address : ".getClientIP()."";

echo "<h6 align=\"center\">Your Browser : ".get_client_browser()."";

?>

</body>



</html>

