<?php
if ($from == 'admin') {
	$log_c = 'admin_logout';
	$cookie = 'admin';
	log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
	setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
	unset($_COOKIE['badminton_'.$cookie.'_user']);
}
elseif ($from == 'view') {
	$log_c = 'kid_logout';
	$cookie = 'parent';
	log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
	setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
	unset($_COOKIE['badminton_'.$cookie.'_user']);
	
}
elseif ($from == 'coach') {
	$log_c = 'coach_logout';
	$cookie = 'coach';
	log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
	setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
	unset($_COOKIE['badminton_'.$cookie.'_user']);
	
}
elseif ($from == 'tabor') {
	$log_c = 'camp_user_logout';
	$cookie = 'camp';
	log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
	setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
	unset($_COOKIE['badminton_'.$cookie.'_user']);
	
}
elseif ($from == 'taborvezeto') {
	$log_c = 'camp_leader_logout';
	$cookie = 'camp_leader';
	log::register($log_c, $_COOKIE['badminton_camp_leader']);
	setcookie('badminton_camp_leader', 'null', time()-60*60*72, '/');
	unset($_COOKIE['badminton_camp_leader']);
	
}
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/' . $from);


?>