
        <?php include 'include/navbar.php';?>
        <?php include 'include/sidebar.php';?>
     
            <div id="layoutSidenav_content">
                <main>
                    <div class="container-fluid px-4">
                        <h1 class="mt-4">Dashboard</h1>
                        <ol class="breadcrumb mb-4">
                            <li class="breadcrumb-item active">Add Visa Country</li>
                        </ol>

                        <div class=" mt-4">


<?php
if (isset($_POST['submit'])) {
  $name = $_POST['country_name'];
  $check = mysqli_query($conn, "SELECT * FROM countries WHERE country_name='$name'");
  if (mysqli_num_rows($check) == 0) {
    mysqli_query($conn, "INSERT INTO countries (country_name) VALUES ('$name')");
    echo "<script>alert('Country added');</script>";
  } else {
    echo "<script>alert('Already exists');</script>";
  }
}
?>

<form method="POST">
  <input type="text" name="country_name" class="form-control mb-3" placeholder="Country Name" required>
  <button type="submit" name="submit" class="btn btn-success">Add Country</button>
</form>


                    </div>
                </main>
                <?php include "include/footer.php";?>
            </div>
        </div>
<!-- JS TextEditor -->
<script src="//cdn.ckeditor.com/4.13.1/standard/ckeditor.js"></script>
         <script>
        CKEDITOR.replace('arContent');
    </script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
        <script src="js/scripts.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
        <script src="assets/demo/chart-area-demo.js"></script>
        <script src="assets/demo/chart-bar-demo.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" crossorigin="anonymous"></script>
        <script src="js/datatables-simple-demo.js"></script>
    </body>
</html>
