<?php
session_start(); 
$u_uname = '';
if (isset($_COOKIE['auth_token'])) {
    $u_uname = $_COOKIE['auth_token'];
} else {
    header("location:login.php");
    exit; 
}
?>
<?php include 'include/connection.php'; ?>

 <?php  
 $action = $_GET['action'];
    $id = intval($_GET['id']);

    switch ($action) {
        case '0':
        mysqli_query($link,"UPDATE server SET server_status = '0' WHERE id ='$id'");
        header("location:clientserver.php?success=123456");
        exit;
        case '1':
        mysqli_query($link,"UPDATE server SET server_status = '1' WHERE id ='$id'");
        header("location:clientserver.php?success=123456");
        exit;
        case '2':
            mysqli_query($link,"UPDATE server SET server_status = '2' WHERE id ='$id'");
            header("location:clientserver.php?success=123456");
            exit;    
            
        default:
            echo "Invalid action.";
            exit;
    }
   
?>

    