Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //koneksi database
- include "Config/Connection.php";
- //tangkap id akses
- if(empty($_GET['id_akses'])){
- $nama_lengkap ="";
- $email = "";
- $no_kontak = "";
- $username = "";
- $password ="";
- $level = $data['level'];
- }else{
- $id_akses=$_GET['id_akses'];
- //Buka data akses berdasarkan id_akses
- $QueryAkses = mysqli_query($conn, "SELECT * FROM akses WHERE id_akses='$id_akses'")or die(mysqli_error($conn));
- $data = mysqli_fetch_array($QueryAkses);
- $nama_lengkap = $data['nama_lengkap'];
- $email = $data['email'];
- $no_kontak = $data['no_kontak'];
- $username = $data['username'];
- $password = $data['password'];
- $level = $data['level'];
- ?>
- <div class="row justify-content-md-center">
- <div class="col-12 mb-4">
- <form action="Proses/Akses/edit_akses.php" method="POST">
- <input type="hidden" name="id_akses" value="<?php echo "$id_akses"; ?>">
- <div class="card shadow-lg-hover">
- <div class="card-body p-2">
- <div class="row">
- <div class="col col-md-6">
- <label for="">Nama Lengkap</label>
- <input type="text" required name="nama_lengkap" id="" class="form-control" value="<?php echo "$nama_lengkap"; ?>">
- </div>
- <div class="col col-md-6">
- <label for="">Email</label>
- <input type="email" required name="email" id="" class="form-control" value="<?php echo "$email"; ?>">
- </div>
- </div>
- <div class="row">
- <div class="col col-md-6">
- <label for="">No.Kontak</label>
- <input type="text" required name="no_kontak" id="" class="form-control" value="<?php echo "$no_kontak"; ?>">
- </div>
- <div class="col col-md-6">
- <label for="">Username</label>
- <input type="text" required name="username" id="" class="form-control" value="<?php echo "$username"; ?>">
- </div>
- </div>
- <div class="row">
- <div class="col col-md-6">
- <label for="">Password</label>
- <input type="password" required name="password" id="" class="form-control" value="<?php echo "$password"; ?>">
- </div>
- <div class="col col-md-6">
- <label for="">Ulangi Password</label>
- <input type="password" required name="ulangi_password" id="" class="form-control" value="<?php echo "$password"; ?>">
- </div>
- </div>
- <div class="row">
- <div class="col col-md-12">
- <label for="">Level Akses</label>
- <select name="level" required class="form-control">
- <option <?php if(empty($level)){echo "selected";} ?> value="">-Pillih Level-</option>
- <option <?php if($level=="Admin"){echo "selected";} ?> value="Admin">Admin</option>
- <option <?php if($level=="Adru"){echo "selected";} ?> value="Adru">Adru</option>
- <option <?php if($level=="BPJS"){echo "selected";} ?> value="BPJS">BPJS</option>
- <option <?php if($level=="Medrek"){echo "selected";} ?> value="Medrek">Medrek</option>
- <option <?php if($level=="Farmasi"){echo "selected";} ?> value="Farmasi">Farmasi</option>
- <option <?php if($level=="Radiologi"){echo "selected";} ?> value="Radiologi">Radiologi</option>
- <option <?php if($level=="Laboratorium"){echo "selected";} ?> value="Laboratorium">Laboratorium</option>
- </select>
- </div>
- </div>
- <div class="row">
- <div class="col col-md-12">
- <p>
- <?php
- if(!empty($_GET['notifikasi'])){
- $notifikasi=$_GET['notifikasi'];
- if($notifikasi=="error1"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Nama lengkap Tidak Boleh Kosong';
- echo '</div>';
- }else{
- if($notifikasi=="error2"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Email Tidak Boleh Kosong';
- echo '</div>';
- }else{
- if($notifikasi=="error3"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Nomor Kontak Tidak Boleh Kosong';
- echo '</div>';
- }else{
- if($notifikasi=="error4"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Username Tidak Boleh Kosong';
- echo '</div>';
- }else{
- if($notifikasi=="error5"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Password Tidak Boleh Kosong';
- echo '</div>';
- }else{
- if($notifikasi=="error6"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Password Tidak Sama';
- echo '</div>';
- }else{
- if($notifikasi=="error7"){
- echo '<div class="alert alert-danger text-white">';
- echo ' Maaf!! Proses input ke database gagal!';
- echo '</div>';
- }
- }
- }
- }
- }
- }
- }
- }else{
- echo '<div class="alert alert-warning text-white">';
- echo ' Silahkan isi form tersebut di atas dengan benar';
- echo '</div>';
- }
- ?>
- </p>
- </div>
- </div>
- </div>
- <div class="card-footer">
- <div class="row">
- <div class="col col-md-12">
- <button type="submit" class="btn btn-md btn-primary">
- <i class="fas fa-save"></i> Simpan
- </button>
- <button type="reset" class="btn btn-md btn-warning">
- <i class="fas fa-undo"></i> Reset
- </button>
- <a href="index.php?page=akses" class="btn btn-md btn-info">
- <i class="fas fa-arrow-alt-circle-left"></i> Kembali
- </a>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- <?php } ?>
Add Comment
Please, Sign In to add comment