<!-- // 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>Data Kelulusan</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> Kelas</h4>
                                            </li>
                                            <?php
                                            foreach ($dtWalasGuru as $study) :
                                                if ($study['kdlbg'] == $nmLembaga['id_lembaga']) {
                                                    if ($study['kdtapel'] == $kdTapel) {
                                                        if ($study['tingkat'] == 'IX') {
                                            ?>
                                                            <li><a data-toggle="tab" href='#inbox<?= $study['kdkelas']; ?>'><span class="inbox-icon"><i class="fa fa fa-pencil "></i></span> <?= $study['kelas']; ?></a></li>
                                                <?php
                                                        }
                                                    }
                                                }
                                                ?>
                                            <?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 ($dtWalasGuru as $study) :
                                            if ($study['kdlbg'] == $nmLembaga['id_lembaga']) {
                                                if ($study['kdtapel'] == $kdTapel) {
                                                    if ($study['tingkat'] == 'IX') {
                                        ?>
                                                        <div id="inbox<?= $study['kdkelas']; ?>" class="tab-pane fade animated zoomInDown shadow-reset custom-inbox-message">
                                                            <div class="mail-title inbox-bt-mg">
                                                                <h2><?= $study['kelas']; ?></h2>
                                                                <div class="view-mail-action view-mail-ov-d-n">
                                                                    <a class="compose-draft-bt" href="#" data-toggle="modal" data-target="#TambahNomorSurat<?= $study['kdkelas']; ?>"><i class="fa fa-plus-circle"></i> Input Nomor Surat</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">NISN</th>
                                                                            <th data-field="email">Nama Students</th>
                                                                            <th data-field="email1">No. SK Kamad</th>
                                                                            <th data-field="email2">No. SKL</th>
                                                                            <th data-field="email3">No. SKBB</th>
                                                                            <th data-field="company">Aksi</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <?php $i = 1;
                                                                        foreach ($dtWalasSiswa as $p) :
                                                                            if ($p['kdkelas'] == $study['kdkelas'] && $p['kdlbg'] == $nmLembaga['id_lembaga'] && $p['kdtapel'] == $kdTapel) {
                                                                        ?>
                                                                                <tr class="new-email">
                                                                                    <td></td>
                                                                                    <td><?= $p['nisn']; ?></td>
                                                                                    <td><?= $p['siswa']; ?></td>
                                                                                    <?php foreach ($nomor as $nm) : if ($nm['kd_students'] == $p['kdsiswa'] && $nm['kd_tapel'] == $kdTapel && $nm['kd_lembaga'] == $nmUser['kd_user']) { ?>
                                                                                            <td><?= $nm['nomor_sk']; ?></td>
                                                                                            <td><?= $nm['nomor_skl']; ?></td>
                                                                                            <td><?= $nm['nomor_skbb']; ?></td>
                                                                                    <?php }
                                                                                    endforeach; ?>
                                                                                    <td>
                                                                                        <?php if ($p['lulus'] == 3) { ?>
                                                                                            <a href="<?= base_url('kamad/surat_lulus/' . $p['kdsiswa']); ?>" target="blank">
                                                                                                <div class="label label-success"><i class=" fa fa-print"></i> SKL</div>
                                                                                            </a>
                                                                                            <!-- <a href="<?= base_url('kamad/cetak_nilai/' . $p['kdsiswa']); ?>" target="blank">
                                                                                                <div class="label label-primary"><i class=" fa fa-print"></i> Nilai</div>
                                                                                            </a> -->
                                                                                            <a href="<?= base_url('kamad/surat_skbb/' . $p['kdsiswa']); ?>" target="blank">
                                                                                                <div class="label label-warning"><i class=" fa fa-print"></i> SKBB</div>
                                                                                            </a>
                                                                                        <?php } ?>
                                                                                    </td>
                                                                                </tr>
                                                                            <?php
                                                                            }
                                                                            ?>
                                                                        <?php endforeach;  ?>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <div><br></div>
                                                        </div>
                                                        <div id="TambahNomorSurat<?= $study['kdkelas']; ?>" class="modal modal-adminpro-general default-popup-PrimaryModal fade" role="dialog">
                                                            <form action="<?= base_url('kamad/tambahNomorSurat'); ?>" 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 Nomor Surat</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
                                                                            foreach ($dtWalasSiswa as $p) :
                                                                                if ($p['kdkelas'] == $study['kdkelas'] && $p['kdlbg'] == $nmLembaga['id_lembaga'] && $p['kdtapel'] == $kdTapel) {
                                                                            ?>
                                                                                    <input type="hidden" class="form-control" id="id_siswa[]" name="id_siswa[]" placeholder="Id Siswa" value='<?= $p['kdsiswa']; ?>'>
                                                                            <?php }
                                                                            endforeach;  ?>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-12">
                                                                                        <label class="login2 pull-left pull-left-pro">Nomor SK Kepala Madrasah (Kelulusan)</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <input id="nomor_sk" name="nomor_sk" class="form-control" placeholder="Nomor Surat Keputusan Kepala Madrasah" value='<?= set_value('nomor_sk'); ?>' required></input>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nomor_sk', '<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">Format Nomor Surat Keterangan Lulus</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <input id="nomor_skl" name="nomor_skl" class="form-control" placeholder="Format nomor SKL sesuai lembaga" value='<?= set_value('nomor_skl'); ?>' required></input>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nomor_skl', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-8">
                                                                                        <label class="login2 pull-right pull-right-pro">Nomor Urut Awal SKL</label>
                                                                                    </div>
                                                                                    <div class="col-lg-4">
                                                                                        <input type="number" id="nomor_awal_skl" name="nomor_awal_skl" class="form-control" placeholder="Nomor" value='<?= set_value('nomor_awal_skl'); ?>' required></input>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nomor_skl', '<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">Format Nomor Surat Keterangan Berkelakuan Baik</label>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                        <input id="nomor_skbb" name="nomor_skbb" class="form-control" placeholder="Format nomor SKBB sesuai lembaga" value='<?= set_value('nomor_skbb'); ?>' required></input>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nomor_skbb', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                            <div class="sparkline11-graph">
                                                                                <div class="row">
                                                                                    <div class="col-lg-8">
                                                                                        <label class="login2 pull-right pull-right-pro">Nomor Urut Awal SKBB</label>
                                                                                    </div>
                                                                                    <div class="col-lg-4">
                                                                                        <input type="number" id="nomor_awal_skbb" name="nomor_awal_skbb" class="form-control" placeholder="Nomor" value='<?= set_value('nomor_awal_skbb'); ?>' required></input>
                                                                                    </div>
                                                                                </div>
                                                                                <?= form_error('nomor_skl', '<small class="text-danger">', '</small>'); ?>
                                                                            </div>
                                                                            <td>
                                                                        </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
                                                    }
                                                }
                                            }
                                        endforeach; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>