include_once __DIR__ . "/" . "../controller/work_controller.php";
include_once __DIR__ . "/" . "../controller/image_controller.php";
session_start();
if (!isset($_SESSION["userLogged"])) {
    session_destroy();
    //redirect login page
    header("location: ../login.php");
} else {
    $userLogged = $_SESSION["userLogged"];
}
function acquireGetParamethers()
{
    return $_GET["id"];
}
$resp = null;
$resp = getWorkById(acquireGetParamethers());
if ($resp["response"]) {
    $workOnGet = $resp["project"];
} else {
    $workOnGet = new Work(0, 'titolo', 'descrizione', '1991-01-01', 'url', 'avatar');
}
?>

<!DOCTYPE html>
<html>
<head>
	<?php 
include_once "admin_head.html";
?>
</head>
<body>
include_once __DIR__ . "/" . "../controller/post_controller.php";
include_once __DIR__ . "/" . "../controller/image_controller.php";
session_start();
if (!isset($_SESSION["userLogged"])) {
    session_destroy();
    //redirect login page
    header("location: ../login.php");
} else {
    $userLogged = $_SESSION["userLogged"];
}
function acquireGetParamethers()
{
    return $_GET["id"];
}
$resp = null;
$resp = getPostById(acquireGetParamethers());
if ($resp["response"]) {
    $postOnGet = $resp["latestPost"];
} else {
    $postOnGet = new Post(0, 0, 'titolo', 'sottotitolo', 'testo', 'preview', 'immagine', '1991-01-01');
}
?>

<!DOCTYPE html>
<html>
<head>
	<?php 
include_once "admin_head.html";
?>
</head>
<body>