<?php
require_once 'core/system.php';
echo only_reg();
$header = 'Поход';
require_once 'core/head.php';
?>
<?

	$taxi_time = intval($_GET['time']);
	$time = time();
	if($user['pohod_start'] == '0')
	{
	if(isset($_GET['pohod']))
	{
		if(isset($taxi_time))
		{
			if($taxi_time == 1)
			{
			$time_plus = '1800';
			}
			elseif($taxi_time == 2)
			{
			$time_plus = '3600';
			}
			elseif($taxi_time == 3)
			{
			$time_plus = '7200';
			}
			elseif($taxi_time == 4)
			{
			$time_plus = '14400';
			}
			elseif($taxi_time == 5)
			{
			$time_plus = '28800';
			}
			$time_db = $time + $time_plus;
			mysql_query("UPDATE `user` SET `pohod_time` = '".$time_db."' WHERE `id` = '".$user['id']."'");
			mysql_query("UPDATE `user` SET `pohod_start` = '".$taxi_time."' WHERE `id` = '".$user['id']."'");
			mysql_query("UPDATE `user` SET `pohod` = '1' WHERE `id` = '".$user['id']."'");

header("Location: gop-stop.php");
			exit();
		}
		else
		{
		header("Location: gop-stop.php");
		exit();
		}
	}
	else
	{
	header("Location: gop-stop.php");
	exit();
	}
	}
	else
	{
	header("Location: gop-stop.php");
	exit();
	}

?>