<?php include 'header.php'; ?>

<div class="content-wrapper">

  <section class="content-header">
    <h1>
      Dashboard
      <!-- <small>Control panel</small> -->
    </h1>
  </section>


  <section class="content">

    <div class="row">

      <div class="col-lg-3 col-xs-6">
        <div class="small-box bg-green">
          <div class="inner">
            <?php 
            $id_saya = $_SESSION['id'];
            $siswa = mysqli_query($koneksi,"SELECT sum(prestasi_point) as total from input_prestasi, prestasi where prestasi_id=input_prestasi.prestasi and input_prestasi.siswa='$id_saya'");
            $s = mysqli_fetch_assoc($siswa);
            ?>
            <h3><?php echo $s['total']; ?> <small style="color: white;" class="text-bold">Point</small></h3>
            <p>Ketertiban Saya</p>
          </div>
          <div class="icon">
            <i class="fa fa-trophy"></i>
          </div>
        </div>
      </div>

      <div class="col-lg-3 col-xs-6">
        <div class="small-box bg-red">
          <div class="inner">
            <?php 
            $id_saya = $_SESSION['id'];
            $siswa = mysqli_query($koneksi,"SELECT sum(pelanggaran_point) as total from input_pelanggaran, pelanggaran where pelanggaran_id=input_pelanggaran.pelanggaran and input_pelanggaran.siswa='$id_saya'");
            $s = mysqli_fetch_assoc($siswa);
            ?>
            <h3><?php echo $s['total']; ?> <small style="color: white;" class="text-bold">Point</small></h3>
            <p>Pelanggaran Saya</p>
          </div>
          <div class="icon">
            <i class="fa fa-warning"></i>
          </div>
        </div>
      </div>

    </div>

    <div class="row">    
      <section class="col-lg-12">

        <div class="box box-primary">
          <div class="box-body text-center">
            <br>
            <br>
            <h3 class="text-bold">Selamat Datang Di Sistem Informasi E-Point Siswa SMP Muhammadiyah 2 Godean</h3>
            <br>
            <br>
          </div>
        </div>
      </section>
    </div>

  </section>

</div>
<?php include 'footer.php'; ?>