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

<div class="content-wrapper">

  <section class="content-header">
    <h1>
      Mata Pelajaran
      <!-- <small>Edit Mata Pelajaran</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
      <li class="active">Dashboard</li>
    </ol> -->
  </section>

  <section class="content">
    <div class="row">
      <section class="col-lg-6">       
        <div class="box">

          <div class="box-header">
            <h3 class="box-title">Edit Mata Pelajaran</h3>
            <a href="mapel.php" class="btn btn-success btn-sm pull-right"><i class="fa fa-reply"></i> &nbsp Kembali</a> 
          </div>
          <div class="box-body">
            <form action="mapel_update.php" method="post">
              <?php 
              $id_mapel = $_GET['id'];
              $mapel = mysqli_query($koneksi,"SELECT * FROM mapel WHERE mapel_id='$id_mapel'");
              while($s=mysqli_fetch_array($mapel)){
                ?>
                <div class="form-group">
                  <label>Nama mapel</label>
                  <input type="hidden" name="id" value="<?php echo $s['mapel_id'] ?>">
                  <input type="text" class="form-control" name="nama" required="required" placeholder="Masukkan Nama mapel.." value="<?php echo $s['mapel_nama'] ?>">
                </div>

                <div class="form-group">
                  <input type="submit" class="btn btn-primary" value="Simpan">
                </div>
                <?php 
              }
              ?>
            </form>
          </div>

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

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