Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?phP
- //koneksi database
- include "../../Config/Connection.php";
- //validasi nama lengkap tidak boleh kosong
- if(empty($_POST["nama_lengkap"])){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error1");
- }else{
- //Validasi email tidak boleh kosong
- if(empty($_POST["email"])){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error2");
- }else{
- //Validasi nomor kontak tidak boleh kosong
- if(empty($_POST["no_kontak"])){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error3");
- }else{
- //Validasi username tidak boleh kosong
- if(empty($_POST["username"])){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error4");
- }else{
- //Validasi password tidak boleh kosong
- if(empty($_POST["password"])){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error5");
- }else{
- //Validasi password tidak sama
- if($_POST["password"]!==$_POST["ulangi_password"]){
- header ("location:../../index.php?page=edit_akses¬ifikasi=error6");
- }else{
- //Buat variabel agar singkat
- $id_akses=$_POST["id_akses"];
- $nama_lengkap=$_POST["nama_lengkap"];
- $email=$_POST["email"];
- $no_kontak=$_POST["no_kontak"];
- $username=$_POST["username"];
- $password=$_POST["password"];
- $level=$_POST["level"];
- //Proses update ke database
- $edit_akses = mysqli_query($conn, "UPDATE akses SET
- nama_lengkap='$nama_lengkap',
- email='$email',
- no_kontak='$no_kontak',
- username='$username',
- password='$password',
- level='$level'
- WHERE id_akses='$id_akses'") or die(mysqli_error($conn));
- if($edit_akses){
- header ("location:../../index.php?page=akses¬ifikasi=edit_akses_berhasil");
- }else{
- header ("location:../../index.php?page=edit_akses¬ifikasi=error7");
- }
- }
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement