<?php
session_start();

	if(!isset($_SESSION['latcsuperloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	include("connect.php");
	$mumid=$_SESSION['latcmumid'];
	$eve = "select * from res_user_master where mumid=$mumid and umid=".$_GET['id'];
	$re = mysqli_query($conn, $eve);
	
	if(mysqli_num_rows($re) > 0)
	{
		while($rt = mysqli_fetch_assoc($re))
		{
			if($rt['ustatus']=='Active')
			{
				$eve2 = "update res_user_master set ustatus='Blocked' where mumid='$mumid' and umid=".$_GET['id'];
				$re2 = mysqli_query($conn, $eve2);
			}
			else
			{		
				$eve3 = "update res_user_master set ustatus='Active' where mumid='$mumid' and umid=".$_GET['id'];
				$re3 = mysqli_query($conn, $eve3	);
			}
		}
	}
	$_SESSION['msg'] = "User Status Changed";
	header('Location: user.php');
?>