<!-- // created by : KuduSinau_Hendrik_081275532220 (TERIMAKASIH UNTUK MENDAPATKAN KEBERKAHAN, DENGAN TIDAK MERUBAH NAMA HAK CIPTA, PLAGIAT, DAN TIDAK MEMPERJUALBELIKAN APLIKASI INI, SEMOGA KITA SEMUA MENDAPAT MANFAAT DAN KEBERKAHAN DARI APLIKASI INI)
// created by : KuduSinau_Hendrik_081275532220 (UNTUK MASUKAN DAN SARAN SERTA PENGEMBANGAN BISA MENGHUBUNGI NOMOR) -->

<body class="materialdesign" onload="hide_loading();">
    <div class="loading overlay">
        <div class="lds-spinner">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <div class="wrapper-pro">
        <div class="content-inner-all">
            <div class="breadcome-area mg-b-30 small-dn">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="breadcome-list map-mg-t-40-gl shadow-reset">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <font size="4">
                                            <strong><?= $Lembaga['sgkt_jenjang'] . ' ' . $Lembaga['nm_status'] . ' ' . ucwords(strtolower($Lembaga['nm_lembaga'])); ?></strong>
                                        </font>
                                    </div>
                                    <div class="col-lg-6 text-right">
                                        <?php foreach ($nmTapel as $tp) :
                                            if ($tp['sts_tapel'] == 1) {
                                        ?>
                                                <font size="4">
                                                    <span class="bread-blod">Semester <?= $tp['kd_smstr']; ?> | <?php if ($tp['kd_smstr'] == 'Ganjil') {
                                                                                                                    echo $tp['kd_tahun'] . '/' . ($tp['kd_tahun'] + 1);
                                                                                                                } elseif ($tp['kd_smstr'] == 'Genap') {
                                                                                                                    echo ($tp['kd_tahun'] - 1) . '/' . $tp['kd_tahun'];
                                                                                                                }; ?></span>
                                                </font>
                                        <?php }
                                        endforeach;
                                        ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="breadcome-area des-none mg-b-30">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="breadcome-list map-mg-t-40-gl shadow-reset">
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                        <font size="1">
                                            <strong><?= $Lembaga['sgkt_jenjang'] . ' ' . $Lembaga['nm_status'] . ' ' . ucwords(strtolower($Lembaga['nm_lembaga'])); ?></strong>
                                        </font>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-right">
                                        <?php foreach ($nmTapel as $tp) :
                                            if ($tp['sts_tapel'] == 1) {
                                        ?>
                                                <font size="1">
                                                    <span class="bread-blod">Semester <?= $tp['kd_smstr']; ?> | <?php if ($tp['kd_smstr'] == 'Ganjil') {
                                                                                                                    echo $tp['kd_tahun'] . '/' . ($tp['kd_tahun'] + 1);
                                                                                                                } elseif ($tp['kd_smstr'] == 'Genap') {
                                                                                                                    echo ($tp['kd_tahun'] - 1) . '/' . $tp['kd_tahun'];
                                                                                                                }; ?></span>
                                                </font>
                                        <?php }
                                        endforeach;
                                        ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="inbox-mailbox-area mg-b-40">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="row">
                                <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
                                    <div class="inbox-email-menu-list shadow-reset">
                                        <div class="compose-email">
                                            <a><b>Cetak Nilai Pengetahuan</b></a>
                                        </div>
                                        <div id="flashsucces" data-flash="<?= $this->session->flashdata('messageSuccess'); ?>"></div>
                                        <div id="flashwarning" data-flash="<?= $this->session->flashdata('messageWarning'); ?>"></div>
                                        <div id="flashupdate" data-flash="<?= $this->session->flashdata('messageUpdate'); ?>"></div>
                                        <div id="flasherror" data-flash="<?= $this->session->flashdata('messageError'); ?>"></div>
                                        <div id="flashsave" data-flash="<?= $this->session->flashdata('messageSave'); ?>"></div>
                                        <div id="flashinfo" data-flash="<?= $this->session->flashdata('messageInfo'); ?>"></div>
                                        <div id="flashinfo2" data-flash="<?= $this->session->flashdata('messageInfo2'); ?>"></div>
                                        <ul class="nav nav-tabs">
                                            <li>
                                                <h4 class="Inbox-category-ad"><i class="fa fa-folder-o" aria-hidden="true"></i> Bidang Study / Kelas</h4>
                                            </li>
                                            <?php
                                            $i = 1;
                                            foreach ($dtKkm as $study) :
                                                if ($study['kdl'] == $nmLembaga['id_lembaga']) {
                                                    if ($study['kdt'] == $kdTapel) {
                                                        if ($study['kdguru'] == $nmUser['kd_teachers']) { ?>
                                                            <li><a data-toggle="tab" href='#inbox<?= $study['idm']; ?>'><span class="inbox-icon"><i class="fa fa fa-pencil "></i></span> <?= $study['mapel'] . ' / ' . $study['kelas']; ?></a></li>
                                                <?php }
                                                    }
                                                }
                                                $i++; ?>
                                            <?php endforeach; ?>
                                        </ul>
                                    </div>
                                </div>
                                <div class="col-lg-9 col-md-9col-sm-12 col-xs-12">
                                    <div class="tab-content view-mail-ov-mg-t-30">
                                        <?php
                                        $i = 1;
                                        foreach ($dtKkm as $study) :
                                            if ($study['kdl'] == $nmLembaga['id_lembaga']) {
                                                if ($study['kdt'] == $kdTapel) {
                                                    if ($study['kdguru'] == $nmUser['kd_teachers']) { ?>
                                                        <div id="inbox<?= $study['idm']; ?>" class="tab-pane fade animated zoomInDown shadow-reset custom-inbox-message">
                                                            <div class="mail-title inbox-bt-mg">
                                                                <h2><?= $study['mapel'] . ' / ' . $study['kelas']; ?></h2>
                                                                <div class="view-mail-action view-mail-ov-d-n">
                                                                    <a class="compose-draft-bt" href="<?= base_url('guru/cetak_p/' . $study['idm']); ?>" target="blank"><i class="fa fa-print"></i> Cetak</a>
                                                                </div>
                                                            </div>
                                                            <div class="datatable-dashv1-list custom-datatable-overright">
                                                                <table id="table1" data-toggle="table" data-pagination="true" data-search="true" data-show-columns="false" data-show-pagination-switch="true" data-show-refresh="true" data-key-events="true" data-show-toggle="true" data-resizable="true" data-cookie="true" data-cookie-id-table="saveId" data-show-export="false" data-click-to-select="true" data-toolbar="#toolbar1">
                                                                    <thead>
                                                                        <tr>
                                                                            <th data-field="state" data-checkbox="true"></th>
                                                                            <th data-field="id">No</th>
                                                                            <th data-field="name">NISN</th>
                                                                            <th data-field="email">Nama Students</th>
                                                                            <?php $i = 1;
                                                                            foreach ($dtKdp as $dp) : if ($dp['kd_gmapel'] == $study['idm'] && $dp['kd_tapel'] == $kdTapel && $dp['kd_lembaga'] == $nmLembaga['id_lembaga']) {
                                                                            ?>
                                                                                    <th data-field="phone<?php echo $i;
                                                                                                            $i++; ?>"><?= $dp['no_kdp']; ?></th>
                                                                            <?php
                                                                                }
                                                                            endforeach;
                                                                            ?>
                                                                            <th data-field="hph">HPH</th>
                                                                            <th data-field="hpts">HPTS</th>
                                                                            <?php foreach ($nmTapel as $tp) :
                                                                                if ($tp['sts_tapel'] == 1 && $tp['kd_lembaga'] == $nmUser['kd_user']) {
                                                                                    if ($tp['kd_smstr'] == 'Ganjil') {
                                                                            ?>
                                                                                        <th data-field="hpas">HPAS</th>
                                                                                    <?php } else { ?>
                                                                                        <th data-field="hpas">HPAT</th>
                                                                            <?php }
                                                                                }
                                                                            endforeach;
                                                                            ?>
                                                                            <th data-field="akhir">HNA</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <?php $i = 1;
                                                                        foreach ($rSiswap as $p) :
                                                                            if ($p['idgmapel'] == $study['idm'] && $p['kdl'] == $nmUser['kd_user'] && $p['kdtapel'] == $kdTapel) {
                                                                        ?>
                                                                                <tr class="new-email">
                                                                                    <td></td>
                                                                                    <td><?= $i;
                                                                                        $i++; ?></td>
                                                                                    <td>
                                                                                        <?php
                                                                                        echo $p['nisn'];
                                                                                        ?>
                                                                                    </td>
                                                                                    <td>
                                                                                        <?php
                                                                                        echo $p['siswa'];
                                                                                        ?>
                                                                                        <?php
                                                                                        foreach ($dtKdp as $dp) : if ($dp['kd_gmapel'] == $study['idm'] && $dp['kd_tapel'] == $kdTapel && $dp['kd_lembaga'] == $nmLembaga['id_lembaga']) {
                                                                                        ?>
                                                                                    <td>
                                                                                        <?php
                                                                                                foreach ($nSiswap as $km) :
                                                                                                    if ($km['idgm'] == $study['idm'] and $km['ids'] == $p['kdsiswa'] and $km['ikdp'] == $dp['id_kdp'] and $km['tipe'] == 'p' && $km['kdlbg'] == $nmUser['kd_user'] && $km['kdtapel'] == $kdTapel) {
                                                                                                        echo $km['nilai'];
                                                                                                    }
                                                                                                endforeach;
                                                                                        ?>
                                                                                    </td>
                                                                            <?php
                                                                                            }
                                                                                        endforeach;
                                                                            ?>
                                                                            <td>
                                                                                <?php
                                                                                $this->db->select_avg('n_p', 'rata');
                                                                                $this->db->where('kd_students', $p['kdsiswa']);
                                                                                $this->db->where('kd_gmapel',  $study['idm']);
                                                                                $this->db->where('kd_tapel',  $kdTapel);
                                                                                $this->db->where('kd_lembaga',  $nmUser['kd_user']);
                                                                                $this->db->where('tipe_n', 'p');
                                                                                $query = $this->db->get('t_nilaip')->row_array();
                                                                                $newNakhirp =  number_format($query['rata'], 2, ",", ".");
                                                                                echo $newNakhirp;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaip as $km) :
                                                                                    if ($km['kd_gmapel'] == $study['idm'] && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                        if ($km['kd_students'] == $p['kdsiswa']) {
                                                                                            if ($km['tipe_n'] == 'q') {
                                                                                                echo $km['n_p'];
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaip as $km) :
                                                                                    if ($km['kd_gmapel'] == $study['idm'] && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                        if ($km['kd_students'] == $p['kdsiswa']) {
                                                                                            if ($km['tipe_n'] == 'r') {
                                                                                                echo $km['n_p'];
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <b>
                                                                                    <?php
                                                                                    foreach ($akhirp as $km) :
                                                                                        if ($km['kd_gmapel'] == $study['idm'] && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                            if ($km['kd_students'] == $p['kdsiswa']) {
                                                                                                echo $km['n_akhirp'];
                                                                                            }
                                                                                        }
                                                                                    endforeach;
                                                                                    ?>
                                                                                </b>
                                                                            </td>
                                                                                </tr>
                                                                            <?php
                                                                            }
                                                                            ?>
                                                                        <?php endforeach;  ?>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>
                                                        <?php
                                                        foreach ($dtKdp as $p) :
                                                            if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                        ?>
                                                                <div id="EditKdp<?= $p['id_kdp']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal fade" role="dialog">
                                                                    <form action="<?= base_url('guru/updateDataKdp'); ?>" method="post">
                                                                        <div class="modal-dialog">
                                                                            <div class="modal-content">
                                                                                <div class="modal-header header-color-modal bg-color-1">
                                                                                    <h4 class="modal-title">Form Tambah KD Pengetahuan</h4>
                                                                                    <div class="modal-close-area modal-close-df">
                                                                                        <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="modal-body">
                                                                                    <?php
                                                                                    $tes = $this->db->get_where('t_kdp', ['id_kdp' => $p['id_kdp'], 'kd_lembaga' => $nmUser['kd_user'], 'kd_tapel' => $kdTapel])->result();
                                                                                    foreach ($tes as $edit) : ?>
                                                                                        <div class="row">
                                                                                            <div class="col-lg-3"></div>
                                                                                            <div class="col-lg-9">
                                                                                                <input type="hidden" class="form-control" id="id_kdp" name="id_kdp" placeholder="Id Bidang Study" value='<?= $p['id_kdp']; ?>'>
                                                                                            </div>
                                                                                        </div>
                                                                                        <div class="sparkline11-graph">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-12">
                                                                                                    <label class="login2 pull-left pull-left-pro">Nomor KD</label>
                                                                                                </div>
                                                                                                <div class="col-lg-12">
                                                                                                    <div class="chosen-select-single">
                                                                                                        <select data-placeholder="Nomor KD" class="chosen-select" tabindex="-1" name='no_kdp' id='no_kdp'>
                                                                                                            <?php
                                                                                                            foreach ($kdp as $km) : {
                                                                                                                    if ($edit->no_kdp == $km['nm_nokdp']) {
                                                                                                                        $select = "selected";
                                                                                                                    } else {
                                                                                                                        $select = "";
                                                                                                                    }
                                                                                                                    echo "<option $select>" . $km['nm_nokdp'] . "</option>";
                                                                                                                }
                                                                                                            endforeach;
                                                                                                            form_error('no_kdp', '<small class="text-danger">', '</small>'); ?>
                                                                                                        </select>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <?= form_error('no_kdp', '<small class="text-danger">', '</small>'); ?>
                                                                                        </div>
                                                                                        <div class="sparkline11-graph">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-12">
                                                                                                    <label class="login2 pull-left pull-left-pro">Kompetensi Dasar</label>
                                                                                                </div>
                                                                                                <div class="col-lg-12">
                                                                                                    <textarea rows="5" id="nm_kdp" name="nm_kdp" class="form-control" placeholder="isi deskripsi lengkap" required><?= $edit->nm_kdp; ?></textarea>
                                                                                                </div>
                                                                                            </div>
                                                                                            <?= form_error('nm_kdp', '<small class="text-danger">', '</small>'); ?>
                                                                                        </div>
                                                                                        <div class="sparkline11-graph">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-12">
                                                                                                    <label class="login2 pull-left pull-left-pro">Deskripsi KD</label>
                                                                                                </div>
                                                                                                <div class="col-lg-12">
                                                                                                    <textarea id="nm_deskp" name="nm_deskp" class="form-control" placeholder="isi deskripsi singkat" required><?= $edit->nm_deskp; ?></textarea>
                                                                                                </div>
                                                                                            </div>
                                                                                            <?= form_error('nm_deskp', '<small class="text-danger">', '</small>'); ?>
                                                                                        </div>
                                                                                </div>
                                                                            <?php endforeach; ?>
                                                                            <div class="modal-footer">
                                                                                <div class="form-group-inner">
                                                                                    <div class="login-btn-inner">
                                                                                        <div class="row">
                                                                                            <div class="col-lg-12">
                                                                                                <div class="login-horizental cancel-wp pull-right">
                                                                                                    <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                                    <button class="btn btn-sm btn-primary" type="submit">Add New</button>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                            </div>
                                                                        </div>
                                                                    </form>
                                                                </div>
                                                        <?php }
                                                        endforeach;  ?>
                                                        <?php $i = 1;
                                                        foreach ($dtKdp as $p) :
                                                            if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                        ?>
                                                                <div id="EditMapel<?= $p['id_kdp']; ?>" class="modal FullColor-popup-AlertModal fade" role="dialog">
                                                                    <form action="<?= base_url('guru/inputNilaip'); ?>" method="post" name="autoSumForm">
                                                                        <div class="modal-dialog">
                                                                            <div class="modal-content">
                                                                                <div class="modal-header header-color-modal bg-color-5">
                                                                                    <h4 class="modal-title">Form Input Nilai Pengetahuan</h4>
                                                                                    <div class="modal-close-area modal-close-df">
                                                                                        <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="modal-body">
                                                                                    <div class="row">
                                                                                        <div class="col-lg-3"></div>
                                                                                        <div class="col-lg-9">
                                                                                            <input type="hidden" class="form-control" id="id_nilaip" name="id_nilaip" placeholder="Id Bidang Study" value='<?= $study['idm']; ?>'>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="sparkline11-graph">
                                                                                        <div class="row">
                                                                                            <div class="col-lg-12">
                                                                                                <input type="text" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['mapel'] . ' / ' . $study['kelas'] . ' / KD ' . $p['no_kdp']; ?>' readonly>
                                                                                                <input type="hidden" class="form-control" id="kd_kdp" name="kd_kdp" placeholder="kd_kdp" value='<?= $p['id_kdp']; ?>'>
                                                                                                <input type="hidden" class="form-control" id="deskp_n" name="deskp_n" placeholder="deskp_n" value='<?= $p['nm_deskp']; ?>'>
                                                                                                <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?php
                                                                                    foreach ($dtNilaip as $edit) :
                                                                                        if ($edit['ikdp'] == $p['id_kdp'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                                                    ?>
                                                                                            <div class="sparkline11-graph">
                                                                                                <div class="row">
                                                                                                    <div class="col-lg-9">
                                                                                                        <label class="login2 pull-right pull-right-pro"><?= '(' . $edit['nisn'] . ') ' . $edit['siswa']; ?></label>
                                                                                                    </div>
                                                                                                    <div class="col-lg-3">
                                                                                                        <input type="number" class="form-control" maxlength="3" id="n_p[]" name="n_p[]" min="0" max="100" placeholder="Nilai" value='<?php
                                                                                                                                                                                                                                        foreach ($nilaip as $km) :
                                                                                                                                                                                                                                            if ($p['id_kdp'] == $km['kd_kdp'] && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                                                                                                                                                                                if ($km['kd_students'] == $edit['ids']) {
                                                                                                                                                                                                                                                    echo $km['n_p'];
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        endforeach;
                                                                                                                                                                                                                                        ?>' required></input>
                                                                                                        <input type="hidden" class="form-control" id="kd_students[]" name="kd_students[]" max="100" placeholder="Siswa" value='<?= $edit['ids']; ?>' required></input>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                    <?php
                                                                                        }
                                                                                    endforeach; ?>
                                                                                </div>
                                                                                <div class="modal-footer">
                                                                                    <div class="form-group-inner">
                                                                                        <div class="login-btn-inner">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-3"></div>
                                                                                                <div class="col-lg-9">
                                                                                                    <div class="login-horizental cancel-wp pull-right">
                                                                                                        <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                                        <button class="btn btn-sm btn-danger" type="submit">Input</button>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </form>
                                                                </div>
                                                        <?php }
                                                        endforeach;  ?>
                                                        <?php $i = 1;
                                                        foreach ($dtKdp as $p) :
                                                            if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                        ?>
                                                                <div id="pts<?= $study['idm']; ?>" class="modal FullColor-popup-AlertModal fade" role="dialog">
                                                                    <form action="<?= base_url('guru/inputNilaipts'); ?>" method="post" name="autoSumForm">
                                                                        <div class="modal-dialog">
                                                                            <div class="modal-content">
                                                                                <div class="modal-header header-color-modal bg-color-5">
                                                                                    <h4 class="modal-title">Form Input Nilai Tengah Semester</h4>
                                                                                    <div class="modal-close-area modal-close-df">
                                                                                        <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="modal-body">
                                                                                    <div class="row">
                                                                                        <div class="col-lg-3"></div>
                                                                                        <div class="col-lg-9">
                                                                                            <input type="hidden" class="form-control" id="id_nilaip" name="id_nilaip" placeholder="Id Bidang Study" value='<?= $study['idm']; ?>'>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="sparkline11-graph">
                                                                                        <div class="row">
                                                                                            <div class="col-lg-12">
                                                                                                <input type="text" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['mapel'] . ' / ' . $study['kelas'] . ' / Penilaian Tengah Semester '; ?>' readonly>
                                                                                                <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?php
                                                                                    foreach ($dtNilaip as $edit) :
                                                                                        if ($edit['ikdp'] == $p['id_kdp'] && $edit['kdlbg'] == $nmUser['kd_user'] && $edit['kdtapel'] == $kdTapel) {
                                                                                    ?>
                                                                                            <div class="sparkline11-graph">
                                                                                                <div class="row">
                                                                                                    <div class="col-lg-9">
                                                                                                        <label class="login2 pull-right pull-right-pro"><?= '(' . $edit['nisn'] . ') ' . $edit['siswa']; ?></label>
                                                                                                    </div>
                                                                                                    <div class="col-lg-3">
                                                                                                        <input type="number" class="form-control" maxlength="3" id="n_p[]" name="n_p[]" min="0" max="100" placeholder="Nilai" value='<?php
                                                                                                                                                                                                                                        foreach ($nilaip as $km) :
                                                                                                                                                                                                                                            if ($km['tipe_n'] == 'q' && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                                                                                                                                                                                if ($km['kd_students'] == $edit['ids']) {
                                                                                                                                                                                                                                                    if ($km['kd_gmapel'] == $edit['idgm']) {
                                                                                                                                                                                                                                                        echo $km['n_p'];
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        endforeach;
                                                                                                                                                                                                                                        ?>' required></input>
                                                                                                        <input type="hidden" class="form-control" id="kd_students[]" name="kd_students[]" max="100" placeholder="Siswa" value='<?= $edit['ids']; ?>' required></input>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                    <?php
                                                                                        }
                                                                                    endforeach; ?>
                                                                                </div>
                                                                                <div class="modal-footer">
                                                                                    <div class="form-group-inner">
                                                                                        <div class="login-btn-inner">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-3"></div>
                                                                                                <div class="col-lg-9">
                                                                                                    <div class="login-horizental cancel-wp pull-right">
                                                                                                        <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                                        <button class="btn btn-sm btn-danger" type="submit">Input</button>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </form>
                                                                </div>
                                                        <?php }
                                                        endforeach;  ?>
                                                        <?php $i = 1;
                                                        foreach ($dtKdp as $p) :
                                                            if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                        ?>
                                                                <div id="pas<?= $study['idm']; ?>" class="modal FullColor-popup-AlertModal fade" role="dialog">
                                                                    <form action="<?= base_url('guru/inputNilaipas'); ?>" method="post" name="autoSumForm">
                                                                        <div class="modal-dialog">
                                                                            <div class="modal-content">
                                                                                <div class="modal-header header-color-modal bg-color-5">
                                                                                    <?php foreach ($nmTapel as $tp) :
                                                                                        if ($tp['sts_tapel'] == 1) {
                                                                                            if ($tp['kd_smstr'] == 'Ganjil') {
                                                                                    ?>
                                                                                                <h4 class="modal-title">Form Input Nilai Akhir Semester</h4>
                                                                                            <?php } else { ?>
                                                                                                <h4 class="modal-title">Form Input Nilai Akhir Tahun</h4>
                                                                                    <?php }
                                                                                        }
                                                                                    endforeach;
                                                                                    ?>
                                                                                    <div class="modal-close-area modal-close-df">
                                                                                        <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="modal-body">
                                                                                    <div class="row">
                                                                                        <div class="col-lg-3"></div>
                                                                                        <div class="col-lg-9">
                                                                                            <input type="hidden" class="form-control" id="id_nilaip" name="id_nilaip" placeholder="Id Bidang Study" value='<?= $study['idm']; ?>'>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="sparkline11-graph">
                                                                                        <div class="row">
                                                                                            <div class="col-lg-12">
                                                                                                <?php foreach ($nmTapel as $tp) :
                                                                                                    if ($tp['sts_tapel'] == 1) {
                                                                                                        if ($tp['kd_smstr'] == 'Ganjil') {
                                                                                                ?>
                                                                                                            <input type="text" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['mapel'] . ' / ' . $study['kelas'] . ' / Penilaian Akhir Semester'; ?>' readonly>
                                                                                                        <?php } else { ?>
                                                                                                            <input type="text" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['mapel'] . ' / ' . $study['kelas'] . ' / Penilaian Akhir Tahun'; ?>' readonly>
                                                                                                <?php }
                                                                                                    }
                                                                                                endforeach;
                                                                                                ?>
                                                                                                <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?php
                                                                                    foreach ($dtNilaip as $edit) :
                                                                                        if ($edit['ikdp'] == $p['id_kdp'] && $edit['kdlbg'] == $nmUser['kd_user'] && $edit['kdtapel'] == $kdTapel) {
                                                                                    ?>
                                                                                            <div class="sparkline11-graph">
                                                                                                <div class="row">
                                                                                                    <div class="col-lg-9">
                                                                                                        <label class="login2 pull-right pull-right-pro"><?= '(' . $edit['nisn'] . ') ' . $edit['siswa']; ?></label>
                                                                                                    </div>
                                                                                                    <div class="col-lg-3">
                                                                                                        <input type="number" class="form-control" maxlength="3" id="n_p[]" name="n_p[]" min="0" max="100" placeholder="Nilai" value='<?php
                                                                                                                                                                                                                                        foreach ($nilaip as $km) :
                                                                                                                                                                                                                                            if ($km['tipe_n'] == 'r' && $km['kd_lembaga'] == $nmUser['kd_user'] && $km['kd_tapel'] == $kdTapel) {
                                                                                                                                                                                                                                                if ($km['kd_students'] == $edit['ids']) {
                                                                                                                                                                                                                                                    if ($km['kd_gmapel'] == $edit['idgm']) {
                                                                                                                                                                                                                                                        echo $km['n_p'];
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        endforeach;
                                                                                                                                                                                                                                        ?>' required></input>
                                                                                                        <input type="hidden" class="form-control" id="kd_students[]" name="kd_students[]" max="100" placeholder="Siswa" value='<?= $edit['ids']; ?>' required></input>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                    <?php
                                                                                        }
                                                                                    endforeach; ?>
                                                                                </div>
                                                                                <div class="modal-footer">
                                                                                    <div class="form-group-inner">
                                                                                        <div class="login-btn-inner">
                                                                                            <div class="row">
                                                                                                <div class="col-lg-3"></div>
                                                                                                <div class="col-lg-9">
                                                                                                    <div class="login-horizental cancel-wp pull-right">
                                                                                                        <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                                        <button class="btn btn-sm btn-danger" type="submit">Input</button>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </form>
                                                                </div>
                                                        <?php }
                                                        endforeach;  ?>
                                                        <div id="TambahGurMapel<?= $study['idm']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal fade" role="dialog">
                                                            <form action="<?= base_url('guru/tambahDataKdp'); ?>" method="post">
                                                                <div class="modal-dialog">
                                                                    <div class="modal-content">
                                                                        <div class="modal-header header-color-modal bg-color-1">
                                                                            <h4 class="modal-title">Form Tambah KD Pengetahuan</h4>
                                                                            <div class="modal-close-area modal-close-df">
                                                                                <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                            </div>
                                                                        </div>
                                                                        <div class="modal-body">
                                                                            <div class="row">
                                                                                <div class="col-lg-3"></div>
                                                                                <div class="col-lg-9">
                                                                                    <input type="hidden" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['idm']; ?>'>
                                                                                </div>
                                                                            </div>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-12">
                                                                                        <label class="login2 pull-left pull-left-pro">Nomor KD</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <div class="chosen-select-single">
                                                                                            <select name='no_kdp' id='no_kdp' data-placeholder="Bidang Study" class="chosen-select" tabindex="-1">
                                                                                                <option disabled selected>Pilih Nomor KD</option>
                                                                                                <?php
                                                                                                foreach ($kdp as $kp) :
                                                                                                ?>
                                                                                                    <option value='<?= $kp['nm_nokdp'] ?>'><?= $kp['nm_nokdp'] ?></option>
                                                                                                <?php
                                                                                                endforeach;
                                                                                                ?>
                                                                                            </select>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('no_kdp', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-12">
                                                                                        <label class="login2 pull-left pull-left-pro">Kompetensi Dasar</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <textarea rows="5" id="nm_kdp" name="nm_kdp" class="form-control" placeholder="isi deskripsi lengkap" required></textarea>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nm_kdp', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-12">
                                                                                        <label class="login2 pull-left pull-left-pro">Deskripsi KD</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <textarea id="nm_deskp" name="nm_deskp" class="form-control" placeholder="isi deskripsi singkat" required></textarea>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nm_deskp', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                        </div>
                                                                        <div class="modal-footer">
                                                                            <div class="form-group-inner">
                                                                                <div class="login-btn-inner">
                                                                                    <div class="row">
                                                                                        <div class="col-lg-12">
                                                                                            <div class="login-horizental cancel-wp pull-right">
                                                                                                <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                                <button class="btn btn-sm btn-primary" type="submit">Add New</button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </form>
                                                        </div>
                                                        <?php $i = 1;
                                                        foreach ($dtKdp as $p) :
                                                            if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel) {
                                                        ?>
                                                                <div id="Proses<?= $study['idm']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal PrimaryModal-bgcolor fade" role="dialog">
                                                                    <form action="<?= base_url('guru/prosesNilaiAkhirp'); ?>" method="post" name="autoSumForm">
                                                                        <div class="modal-dialog">
                                                                            <div class="modal-content">
                                                                                <div class="modal-close-area modal-close-df">
                                                                                    <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                                                                                </div>
                                                                                <div class="modal-body">
                                                                                    <input type="hidden" class="form-control" id="id_nilaip" name="id_nilaip" placeholder="Id Bidang Study" value='<?= $study['idm']; ?>'>
                                                                                    <input type="hidden" class="form-control" id="id_gmapel" name="id_gmapel" placeholder="Id Bidang Study" value='<?= $study['mapel'] . ' / ' . $study['kelas'] . ' / KD ' . $p['no_kdp']; ?>' readonly>
                                                                                    <input type="hidden" class="form-control" id="kd_kdp" name="kd_kdp" placeholder="kd_kdp" value='<?= $p['id_kdp']; ?>'>
                                                                                    <input type="hidden" class="form-control" id="deskp_n" name="deskp_n" placeholder="deskp_n" value='<?= $p['nm_deskp']; ?>'>
                                                                                    <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                                    <?php
                                                                                    foreach ($dtNilaip as $edit) :
                                                                                        if ($edit['ikdp'] == $p['id_kdp'] && $edit['kdlbg'] == $nmUser['kd_user'] && $edit['kdtapel'] == $kdTapel) {
                                                                                    ?>
                                                                                            <input type="hidden" class="form-control" id="kd_students[]" name="kd_students[]" max="100" placeholder="Siswa" value='<?= $edit['ids']; ?>' required></input>
                                                                                    <?php
                                                                                        }
                                                                                    endforeach; ?>
                                                                                    <i class="fa fa-check modal-check-pro"></i>
                                                                                    <h2>Apakah anda yakin ?</h2>
                                                                                    <p>Silahkan klik tombol proses <br>untuk memproses nilai akhir <?= $study['mapel'] . ' / ' . $study['kelas']; ?> !</p>
                                                                                </div>
                                                                                <div class="modal-footer footer-modal-admin">
                                                                                    <button type='reset' data-dismiss='modal' class="btn btn-sm btn-white">Cancel</button>
                                                                                    <button class="btn btn-sm btn-danger" type="submit">Proses</button>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </form>
                                                                </div>
                                                        <?php }
                                                        endforeach;  ?>
                                        <?php }
                                                }
                                            }
                                        endforeach; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>