<?php
if (isset($_POST['submit'])) {

    $category = $_POST['category'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $othername = $_POST['othername'];
    $academic = $_POST['academic'];
    $nationality = $_POST['nationality'];
    $institution = $_POST['institution'];
    $address = $_POST['address'];
    $postalCode = $_POST['postalCode'];
    $townCity = $_POST['townCity'];
    $country = $_POST['country'];
    $telephone = $_POST['telephone'];
    $email = $_POST['email'];
    $nationalID = $_POST['nationalID']; 
    $regFee = $_POST['regFee'];
    $fee = $_POST['fee'];


    $to = 'mannehills@gmail.com';
    $subject = 'Application Form';

    $message = "
        Training Category: $category
        First Name: $firstname 
        Last Name: $lastname
        Other Name: $othername  
        Highest Qualification: $academic
        Nationality: $nationality
        Institution/Company: $institution
        Address: $address
        Postal Code: $postalCode
        Town/City: $townCity
        Country: $country
        Telephone: $telephone
        Email: $email 
        National ID/Passport: $nationality
        Registration fee: $regFee
        Fee: $fee

        "; 
    
    
    $from = $email;

    // echo $message;

    // if($email == "leeann2poulsen@forum.dk" || $email == "linabug@gmail.com" || $name == "HenryTigue"){

    // }else{  
        // Sending email
    if (mail($to, $subject, $message)) {
        echo '
            <script>
            window.location.href="app-response?message_sent";
            </script>
            ';
        } else {
        echo '
            <script>
            window.location.href="app-response?message_not_sent";
            </script>
            ';
        }
    } 

?>


<!doctype html>
<html lang="zxx">


<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>
    <!-- Required meta tags -->
    <link rel="stylesheet" href="assets/css/style-liberty.css">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="keywords" content="Sectoral Responsive web template, Bootstrap Web Templates, Android Compatible web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
    <title>BuraSolutions Solar Academy</title>
    <link href="http://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600&amp;display=swap" rel="stylesheet">
    <!-- Template CSS -->

    <!-- Favicon -->
    <link href="assets/images/buralogo.png" rel="shortcut icon" />

    <script src="https://kit.fontawesome.com/ba375fe002.js" crossorigin="anonymous"></script>
</head>

<body>

    <body>
        <!-- New toolbar-->
        <style>
            * {
                box-sizing: border-box;
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
            }
        </style>


        <!--header-->
        <?php include 'header.php'; ?>
        <!--/header-->
        <!--/inner-page-->

        <div class="inner-banner">
        </div>
        <section class="w3l-breadcrumb">
            <div class="container">
                <ul class="breadcrumbs-custom-path">
                    <li><a href="./">Home</a></li>
                    <li><span class="fa fa-arrow-right mx-2"></span><a href="academy">Academy</a></li>
                    <li class="active"><span class="fa fa-arrow-right mx-2" aria-hidden="true"></span>Apply</li>

                </ul>
            </div>
        </section>


            <div class="midd-w3 py-5">
                <div class="container py-lg-5 py-md-3">
                    <div class="row">
                        <div class="col-lg-6 mb-lg-0 mb-md-5 mb-4 align-self">
                            <h6 class="title-subhny">Apply</h6>
                            <h3 class="title-w3l mt-2">Application Form</h3>
                            <form action="" method="POST" class="application">
                                    <h5>1. Training applied for:</h5>

                                    <select name="category"  id="category">
                                        <option value="SPVI" name="SPVI" id="SPVI">Solar Photovoltaic Installation(SPVI)</option><i class="fa-solid fa-chevron-down"></i>
                                        <!-- <option value="CCTV" name="CCTV" id="CCTV">CCTV Installation</option>
                                        <option value="CP-SPVI" name="CP-SPVI" id="CP-SPVI">CP-SPVI</option> -->
                                    </select>

                                        <h5>2. Applicant's Personal Details:</h5>
                                        <label for="names">Names (in full)</label>
                                        <input type="text" placeholder="First Name" name="firstname" id="firstname">
                                        <input type="text" placeholder="Last Name" name="lastname" id="lastname">
                                        <input type="text" placeholder="Other Name" name="othername" id="othername">

                                        <label for="academic">Highest Academic/Professional Qualification</label>
                                        <input type="text" name="academic" id="academic">

                                        <label for="nationality">Nationality</label>
                                        <input type="text" name="nationality" id="nationality">

                                        <label for="institution">Institution/Comapany/Other</label>
                                        <input type="text" name="institution" id="institution">

                                        <label for="address">Address</label>
                                        <input type="text" name="address" id="address">

                                        <label for="postalCode">Postal Code</label>
                                        <input type="text" name="postalCode" id="postalCode">

                                        <label for="townCity">Town/City</label>
                                        <input type="text" name="townCity" id="townCity">

                                        <label for="country">Country</label>
                                        <input type="text" name="country" id="country">

                                        <label for="telephone">Telephone</label>
                                        <input type="tel" name="telephone" id="telephone">

                                        <label for="email">Email Address</label>
                                        <input type="email" name="email" id="email">

                                        <label for="nationalID">National ID/Passport Number</label>
                                        <input type="text" name="nationalID" id="nationalID">
                                    
                                        <h5>3.Application Fee:</h5>
                                        <!-- <b><span id="regFee" name="regFee">Registration fee(N2000)</span> [compulsory]</b> -->
                                        <div>
                                            <select name="fee" id="fee">
                                            <option value="Three months internship(N40,000)">Three months internship(N40,000)</option>
                                            <!-- <option value="Two weeks crash program(N30,000)">Two Weeks crash program(N30,000)</option>
                                            <option value="CCTV Installation(N20,000)">CCTV Installation(N20,000)</option> -->
                                            </select> 
                                        </div>
                                        <div class="footer">
                                            <input type="submit" value="Submit" class="submit-btn" id="submit" name="submit">
                                        </div>
                                </form>
                        </div>
                        <div class="col-lg-6">
                            <div class="position-relative">
                                <!-- <img src="assets/images/pic7.jpeg" alt="" class="radius-image img-fluid"> -->
                                <img src="assets/images/sept-training.jpeg" alt="" class="radius-image img-fluid">

                                <!-- <img src="assets/images/" alt=""> -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        <!-- home page block grids -->

        <div style="margin: 8px auto; display: block; text-align:center;">

            <!---728x90--->

        </div>
        

        <!-- footer-28 block -->
        <?php include 'footer.php'; ?>
        <!-- Template JavaScript -->
        <script src="assets/js/jquery-3.3.1.min.js"></script>
        <script src="assets/js/theme-change.js"></script>
        <!--/MENU-JS-->
        <script>
            $(window).on("scroll", function() {
                var scroll = $(window).scrollTop();

                if (scroll >= 80) {
                    $("#site-header").addClass("nav-fixed");
                } else {
                    $("#site-header").removeClass("nav-fixed");
                }
            });

            //Main navigation Active Class Add Remove
            // $(".navbar-toggler").on("click", function() {
            //     $("header").toggleClass("active");
            // });
            // $(document).on("ready", function() {
            //     if ($(window).width() > 991) {
            //         $("header").removeClass("active");
            //     }
            //     $(window).on("resize", function() {
            //         if ($(window).width() > 991) {
            //             $("header").removeClass("active");
            //         }
            //     });
            // });
        </script>
        <!--//MENU-JS-->

        <!-- <script src="assets/js/bootstrap.min.js"></script>



        <div id="v-w3layouts"></div>
        <script>
            (function(v, d, o, ai) {
                ai = d.createElement('script');
                ai.defer = true;
                ai.async = true;
                ai.src = v.location.protocol + o;
                d.head.appendChild(ai);
            })(window, document, '../../../../../../../a.vdo.ai/core/v-w3layouts/vdo.ai.js');
        </script> -->
    </body>



</html>