<?php
session_start();

	if(!isset($_SESSION['linkarisesuloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	if($_SESSION['linkariseutype']!='Superuser'){
			header('Location: index.php');
		return;
	} 
	include("connect.php");
	
	
	$brmid=$_GET['id'];
	$eve = "select * from res_businessregister_master where brmid=$brmid";
	$re = mysqli_query($conn, $eve);
	while($rt = mysqli_fetch_assoc($re))
	{
		$brcurrentplanstatus=$rt['brcurrentplanstatus'];

		if($brcurrentplanstatus=='Active')
		{
			$eve1 = "update res_businessregister_master set brcurrentplanstatus='Blocked' where brmid=$brmid";
			$re1 = mysqli_query($conn, $eve1);
		}
		else
		{
			$eve1 = "update res_businessregister_master set brcurrentplanstatus='Active' where brmid=$brmid";
			$re1 = mysqli_query($conn, $eve1);
		}
	}

	$_SESSION['msg'] = "Product Status Changed";
	header('Location: businessregister.php');
?>