<?php defined('BASEPATH') or exit('No direct script access allowed');
// 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)
class M_admin extends CI_Model
{
    // START VIEW DATA ==============================================================================================
    public function viewDataRsiswa()
    {
        $this->db->select(' t_kelas.nm_rombel as kelas, 
                            t_kelas.id_kelas as kdkelas, 
                            t_students.nm_students as siswa, 
                            t_students.nisn_students as nisn, 
                            t_students.nislokal_students as nism, 
                            t_students.id_students as kdsiswa, 
                            t_rombelsiswa.id_rombelsiswa as idr, 
                            t_rombelsiswa.kd_tapel as kdt, 
                            t_rombelsiswa.kd_lembaga as kdl
        ');
        $this->db->from('t_students');
        $this->db->join('t_rombelsiswa', 't_students.id_students = t_rombelsiswa.kd_students', 'left');
        $this->db->join('t_kelas', 't_rombelsiswa.kd_kelas = t_kelas.id_kelas', 'left');
        $this->db->order_by('t_students.nm_students', SORT_ASC);
        $query = $this->db->get();
        return $query->result_array();
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataWalas()
    {
        $this->db->select(' t_kelas.nm_rombel as kelas, 
                            t_kelas.id_kelas as kdkelas, 
                            t_walas.kd_tapel as kdt, 
                            t_teachers.nm_teachers as walas, 
                            t_teachers.sts_teachers as sts, 
                            t_teachers.nuptk_teachers as nuptk, 
                            t_teachers.nip_teachers as nip, 
                            t_teachers.id_teachers as kdteachers, 
                            t_walas.id_walas as idw, 
                            t_walas.kd_lembaga as kdl
        ');
        $this->db->from('t_teachers');
        $this->db->join('t_walas', 't_teachers.id_teachers = t_walas.kd_teachers', 'left');
        $this->db->join('t_kelas', 't_walas.kd_kelas = t_kelas.id_kelas', 'left');
        $this->db->order_by('t_kelas.nm_rombel', SORT_ASC);
        $query = $this->db->get();
        return $query->result_array();
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataKelas()
    {
        $this->db->select('*');
        $this->db->from('t_kelas');
        $this->db->order_by('angka_kelas', SORT_ASC);
        $query = $this->db->get();
        return $query->result_array();
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataTeachers()
    {
        $this->db->select(' t_teachers.nm_teachers as kamad, 
                            t_teachers.sts_teachers as sts, 
                            t_teachers.id_teachers as kdg, 
                            t_teachers.kd_lembaga as kd_lembaga, 
                            t_tgl.kd_tapel as idt
        ');
        $this->db->from('t_teachers');
        $this->db->join('t_tgl', 't_teachers.id_teachers = t_tgl.kd_teachers', 'left');
        //$this->db->join('t_tapel', 't_tgl.kd_tapel = t_tapel.id_tapel');
        $this->db->order_by('t_teachers.nm_teachers', SORT_ASC);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result_array();
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataTapel()
    {
        $this->db->select(' t_tapel.id_tapel as kd, 
                            t_tapel.kd_tahun as tahun, 
                            t_tapel.kd_smstr as smstr, 
                            t_tapel.sts_tapel as status
        ');
        $this->db->from('t_tapel');
        $this->db->join('t_tgl', 't_tapel.id_tapel = t_tgl.kd_tapel', 'left');
        $this->db->where('sts_tapel', 1);
        $this->db->order_by('t_tapel.kd_tahun', SORT_ASC);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->row_array();
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataTgl()
    {
        $this->db->select(' t_tapel.id_tapel as kdtapel, 
                            t_tapel.kd_tahun as tahun, 
                            t_tapel.nm_tapel as nama_tahun, 
                            t_tapel.kd_smstr as semester, 
                            t_tapel.sts_tapel as status,
                            t_teachers.nm_teachers as nama_guru,
                            t_teachers.id_teachers as kdguru,
                            t_teachers.sts_teachers as stsguru,
                            t_tgl.kd_lembaga as kd_lembaga,
                            t_tgl.tmpt_tgl as tempat,
                            t_tgl.nm_tgl1 as tanggal,
                            t_tgl.nm_tgl3 as tanggal_lulus,
                            t_tgl.id_tgl as idTgl,
        ');
        $this->db->from('t_teachers');
        $this->db->join('t_tgl', 't_teachers.id_teachers = t_tgl.kd_teachers', 'left');
        $this->db->join('t_tapel', 't_tapel.id_tapel = t_tgl.kd_tapel', 'left');
        //$this->db->where('sts_tapel', 1);
        $this->db->order_by('t_tapel.kd_tahun', SORT_ASC);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result_array();
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function viewDataGmapel()
    {
        $this->db->select(' t_teachers.nuptk_teachers as nuptk, 
                            t_teachers.nm_teachers as guru, 
                            t_teachers.sts_teachers as sts, 
                            t_teachers.id_teachers as kdguru, 
                            t_kelas.nm_rombel as kelas, 
                            t_kelas.id_kelas as kdkelas, 
                            t_bidstudy.nm_nmbidstudy as mapel, 
                            t_bidstudy.id_bidstudy as kdmapel, 
                            t_gmapel.id_gmapel as idm, 
                            t_gmapel.kd_lembaga as kdl, 
                            t_bidstudy.nm_kelompok as kelompok, 
                            t_gmapel.kd_tapel as kdt
        ');
        $this->db->from('t_teachers');
        $this->db->join('t_gmapel', 't_teachers.id_teachers = t_gmapel.kd_teachers', 'left');
        $this->db->join('t_kelas', 't_gmapel.kd_kelas = t_kelas.id_kelas', 'left');
        $this->db->join('t_bidstudy', 't_gmapel.kd_bidstudy = t_bidstudy.id_bidstudy', 'left');
        $this->db->order_by('t_teachers.nm_teachers', SORT_ASC);
        $query = $this->db->get();
        return $query->result_array();
        // created by : KuduSinau_Hendrik_081275532220
    }
    // END VIEW DATA ==============================================================================================

    // START CRUD DATA ==============================================================================================
    public function join_user()
    {
        $this->db->select('*');
        $this->db->from('t_jenjang');
        $this->db->join('t_lembaga', 't_jenjang.id_jenjang = t_lembaga.jenjang_lembaga');
        $this->db->join('t_status', 't_lembaga.sts_lembaga = t_status.id_status');
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result_array();
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataGurMapel($data, $idGmapel)
    {
        $query = $this->db->update("t_gmapel", $data, $idGmapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataGurMapel($idGmapel)
    {
        $query = $this->db->delete("t_gmapel", $idGmapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataTglRapor($data, $idTgl)
    {
        $query = $this->db->update("t_tgl", $data, $idTgl);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataTglRapor($idTgl)
    {
        $query = $this->db->delete("t_tgl", $idTgl);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataGurMapel($data)
    {
        $query = $this->db->insert('t_gmapel', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataMapel($data)
    {
        $query = $this->db->insert('t_bidstudy', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataMapel($idBidstudy)
    {
        $query = $this->db->delete('t_bidstudy', $idBidstudy);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataMapel($data, $idBidstudy)
    {
        $query = $this->db->update('t_bidstudy', $data, $idBidstudy);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataEskul($data, $id_eskul)
    {
        $query = $this->db->update("t_eskul", $data, $id_eskul);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataEskul($id_eskul)
    {
        $query = $this->db->delete("t_eskul", $id_eskul);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataKelas($data)
    {
        $query = $this->db->insert('t_kelas', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataKelas($data, $idKelas)
    {
        $query = $this->db->update("t_kelas", $data, $idKelas);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataKelas($idKelas)
    {
        $query = $this->db->delete("t_kelas", $idKelas);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataGuru($data)
    {
        $query = $this->db->insert('t_teachers', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataUserGuru($dataUsers)
    {
        $query = $this->db->insert('t_user', $dataUsers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataGuru($data, $idTeachers)
    {
        $query = $this->db->update("t_teachers", $data, $idTeachers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataUserGuru($dataUsers, $idkdTeachers)
    {
        $query = $this->db->update("t_user", $dataUsers, $idkdTeachers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataGuru($idTeachers)
    {
        $query = $this->db->delete("t_teachers", $idTeachers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataUserGuru($idTeachers)
    {
        $query = $this->db->delete("t_user", $idTeachers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataSiswa($data)
    {
        $query = $this->db->insert('t_students', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataUserSiswa($dataUsers)
    {
        $query = $this->db->insert('t_user', $dataUsers);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataSiswa($data, $idStudents)
    {
        $query = $this->db->update("t_students", $data, $idStudents);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataUserSiswa($dataUser,  $idkdStudents)
    {
        $query = $this->db->update("t_user", $dataUser,  $idkdStudents);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSiswa($idStudents)
    {
        $query = $this->db->delete("t_students", $idStudents);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataUserSiswa($idStudents)
    {
        $query = $this->db->delete("t_user", $idStudents);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataTahun($data)
    {
        $query = $this->db->insert('t_tahun', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataTahun($data, $idTahun)
    {
        $query = $this->db->update("t_tahun", $data, $idTahun);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataTahun($idTahun)
    {
        $query = $this->db->delete("t_tahun", $idTahun);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataJurusan($data)
    {
        $query = $this->db->insert('t_jurusan', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataJurusan($data, $idJurusan)
    {
        $query = $this->db->update("t_jurusan", $data, $idJurusan);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataJurusan($idJurusan)
    {
        $query = $this->db->delete("t_jurusan", $idJurusan);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataTapel($data, $idTapel)
    {
        $query = $this->db->update("t_tapel", $data, $idTapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataTapel($data)
    {
        $query = $this->db->insert('t_tapel', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataTapel($idTapel)
    {
        $query = $this->db->delete("t_tapel", $idTapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataWalas($data, $idWalas)
    {
        $query = $this->db->update("t_walas", $data, $idWalas);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataWalas($idWalas)
    {
        $query = $this->db->delete("t_walas", $idWalas);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataRombelSiswa($data)
    {
        $query = $this->db->insert_batch('t_rombelsiswa', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataRombelSiswa($data, $isKlsrbl)
    {
        $query = $this->db->update("t_rombelsiswa", $data, $isKlsrbl);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataRombelSiswa($isKlsrbl)
    {
        $query = $this->db->delete("t_rombelsiswa", $isKlsrbl);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSiswaRombel($idSiswa)
    {
        $query = $this->db->delete("t_rombelsiswa", $idSiswa);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataNamaMapel($data)
    {
        $query = $this->db->insert('t_nmbidstudy', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataNamaMapel($data, $idNmmapel)
    {
        $query = $this->db->update("t_nmbidstudy", $data, $idNmmapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataNamaMapel($idNmmapel)
    {
        $query = $this->db->delete("t_nmbidstudy", $idNmmapel);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataSso($data)
    {
        $query = $this->db->insert('t_sso', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataSso($data, $idSso)
    {
        $query = $this->db->update("t_sso", $data, $idSso);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSso($idSso)
    {
        $query = $this->db->delete("t_sso", $idSso);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataSsp($data)
    {
        $query = $this->db->insert('t_ssp', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataSsp($data, $idSsp)
    {
        $query = $this->db->update("t_ssp", $data, $idSsp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSsp($idSsp)
    {
        $query = $this->db->delete("t_ssp", $idSsp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataBobotIjazah($data)
    {
        $query = $this->db->insert('t_bobot', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataBobotIjazah($data, $idBobot)
    {
        $query = $this->db->update("t_bobot", $data, $idBobot);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataBobotIjazah($idBobot)
    {
        $query = $this->db->delete("t_bobot", $idBobot);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    // END CRUD DATA ==============================================================================================
    public function insertExcelGuru($data)
    {
        $this->db->insert_batch('t_teachers', $data);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function insertExcelUserGuru($dataUser)
    {
        $this->db->insert_batch('t_user', $dataUser);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function insertExcelSiswa($data)
    {
        $this->db->insert_batch('t_students', $data);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function insertExcelUserSiswa($dataUser)
    {
        $this->db->insert_batch('t_user', $dataUser);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataSikapSp($data)
    {
        $query = $this->db->insert('t_nmssp', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataSpiritual($data, $idnmssp)
    {
        $query = $this->db->update("t_nmssp", $data, $idnmssp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSpiritual($idSp)
    {
        $query = $this->db->delete("t_nmssp", $idSp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataSikapSo($data)
    {
        $query = $this->db->insert('t_nmsso', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataSosial($data, $idnmsso)
    {
        $query = $this->db->update("t_nmsso", $data, $idnmsso);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataSosial($idSo)
    {
        $query = $this->db->delete("t_nmsso", $idSo);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataNamaEskul($data)
    {
        $query = $this->db->insert('t_nmeskul', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataNamaEskul($data, $idnmeskul)
    {
        $query = $this->db->update("t_nmeskul", $data, $idnmeskul);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataNamaEskul($idnmeskul)
    {
        $query = $this->db->delete("t_nmeskul", $idnmeskul);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataKdp($data)
    {
        $query = $this->db->insert('t_nmkdp', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataKdp($data, $idnmkdp)
    {
        $query = $this->db->update("t_nmkdp", $data, $idnmkdp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataKdp($idnmkdp)
    {
        $query = $this->db->delete("t_nmkdp", $idnmkdp);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function insertExcelKdp($data)
    {
        $this->db->insert_batch('t_nmkdp', $data);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataKdk($data)
    {
        $query = $this->db->insert('t_nmkdk', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateDataKdk($data, $idnmkdk)
    {
        $query = $this->db->update("t_nmkdk", $data, $idnmkdk);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function deleteDataKdk($idnmkdk)
    {
        $query = $this->db->delete("t_nmkdk", $idnmkdk);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function insertExcelKdk($data)
    {
        $this->db->insert_batch('t_nmkdk', $data);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputDataAllMapel($data)
    {
        $this->db->insert_batch('t_bidstudy', $data);
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function inputNomorSurat($data)
    {
        $query = $this->db->insert_batch('t_nomor', $data);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function updateNomorSurat($data, $idnmkdk)
    {
        $query = $this->db->update_batch("t_nomor", $data, $idnmkdk);
        if ($query) {
            return true;
        } else {
            return false;
        }
        // created by : KuduSinau_Hendrik_081275532220
    }
    public function cekRestore()
    {
        $cek = $this->db->query("SHOW TABLES");
        if ($cek->num_rows() > 0) {
            $query = $this->db->query("DROP TABLE   t_absensi,
                                                    t_akhirk,
                                                    t_alumni,
                                                    t_akhirp,
                                                    t_akhirso,
                                                    t_akhirsp,
                                                    t_bidstudy,
                                                    t_bobot,
                                                    t_catatan,
                                                    t_eskul,
                                                    t_gmapel,
                                                    t_ijazah,
                                                    t_jurusan,
                                                    t_kdk,
                                                    t_kdp,
                                                    t_kelas,
                                                    t_kkm,
                                                    t_lembaga,
                                                    t_naik,
                                                    t_nilaieskul,
                                                    t_nilaik,
                                                    t_nilaip,
                                                    t_nilaisso,
                                                    t_nilaissp,
                                                    t_nmbidstudy,
                                                    t_nmeskul,
                                                    t_nmkdk,
                                                    t_nmkdp,
                                                    t_nmsso,
                                                    t_nmssp,
                                                    t_prestasi,
                                                    t_rombelsiswa,
                                                    t_sso,
                                                    t_ssp,
                                                    t_students,
                                                    t_tahun,
                                                    t_tapel,
                                                    t_teachers,
                                                    t_tgl,
                                                    t_token,
                                                    t_user,
                                                    t_walas,
                                                    t_nomor
            ");
            return htmlspecialchars($query);
        } else {
            return true;
        }
    }
    // created by : KuduSinau_Hendrik_081275532220
}
// 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)