<?php
if(isset($_COOKIE['user_id'])){
	$current_user_qury=mysqli_query($connation,"SELECT * FROM user_details WHERE user_id='$_COOKIE[user_id]'");
	$current_user_resalt=mysqli_fetch_array($current_user_qury);
	if($current_user_resalt['user_type']==2||$current_user_resalt['user_type']==0){
	echo "<script>window.location='switch-option';</script>";
	}
}
else{
	echo "<script>window.location='logout';</script>";
}
?>