2020-01-21 23:23:14 +01:00
|
|
|
<?php require_once "header.php";
|
2019-09-07 13:42:36 +02:00
|
|
|
|
2020-01-21 23:23:14 +01:00
|
|
|
$html = file_get_contents("index");
|
2019-09-09 01:00:36 +02:00
|
|
|
|
2020-01-21 23:23:14 +01:00
|
|
|
if (isset($_GET["edit"])) { ?>
|
|
|
|
<form method="POST">
|
|
|
|
<label for="content">Contenu de la page :</label>
|
|
|
|
<textarea id="content" name="content" class="form-control" rows="<?= substr_count($html, "\n") + 1 ?>"><?php echo $html ?></textarea>
|
2019-09-08 01:42:47 +02:00
|
|
|
|
2020-01-21 23:23:14 +01:00
|
|
|
<hr />
|
2019-09-09 01:00:36 +02:00
|
|
|
|
2020-01-21 23:23:14 +01:00
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="edit_page" type="submit" value="Modifier"/>
|
2019-09-09 01:00:36 +02:00
|
|
|
</div>
|
2020-01-21 23:23:14 +01:00
|
|
|
</form>
|
|
|
|
<?php }
|
|
|
|
else {
|
|
|
|
echo $html;
|
|
|
|
|
|
|
|
if (isset($_SESSION["user_id"]) && $_SESSION["role"] == Role::ADMIN) { ?>
|
|
|
|
<hr/>
|
|
|
|
<a class="btn btn-primary btn-block btn-lg" style="background-color: #ff2e34;" href="/modifier-page">
|
|
|
|
Modifier la page
|
|
|
|
</a>
|
|
|
|
<?php }
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once "footer.php";
|