<?= $this->extend('backend/layout/template_admin'); ?>

<?= $this->section('content'); ?>
<!-- /.content-header -->

<!-- Main content -->
<section class="content">
  <div class="container-fluid">
    <!-- Small boxes (Stat box) -->
    <div class="row">
      <div class="col">
        <div class="jumbotron">
          <h3>Assalamu 'alaikum <?= $user['nama_lengkap']; ?></h3>
          <p class="lead">Selamat datang di portal aplikasi MIJ.</p>
          <!-- <hr class="my-4">
                    <p>It uses utility classes for typography and spacing to space content out within the larger container.</p> -->
        </div>
      </div>
    </div>
    <div class="row">
      <?php
      $db = \Config\Database::connect();

      $menupegawai = $db->table('user_access_menu')->select('*')->where('role_kode', $user['role_kode'])->where('menu_id', 6)->get()->getRowArray();
      $menukesiswaan = $db->table('user_access_menu')->select('*')->where('role_kode', $user['role_kode'])->where('menu_id', 9)->get()->getRowArray();
      $menukeuangan = $db->table('user_access_menu')->select('*')->where('role_kode', $user['role_kode'])->where('menu_id', 10)->get()->getRowArray();


      if ($menupegawai or $menukeuangan) : ?>
        <div class="col-lg-3 col-6">
          <!-- small box -->
          <div class="small-box bg-info">
            <div class="inner">
              <h3><?= $jumlahpegawai; ?></h3>

              <p>Pegawai MIJ</p>
            </div>
            <div class="icon">
              <i class="fa fa-fw fa-users"></i>
            </div>
            <a href="<?= base_url(); ?>/pegawai" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
          </div>
        </div>
      <?php endif; ?>
      <!-- ./col -->

      <?php if ($menukesiswaan) : ?>
        <div class="col-lg-3 col-6">
          <!-- small box -->
          <div class="small-box bg-success">
            <div class="inner">
              <h3><?= $jumlahkelas; ?></h3>

              <p>Kelas</p>
            </div>
            <div class="icon">
              <i class="fas fa-fw fa-book-open"></i>

            </div>
            <a href="<?= base_url(); ?>/tatausaha/kelas" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-6">
          <!-- small box -->
          <div class="small-box bg-warning">
            <div class="inner">
              <h3><?= $jumlahsiswaaktif; ?></h3>

              <p>Peserta Didik</p>
            </div>
            <div class="icon">
              <i class="fas fa-fw fa-book-reader"></i>

            </div>
            <a href="<?= base_url(); ?>/tatausaha/datasiswa" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-6">
          <!-- small box -->
          <div class="small-box bg-primary">
            <div class="inner">
              <h3><?= $jumlahalumni; ?></h3>

              <p>Alumni</p>
            </div>

            <div class="icon">
              <i class="fas fa-fw fa-user-graduate"></i>
            </div>
            <a href="<?= base_url(); ?>/tatausaha/dataalumni" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
      <?php endif; ?>
    </div>
    <!-- /.row -->
    <!-- Main row -->

  </div><!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?= $this->endSection(); ?>