<?php
include '../../config/conn.php';

if ($_GET['aksi'] == 'onoff') {
  $query = mysqli_query($conn, "SELECT * FROM pengaturan LIMIT 1");
  $r = mysqli_fetch_array($query);
if($r['akses_pengguna']=='Y'){
     mysqli_query($conn, "UPDATE pengaturan SET 
                                    akses_pengguna = 'N'
                                    WHERE id_pengaturan = '1'");
    
}else{ mysqli_query($conn, "UPDATE pengaturan SET 
                                    akses_pengguna = 'Y'
                                    WHERE id_pengaturan = '1'");

   }

   if (!$query) {
    echo "<script>ySimpan('?module=$module');</script>";
  } else {
    echo "<script>ySimpan('?module=$module');</script>";
  }
 
}
?>