62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
|
ob_start(); // Start reading html
|
|
$relativePath = "../";
|
|
require_once $relativePath . 'classes/dao.php';
|
|
|
|
$statut = shell_exec("git status");
|
|
$canUpdate = strpos($statut, 'Your branch is up to date') !== false &&
|
|
strpos($statut, 'Your branch is up-to-date' !== false);
|
|
?>
|
|
<div class="inner">
|
|
<h1>ADMIN</h1>
|
|
<h2>Mise a jour du site</h2>
|
|
|
|
<?php if ($canUpdate): ?>
|
|
<p id="UpdateNeeded">Une mise à jour est disponible</p>
|
|
<!-- <label for="usernameInput">Login</label>-->
|
|
<!-- <input type="text" id="usernameInput">-->
|
|
<!---->
|
|
<!-- <label for="passwordInput">Password</label>-->
|
|
<!-- <input type="password" id="passwordInput">-->
|
|
<!---->
|
|
<!-- <div class="save">-->
|
|
<!-- <i class="fas fa-save"></i> Mettre à Jour-->
|
|
<!-- </div>-->
|
|
<?php else: ?>
|
|
<p id="noUpdateNeeded">Aucune mise à jour disponible</p>
|
|
<?php endif; ?>
|
|
|
|
<div id="gitButton">
|
|
<a href="https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/site-accueil-insa" target="_blank">
|
|
Voir sur Gitea
|
|
</a>
|
|
</div>
|
|
<h3>Statut</h3>
|
|
<p>
|
|
<?php
|
|
echo nl2br($statut)
|
|
?>
|
|
</p>
|
|
|
|
<div class="buttons-container">
|
|
<a href="index.php" class="admin-back-button">
|
|
Retour sur la page admin
|
|
</a>
|
|
<a href="<?= $relativePath ?>index.php" class="website-back-button">
|
|
Retour sur le site
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
|
|
|
|
<?php
|
|
$pageContent = ob_get_clean(); // Store html content in variable
|
|
$pageTitle = "Mise à jour";
|
|
|
|
$pageScripts = "<script type=\"text/javascript\" src=\"../assets/js/updateManager.js\"></script>";
|
|
|
|
include($relativePath . "includes/template.php"); // Display template with variable content
|
|
|
|
?>
|