<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
    <link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />

    <link rel="icon" type="image/png" href="../../assets/images/favicon.png" />

    <title>Aplikasi UMKM</title>

    <style>
        /* Hide scrollbar for Chrome, Safari and Opera */
        .hdscr::-webkit-scrollbar {
        display: none;
        }

        /* Hide scrollbar for IE, Edge and Firefox */
        .hdscr {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
        }
    </style>
  </head>
  <body>

        <nav class="navbar navbar-expand-lg navbar-dark bg-primary">    
            <div class="container">
                <a class="navbar-brand" href="#">
                    <img src="../../assets/images/logo-white.png" width="100" alt="">
                </a>
                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon"></span>
                    </button>

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav mr-auto">
                        
                        </ul>
                        <form methode="POST" action="../login/logout" class="form-inline my-2 my-lg-0" >
                        <button class="btn btn-outline-warning btn-sm my-2 my-sm-0" type="submit">Logout</button>
                        </form>
                    </div>
             </div>
        </nav>

    <div class="container">
       <div class="row">
           <div class="col-md-3" style="cursor:pointer;">
                <div class="card" style="width: 18rem;">
                <div class="card-header text-center">
                    <img src="../../assets/images/user.png" width="125" /><br>
                    <strong><?php echo $user_logged->nama ?></strong>
                </div>
                    <ul class="list-group list-group-flush">
                    <a href="<?php echo base_url('index.php/')?>admin/dashboard" style="text-decoration:none;">
                        <li class="list-group-item text-dark border-bottom">Data Pemilik UMKM</li>
                    </a>
                    <a href="<?php echo base_url('index.php/')?>admin/umkm" style="text-decoration:none;">
                        <li class="list-group-item text-dark border-bottom">Data UMKM</li>
                    </a>
                    <a href="<?php echo base_url('index.php/')?>admin/absensi" style="text-decoration:none;">
                        <li class="list-group-item bg-primary text-white border-bottom">Absensi</li>
                    </a>
                    <a href="<?php echo base_url('index.php/')?>admin/laporan" style="text-decoration:none;">
                        <li class="list-group-item text-dark border-bottom">Laporan</li>
                    </a>
                    <a href="<?php echo base_url('index.php/')?>admin/setting" style="text-decoration:none;">
                        <li class="list-group-item text-dark">Setting</li>
                    </a>
                    </ul>
                </div>
           </div>
           <div class="col-md-9" >
                <div class="card">
                    <h5 class="card-header">Absensi</h5>
                    <div class="card-body">
                        <div>
                        <ul class="nav nav-tabs">
                        <li class="nav-item">
                                <a href="<?php echo base_url('index.php/')?>admin/absensi" class="nav-link">Absen Aktif</a>
                            </li>
                            <li class="nav-item">
                                <a href="<?php echo base_url('index.php/')?>admin/daftarabsen" class="nav-link">Data Absensi</a>
                            </li>
                            <li class="nav-item">
                                <a href="<?php echo base_url('index.php/')?>admin/progresabsen" class="nav-link">Progres Absensi</a>
                            </li>
                            <li class="nav-item">
                                <a href="" class="nav-link active">Buat Absensi</a>
                            </li>
                            
                        </ul>

                        <div class="mt-3 hdscr" style="max-height:400px;overflow-y: auto;">
                            <form action="" method="POST" class="needs-validation">
                                <?php
                                    if(isset($error_tutup_tahun)){
                                ?>
                                        <div class="alert alert-danger" role="alert">Gagal, Absensi untuk tahun <strong><?php echo $error_tutup_tahun ?></strong> sudah ditutup !</div>
                                <?php   
                                    }
                                ?>
                                <?php
                                    if(isset($error_last_mont)){
                                ?>
                                        <div class="alert alert-danger" role="alert">Gagal, Absensi bulan sebelumnya  <strong>( <?php echo $error_last_mont ?> <?php echo $tahun ?> )</strong> belum dibuat !</div>
                                <?php   
                                    }
                                ?>
                                <?php
                                    if(isset($msg)){
                                        if($msg=='success'){
                                ?>
                                    <div class="alert alert-success" role="alert">Data berhasil tersimpan !</div>
                                <?php            
                                        } else {

                                ?> 
                                    <div class="alert alert-danger" role="alert">Gagal, Data sudah ada !</div>
                                <?php
                                        }
                                    }
                                ?>
                                <div class="form-group">
                                    <label for="tahun">Tahun</label>
                                    <select name="tahun" class="form-control" id="tahun" required>
                                        <option value="<?php echo date('Y');?>" <?php if($tahun==date('Y')){ echo 'selected';} ?>><?php echo date('Y');?></option>
                                        <option value="<?php echo date('Y')-1;?>" <?php if($tahun==(date('Y')-1)){ echo 'selected';} ?>><?php echo date('Y')-1;?></option>
                                        <option value="<?php echo date('Y')-2;?>" <?php if($tahun==(date('Y')-2)){ echo 'selected';} ?>><?php echo date('Y')-2;?></option>
                                    </select>
                                </div>

                                <div class="form-group">
                                    <label for="bulan">Bulan</label>
                                    <select name="bulan" class="form-control" id="bulan" required>
                                        <option value="">--Pilih Bulan--</option>
                                        
                                        <option value="1"
                                        
                                        >Januari</option>
                                        <option value="2"
                                        
                                        >Februari</option>
                                        <option value="3"
                                        
                                        >Maret</option>
                                        <option value="4"
                                        
                                        >April</option>
                                        <option value="5"
                                        
                                        >Mei</option>
                                        <option value="6"
                                        
                                        >Juni</option>
                                        <option value="7"
                                        
                                        >Juli</option>
                                        <option value="8"
                                        
                                        >Agustus</option>
                                        <option value="9"
                                        
                                        >September</option>
                                        <option value="10"
                                        
                                        >Oktober</option>
                                        <option value="11"
                                        
                                        >November</option>
                                        <option value="12"
                                        
                                        >Desember</option>
                                   
                                    </select>
                                </div>


                                <button type="submit" class="btn btn-primary">Simpan</button>
                               
                            </form>
                        </div>
                        

                        </div>
                    </div>
                </div>
           </div>

       </div>
    </div>
    

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
    <script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
    <script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#tabeldata').DataTable();
        } );
    </script>
  </body>
</html>