<?php

session_start();

if (!isset($_SESSION['user_id'])) {

    header("Location: ../login.php");
    exit;
}

?>


<!DOCTYPE html>
<html lang="id">

<head>

    <meta charset="UTF-8">

    <title>
        Tambah Galeri - Admin DISPUSIP
    </title>


    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">


    <style>
        body {
            background: #f4f7fb;
        }


        .card {

            border: none;
            border-radius: 15px;
            overflow: hidden;

        }


        .card-header {

            background: #0d6efd;
            color: white;
            padding: 20px 30px;

        }


        .card-body {

            padding: 30px;

        }


        .form-label {

            font-weight: 600;

        }
    </style>


</head>


<body>


    <div class="container mt-5">


        <div class="card shadow">



            <div class="card-header">


                <h4 class="mb-0">

                    🖼 Tambah Galeri

                </h4>


                <p class="mb-0 mt-2">

                    Tambahkan dokumentasi kegiatan DISPUSIP Kabupaten Banyuwangi.

                </p>


            </div>





            <div class="card-body">


                <form action="proses-tambah.php"
                    method="POST"
                    enctype="multipart/form-data">





                    <div class="mb-3">

                        <label class="form-label">

                            Judul Galeri

                        </label>


                        <input type="text"
                            name="judul"
                            class="form-control"
                            placeholder="Masukkan judul galeri"
                            required>


                    </div>





                    <div class="mb-3">


                        <label class="form-label">

                            Foto Galeri

                        </label>


                        <input type="file"
                            name="gambar"
                            class="form-control"
                            accept=".jpg,.jpeg,.png,.webp"
                            required>


                    </div>





                    <div class="mb-3">


                        <label class="form-label">

                            Link Instagram

                        </label>


                        <input type="url"
                            name="link"
                            class="form-control"
                            placeholder="https://www.instagram.com/...">


                        <small class="text-muted">

                            Masukkan link postingan Instagram jika tersedia.

                        </small>


                    </div>





                    <div class="mb-3">


                        <label class="form-label">

                            Deskripsi

                        </label>


                        <textarea
                            name="deskripsi"
                            class="form-control"
                            rows="5"
                            placeholder="Masukkan deskripsi foto"></textarea>


                    </div>





                    <button type="submit"
                        class="btn btn-primary">

                        💾 Simpan

                    </button>



                    <a href="index.php"
                        class="btn btn-secondary">

                        ← Kembali

                    </a>




                </form>


            </div>


        </div>


    </div>


</body>


</html>