<?php if ($_GET[act]==''){ ?>
            <div class="col-xs-12">  
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title"><?php if (isset($_GET[tahun])){ echo "Jadwal Pelajaran"; }else{ echo "Jadwal Pelajaran Anda Pada Tahun ".date('Y'); } ?></h3>
                  <form style='margin-right:5px; margin-top:0px' class='pull-right' action='' method='GET'>
				   <input type="hidden" name='view' value='jadwalpelajaran'>
                    
                        <?php 
                            
                            $tahun = mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM tahun_ajaran where aktif='Y'"));
      
                            
                        ?>
                    
                    <input type="hidden" name='tahun' value='<?php echo $tahun['idTahunAjaran']; ?>'>
                    <input type="submit" style='margin-top:-4px' class='btn btn-success btn-sm' value='Lihat'>
                  </form>

                </div><!-- /.box-header -->
                <div class="table-responsive">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style='width:20px'>No</th>
						<th>Semester</th>
                        <th>Kode Pelajaran</th>
                        <th>Jadwal Pelajaran</th>
                        <th>Kelas</th>
                        <th>Guru</th>
                        <th>Hari</th>

                       
                      </tr>
                    </thead>
                    <tbody>
                  <?php
                     if (isset($_GET[tahun])){
                      $tampil = mysqli_query($conn,"SELECT a.*, e.nmKelas, b.namamatapelajaran, b.kode_pelajaran, c.nama_guru FROM rb_jadwal_pelajaran a 
                                            JOIN rb_mata_pelajaran b ON a.kode_pelajaran=b.kode_pelajaran
                                              JOIN rb_guru c ON a.nip=c.nip 
                                                
                                                  JOIN kelas_siswa e ON a.idKelas=e.idKelas
                                                  where a.nip='$_SESSION[nips]' AND a.idTahunAjaran='$_GET[tahun]' ORDER BY a.hari DESC");
                    
                    
                    }
                    $no = 1;
                    while($r=mysqli_fetch_array($tampil)){
                    echo "<tr><td>$no</td>
					  <td>$r[semester]</td>
			
                              <td>$r[kode_pelajaran]</td>
                              <td>$r[namamatapelajaran]</td>
                              <td>$r[nmKelas]</td>
                              <td>$r[nama_guru]</td>
                              <td>$r[hari]</td>
                           
                              </tr>";
                      $no++;
                      }
                  ?>
                    </tbody>
                  </table>
                </div>
				 <?php 
                    if ( $_GET[tahun] == ''){
                        echo "<center style='padding:60px; color:red'>Silahkan Memilih Tahun akademik  Terlebih dahulu...</center>";
                    }
                ?><!-- /.box-body -->
                </div>
            </div>

<?php 
}elseif ($_GET[act]=='kompetensidasar'){
    $d = mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM rb_jadwal_pelajaran a JOIN rb_mata_pelajaran b ON a.kode_pelajaran=b.kode_pelajaran JOIN rb_kelas c ON a.kode_kelas=c.kode_kelas where a.kodejdwl='$_GET[kodejdwl]'"));
            echo "<div class='col-xs-12'>  
              <div class='box'>
                <div class='box-header'>
                  <h3 class='box-title'>Kompetensi Dasar</h3>
                </div>
                <div class='table-responsive'>
                  <div class='table-responsive'>
                  <table class='table table-condensed table-hover'>
                      <tbody>
                        <input type='hidden' name='id' value='$d[kodekelas]'>
                        <tr><th width='120px' scope='row'>Kode Kelas</th> <td>$d[kode_kelas]</td></tr>
                        <tr><th scope='row'>Nama Kelas</th>               <td>$d[nama_kelas]</td></tr>
                        <tr><th scope='row'>Mata Pelajaran</th>           <td>$d[namamatapelajaran]</td></tr>
                      </tbody>
                  </table>
                  </div>
<div class='table-responsive'>
                  <table class='table table-bordered table-striped'>
                    <thead>
                      <tr>
                        <th style='width:20px'>No</th>
                        <th>Kelas</th>
                        <th>Mata Pelajaran</th>
                        <th>Ranah</th>
                        <th>Indikator</th>
                      </tr>
                    </thead>
                    <tbody>";
                      $tampil = mysqli_query($conn,"SELECT * FROM rb_kompetensi_dasar z JOIN rb_jadwal_pelajaran a ON z.kodejdwl=a.kodejdwl JOIN rb_kelas b ON a.kode_kelas=b.kode_kelas JOIN rb_mata_pelajaran c ON a.kode_pelajaran=c.kode_pelajaran where a.kodejdwl='$_GET[kodejdwl]' ORDER BY z.id_kompetensi_dasar DESC");
                    $no = 1;
                    while($r=mysqli_fetch_array($tampil)){
                    echo "<tr><td>$no</td>
                              <td>$r[nama_kelas]</td>
                              <td>$r[namamatapelajaran]</td>
                              <td>$r[ranah]</td>
                              <td>$r[kompetensi_dasar]</td>
                          </tr>";
                      $no++;
                      }
                    echo "<tbody>
                  </table>
                </div>
                </div>
            </div>";
} 
?>