if (isset($_POST['cetak'])) {
            $tgl1 = $_POST['tgl1'];
            $tgl2 = $_POST['tgl2'];
            $admin .= '<script language=javascript>
window.open("./cetaksiswalomba.php?idsiswa=' . $idsiswa . '&tgl1=' . $tgl1 . '&tgl2=' . $tgl2 . '", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=50, left=200, width=800, height=600");
</script>';
        }
        $admin .= '<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">Cari Siswa</h3></div>';
        $admin .= '
<form method="post" action="" class="form-inline"id="posts"class="form-inline">
<table class="table table-striped table-hover">
	<tr>
		<td>Siswa</td>
		<td>:</td>
		<td>' . getsiswa($idsiswa) . '<input type="hidden" name="idsiswa" value="' . $idsiswa . '"></td>
		</tr>
	<tr>
		<td>Tanggal Mulai</td>
		<td>:</td>
		<td><input type="text" id="tgl1" name="tgl1" value="' . $tgl1 . '"class="form-control"  required></td>
		</tr>
	<tr>
		<td>Tanggal Akhir</td>
		<td>:</td>
		<td><input type="text" id="tgl2" name="tgl2" value="' . $tgl2 . '"class="form-control" required></td>
		</tr>	
<tr>
		<td></td>
		<td></td>
		<td>
    $departemen = $data['departemen'];
    $tahunajaran = $data['tahunajaran'];
    $datarapor = getidraporafkelas($jenjang, $departemen, $tahunajaran);
    $idrapor = $datarapor['id'];
    $admin .= '
<form method="post" action="" class="form-inline">
<table class="table">';
    $admin .= '<tr>
<td>Kelas</td>
		<td>:</td>
		<td>' . getkelas($idkelas) . '</td>
</tr>';
    $admin .= '<tr>
<td>Nama Siswa</td>
		<td>:</td>
		<td>' . getsiswa($idsiswa) . '</td>
</tr>
</table>';
    /*******************************/
    $no = 1;
    $admin .= '<table class="table" width="100%">
<tr>
<td width="5%">No</td>
<td>Master ' . $idrapor . '</td>
<td colspan="2" width="10%">Nilai</td>
</tr>';
    $selectgrade = '<select name="grade" class="form-control" required>';
    $hasilj = $koneksi_db->sql_query("SELECT * FROM akad_gradeafektif ORDER BY id asc");
    $selectgrade .= '<option value="">== Grade ==</option>';
    while ($datasj = $koneksi_db->sql_fetchrow($hasilj)) {
        $selectgrade .= '<option value="' . $datasj['id'] . '">' . $datasj['nama'] . '</option>';