session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //les sources
    $projetManager = new ProjetManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $appartement = "";
    $idAppartement = 0;
    $idProjet = $_GET['idProjet'];
    $projet = $projetManager->getProjetById($idProjet);
    if (isset($_GET['idAppartement']) and ($_GET['idAppartement'] > 0 and $_GET['idAppartement'] <= $appartementManager->getLastId())) {
        $idAppartement = htmlentities($_GET['idAppartement']);
        $appartement = $appartementManager->getAppartementById($idAppartement);
        $piecesManager = new AppartementPiecesManager($pdo);
        $piecesNumber = $piecesManager->getPiecesAppartementNumberByIdAppartement($idAppartement);
        if ($piecesNumber != 0) {
            $piecesAppartement = $piecesManager->getPiecesAppartementByIdAppartement($idAppartement);
        }
    }
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>ImmoERP - Management Application</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />