<?php /*<!doctype html>
<html lang="id">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title><?= esc($title ?? 'Admin') ?></title>

  <link rel="stylesheet" href="<?= base_url('assets/admin/admin.css') ?>">
</head>

<body>
  <div class="app">

    <!-- TOPBAR -->
    <header class="topbar">
      <div class="brand">
        <a class="brand-link" href="<?= site_url('admin') ?>">Admin SMAS</a>
      </div>

      <div class="topbar-right">
        <div class="user-chip">
          <span class="dot"></span>
          <span>Halo, <?= esc(auth()->user()->username ?? 'Admin') ?></span>
        </div>

        <!-- Pakai POST lebih aman; kalau route logout kamu GET, ini tetap bisa kamu ganti balik jadi <a> -->
        <form action="<?= site_url('logout') ?>" method="post">
          <?= csrf_field() ?>
          <button type="submit" class="btn btn-ghost">Logout</button>
        </form>
      </div>
    </header>

    <div class="shell">
      <!-- SIDEBAR -->
      <aside class="sidebar">
        <div class="menu-title">Menu</div>

        <?php $uri = service('uri')->getPath(); ?>

        <nav class="menu">
          <a class="menu-item <?= ($uri === 'admin' || $uri === 'admin/') ? 'active' : '' ?>"
             href="<?= site_url('admin') ?>">Dashboard</a>

          <a class="menu-item <?= str_starts_with($uri, 'admin/informasi') ? 'active' : '' ?>"
             href="<?= site_url('admin/informasi') ?>">Informasi Sekolah</a>

          <a class="menu-item <?= str_starts_with($uri, 'admin/berita') ? 'active' : '' ?>"
             href="<?= site_url('admin/berita') ?>">Berita</a>

          <a class="menu-item <?= str_starts_with($uri, 'admin/galeri') ? 'active' : '' ?>"
             href="<?= site_url('admin/galeri') ?>">Galeri</a>

          <a class="menu-item <?= str_starts_with($uri, 'admin/password') ? 'active' : '' ?>"
             href="<?= site_url('admin/password') ?>">Ubah Password</a>
        </nav>
      </aside>

      <!-- CONTENT -->
      <main class="content">
        <?= $this->renderSection('content') ?>
      </main>
    </div>

  </div>
</body>
</html>
 */ ?>

<?php /*<?= $this->extend('admin/layout') ?>
<?= $this->section('content') ?>

<h2>Informasi Sekolah</h2>

<?php if (session('message')): ?>
  <div style="padding:10px; background:#e7f7ee; border:1px solid #b7e1c7; margin:10px 0;">
    <?= esc(session('message')) ?>
  </div>
<?php endif; ?>

<form method="post" action="<?= site_url('admin/informasi') ?>">
  <?= csrf_field() ?>

  <h3>Sosial Media</h3>

  <label>Facebook URL</label><br>
  <input type="text" name="facebook_url" value="<?= esc($row['facebook_url'] ?? '') ?>" style="width:100%; padding:10px;"><br><br>

  <label>Instagram URL</label><br>
  <input type="text" name="instagram_url" value="<?= esc($row['instagram_url'] ?? '') ?>" style="width:100%; padding:10px;"><br><br>

  <label>YouTube URL</label><br>
  <input type="text" name="youtube_url" value="<?= esc($row['youtube_url'] ?? '') ?>" style="width:100%; padding:10px;"><br><br>

  <label>Email</label><br>
  <input type="text" name="email" value="<?= esc($row['email'] ?? '') ?>" style="width:100%; padding:10px;"><br><br>

  <h3>Visi, Misi, Tujuan</h3>

  <label>Visi</label><br>
  <textarea name="visi" rows="3" style="width:100%; padding:10px;"><?= esc($row['visi'] ?? '') ?></textarea><br><br>

  <label>Misi</label><br>
  <textarea name="misi" rows="4" style="width:100%; padding:10px;"><?= esc($row['misi'] ?? '') ?></textarea><br><br>

  <label>Tujuan</label><br>
  <textarea name="tujuan" rows="3" style="width:100%; padding:10px;"><?= esc($row['tujuan'] ?? '') ?></textarea><br><br>

  <button type="submit" style="padding:10px 16px;">Simpan</button>
</form>

<?= $this->endSection() ?>
 */ ?>
