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

    $fullname = $_POST['fullname'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $address = $_POST['address'];
    $stateOfOrigin = $_POST['stateOfOrigin'];
    $academicLevel = $_POST['academicLevel'];
    $graduation = $_POST['graduation'];
    $industry = $_POST['industry'];
    $energySpace = $_POST['energySpace'];
    $challenges = $_POST['challenges'];
    $expectations = $_POST['expectations'];


    $to = 'mannehills@gmail.com';
    $to = 'buradum@burasolutions.com';
    $subject = '3 days Solar PV Registration';

    $message = "
        Fullname: $fullname
        Email: $email 
        Phone: $phone
        Address: $address
        State of Origin: $stateOfOrigin
        Highest Academic Level: $academicLevel
        Year of Graduation: $graduation
        Industry player: $industry
        Energy space: $energySpace
        Challenges: $challenges
        Expectations: $expectations
        ";


    $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 Training</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>
    <style>
        select {
            border: 1px solid #0b2341;
            border-radius: 5px;
            padding: 10px;
            margin-bottom: 0.8rem;
            width: 100%;
        }
    </style>
</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="academy">Academy</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>Solar Skill Up 1.0
                    </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">Register</h6>
                        <h3 class="title-w3l mt-2">Registration Form</h3>
                        <form action="" method="POST" class="application">
                            <h5>1. Training:</h5>
                            <input type="text" value="A 3 days Solar PV training" readonly>

                            <h5>2. Applicant's Personal Details:</h5>
                            <label for="fullname">Full Name*</label>
                            <input type="text" name="fullname" placeholder="Fullname" required>

                            <label for="email">Email Address*</label>
                            <input type="email" name="email" placeholder="youremail@example.com" required>

                            <label for="phone">Phone number*</label>
                            <input type="tel" name="phone" placeholder="08012345678" required>

                            <label for="address">Address*</label>
                            <input type="text" name="address" placeholder="Address" required>

                            <label for="state">State of origin*</label>
                            <input type="text" name="stateOfOrigin" placeholder="State">

                            <label for="academicLevel">Highest Academic Qualification*</label>
                            <select name="academicLevel">
                                <option value="">-Select-</option>
                                <option value="secondary" name="secondary">Secondary School</option>
                                <option value="university" name="university">University Degree</option>
                            </select>

                            <label for="graduation">Year of Graduation/Expected to Graduate</label>
                            <input type="text" name="graduation" placeholder="Year">

                            <label for="industry">Are you an industry player?</label>
                            <select name="industry">
                                <option value="">-Select-</option>
                                <option value="installer" name="installer">Installer</option>
                                <option value="engineer" name="engineer">Engineer</option>
                                <option value="beginner" name="beginner">Beginner</option>
                            </select>

                            <label for="energySpace">How long have you been in the clean energy space?</label>
                            <select name="energySpace">
                                <option value="">-Select-</option>
                                <option value="installer" name="installer">Less than 1 year</option>
                                <option value="engineer" name="engineer">1 to 3 years</option>
                                <option value="beginner" name="beginner">3 years and above</option>
                            </select>

                            <label for="challenges">What are the common challenges you face?</label>
                            <textarea name="challenges" cols="30" rows="10"
                                placeholder="Write your challenges..."></textarea>

                            <label for="expectations">What are your expectations from the training?*</label>
                            <textarea name="expectations" cols="30" rows="10"
                                placeholder="Write your expectations..."></textarea>

                            <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/skill-up.jpeg" alt="" class="radius-image img-fluid">
                        </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");
                }
            });

        </script>

    </body>



</html>