<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pendaftaran Rumah Sakit</title>
    <!-- Tambahkan link CSS SB Admin dan Bootstrap -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .card {
            border-radius: 20px;
        }

        .form-control {
            border-radius: 30px;
            height: 50px;
            font-size: 16px;
        }

        .btn-primary {
            background-color: #4e73df;
            border: none;
            border-radius: 50px;
            height: 50px;
            font-size: 18px;
            width: 100%;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
        }

        .btn-primary:hover {
            background-color: #3a5fbd;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        }

        .btn-primary:active {
            background-color: #2f4aad;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        .alert {
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .col-lg-6 {
                width: 100%;
                margin-top: 20px;
            }

            .bg-register-image {
                display: none;
            }

            img {
                width: 30%;
            }
        }
    </style>
</head>
<body class="bg-gradient-primary">

<div class="container">

    <!-- Outer Row -->
    <div class="row justify-content-center">

        <div class="col-xl-10 col-lg-12 col-md-9">

            <div class="card o-hidden border-0 shadow-lg my-5">
                <div class="card-body p-0">
                    <!-- Nested Row within Card Body -->
                    <div class="row">
                        <div class="col-lg-6 d-none d-lg-block bg-register-image"></div>
                        <div class="col-lg-6">
                            <div class="p-5">
                                <div class="text-center">
                                    <h1 class="h4 text-gray-900 mb-4">Buat Akun Baru</h1>
                                </div>
                                <?php 
                                if(isset($_GET['alert'])){
                                    if($_GET['alert'] == "invalid_nik"){
                                        echo "<div class='alert alert-warning text-center'>NIK harus terdiri dari 16 digit angka.</div>";
                                    }elseif($_GET['alert'] == "nik_terdaftar"){
                                        echo "<div class='alert alert-danger text-center'>NIK sudah digunakan, silakan gunakan NIK lain.</div>";
                                    }elseif($_GET['alert'] == "daftar_sukses"){
                                        echo "<div class='alert alert-success text-center'>Selamat, akun Anda telah terdaftar!</div>";
                                    }elseif($_GET['alert'] == "daftar_gagal"){
                                        echo "<div class='alert alert-danger text-center'>Pendaftaran gagal, coba lagi.</div>";
                                    }
                                }
                                ?>

                               <form action="proses_daftar.php" method="POST">
    <div class="form-group mb-3">
        <input type="text" class="form-control" name="nik" placeholder="NIK" required minlength="16" maxlength="16" pattern="\d{16}">
    </div>
    <div class="form-group mb-3">
        <input type="text" class="form-control" name="nama" placeholder="Nama Lengkap" required>
    </div>
    <div class="form-group mb-3">
        <input type="text" class="form-control" name="username" placeholder="Username" required>
    </div>
    <div class="form-group mb-3">
        <input type="password" class="form-control" name="password" placeholder="Password" required>
    </div>
    <div class="form-group mb-3">
        <select name="role" class="form-control" required>
            <option value="">-- Pilih Sebagai --</option>
            <option value="pelanggan">Pelanggan</option>
            <option value="kurir">Kurir</option>
        </select>
    </div>
    <button type="submit" class="btn btn-primary">Daftar</button>
</form>


                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </div>

</div>

<!-- Tambahkan script JS SB Admin dan Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="path/to/sb-admin-2.min.js"></script>
</body>
</html>
