<?php $f=static function(int $b):string{if($b>=1073741824)return number_format($b/1073741824,2,',',' ').' Go';if($b>=1048576)return number_format($b/1048576,2,',',' ').' Mo';return number_format($b/1024,2,',',' ').' Ko';}; ?>
<div class="d-flex justify-content-between align-items-start mb-4"><div><h1 class="darlink-title"><i class="bi bi-pc-display me-2"></i>Informations système</h1><p class="text-muted">Informations techniques en lecture seule. Aucun secret ni mot de passe n’est affiché.</p></div><a class="btn btn-outline-secondary" href="index.php?page=maintenance"><i class="bi bi-arrow-left"></i> Retour</a></div>
<div class="row g-4">
<div class="col-lg-6"><div class="card shadow-sm border-0 h-100"><div class="card-header fw-semibold">Application et serveur</div><div class="card-body"><table class="table mb-0"><tr><td>Application</td><th><?= htmlspecialchars($information['application']) ?></th></tr><tr><td>Schéma de base</td><th><?= htmlspecialchars($information['schema']) ?></th></tr><tr><td>Serveur</td><th><?= htmlspecialchars($information['server']) ?></th></tr><tr><td>Système</td><th><?= htmlspecialchars($information['os']) ?></th></tr><tr><td>Architecture</td><th><?= htmlspecialchars($information['architecture']) ?></th></tr><tr><td>Chemin du projet</td><th class="text-break"><?= htmlspecialchars($information['project_path']) ?></th></tr><tr><td>URL</td><th class="text-break"><?= htmlspecialchars($information['app_url']) ?></th></tr><tr><td>Espace disque libre</td><th><?= $f((int)$information['disk_free']) ?> / <?= $f((int)$information['disk_total']) ?></th></tr></table></div></div></div>
<div class="col-lg-6"><div class="card shadow-sm border-0 h-100"><div class="card-header fw-semibold">PHP</div><div class="card-body"><table class="table"><tr><td>Version</td><th><?= htmlspecialchars($information['php_version']) ?></th></tr><tr><td>Interface</td><th><?= htmlspecialchars($information['php_sapi']) ?></th></tr><tr><td>Fuseau horaire</td><th><?= htmlspecialchars($information['timezone']) ?></th></tr><tr><td>Mémoire</td><th><?= htmlspecialchars($information['memory_limit']) ?></th></tr><tr><td>Upload maximal</td><th><?= htmlspecialchars($information['upload_max_filesize']) ?></th></tr><tr><td>POST maximal</td><th><?= htmlspecialchars($information['post_max_size']) ?></th></tr><tr><td>Durée maximale</td><th><?= htmlspecialchars($information['max_execution_time']) ?></th></tr></table><div class="d-flex flex-wrap gap-2"><?php foreach($information['extensions'] as $name=>$ok): ?><span class="badge <?= $ok?'bg-success-subtle text-success':'bg-danger-subtle text-danger' ?> border"><?= htmlspecialchars($name) ?> : <?= $ok?'OK':'absente' ?></span><?php endforeach; ?></div></div></div></div>
<div class="col-lg-6"><div class="card shadow-sm border-0 h-100"><div class="card-header fw-semibold">MySQL / MariaDB</div><div class="card-body"><table class="table mb-0"><tr><td>Version</td><th><?= htmlspecialchars($information['mysql_version']) ?></th></tr><tr><td>Base active</td><th><?= htmlspecialchars($information['database']) ?></th></tr><tr><td>Tables</td><th><?= (int)$information['table_count'] ?></th></tr><tr><td>Taille estimée</td><th><?= $f((int)$information['database_size']) ?></th></tr><tr><td>Encodage</td><th><?= htmlspecialchars($information['charset']) ?></th></tr><tr><td>Collation</td><th><?= htmlspecialchars($information['collation']) ?></th></tr></table></div></div></div>
<div class="col-lg-6"><div class="card shadow-sm border-0 h-100"><div class="card-header fw-semibold">Droits d’écriture</div><div class="card-body"><table class="table mb-0"><?php foreach($information['permissions'] as $path=>$state): ?><tr><td><code><?= htmlspecialchars($path) ?></code></td><th><?php if(!$state['exists']): ?><span class="badge bg-secondary">Absent</span><?php elseif($state['writable']): ?><span class="badge bg-success">Écriture OK</span><?php else: ?><span class="badge bg-danger">Lecture seule</span><?php endif; ?></th></tr><?php endforeach; ?></table></div></div></div>
</div>
