<div class="container-fluid">
    <h1 class="h3 mb-4 text-gray-800">Tambah Vendor Baru</h1>

    <?php if (isset($_GET['error'])): ?>
        <div class="alert alert-danger alert-dismissible fade show" role="alert">
            <?php
                switch ($_GET['error']) {
                    case 'add_failed':
                        echo "Gagal menambahkan vendor. Silakan coba lagi.";
                        break;
                }
            ?>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        </div>
    <?php endif; ?>

    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary">Form Vendor Baru</h6>
        </div>
        <div class="card-body">
            <form action="?page=sla_vendors_store" method="POST">
                <div class="mb-3">
                    <label for="nama_vendor" class="form-label">Nama Vendor</label>
                    <input type="text" name="nama_vendor" id="nama_vendor" class="form-control" placeholder="Nama Vendor" required>
                </div>
                <div class="mb-3">
                    <label for="jenis_layanan" class="form-label">Jenis Layanan</label>
                    <input type="text" name="jenis_layanan" id="jenis_layanan" class="form-control" placeholder="Jenis Layanan (e.g., ISP, SIMRS)">
                </div>
                <div class="mb-3">
                    <label for="kontak_vendor" class="form-label">Kontak Vendor</label>
                    <input type="text" name="kontak_vendor" id="kontak_vendor" class="form-control" placeholder="Kontak (Email/Telepon)">
                </div>
                <div class="mb-3">
                    <label for="sla_uptime_percentage" class="form-label">SLA Uptime (%)</label>
                    <input type="number" name="sla_uptime_percentage" id="sla_uptime_percentage" step="0.01" class="form-control" placeholder="e.g., 99.90">
                </div>
                <div class="mb-3">
                    <label for="sla_response_time_minutes" class="form-label">SLA Respon (Menit)</label>
                    <input type="number" name="sla_response_time_minutes" id="sla_response_time_minutes" class="form-control" placeholder="e.g., 15">
                </div>
                <button type="submit" class="btn btn-primary">Simpan Vendor</button>
                <a href="?page=sla_vendors" class="btn btn-secondary">Batal</a>
            </form>
        </div>
    </div>
</div>
