SHARE
TWEET

Untitled

Rofihimam Oct 23rd, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include 'lib/library.php';
  3.  
  4.     if($_SERVER['REQUEST_METHOD'] == 'POST'){
  5.         $nis = $_POST['nis'];
  6.         $nama_lengkap = $_POST['nama_lengkap'];
  7.         $jenis_kelamin = $_POST['jenis_kelamin'];
  8.         $kelas = $_POST['kelas'];
  9.         $jurusan = $_POST['jurusan'];
  10.         $alamat = $_POST['alamat'];
  11.         $golongan_darah = $_POST['golongan_darah'];
  12.         $nama_ibu_kandung = $_POST['nama_ibu_kandung'];
  13.  
  14.         $sql = "UPDATE siswa SET nis = '$nis',
  15.                         nama_lengkap = '$nama_lengkap',
  16.                         jenis_kelamin = '$jenis_kelamin',
  17.                         kelas = '$kelas',
  18.                         jurusan = '$jurusan',
  19.                         alamat = '$alamat',
  20.                         golongan_darah = '$golongan_darah',
  21.                         nama_ibu_kandung = '$nama_ibu_kandung' WHERE nis = '$nis' ";
  22.  
  23.         $mysqli->query($sql) or die ($mysqli->error);
  24.  
  25.         header('Location: index.php');
  26.     }
  27.  
  28.     $nis = $_GET['nis'];
  29.  
  30.     if (empty($nis)) header('Location: index.php');
  31.  
  32.     $sql = "SELECT * FROM siswa WHERE nis = '$nis' ";
  33.     $query = $mysqli->query($sql);
  34.     $siswa = $query->fetch_array();
  35.  
  36.     if (empty($siswa)) header('Location: index.php');
  37.  
  38.     include 'views/v_tambah.php';
  39. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top