<?php

include "../../config/koneksi.php";


$id = $_GET['id'];


$data = mysqli_fetch_assoc(
    mysqli_query(
        $koneksi,
        "SELECT * FROM layanan WHERE id='$id'"
    )
);


?>


<!DOCTYPE html>
<html>

<head>

    <title>Edit Layanan</title>

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

</head>


<body>


    <div class="container py-4">


        <div class="card shadow">


            <div class="card-header bg-warning">

                <h4>Edit Layanan</h4>

            </div>


            <div class="card-body">


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


                    <input type="hidden"
                        name="id"
                        value="<?= $data['id']; ?>">


                    <label>Judul</label>

                    <input type="text"
                        name="judul"
                        class="form-control mb-3"
                        value="<?= $data['judul']; ?>">



                    <label>Deskripsi</label>

                    <textarea name="deskripsi"
                        class="form-control mb-3">

<?= $data['deskripsi']; ?>

</textarea>



                    <label>Gambar</label>

                    <input type="file"
                        name="gambar"
                        class="form-control mb-3">


                    <button class="btn btn-warning">

                        Update

                    </button>


                </form>


            </div>


        </div>


    </div>


</body>

</html>