v_login.php

mail@pastecode.io avatar
unknown
html
2 years ago
2.1 kB
3
Indexable
Never
<!DOCTYPE html>
<html>

<head>
  <?php $this->load->view("../../_partials/head.php") ?>
</head>

<body>
  <div id="app">
    <div id="main" style="margin-left: 0;">

      <div class="page-content">
        <section class="content">
            <div class="card shadow-lg my-5 mx-auto" style="max-width: 500px;">
              <div class="card-body ">
                <center>
                  <a href="<?php echo site_url('login/admin') ?>" ><font face="Tahoma"><b>SELAMAT DATANG DI ABSENSI UMK</b></font></a><br>
                  <br><img src="<?php echo base_url(); ?>images/umk.png" height="150px" width="150px" align="center"><br>
                  <br>
                  <form action="<?php echo site_url('login/logined') ?>" method="post">
                    <div class="form-group col-sm-7">
                      <input type="text" class="shadow-sm form-control" name="username" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1" required>
                    </div>
                    <div class="form-group col-sm-7">
                      <input type="password" class="shadow-sm form-control" name="password" placeholder="Password" aria-label="Password" aria-describedby="basic-addon1" required>
                    </div>
                    <div class="form-group col-sm-5">
                      <button class="form-control btn btn-primary">Login</button>
                    </div>
                  </form>
                </center><br>
              </div>
            </div>
        </section>
      </div>

    </div>
  </div>
  <?php $this->load->view("../../_partials/js.php") ?>
</body>

</html>

<script>
  $(document).ready(function () {
    $.ajax({
        type: 'POST',
        url: base_url + "/login/Login/CheckToken/",
        success: function (data) {
          console.log(data)
          if(data != 'ended') {
            window.location.href = base_url + "/dashboard";
          }
        },
        error: function (response) {
          console.log("gagal")
        },
    });
  })
</script>