<?php
/**
 * Created by PhpStorm.
 * User: roysinclair
 * Date: 2016/02/29
 * Time: 8:33 AM
 */

//20190510 - Included the layout in wizard steps. - Gael

// print_rr($_REQUEST);
// die("XXXX");

$stepData = json_decode($_COOKIE[$_SERVER["QUERY_STRING"]]);

$title = isset($stepData) ? $stepData->title : "";
$name = isset($stepData) ? $stepData->name : "";
$lastName = isset($stepData) ? $stepData->lastName : "";
$Email_Address = isset($stepData) ? $stepData->Email_Address : "";
$passportNumber = isset($stepData) ? $stepData->passportNumber : "";
$birth = isset($stepData) ? $stepData->birth : "";


$pdo = $SA->query('SELECT type FROM inputtitles');
$pdo->execute();
$results = $pdo->fetchAll();

foreach ($results as $row) {
    $selected = ($row["type"] == $title ) ? "selected" : "";
    $titleOptions .= "<option value='".$row["type"]."' $selected>".$row['type']."</option>";
}

$WizardContent = "
    <h1 class='text-center'>Personal details</h1>
    <h5 class='text-center'>
        Now for some basic information. We use these details to create your <br> online account and open your facility. 
    </h5>

    <form role='form' id='non-sa-natural-basicInformation'>
        <div class='form-body padding-top35px'>
            <div class='form-group form-md-line-input' id='title'>
                <select class='form-control edited input-lg' id='form_control_1'>
                    <option value='NONE' selected=''>Please select</option>
                    $titleOptions
                </select>
                <label for='form_control_1'>Title <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input' id='name' >
                <input type='text' class='form-control input-lg' value='$name'>
                <label for='form_control_1'>Name <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input' id='lastName'>
                <input type='text' class='form-control input-lg' value='$lastName'  >
                <label for='form_control_1'>Last Name <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input' id='Email-Address' >
                <input type='email' class='form-control input-lg' value='$Email_Address'>
                <label for='form_control_1'>Email Address <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input' id='passportNumber'>
                <input type='text' class='form-control input-lg' value='$passportNumber'>
                <label for='form_control_1'>Passport Number <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input ' id='birth'>
                <input type='text' class='form-control input-lg' value='$birth' id='mask_date2'>
                <label for='form_control_1'>Date of Birth <span class='required' aria-required='true'>*</span></label>
                <span class='help-block hiddenContent'></span>
            </div>
        </div>

        <div class='form-actions button-right'>
            <div class='padding-top52px'></div>
            <a href='#'>
                <button type='button' class='btn purple btn-lg' id='saveData'>Continue</button>
            </a>
        </div>

        <div class='form-actions noborder'>
            <div class='padding-top52px'></div>
            <a href='#'>
                <button type='button' class='btn purple btn-lg' id='backButton'>Back</button>
            </a>
        </div>

        <div class='form-actions noborder hidden' id='updateBasic'>
            <div class='padding-top52px'></div>
            <a href='#'>
                <button type='button' class='btn purple btn-lg' id='updateButton'>Update</button>
            </a>
        </div>
    </form>
    <div class='padding-bottom-100px'> </div>
";
require("layout_basic.php");
?>