<?php
	include'connection.php';
	ob_start();
	$uid=$_GET['id'];
echo	$sub=substr($uid,"0","2");
	if($sub==30)
	{
		$mquery="update masterdis set Active=1 where Userid=$uid";
		mysqli_query($con,$mquery);
		header('location:view_md.php');
	}
	elseif($sub==20)
	{
		$dquery="update distributer set Active=1 where Userid=$uid";
		mysqli_query($con,$dquery);
		header('location:view_distributer.php');
	}
	elseif($sub==22)
	{
		$dquery="update admin set Active=1 where Userid=$uid";
		mysqli_query($con,$dquery);
		header('location:view_admin.php');
	}
	else
	{
		$rquery="update retailer set Active=1 where Userid=$uid";
		mysqli_query($con,$rquery);
		header('location:view_retailer.php');
	}
    ob_end_flush();
?>