<!-- // 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>Input Nilai Keterampilan</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'] && $study['kdt'] == $kdTapel['id_tapel'] && $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-9 col-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'] && $study['kdt'] == $kdTapel['id_tapel'] && $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-discard-bt" href="#" data-toggle="modal" data-target="#TambahKDr<?= $study['idm']; ?>"><i class="fa fa-plus-circle"></i> Input KD Referensi</a>
                                                            <a class="compose-draft-bt" href="#" data-toggle="modal" data-target="#TambahGurMapel<?= $study['idm']; ?>"><i class="fa fa-plus-circle"></i> Input KD Manual</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="name">Nomor KD</th>
                                                                    <th data-field="email">Kompetensi Dasar</th>
                                                                    <th data-field="phone">Deskripsi KD</th>
                                                                    <th data-field="company">Aksi</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <?php $i = 1;
                                                                foreach ($dtKdk as $p) :
                                                                    if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                ?>
                                                                        <tr class="new-email">
                                                                            <td></td>
                                                                            <td><?= $p['no_kdk']; ?></td>
                                                                            <td><?= $p['nm_kdk']; ?></td>
                                                                            <td><?= $p['nm_deskk']; ?></td>
                                                                            <td>
                                                                                <a href="#" data-toggle="modal" data-target="#EditMapel<?= $p['id_kdk']; ?>">
                                                                                    <div class="label label-success"><i class=" fa fa-plus"></i></div>
                                                                                </a>
                                                                                <a href="#" data-toggle="modal" data-target="#EditKdk<?= $p['id_kdk']; ?>">
                                                                                    <div class="label label-warning"><i class=" fa fa-edit"></i></div>
                                                                                </a>
                                                                                <a href='<?= base_url('guru/hapusDataKdk/' . $p['id_kdk']); ?>' id='btn-hapus'>
                                                                                    <div class="label label-danger"><i class=" fa fa-trash"></i></div>
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                    <?php
                                                                    }
                                                                    ?>
                                                                <?php endforeach;  ?>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                    <div><br></div>
                                                    <a href="#" data-toggle="modal" data-target="#Proses<?= $study['idm']; ?>">
                                                        <div class="btn btn-warning"><i class=" fa fa-pencil"></i> Proses Nilai Akhir</div>
                                                    </a>
                                                </div>
                                                <?php
                                                foreach ($dtKdk as $p) :
                                                    if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel['id_tapel']) {
                                                ?>
                                                        <div id="EditKdk<?= $p['id_kdk']; ?>" class="modal modal-adminpro-general Customwidth-popup-WarningModal fade" role="dialog">
                                                            <form action="<?= base_url('guru/updateDataKdk'); ?>" method="post">
                                                                <div class="modal-dialog">
                                                                    <div class="modal-content">
                                                                        <div class="modal-header header-color-modal bg-color-3">
                                                                            <h4 class="modal-title">Form Update KD Keterampilan</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_kdk', ['id_kdk' => $p['id_kdk']])->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_kdk" name="id_kdk" placeholder="Id Bidang Study" value='<?= $p['id_kdk']; ?>'>
                                                                                    </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_kdk' id='no_kdk'>
                                                                                                    <option disabled selected>Pilih Nomor KD</option>
                                                                                                    <?php
                                                                                                    foreach ($kdk as $km) : {
                                                                                                            if ($edit->no_kdk == $km['nm_nokdk']) {
                                                                                                                $select = "selected";
                                                                                                            } else {
                                                                                                                $select = "";
                                                                                                            }
                                                                                                            echo "<option $select>" . $km['nm_nokdk'] . "</option>";
                                                                                                        }
                                                                                                    endforeach;
                                                                                                    form_error('no_kdk', '<small class="text-danger">', '</small>'); ?>
                                                                                                </select>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?= form_error('no_kdk', '<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_kdk" name="nm_kdk" class="form-control" placeholder="isi deskripsi lengkap" required><?= $edit->nm_kdk; ?></textarea>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?= form_error('nm_kdk', '<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_deskk" name="nm_deskk" class="form-control" placeholder="isi deskripsi singkat" required><?= $edit->nm_deskk; ?></textarea>
                                                                                        </div>
                                                                                    </div>
                                                                                    <?= form_error('nm_deskk', '<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-warning" type="submit">Update</button>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    </div>
                                                                </div>
                                                            </form>
                                                        </div>
                                                <?php }
                                                endforeach;  ?>
                                                <?php $i = 1;
                                                foreach ($dtKdk as $p) :
                                                    if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel['id_tapel']) {
                                                ?>
                                                        <div id="EditMapel<?= $p['id_kdk']; ?>" class="modal FullColor-popup-AlertModal fade" role="dialog">
                                                            <form action="<?= base_url('guru/inputNilaik'); ?>" 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">
                                                                                </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_kdk']; ?>' readonly>
                                                                                        <input type="hidden" class="form-control" id="kd_kdk" name="kd_kdk" placeholder="kd_kdk" value='<?= $p['id_kdk']; ?>'>
                                                                                        <input type="hidden" class="form-control" id="deskk_n" name="deskk_n" placeholder="deskk_n" value='<?= $p['nm_deskk']; ?>'>
                                                                                        <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                            <?php
                                                                            foreach ($dtNilaik as $edit) :
                                                                                if ($edit['ikdk'] == $p['id_kdk'] && $edit['kdlbg'] == $nmUser['kd_user'] && $edit['kdtapel'] == $kdTapel['id_tapel']) {
                                                                            ?>
                                                                                    <input type="hidden" class="form-control" id="id_nilaik[]" name="id_nilaik[]" placeholder="Id Nilai K" value='<?php
                                                                                                                                                                                                    foreach ($nilaik as $km) :
                                                                                                                                                                                                        if ($km['tipe_n'] == 'k' && $p['id_kdk'] == $km['kd_kdk'] && $nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                                                                                                                                            if ($km['kd_students'] == $edit['ids']) {
                                                                                                                                                                                                                echo $km['id_nilaik'];
                                                                                                                                                                                                            }
                                                                                                                                                                                                        }
                                                                                                                                                                                                    endforeach;
                                                                                                                                                                                                    ?>'></input>
                                                                                    <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_k[]" name="n_k[]" min="0" max="100" placeholder="Nilai" value='<?php
                                                                                                                                                                                                                                foreach ($nilaik as $km) :
                                                                                                                                                                                                                                    if ($km['tipe_n'] == 'k' && $p['id_kdk'] == $km['kd_kdk'] && $nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                                                                                                                                                                        if ($km['kd_students'] == $edit['ids']) {
                                                                                                                                                                                                                                            echo $km['n_k'];
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                endforeach;
                                                                                                                                                                                                                                ?>' required></input>
                                                                                                <?php
                                                                                                ?>
                                                                                                <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/tambahDataKdk'); ?>" 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 Keterampilan</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_kdk' id='no_kdk' data-placeholder="Bidang Study" class="chosen-select" tabindex="-1">
                                                                                        <option disabled selected>Pilih Nomor KD</option>
                                                                                        <?php
                                                                                        foreach ($kdk as $kp) :
                                                                                        ?>
                                                                                            <option value='<?= $kp['nm_nokdk'] ?>'><?= $kp['nm_nokdk'] ?></option>
                                                                                        <?php
                                                                                        endforeach;
                                                                                        ?>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <?= form_error('no_kdk', '<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_kdk" name="nm_kdk" class="form-control" placeholder="isi deskripsi lengkap" required></textarea>
                                                                            </div>
                                                                        </div>
                                                                        <?= form_error('nm_kdk', '<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_deskk" name="nm_deskk" class="form-control" placeholder="isi deskripsi singkat" required></textarea>
                                                                            </div>
                                                                        </div>
                                                                        <?= form_error('nm_deskk', '<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>
                                                <div id="TambahKDr<?= $study['idm']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal fade" role="dialog">
                                                    <form action="<?= base_url('guru/tambahAllDataKdk'); ?>" 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 Keterampilan</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']; ?>'>
                                                                            <input type="hidden" class="form-control" id="nm_kelas" name="nm_kelas" placeholder="Id Nama Kelas" value='<?= $study['tgkt']; ?>'>
                                                                            <input type="hidden" class="form-control" id="nm_mapel" name="nm_mapel" placeholder="Id Nama Mapel" value='<?= $study['kodemapel']; ?>'>
                                                                        </div>
                                                                    </div>
                                                                    <div class="sparkline11-graph">
                                                                        <div class="row">
                                                                            <div class="col-lg-12">
                                                                                <label class="login2 pull-left pull-left-pro">Daftar Nomor KD</label>
                                                                            </div>
                                                                            <div class="col-lg-12">
                                                                                <select data-placeholder="Pilih nomor KD sesuai semester" class="chosen-select" multiple="" tabindex="-1" name='no_kdk[]' id='no_kdk[]'>
                                                                                    <?php foreach ($nmKdk as $std) :  if ($std['nm_jenjang'] == $nmUser['kd_jenjang'] && $std['nm_kelas'] == $study['tgkt'] && $std['nm_mapel'] == $study['kodemapel']) { ?>
                                                                                            <option value='<?= $std['kd_kdk'] ?>'><?= $std['nm_mapel'] . ' : ' . $std['kd_kdk']; ?></option>
                                                                                    <?php }
                                                                                    endforeach; ?>
                                                                                    <?= form_error('no_kdk', '<small class="text-danger">', '</small>'); ?>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <?= form_error('no_kdp', '<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 ($dtKdk as $p) :
                                                    if ($p['kd_gmapel'] == $study['idm'] && $p['kd_lembaga'] == $nmUser['kd_user'] && $p['kd_tapel'] == $kdTapel['id_tapel']) {
                                                ?>
                                                        <div id="Proses<?= $study['idm']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal PrimaryModal-bgcolor fade" role="dialog">
                                                            <form action="<?= base_url('guru/prosesNilaiAkhirk'); ?>" 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_nilaik" name="id_nilaik" 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_kdk']; ?>' readonly>
                                                                            <input type="hidden" class="form-control" id="kd_kdk" name="kd_kdk" placeholder="kd_kdk" value='<?= $p['id_kdk']; ?>'>
                                                                            <input type="hidden" class="form-control" id="deskk_n" name="deskk_n" placeholder="deskk_n" value='<?= $p['nm_deskk']; ?>'>
                                                                            <input type="hidden" class="form-control" id="kd_gmapel" name="kd_gmapel" placeholder="kd_gmapel" value='<?= $study['idm']; ?>'>
                                                                            <?php
                                                                            foreach ($dtNilaik as $edit) :
                                                                                if ($edit['ikdk'] == $p['id_kdk'] && $nmUser['kd_user'] == $edit['kdlbg'] && $edit['kdtapel'] == $kdTapel['id_tapel']) {
                                                                            ?>
                                                                                    <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-question 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>