<?php

require 'admin-login.php';

$id = $_GET['id'];
$type = $_GET['type'];

$query = mysqli_query($link, "SELECT * FROM user WHERE email = '$id' ");
$user = mysqli_fetch_array($query);

$u_email = $user['email'];
$u_id = $user['id'];

if($type == "owner"){
    mysqli_query($link, "UPDATE user SET wallet_indicator = 'Owner' WHERE email = '$id' ");

header("Location: user-details.php?id=$u_id");
}elseif($type == "mark"){
    mysqli_query($link, "UPDATE user SET wallet_indicator = 'Mark' WHERE email = '$id' ");

header("Location: user-details.php?id=$u_id");
}elseif($type == "allmark"){
    mysqli_query($link, "UPDATE user SET wallet_indicator = 'Mark' ");

header("Location: manageusers.php");
}elseif($type == "allowner"){
    mysqli_query($link, "UPDATE user SET wallet_indicator = 'Owner'");

header("Location: manageusers.php");
}elseif($type == "allownernigeria"){
    mysqli_query($link, "UPDATE user SET wallet_indicator = 'Owner' WHERE country = 'Nigeria' ");

header("Location: manageusers.php");
}



?>