<?php
 include '../../koneksi.php';
 $id = $_GET['id'];
 //$user = $_GET['user'];
 switch($_GET[action]){ 
case "aktifasi_pengguna":
$query = mysql_query("select * from user where id=$id");
while ($q = mysql_fetch_array($query)) {
$status =$q['status_admin'];
$user =$q['username'];
if($status=="Aktif")
{
$update = mysql_query("update user set status_admin='Tunggu Di Konfirmasi' where id='$id'");
$aksi="Non Aktifkan";
}
else if ($status=="Tunggu Di Konfirmasi")
{
$update = mysql_query("update user set status_admin='Aktif' where id='$id'");
}

}
if ($update) {
    header("location:tabel_user.php");
} else {
    echo "gagal";
}

break;
    }

?>