2020-01-21 22:23:14 +00:00
|
|
|
<?php require_once "header.php";
|
2019-09-07 11:42:36 +00:00
|
|
|
|
2020-01-21 22:23:14 +00:00
|
|
|
$html = file_get_contents("index");
|
2019-09-08 23:00:36 +00:00
|
|
|
|
2020-01-21 22:23:14 +00: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-07 23:42:47 +00:00
|
|
|
|
2020-01-21 22:23:14 +00:00
|
|
|
<hr />
|
2019-09-08 23:00:36 +00:00
|
|
|
|
2020-01-21 22:23:14 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="edit_page" type="submit" value="Modifier"/>
|
2019-09-08 23:00:36 +00:00
|
|
|
</div>
|
2020-01-21 22:23:14 +00: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";
|