<?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 = "";
if (isset($_SERVER["QUERY_STRING"])) {
    $QUERY_STRING = $_SERVER["QUERY_STRING"];

    if (isset($_COOKIE[$QUERY_STRING])) {
        $stepData = json_decode($_COOKIE[$QUERY_STRING]);
    }
    
}

$title ="";
$name ="";
$lastName ="";
$Email_Address ="";
$idNumber ="";
$birth ="";
$occupation ="";

if (isset($stepData) && $stepData != "") {

    $title =  $stepData->title ;
    $name =  $stepData->name ;
    $lastName =  $stepData->lastName ;
    $Email_Address =  $stepData->Email_Address ;
    $idNumber =  $stepData->idNumber ;
    $birth =  $stepData->birth ;
    $occupation =  $stepData->occupation ;
}




$pdo = $SA->query('SELECT type FROM inputtitles');
$pdo->execute();
$results = $pdo->fetchAll();

$titleOptions = "";
foreach ($results as $row) {
    $selected = ($row["type"] == $title ) ? "selected" : "";
    $titleOptions .= "<option value='".$row["type"]."' $selected>".$row['type']."</option>";
}

$WizardContent = "
    <h1 class='text-left hFont'>Personal details</h1>
    <h5 class='text-left'>
        Now for some basic information. We use these details to create your online account and open your facility. 
    </h5>

    <form role='form' id='sa-natural-basicInformation'>
        <input type='hidden' id='strEntityType' name='strEntityType' value='SA NATURAL'>
        <div class='row '>
        <div class='form-body padding-top35px'>
        
            <div class='form-group form-md-line-input-signup col-md-2' style='padding-left: 5px !important' id='title'>
                <label for='form_control_1'>Title</label>
                <span class='help-block hiddenContent'></span>
                <select class='form-control edited input-lg' id='form_control_1'>
                    <option value='NONE' selected=''></option> 
                    $titleOptions
                </select>
                
            </div>

            <div class='form-group form-md-line-input-signup col-md-10'style='padding-right: 0px !important' id='name' >
                <label for='form_control_1'>Name</label>
                <span class='help-block hiddenContent'></span>
                <input type='text' class='form-control input-lg' value='$name'>
                
            </div>
        </div>
            <div class='form-group form-md-line-input-signup' id='lastName'>
                <label for='form_control_1'>Surname / Company Name</label>
                <span class='help-block hiddenContent'></span>
                <input type='text' class='form-control input-lg' value='$lastName'  >
                
            </div>

            <div class='form-group form-md-line-input-signup' id='Email-Address' >
                <label for='form_control_1'>Email Address</label>
                <span class='help-block hiddenContent'></span>
                <input id='client_email' type='email' class='form-control input-lg' value='$Email_Address'>
                
            </div>

            <div class='form-group form-md-line-input-signup' id='idNumber'>
                <label for='form_control_1'>ID / Registration Number</label>
                <span class='help-block hiddenContent'></span>
                <input type='numbers' class='form-control input-lg' value='$idNumber' maxlength='13'>
                
            </div>

            <div class='form-group form-md-line-input-signup ' id='birth'>
                <label for='form_control_1'>Date of Birth</label>
                <span class='help-block hiddenContent'></span>
                <input type='text' class='form-control input-lg' value='$birth' id='mask_date2'>
                
            </div>

            <div class='form-group form-md-line-input-signup ' id='occupation'>
                <label for='occupation'>Occupation</label>
                <span class='help-block hiddenContent'></span>
                <input type='text' class='form-control input-lg' value='$occupation'>
                
            </div>
        </div>

        <div class='form-actions  text-center'>
            <div class='padding-top52px'></div>
            <a href='#'>
                <button type='button' class='btn purple btn-lg center-block' 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");
?>

