<?php
if($_SESSION['userID']){
	$userID=$_SESSION['userID'];
	$expire_date=0;
	$expire_sms =0;
	$goroohe_alan=user_group($_SESSION['userID']);
	if($goroohe_alan==8){
		$expire_sms=get_user_permition_sms ($_SESSION['userID']);
		if($expire_sms==1){
			update_user_group_expier_date($_SESSION['userID']);
			$db->execute("update goroohe_karbaran set location=1 WHERE user_id =$userID");
			header("Location:index.php");
		}
	}else{
		$expire_sms=get_user_permition_sms ($_SESSION['userID']);
		$expire_date = get_user_permition_date ($_SESSION['userID']);
		if($expire_date==1){
			update_user_group_expier_date($_SESSION['userID']);
			$db->execute("update goroohe_karbaran set location=2 WHERE user_id =$userID");
			header("Location:index.php");
		}
		if($expire_sms==1){
			$db->execute("update goroohe_karbaran set location=3 WHERE user_id =$userID");
			header("Location:epay.php");
		}
	}
//---------------------------------------
	$goroohe_alan2=user_group($_SESSION['userID']);
	if($goroohe_alan2 == 8){
		header("Location:single.php");
		$_SESSION['goroohe_alan']=8;
	}
}
?>