<?php
error_reporting(0);

function redirect($url) {
	echo "<script> location.replace('$url'); </script>";
}

include('def.php');
include('../db.inc.php');
if(isset($_COOKIE['ACCID'])) {
	$accid=$_COOKIE['ACCID'];
	$curr_user=mysqli_fetch_array(mysqli_query($connectionString,"SELECT * FROM users WHERE number='$accid' LIMIT 1"),MYSQLI_ASSOC);
	if((isset($_GET['r']) && $_GET['r'] != "login")) {
		require('request.php');
	}
	else {
		include('home.php');
		$rendered_page='home.html';
	}
}
else {
	$rendered_page='login.html';
}
if((isset($_GET['r']) && $_GET['r'] == "login")) {
		require('login.php');
}


$rendered_page='tpls/'.$rendered_page;
require('main.php');


?>
