<?php
@ob_start();
include 'include/functions/header.php';
?>
<!DOCTYPE html>
<html lang="<?php print $language_code; ?>">
<!--<![endif]-->

<head>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta charset="UTF-8" />

	<title><?php print $site_title.' - '.$title; if($offline) print ' - '.$lang['server-offline']; ?></title>

	<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
	<link rel='stylesheet' href='<?php print $site_url; ?>css/style.css?v=0.2' type='text/css' media='all' />
	<link rel='stylesheet' href='<?php print $site_url; ?>css/flag-icon.min.css' type='text/css' media='all' />
	<link rel="shortcut icon" href="<?php print $site_url; ?>images/icon.png?v="  />
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
</head>

<body>

<header style="">
<img src="<?php print $site_url; ?>images/bg-header.png" style="width:100%;height:100%;" ></a>
</header>

<nav class="navbar navbar-dark navbar-expand-lg nav-top-center">
	<div class="container">

		<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggler2"
				aria-controls="navbarToggler2" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarToggler2">
			<ul class="navbar-nav me-auto mb-2 mb-lg-0 m-auto d-lg-flex align-items-center">
				<li class="nav-item">
					<a class="nav-link active" aria-current="page" href="<?php print $site_url; ?>news"><?php print $lang['news']; ?></a>
				</li>
				<li class="nav-item">
					<a class="nav-link active" href="<?php print $site_url; ?>download"><?php print $lang['download']; ?></a>
				</li>
				<?php if(!$database->is_loggedin()) { ?>
				<li class="nav-item">
					<a class="nav-link active" href="<?php print $site_url; ?>users/register"><?php print $lang['register']; ?></a>
				</li>
				<?php } else { ?>
				<li class="nav-item">
					<a class="nav-link active" href="<?php print $site_url; ?>users/logout"><?php print $lang['logout']; ?></a>
				</li>
				<?php } ?>
				<a class="navbar-brand" href="<?php print $site_url; ?>"><img src="<?php print $site_url; ?>images/icon.png" width="80px" alt="logo"
																			  class="img-fluid"></a>

				<li class="nav-item">
					<a class="nav-link active" href="<?php print $social_links['discord'];?>">Discord</a>
				</li>
					<li class="nav-item">
						<a class="nav-link active" href="https://itemshop.metin2top.com/">Item-Shop</a>
					</li>

			</ul>

		</div>
	</div>
</nav>
<div class="container main-container">
	<div class="row">
		<div class="col-lg-3">
			<?php include 'include/sidebar/user.php'; ?>
			<?php include 'include/sidebar/guilds.php'; ?>
		</div>
		<div class="col-lg-6 mb-4">
			<div id="mainCarousel" class="carousel slide">
				<div class="carousel-indicators">
					<button type="button" data-bs-target="#mainCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
					<button type="button" data-bs-target="#mainCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
					<button type="button" data-bs-target="#mainCarousel" data-bs-slide-to="2" aria-label="Slide 3"></button>
				</div>
				<div class="carousel-inner">
					<div class="carousel-item active">
						<img src="<?php print $site_url;?>images/slider/1.png" class="d-block w-100" alt="...">
					</div>
					<div class="carousel-item">
						<img src="<?php print $site_url;?>images/slider/2.png" class="d-block w-100" alt="...">
					</div>
					<div class="carousel-item">
						<img src="<?php print $site_url;?>images/slider/3.png" class="d-block w-100" alt="...">
					</div>
				</div>
				<button class="carousel-control-prev" type="button" data-bs-target="#mainCarousel" data-bs-slide="prev">
					<span class="carousel-control-prev-icon" aria-hidden="true"></span>
					<span class="visually-hidden">Previous</span>
				</button>
				<button class="carousel-control-next" type="button" data-bs-target="#mainCarousel" data-bs-slide="next">
					<span class="carousel-control-next-icon" aria-hidden="true"></span>
					<span class="visually-hidden">Next</span>
				</button>
			</div>
			<div class="main-page p-3">
				<?php include 'pages/'.$page.'.php'; ?>
			</div>
		</div>


		<div class="col-lg-3">
			<?php if(!$offline && $statistics) include 'include/sidebar/statistics.php'; ?>
			<?php include 'include/sidebar/players.php'; ?>
		</div>
	</div>
</div>
<div class="footer mt-5">
	<nav class="navbar navbar-dark navbar-expand-lg">
		<div class="container">

			<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggler2"
					aria-controls="navbarToggler2" aria-expanded="false" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<div class="collapse navbar-collapse" id="navbarToggler2">
				<ul class="navbar-nav me-auto mb-2 mb-lg-0 m-auto d-lg-flex align-items-center">
					<li class="nav-item">
						<a class="nav-link" aria-current="page" href="<?php print $site_url; ?>news"><?php print $lang['news']; ?></a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="<?php print $site_url; ?>download"><?php print $lang['download']; ?></a>
					</li>
					<?php if(!$database->is_loggedin()) { ?>
						<li class="nav-item">
							<a class="nav-link" href="<?php print $site_url; ?>users/register"><?php print $lang['register']; ?></a>
						</li>
					<?php } else { ?>
						<li class="nav-item">
							<a class="nav-link" href="<?php print $site_url; ?>users/logout"><?php print $lang['logout']; ?></a>
						</li>
					<?php } ?>
					<a class="navbar-brand" href="<?php print $site_url; ?>"><img src="<?php print $site_url; ?>images/icon.png" width="80px" alt="logo"
																				  class="img-fluid"></a>

					<li class="nav-item">
						<a class="nav-link" href="<?php print $social_links['discord'];?>">Discord</a>
					</li>
						<li class="nav-item">
							<a class="nav-link" href="https://itemshop.metin2top.com/">Item-Shop</a>
						</li>

				</ul>

			</div>
		</div>
	</nav>
	<div class="footer-copyright ">
		<div class="container">
			<div class="row py-4 justify-content-between">
				<div class="col-md-4 text-center">
					<p class="text-center text-md-start mb-0">© <?php print date('Y'); ?> <span class="highlight">Metin2Top</span>. All rights reserved.</p>
				</div>
				<div class="col-md-4 text-center">
					<!-- tos, rules, and privacy links -->
					<a href="<?php print $site_url;?>tos" class="text-white mx-1">Terms Of Service</a>
					<a href="<?php print $site_url;?>privacy" class="text-white mx-1">Privacy Policy</a>
					<a href="<?php print $site_url;?>rules" class="text-white mx-1">Rules</a>
				</div>
				<div class="col-md-4 text-center">
				
					Server întreținut tehnic de <a href="https://go4metin.ro">Knop - Go4Metin.ro</a></b>
				</div>
			</div>
		</div>
	</div>
	<!--<div class="footer-parcerias ">
		<div class="container">
			<div class="row py-4 justify-content-between">
	

				<div class="col-md-100 text-center">
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2pserver.png" class="img-fluid"></a></b>
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2-toplist.png" class="img-fluid"></a></b>
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2pserver.png" class="img-fluid"></a></b>
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2-toplist.png" class="img-fluid"></a></b>
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2pserver.png" class="img-fluid"></a></b>
					<a href="https://discord.gg/3JEGWc75pm"><img src="<?php print $site_url;?>images/vote/metin2-toplist.png" class="img-fluid"></a></b>
				</div>
			</div>
		</div>
	</div> -->
</div>

<div id="mini-icons">
	<div class="languagewrapper">
		<a class="current-language flag-icon flag-icon-<?php print $language_code;?>"
		   onmouseover="if (!window.__cfRLUnblockHandlers) return false; enlarge()"
		   onmouseout="if (!window.__cfRLUnblockHandlers) return false; dlarge()"
		   type="button" >
		</a>
		<div class="languages" id="languages" style="width: 0vw; left: -504px;">
			<?php foreach($json_languages['languages'] as $key => $value) { ?>
				<a href="<?php print $site_url;?>?lang=<?php print $key;?>" class="flag-icon flag-icon-<?php print $key;?>"
				   onmouseover="if (!window.__cfRLUnblockHandlers) return false; enlarge()"
				   onmouseout="if (!window.__cfRLUnblockHandlers) return false; dlarge()"
				   style="width: 56px;">
				</a>
			<?php } ?>
		</div>
	</div>

	<div class="youtube text-center">
		<a target="_blank" href="<?php print $social_links['youtube'];?>">
			<i class="bi bi-youtube"></i>
		</a>
	</div>
	<div class="facebook text-center">
		<a target="_blank" href="<?php print $social_links['facebook'];?>">
			<i class="bi bi-facebook"></i>
		</a>
	</div>
	<div class="instagram text-center">
		<a target="_blank" href="<?php print $social_links['instagram'];?>">
			<i class="bi bi-instagram"></i>
		</a>
	</div>
	<div class="discord text-center">
		<a target="_blank" href="<?php print $social_links['discord'];?>">
			<i class="bi bi-discord"></i>
		</a>
	</div>
</div>



<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

<script src="<?php print $site_url;?>js/app.js" ></script>

<?php include 'include/functions/footer.php'; ?>

</body>

</html>
