<!-- // 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>Nilai Sikap Sosial</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
                                            $i = 1;
                                            foreach ($dtWalasGuru as $study) :
                                                if ($study['kdlbg'] == $nmLembaga['id_lembaga'] && $study['kdtapel'] == $kdTapel['id_tapel'] && $study['kdguru'] == $nmUser['kd_teachers']) {
                                            ?>
                                                    <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 }
                                                $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 ($dtWalasGuru as $study) :
                                            if ($study['kdlbg'] == $nmLembaga['id_lembaga'] && $study['kdtapel'] == $kdTapel['id_tapel'] && $study['kdguru'] == $nmUser['kd_teachers']) {
                                        ?>
                                                <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">
                                                        </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>
                                                                    <th data-field="phone">SO1</th>
                                                                    <th data-field="phone1">SO2</th>
                                                                    <th data-field="phone2">SO3</th>
                                                                    <th data-field="phone3">SO4</th>
                                                                    <th data-field="phone4">SO5</th>
                                                                    <th data-field="company">Aksi</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <?php $i = 1;
                                                                foreach ($dtWalasSiswa as $p) : if ($nmUser['kd_user'] == $p['kdlbg'] && $p['kdtapel'] == $kdTapel['id_tapel'] && $p['kdkelas'] == $study['kdkelas']) {
                                                                ?>
                                                                        <tr class="new-email">
                                                                            <td></td>
                                                                            <td><?php $i;
                                                                                $i++;  ?></td>
                                                                            <td><?= $p['nisn']; ?></td>
                                                                            <td><?= $p['siswa']; ?></td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                        if ($km['kd_kelas'] == $study['kdkelas'] and $km['kd_students'] == $p['kdsiswa'] and $km['tipe_n'] == 'so1') {
                                                                                            echo $km['n_so'];
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                        if ($km['kd_kelas'] == $study['kdkelas'] and $km['kd_students'] == $p['kdsiswa'] and $km['tipe_n'] == 'so2') {
                                                                                            echo $km['n_so'];
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                        if ($km['kd_kelas'] == $study['kdkelas'] and $km['kd_students'] == $p['kdsiswa'] and $km['tipe_n'] == 'so3') {
                                                                                            echo $km['n_so'];
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                        if ($km['kd_kelas'] == $study['kdkelas'] and $km['kd_students'] == $p['kdsiswa'] and $km['tipe_n'] == 'so4') {
                                                                                            echo $km['n_so'];
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php
                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                        if ($km['kd_kelas'] == $study['kdkelas'] and $km['kd_students'] == $p['kdsiswa'] and $km['tipe_n'] == 'so5') {
                                                                                            echo $km['n_so'];
                                                                                        }
                                                                                    }
                                                                                endforeach;
                                                                                ?>
                                                                            </td>
                                                                            <td>
                                                                                <?php if (!($cekNso < 5)) { ?>
                                                                                    <a href="#" data-toggle="modal" data-target="#EditMapel<?= $p['kdsiswa']; ?>">
                                                                                        <div class="label label-success"><i class=" fa fa-plus"></i></div>
                                                                                    </a>
                                                                                <?php } ?>
                                                                            </td>
                                                                        </tr>
                                                                    <?php
                                                                    }
                                                                    ?>
                                                                <?php endforeach;  ?>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <?php $i = 1;
                                                foreach ($dtWalasSiswa as $p) : if ($nmUser['kd_user'] == $p['kdlbg'] && $p['kdtapel'] == $kdTapel['id_tapel'] && $p['kdkelas'] == $study['kdkelas']) {
                                                ?>
                                                        <div id="EditMapel<?= $p['kdsiswa']; ?>" class="modal FullColor-popup-AlertModal fade" role="dialog">
                                                            <form action="<?= base_url('walas/inputNilaiSo'); ?>" 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 Sikap Sosial</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='<?= $p['nisn'] . ' / ' . $p['siswa'] . ' / ' . $p['kelas']; ?>' readonly>
                                                                                        <input type="hidden" class="form-control" id="kd_kelas" name="kd_kelas" placeholder="kd_kelas" value='<?= $p['kdkelas']; ?>'>
                                                                                        <input type="hidden" class="form-control" id="kd_students" name="kd_students" placeholder="kd_students" value='<?= $p['kdsiswa']; ?>'>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                            <?php
                                                                            foreach ($sso as $edit) : if ($nmUser['kd_user'] == $edit['kd_lembaga'] && $edit['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                            ?>
                                                                                    <input type="hidden" class="form-control" maxlength="1" id="id_nilaisso[]" name="id_nilaisso[]" placeholder="Id Nilai So" value='<?php
                                                                                                                                                                                                                        foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                                                                                                                                                                if ($p['kdkelas'] == $km['kd_kelas']) {
                                                                                                                                                                                                                                    if ($km['kd_students'] == $p['kdsiswa']) {
                                                                                                                                                                                                                                        if ($km['kd_sso'] ==  $edit['id_sso']) {
                                                                                                                                                                                                                                            echo $km['id_nilaisso'];
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                        endforeach;
                                                                                                                                                                                                                        ?>'></input>
                                                                                    <div class="sparkline11-graph">
                                                                                        <div class="row">
                                                                                            <div class="col-lg-9">
                                                                                                <label class="login2 pull-right pull-right-pro"><?= '(' . $edit['kd_kdsso'] . ') ' . $edit['nm_sso']; ?></label>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <input type="number" class="form-control" maxlength="1" id="n_so[]" name="n_so[]" min="1" max="4" placeholder="Nilai" value='<?php
                                                                                                                                                                                                                                foreach ($nilaisso as $km) : if ($nmUser['kd_user'] == $km['kd_lembaga'] && $km['kd_tapel'] == $kdTapel['id_tapel']) {
                                                                                                                                                                                                                                        if ($p['kdkelas'] == $km['kd_kelas']) {
                                                                                                                                                                                                                                            if ($km['kd_students'] == $p['kdsiswa']) {
                                                                                                                                                                                                                                                if ($km['kd_sso'] ==  $edit['id_sso']) {
                                                                                                                                                                                                                                                    echo $km['n_so'];
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                endforeach;
                                                                                                                                                                                                                                ?>' required></input>
                                                                                                <input type="hidden" class="form-control" id="kd_sso[]" name="kd_sso[]" placeholder="kd_sso" value='<?= $edit['id_sso']; ?>'>
                                                                                                <input type="hidden" class="form-control" id="desk_so[]" name="desk_so[]" placeholder="desk_so" value='<?= $edit['nm_sso']; ?>'>
                                                                                                <input type="hidden" class="form-control" id="tipe_n[]" name="tipe_n[]" placeholder="tipe_n" value='<?= $edit['kd_kdsso']; ?>'>
                                                                                            </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 }
                                        endforeach; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>