Evaluasi Akhir Semester

.
Nama: Ahmad Syauqi
NRP: 05111740000093

1. Rancangan Database
2. Rancangan Interface Aplikasi
2.1. Halaman index

2.2. Halaman setelah login
2.3. Halaman daftar

3. Implementasi

Pada pengimplementasiannya, saya menggunakan framework CodeIgniter. Berikut saya sertakan source codenya.
3.1. Model

3.1.1. Daftar_model.php
 <?php  
 class Daftar_model extends CI_Model{  
  public function register($user){  
       $this->db->insert('user', $user);  
  }  
 }  
3.1.2. Signin_model.php
 <?php  
 class Signin_model extends CI_Model{  
  function auth_user($id,$password){  
       $query=$this->db->query("SELECT * FROM user WHERE (nik='$id' AND password='$password') OR (nisn='$id' AND password='$password')");  
     return $query;  
  }  
 }  
3.1.3. Update_model.php
 <?php  
 class Update_model extends CI_Model{  
  public function ubah($where, $data){  
       $this->db->where($where);  
   $this->db->update('user',$data);  
  }  
 }  

3.2. View

3.2.1. welcome_message.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 ?><!DOCTYPE html>  
 <html lang="en">  
      <head>  
           <title><?php echo SITE_NAME?></title>  
           <meta charset="utf-8">  
   <meta http-equiv="X-UA-Compatible" content="IE=edge">  
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">  
   <meta name="description" content="">  
   <meta name="author" content="">  
   <!-- Bootstrap core CSS-->  
   <link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet">  
   <!-- Custom fonts for this template-->  
   <link href="<?php echo base_url('assets/fontawesome-free/css/all.min.css') ?>" rel="stylesheet" type="text/css">  
   <!-- Page level plugin CSS-->  
   <link href="<?php echo base_url('assets/datatables/dataTables.bootstrap4.css') ?>" rel="stylesheet">  
   <!-- Custom styles for this template-->  
   <link href="<?php echo base_url('css/sb-admin.css') ?>" rel="stylesheet">  
   <link href="<?php echo base_url('css/custom.css') ?>" rel="stylesheet">  
  </head>  
  <body class="text-center landing">  
   <form class="form-signin bg-light log_in" role="form" method="post" action="<?php echo base_url().'index.php/welcome/auth'?>">  
    <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>  
    <?php echo $this->session->flashdata('msg');?>  
    <input type="text" name="id" class="form-control pad_form" placeholder="NISN atau NIK" required="" autofocus="">  
    <input type="password" name="password" class="form-control pad_form" placeholder="Password" required="">  
    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>  
    <table class="table" style="width: 100%;">  
         <tr>  
              <td>  
               <a href="<?php echo site_url('daftar');?>" class="btn btn-light btn-block small" style="width: 90%;">Daftar SD</a>  
          </td>  
          <td>  
                  <a href="<?php echo site_url('daftar_smp');?>" class="btn btn-light btn-block small" style="width: 90%;">Daftar SMP</a>  
             </td>  
        </tr>  
    </table>  
            <p class="mt-5 mb-3 text-muted">© Ahmad Syauqi 2018</p>  
   </form>  
 </body></html>  
3.2.2. daftar.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 ?><!DOCTYPE html>  
 <html lang="en">  
      <head>  
           <title><?php echo SITE_NAME?></title>  
           <meta charset="utf-8">  
   <meta http-equiv="X-UA-Compatible" content="IE=edge">  
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">  
   <meta name="description" content="">  
   <meta name="author" content="">  
   <!-- Bootstrap core CSS-->  
   <link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet">  
   <!-- Custom fonts for this template-->  
   <link href="<?php echo base_url('assets/fontawesome-free/css/all.min.css') ?>" rel="stylesheet" type="text/css">  
   <!-- Page level plugin CSS-->  
   <link href="<?php echo base_url('assets/datatables/dataTables.bootstrap4.css') ?>" rel="stylesheet">  
   <!-- Custom styles for this template-->  
   <link href="<?php echo base_url('css/sb-admin.css') ?>" rel="stylesheet">  
   <link href="<?php echo base_url('css/custom.css') ?>" rel="stylesheet">  
  </head>  
  <body class="text-center bg-secondary">  
   <form class="form-signin bg-light sign_up" role="form" method="post" action="<?php echo base_url().'index.php/daftar/pendaftaran'?>">  
    <h1 class="h3 mb-3 font-weight-normal">Form Pendaftaran SD</h1>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nik">NIK:</label>  
     <input style="width: 70%;" type="text" name="nik" class="form-control pad_form" placeholder="NIK" required="" autofocus="" maxlength="16">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Nama Lengkap:</label>  
     <input style="width: 70%;" type="text" name="nama" class="form-control pad_form" placeholder="Nama Lengkap" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Agama:</label>  
     <select class="custom-select" name="agama">  
      <option value="Islam">Islam</option>  
      <option value="Kristen">Kristen</option>  
      <option value="Katolik">Katolik</option>  
      <option value="Hindu">Hindu</option>  
      <option value="Budha">Budha</option>  
      <option value="Konghuchu">Konghuchu</option>  
     </select>  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Tempat Lahir:</label>  
     <input style="width: 70%;" type="text" name="tempat_lahir" class="form-control pad_form" placeholder="Tempat Lahir" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Tanggal Lahir:</label>  
     <input style="width: 70%;" type="date" name="tanggal_lahir" class="form-control pad_form" placeholder="Tanggal Lahir" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Jenis Kelamin:</label>  
     <input style="width: 20%;" type="radio" name="jenis_kelamin" required="" value="Laki-laki">Laki-laki  
     <input style="width: 20%;" type="radio" name="jenis_kelamin" required="" value="Perempuan">Perempuan  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="alamat">Alamat:</label>  
     <input style="width: 70%;" type="text" name="alamat" class="form-control pad_form" placeholder="Alamat" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="provinsi">Provinsi:</label>  
     <input style="width: 70%;" type="text" name="provinsi" class="form-control pad_form" placeholder="Provinsi" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kota">Kota:</label>  
     <input style="width: 70%;" type="text" name="kota" class="form-control pad_form" placeholder="Kota" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kecamatan">Kecamatan:</label>  
     <input style="width: 70%;" type="text" name="kecamatan" class="form-control pad_form" placeholder="Kecamatan" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kelurahan">Kelurahan:</label>  
     <input style="width: 70%;" type="text" name="kelurahan" class="form-control pad_form" placeholder="Kelurahan" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="password">Password:</label>  
     <input style="width: 70%;" type="password" name="password" class="form-control pad_form" placeholder="Password" required="">  
    </div>  
    <input type="hidden" name="tingkat" value="SD">  
    <button class="btn btn-lg btn-primary btn-block" style="width: auto; margin: auto;" type="submit">Daftar</button>  
            <p class="mt-5 mb-3 text-muted">© Ahmad Syauqi 2018</p>  
   </form>  
 </body></html>  
3.2.3. daftar_smp.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 ?><!DOCTYPE html>  
 <html lang="en">  
      <head>  
           <title><?php echo SITE_NAME?></title>  
           <meta charset="utf-8">  
   <meta http-equiv="X-UA-Compatible" content="IE=edge">  
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">  
   <meta name="description" content="">  
   <meta name="author" content="">  
   <!-- Bootstrap core CSS-->  
   <link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet">  
   <!-- Custom fonts for this template-->  
   <link href="<?php echo base_url('assets/fontawesome-free/css/all.min.css') ?>" rel="stylesheet" type="text/css">  
   <!-- Page level plugin CSS-->  
   <link href="<?php echo base_url('assets/datatables/dataTables.bootstrap4.css') ?>" rel="stylesheet">  
   <!-- Custom styles for this template-->  
   <link href="<?php echo base_url('css/sb-admin.css') ?>" rel="stylesheet">  
   <link href="<?php echo base_url('css/custom.css') ?>" rel="stylesheet">  
  </head>  
  <body class="text-center bg-secondary">  
   <form class="form-signin bg-light sign_up" role="form" method="post" action="<?php echo base_url().'index.php/daftar/pendaftaran'?>">  
    <h1 class="h3 mb-3 font-weight-normal">Form Pendaftaran SMP</h1>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nik">NIK:</label>  
     <input style="width: 70%;" type="text" name="nik" class="form-control pad_form" placeholder="NIK" required="" autofocus="" maxlength="16">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nik">NISN:</label>  
     <input style="width: 70%;" type="text" name="nisn" class="form-control pad_form" placeholder="NISN" required="" maxlength="10">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Nama Lengkap:</label>  
     <input style="width: 70%;" type="text" name="nama" class="form-control pad_form" placeholder="Nama Lengkap" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Agama:</label>  
     <select class="custom-select" name="agama">  
      <option value="Islam">Islam</option>  
      <option value="Kristen">Kristen</option>  
      <option value="Katolik">Katolik</option>  
      <option value="Hindu">Hindu</option>  
      <option value="Budha">Budha</option>  
      <option value="Konghuchu">Konghuchu</option>  
     </select>  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Tempat Lahir:</label>  
     <input style="width: 70%;" type="text" name="tempat_lahir" class="form-control pad_form" placeholder="Tempat Lahir" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Tanggal Lahir:</label>  
     <input style="width: 70%;" type="date" name="tanggal_lahir" class="form-control pad_form" placeholder="Tanggal Lahir" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="nama">Jenis Kelamin:</label>  
     <input style="width: 20%;" type="radio" name="jenis_kelamin" required="" value="Laki-laki">Laki-laki  
     <input style="width: 20%;" type="radio" name="jenis_kelamin" required="" value="Perempuan">Perempuan  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="alamat">Alamat:</label>  
     <input style="width: 70%;" type="text" name="alamat" class="form-control pad_form" placeholder="Alamat" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="provinsi">Provinsi:</label>  
     <input style="width: 70%;" type="text" name="provinsi" class="form-control pad_form" placeholder="Provinsi" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kota">Kota:</label>  
     <input style="width: 70%;" type="text" name="kota" class="form-control pad_form" placeholder="Kota" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kecamatan">Kecamatan:</label>  
     <input style="width: 70%;" type="text" name="kecamatan" class="form-control pad_form" placeholder="Kecamatan" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="kelurahan">Kelurahan:</label>  
     <input style="width: 70%;" type="text" name="kelurahan" class="form-control pad_form" placeholder="Kelurahan" required="">  
    </div>  
    <div class="form-group form-inline">  
     <label style="width: 30%;" for="password">Password:</label>  
     <input style="width: 70%;" type="password" name="password" class="form-control pad_form" placeholder="Password" required="">  
    </div>  
    <input type="hidden" name="tingkat" value="SMP">  
    <button class="btn btn-lg btn-primary btn-block" style="width: auto; margin: auto;" type="submit">Daftar</button>  
            <p class="mt-5 mb-3 text-muted">© Ahmad Syauqi 2018</p>  
   </form>  
 </body></html>  
3.2.4. home.php
 <!DOCTYPE html>  
 <html lang="en">  
  <head>  
   <title><?php echo SITE_NAME?> - Home</title>  
   <meta charset="utf-8">  
   <meta http-equiv="X-UA-Compatible" content="IE=edge">  
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">  
   <meta name="description" content="">  
   <meta name="author" content="">  
   <!-- Bootstrap core CSS-->  
   <link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet">  
   <!-- Custom fonts for this template-->  
   <link href="<?php echo base_url('assets/fontawesome-free/css/all.min.css') ?>" rel="stylesheet" type="text/css">  
   <!-- Page level plugin CSS-->  
   <link href="<?php echo base_url('assets/datatables/dataTables.bootstrap4.css') ?>" rel="stylesheet">  
   <!-- Custom styles for this template-->  
   <link href="<?php echo base_url('css/sb-admin.css') ?>" rel="stylesheet">  
   <link href="<?php echo base_url('css/custom.css') ?>" rel="stylesheet">  
  </head>  
  <body id="page-top">  
   <nav class="navbar navbar-expand navbar-dark bg-dark static-top">  
    <a class="navbar-brand mr-1" href="index.html">PPDB Online</a>  
    <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">  
     <i class="fas fa-bars"></i>  
    </button>  
    <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0"></form>  
    <!-- Navbar -->  
    <ul class="navbar-nav ml-auto ml-md-0">  
     <li class="nav-item dropdown no-arrow">  
      <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">  
       <i class="fas fa-user-circle fa-fw"></i>  
      </a>  
      <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">  
       <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>  
      </div>  
     </li>  
    </ul>  
   </nav>  
   <div id="wrapper">  
    <!-- Sidebar -->  
    <ul class="sidebar navbar-nav">  
     <li class="nav-item active">  
      <a class="nav-link" href="<?php echo site_url('home')?>">  
       <i class="fas fa-fw fa-tachometer-alt"></i>  
       <span>Dashboard</span>  
      </a>  
     </li>  
     <li class="nav-item">  
      <a class="nav-link" href="<?php echo site_url('sekolah')?>">  
       <i class="fas fa-sign-in-alt"></i>  
       <span>Daftar Sekolah</span></a>  
     </li>  
     <li class="nav-item">  
      <a class="nav-link" href="<?php echo site_url('report').'/pdf';?>">  
       <i class="fas fa-file-download"></i>  
       <span>Download Form</span></a>  
     </li>  
    </ul>  
    <div id="content-wrapper">  
     <div class="container-fluid">  
      <ul class="nav nav-tabs" id="myTab" role="tablist">  
       <li class="nav-item text-center">  
        <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Biodata</a>  
       </li>  
       <li class="nav-item text-center">  
        <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Orang Tua</a>  
       </li>  
      </ul>  
      <div class="tab-content" id="myTabContent">  
       <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">  
        <form class="form-signin" style="margin:50px 0px;" role="form" method="post" action="<?php echo base_url().'index.php/home/update_data'?>">  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nik">NIK:</label>  
          <input style="width: 70%;" type="text" name="nik" class="form-control pad_form" placeholder="NIK" required="" readonly="" value='<?php echo $nik;?>'>  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nik">NISN:</label>  
          <input style="width: 70%;" type="text" name="nisn" class="form-control pad_form" placeholder="NISN" required="" readonly="" value="<?php echo $nisn;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nama">Nama Lengkap:</label>  
          <input style="width: 70%;" type="text" name="nama" class="form-control pad_form" placeholder="Nama Lengkap" required="" value="<?php echo $nama;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nama">Agama:</label>  
          <input style="width: 70%;" type="text" name="agama" class="form-control pad_form" placeholder="Agama" required="" value="<?php echo $agama;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nama">Tempat Lahir:</label>  
          <input style="width: 70%;" type="text" name="tempat_lahir" class="form-control pad_form" placeholder="Tempat Lahir" required="" value="<?php echo $tempat_lahir;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nama">Tanggal Lahir:</label>  
          <input style="width: 70%;" type="date" name="tanggal_lahir" class="form-control pad_form" placeholder="Tanggal Lahir" required="" value="<?php echo $tanggal_lahir;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nama">Jenis Kelamin:</label>  
          <input style="width: 70%;" type="text" name="jenis_kelamin" class="form-control pad_form" placeholder="Jenis Kelamin" required="" value="<?php echo $jenis_kelamin;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="alamat">Alamat:</label>  
          <input style="width: 70%;" type="text" name="alamat" class="form-control pad_form" placeholder="Alamat" required="" value="<?php echo $alamat;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="provinsi">Provinsi:</label>  
          <input style="width: 70%;" type="text" name="provinsi" class="form-control pad_form" placeholder="Provinsi" required="" value="<?php echo $provinsi;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="kota">Kota:</label>  
          <input style="width: 70%;" type="text" name="kota" class="form-control pad_form" placeholder="Kota" required="" value="<?php echo $kota;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="kecamatan">Kecamatan:</label>  
          <input style="width: 70%;" type="text" name="kecamatan" class="form-control pad_form" placeholder="Kecamatan" required="" value="<?php echo $kecamatan;?>">  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="kelurahan">Kelurahan:</label>  
          <input style="width: 70%;" type="text" name="kelurahan" class="form-control pad_form" placeholder="Kelurahan" required="" value="<?php echo $kelurahan;?>">  
         </div>  
         <button class="btn btn-lg btn-primary btn-block" style="width: auto; margin: auto;" type="submit">Daftar</button>  
        </form>  
       </div>  
       <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">  
        <form class="form-signin" style="margin:50px 0px;" role="form" method="post" action="<?php echo base_url().'index.php/home/update_ortu'?>">  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nik">Ayah:</label>  
          <input style="width: 70%;" type="text" name="ayah" class="form-control pad_form" placeholder="Nama Ayah" required="" value='<?php echo $ayah;?>'>  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nik">Ibu:</label>  
          <input style="width: 70%;" type="text" name="ibu" class="form-control pad_form" placeholder="Nama Ibu" required="" value='<?php echo $ibu;?>'>  
         </div>  
         <div class="form-group form-inline">  
          <label style="width: 10%;" for="nik">Wali:</label>  
          <input style="width: 70%;" type="text" name="wali" class="form-control pad_form" placeholder="Nama Wali" required="" value='<?php echo $wali;?>'>  
         </div>  
         <button class="btn btn-lg btn-primary btn-block" style="width: auto; margin: auto;" type="submit">Ubah</button>  
        </form>  
       </div>  
      </div>  
      <!-- End Tabs -->  
     </div>  
     <!-- /.container-fluid -->  
     <!-- Sticky Footer -->  
     <footer class="sticky-footer">  
      <div class="container my-auto">  
       <div class="copyright text-center my-auto">  
        <span>Copyright © Ahmad Syauqi 2018</span>  
       </div>  
      </div>  
     </footer>  
    </div>  
    <!-- /.content-wrapper -->  
   </div>  
   <!-- /#wrapper -->  
   <!-- Scroll to Top Button-->  
   <a class="scroll-to-top rounded" href="#page-top">  
    <i class="fas fa-angle-up"></i>  
   </a>  
   <!-- Logout Modal-->  
   <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">  
    <div class="modal-dialog" role="document">  
     <div class="modal-content">  
      <div class="modal-header">  
       <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>  
       <button class="close" type="button" data-dismiss="modal" aria-label="Close">  
        <span aria-hidden="true">×</span>  
       </button>  
      </div>  
      <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>  
      <div class="modal-footer">  
       <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>  
       <a class="btn btn-primary" href="<?php echo site_url('home').'/logout';?>">Logout</a>  
      </div>  
     </div>  
    </div>  
   </div>  
   <!-- Bootstrap core JavaScript-->  
   <script src="<?php echo base_url('assets/jquery/jquery.min.js') ?>"></script>  
   <script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>  
   <!-- Core plugin JavaScript-->  
   <script src="<?php echo base_url('assets/jquery-easing/jquery.easing.min.js') ?>"></script>  
   <!-- Page level plugin JavaScript-->  
   <script src="<?php echo base_url('assets/chart.js/Chart.min.js') ?>"></script>  
   <script src="<?php echo base_url('assets/datatables/jquery.dataTables.js') ?>"></script>  
   <script src="<?php echo base_url('assets/datatables/dataTables.bootstrap4.js') ?>"></script>  
   <!-- Custom scripts for all pages-->  
   <script src="<?php echo base_url('js/sb-admin.min.js') ?>"></script>  
   <!-- Demo scripts for this page-->  
   <script src="<?php echo base_url('js/demo/datatables-demo.js') ?>"></script>  
   <script src="<?php echo base_url('js/demo/chart-area-demo.js') ?>"></script>  
  </body>  
 </html>  
3.2.5. sekolah.php
 <!DOCTYPE html>  
 <html lang="en">  
  <head>  
   <title><?php echo SITE_NAME?> - Home</title>  
   <meta charset="utf-8">  
   <meta http-equiv="X-UA-Compatible" content="IE=edge">  
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">  
   <meta name="description" content="">  
   <meta name="author" content="">  
   <!-- Bootstrap core CSS-->  
   <link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet">  
   <!-- Custom fonts for this template-->  
   <link href="<?php echo base_url('assets/fontawesome-free/css/all.min.css') ?>" rel="stylesheet" type="text/css">  
   <!-- Page level plugin CSS-->  
   <link href="<?php echo base_url('assets/datatables/dataTables.bootstrap4.css') ?>" rel="stylesheet">  
   <!-- Custom styles for this template-->  
   <link href="<?php echo base_url('css/sb-admin.css') ?>" rel="stylesheet">  
   <link href="<?php echo base_url('css/custom.css') ?>" rel="stylesheet">  
  </head>  
  <body id="page-top">  
   <nav class="navbar navbar-expand navbar-dark bg-dark static-top">  
    <a class="navbar-brand mr-1" href="index.html">PPDB Online</a>  
    <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">  
     <i class="fas fa-bars"></i>  
    </button>  
    <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0"></form>  
    <!-- Navbar -->  
    <ul class="navbar-nav ml-auto ml-md-0">  
     <li class="nav-item dropdown no-arrow">  
      <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">  
       <i class="fas fa-user-circle fa-fw"></i>  
      </a>  
      <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">  
       <a class="dropdown-item" href="" data-toggle="modal" data-target="#logoutModal">Logout</a>  
      </div>  
     </li>  
    </ul>  
   </nav>  
   <div id="wrapper">  
    <!-- Sidebar -->  
    <ul class="sidebar navbar-nav">  
     <li class="nav-item">  
      <a class="nav-link" href="<?php echo site_url('home')?>">  
       <i class="fas fa-fw fa-tachometer-alt"></i>  
       <span>Dashboard</span>  
      </a>  
     </li>  
     <li class="nav-item active">  
      <a class="nav-link" href="<?php echo site_url('sekolah')?>">  
       <i class="fas fa-sign-in-alt"></i>  
       <span>Daftar Sekolah</span></a>  
     </li>  
     <li class="nav-item">  
      <a class="nav-link" href="<?php echo site_url('report').'/pdf';?>">  
       <i class="fas fa-file-download"></i>  
       <span>Download Form</span></a>  
     </li>  
    </ul>  
    <div id="content-wrapper">  
     <div class="container-fluid">  
      <form class="form-signin" style="margin:50px 0px;" role="form" method="post" action="<?php echo base_url().'index.php/sekolah/update_sekolah'?>">  
       <div class="form-group form-inline">  
        <label style="width: 10%;" for="nik">Asal Sekolah:</label>  
        <input style="width: 70%;" type="text" name="asal_sekolah" class="form-control pad_form" placeholder="Nama Asal Sekolah" required="" value='<?php echo $asal_sekolah;?>'>  
       </div>  
       <div class="form-group form-inline">  
        <label style="width: 10%;" for="nik">Ibu:</label>  
        <input style="width: 70%;" type="text" name="sekolah1" class="form-control pad_form" placeholder="Nama Sekolah Pilihan 1" required="" value='<?php echo $sekolah1;?>'>  
       </div>  
       <div class="form-group form-inline">  
        <label style="width: 10%;" for="nik">Wali:</label>  
        <input style="width: 70%;" type="text" name="sekolah2" class="form-control pad_form" placeholder="Nama Sekolah Pilihan 2" required="" value='<?php echo $sekolah2;?>'>  
       </div>  
       <button class="btn btn-lg btn-primary btn-block" style="width: auto; margin: auto;" type="submit">Ajukan</button>  
      </form>  
     </div>  
     <!-- /.container-fluid -->  
     <!-- Sticky Footer -->  
     <footer class="sticky-footer">  
      <div class="container my-auto">  
       <div class="copyright text-center my-auto">  
        <span>Copyright © Ahmad Syauqi 2018</span>  
       </div>  
      </div>  
     </footer>  
    </div>  
    <!-- /.content-wrapper -->  
   </div>  
   <!-- /#wrapper -->  
   <!-- Scroll to Top Button-->  
   <a class="scroll-to-top rounded" href="#page-top">  
    <i class="fas fa-angle-up"></i>  
   </a>  
   <!-- Logout Modal-->  
   <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">  
    <div class="modal-dialog" role="document">  
     <div class="modal-content">  
      <div class="modal-header">  
       <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>  
       <button class="close" type="button" data-dismiss="modal" aria-label="Close">  
        <span aria-hidden="true">×</span>  
       </button>  
      </div>  
      <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>  
      <div class="modal-footer">  
       <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>  
       <a class="btn btn-primary" href="login.html">Logout</a>  
      </div>  
     </div>  
    </div>  
   </div>  
   <!-- Bootstrap core JavaScript-->  
   <script src="<?php echo base_url('assets/jquery/jquery.min.js') ?>"></script>  
   <script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>  
   <!-- Core plugin JavaScript-->  
   <script src="<?php echo base_url('assets/jquery-easing/jquery.easing.min.js') ?>"></script>  
   <!-- Page level plugin JavaScript-->  
   <script src="<?php echo base_url('assets/chart.js/Chart.min.js') ?>"></script>  
   <script src="<?php echo base_url('assets/datatables/jquery.dataTables.js') ?>"></script>  
   <script src="<?php echo base_url('assets/datatables/dataTables.bootstrap4.js') ?>"></script>  
   <!-- Custom scripts for all pages-->  
   <script src="<?php echo base_url('js/sb-admin.min.js') ?>"></script>  
   <!-- Demo scripts for this page-->  
   <script src="<?php echo base_url('js/demo/datatables-demo.js') ?>"></script>  
   <script src="<?php echo base_url('js/demo/chart-area-demo.js') ?>"></script>  
  </body>  
 </html>  
3.2.6. table_report.php
 <!DOCTYPE html>  
 <html>  
 <head>  
  <title>Report Table</title>  
  <style type="text/css">  
   #outtable{  
    padding: 50px;  
   }  
   td{  
    padding-left: 20px;  
    padding-right: 20px;  
    width: 200px;  
   }  
  </style>  
 </head>  
 <body>  
  <h3 style="text-align: center;">FORMULIR PENERIMAAN PESERTA DIDIK BARU</h3>  
      <div id="outtable">  
       <table border="0">  
            <tbody>  
                  <tr>  
                       <td>NIK:</td>  
                       <td><?php echo $nik; ?></td>  
                  </tr>  
      <tr>  
       <td>NISN:</td>  
       <td><?php echo $nisn; ?></td>  
      </tr>  
      <tr>  
       <td>Nama:</td>  
       <td><?php echo $nama; ?></td>  
      </tr>  
      <tr>  
       <td>Tempat, Tanggal Lahir:</td>  
       <td><?php echo $tempat_lahir.', '.$tanggal_lahir; ?></td>  
      </tr>  
      <tr>  
       <td>Alamat:</td>  
       <td><?php echo $alamat.', '.$kelurahan.', '.$kecamatan.', '.$kota.', '.$provinsi; ?></td>  
      </tr>  
      <tr>  
       <td>Nama Ayah:</td>  
       <td><?php echo $ayah; ?></td>  
      </tr>  
      <tr>  
       <td>Nama Ibu:</td>  
       <td><?php echo $ibu; ?></td>  
      </tr>  
      <tr>  
       <td>Nama Wali:</td>  
       <td><?php echo $wali; ?></td>  
      </tr>  
      <tr>  
       <td>Asal Sekolah:</td>  
       <td><?php echo $asal_sekolah; ?></td>  
      </tr>  
      <tr>  
       <td>Sekolah Pilihan 1:</td>  
       <td><?php echo $sekolah1; ?></td>  
      </tr>  
      <tr>  
       <td>Sekolah Pilihan 2:</td>  
       <td><?php echo $sekolah2; ?></td>  
      </tr>  
            </tbody>  
       </table>  
   <table style="margin: auto; margin-right: 0px;">  
    <tr style="text-align: center;">  
     <td style="padding-bottom: 60px; padding-top: 60px;">TTD</td>  
    </tr>  
    <tr style="text-align: center;">  
     <td><?php echo $nama; ?></td>  
    </tr>  
   </table>  
       </div>  
 </body>  
 </html>  

3.3 Controller

3.3.1. Daftar.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Daftar extends CI_Controller {  
      function __construct(){  
     parent::__construct();  
     $this->load->library(array('form_validation'));  
     $this->load->helper(array('url','form'));  
     $this->load->model('daftar_model'); //call model  
   }  
      public function index()  
      {  
           $this->load->view('daftar');  
           //echo '<script type="text/javascript">alert("hello!");</script>';  
      }  
      public function pendaftaran()  
      {  
           $user=array(  
                'nik'=>$this->input->post('nik'),  
                'nisn'=>$this->input->post('nisn'),  
                'tingkat'=>$this->input->post('tingkat'),  
                'password'=>$this->input->post('password'),  
                'nama'=>$this->input->post('nama'),  
                'agama'=>$this->input->post('agama'),  
                'tempat_lahir'=>$this->input->post('tempat_lahir'),  
                'tanggal_lahir'=>$this->input->post('tanggal_lahir'),  
                'jenis_kelamin'=>$this->input->post('jenis_kelamin'),  
                'alamat'=>$this->input->post('alamat'),  
                'provinsi'=>$this->input->post('provinsi'),  
                'kota'=>$this->input->post('kota'),  
                'kecamatan'=>$this->input->post('kecamatan'),  
                'kelurahan'=>$this->input->post('kelurahan')  
           );  
           if (!$this->daftar_model->register($user)){  
                redirect(site_url('welcome'));  
           }  
           else{  
                redirect(site_url('daftar'));  
                echo '<script type="text/javascript">alert("Pendaftaran Gagal");</script>';  
           }  
      }  
 }  
3.3.2. Daftar_smp.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Daftar_smp extends CI_Controller {  
      function __construct(){  
     parent::__construct();  
     $this->load->library(array('form_validation'));  
     $this->load->helper(array('url','form'));  
     $this->load->model('daftar_model'); //call model  
   }  
      public function index()  
      {  
           $this->load->view('daftar_smp');  
           //echo '<script type="text/javascript">alert("hello!");</script>';  
      }  
      public function pendaftaran()  
      {  
           $user=array(  
                'nik'=>$this->input->post('nik'),  
                'nisn'=>$this->input->post('nisn'),  
                'tingkat'=>$this->input->post('tingkat'),  
                'password'=>$this->input->post('password'),  
                'nama'=>$this->input->post('nama'),  
                'agama'=>$this->input->post('agama'),  
                'tempat_lahir'=>$this->input->post('tempat_lahir'),  
                'tanggal_lahir'=>$this->input->post('tanggal_lahir'),  
                'jenis_kelamin'=>$this->input->post('jenis_kelamin'),  
                'alamat'=>$this->input->post('alamat'),  
                'provinsi'=>$this->input->post('provinsi'),  
                'kota'=>$this->input->post('kota'),  
                'kecamatan'=>$this->input->post('kecamatan'),  
                'kelurahan'=>$this->input->post('kelurahan')  
           );  
           if (!$this->daftar_model->register($user)){  
                redirect(site_url('welcome'));  
           }  
           else{  
                redirect(site_url('daftar_smp'));  
                echo '<script type="text/javascript">alert("Pendaftaran Gagal");</script>';  
           }  
      }  
 }  
3.3.3. Home.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Home extends CI_Controller {  
      function __construct(){  
     parent::__construct();  
     $this->load->library(array('form_validation'));  
     $this->load->helper(array('url','form'));  
     $this->load->model('update_model');  
   }  
      public function index()  
      {  
           $id=$this->session->userdata('nik');  
         $query=$this->db->query("SELECT * FROM user WHERE nik='$id'");  
         $data=$query->row_array();  
           $this->load->view('home', $data);  
           //echo '<script type="text/javascript">alert("hello!");</script>';  
      }  
      public function update_data()  
      {  
           $data=array(  
                'nik'=>$this->input->post('nik'),  
                'nisn'=>$this->input->post('nisn'),  
                'nama'=>$this->input->post('nama'),  
                'agama'=>$this->input->post('agama'),  
                'tempat_lahir'=>$this->input->post('tempat_lahir'),  
                'tanggal_lahir'=>$this->input->post('tanggal_lahir'),  
                'jenis_kelamin'=>$this->input->post('jenis_kelamin'),  
                'alamat'=>$this->input->post('alamat'),  
                'provinsi'=>$this->input->post('provinsi'),  
                'kota'=>$this->input->post('kota'),  
                'kecamatan'=>$this->input->post('kecamatan'),  
                'kelurahan'=>$this->input->post('kelurahan')  
           );  
           $where=array('nik'=>$this->session->userdata('nik'));  
           $a=$this->update_model->ubah($where ,$data);  
           redirect(site_url('home'));  
      }  
      public function update_ortu(){  
           $data=array(  
                'ayah'=>$this->input->post('ayah'),  
                'ibu'=>$this->input->post('ibu'),  
                'wali'=>$this->input->post('wali')  
           );  
           $where=array('nik'=>$this->session->userdata('nik'));  
           $this->update_model->ubah($where, $data);  
           redirect(site_url('home'));  
      }  
      function logout(){  
     $this->session->sess_destroy();  
     $url=base_url('');  
     redirect($url);  
   }  
 }  
3.3.4. Report.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Report extends CI_Controller {  
      function pdf()  
      {  
           $this->load->library('pdfgenerator');  
            $id=$this->session->userdata('nik');  
           $data2=$this->db->query("SELECT * FROM user WHERE nik='$id'");  
           $data=$data2->row_array();  
        $html = $this->load->view('table_report', $data, true);  
        $this->pdfgenerator->generate($html,'form_pendaftaran');  
      }  
 }  
3.3.5. Sekolah.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Sekolah extends CI_Controller {  
      function __construct(){  
     parent::__construct();  
     $this->load->library(array('form_validation'));  
     $this->load->helper(array('url','form'));  
     $this->load->model('update_model');  
   }  
      public function index()  
      {  
           $id=$this->session->userdata('nik');  
         $query=$this->db->query("SELECT * FROM user WHERE nik='$id'");  
         $data=$query->row_array();  
           $this->load->view('sekolah', $data);  
           //echo '<script type="text/javascript">alert("hello!");</script>';  
      }  
      public function update_sekolah()  
      {  
           $id=$this->session->userdata('nik');  
           $data= array(  
                'nik'=>$this->session->userdata('nik'),  
                'asal_sekolah'=>$this->input->post('asal_sekolah'),  
                'sekolah1'=>$this->input->post('sekolah1'),  
                'sekolah2'=>$this->input->post('sekolah2')  
           );  
           $where=array('nik'=>$id);  
           $this->update_model->ubah($where, $data);  
           redirect(site_url('sekolah'));  
      }  
 }  
 ?>  
3.3.6. Welcome.php
 <?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Welcome extends CI_Controller {  
      function __construct(){  
     parent::__construct();  
     $this->load->model('signin_model');  
   }  
      /**  
       * Index Page for this controller.  
       *  
       * Maps to the following URL  
       *           http://example.com/index.php/welcome  
       *     - or -  
       *           http://example.com/index.php/welcome/index  
       *     - or -  
       * Since this controller is set as the default controller in  
       * config/routes.php, it's displayed at http://example.com/  
       *  
       * So any other public methods not prefixed with an underscore will  
       * map to /index.php/welcome/<method_name>  
       * @see https://codeigniter.com/user_guide/general/urls.html  
       */  
      public function index()  
      {  
           $this->load->view('welcome_message');  
           //echo '<script type="text/javascript">alert("hello!");</script>';  
      }  
      function auth(){  
     $id=htmlspecialchars($this->input->post('id',TRUE),ENT_QUOTES);  
     $password=htmlspecialchars($this->input->post('password',TRUE),ENT_QUOTES);  
     $cek_user=$this->signin_model->auth_user($id ,$password);  
     if($cek_user->num_rows() > 0){  
          $data=$cek_user->row_array();  
       $this->session->set_userdata('nik',$data['nik']);  
       $this->session->set_userdata('masuk', TRUE);  
       redirect(site_url('home'));  
     }  
     else{  
       echo $this->session->set_flashdata('msg','NIK/NISN atau Password Salah');  
       redirect(site_url('welcome'));  
     }  
   }  
 }  

Berikut adalah hasilnya.

Lebih detailnya bisa langsung cek disini.

Terima kasih.

Komentar