<?php
/**
 * Created by PhpStorm.
 * User: Gael Wamba Musikingala
 * Date: 2019/04/29
 * Time: 8:33 AM
 */

//20190510 - Included the layout in wizard steps. - Gael

$stepData = json_decode($_COOKIE[$_SERVER["QUERY_STRING"]]);
//print_rr($stepData);

$currency = isset($stepData) ? $stepData->currency : "";
$investment = isset($stepData) ? $stepData->currency.$stepData->investment : "";
$source = isset($stepData) ? $stepData->source : "";



$pdo = $SA->query('SELECT type FROM inputsource');
$pdo->execute();
$results = $pdo->fetchAll();

foreach ($results as $row) {
    $selected = ($row["type"] == $source ) ? "selected" : "";
    $ddlInputSource .= "<option value='".$row["type"]."' $selected>".$row["type"]."</option>";
}

for ($i = 0; $i <= 3.5; $i += 0.5){
    $ddlAdvisorFee .= "<option value='$i'>$i%</option>";
}

$ddlCurrency = "
    <option value='NONE' ". (($currency == 'NONE') ? 'selected' : '') ." >Please select</option>
    <option value='USD'  ". (($currency == 'USD') ? 'selected' : '') ." >US Dollars</option>
    <option value='ZAR'  ". (($currency == 'ZAR') ? 'selected' : '') ." >SA Rands</option>
";

$WizardContent = "
    <h1 class='text-center'>Bank Details</h1>
    <h5 class='text-center'>Which bank account would you like to use for your transactions ? <br> When you redeem your gold, it will be converted into cash and transferred to this account
    </h5>

    <form role='form' id='non-sa-legal-bankDetails'>
        <div class='form-body padding-top35px'>

            <div class='form-group form-md-line-input' id='currency'>
                <select class='form-control edited input-lg' id='form_control_1'>
                    $ddlCurrency
                </select>
                <label for='form_control_1'>Which currency would you like to contribute with ?</label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input' id='investment' >
                <input type='text' class='form-control input-lg' value='$investment' id='investmentCurrency'>
                <label for='form_control_1'>Single Investment Amount</label>
                <span class='help-block hiddenContent'></span>
            </div>

            <div class='form-group form-md-line-input form-md-floating-label' id='source'>
                <select class='form-control edited input-lg'>
                    <option value='NONE' selected=''>Please select</option>
                    $ddlInputSource
                </select>
                <label for='form_control_1'>Source of funds ?</label>
                <span class='help-block hiddenContent'></span>
            </div>

            <!-- HIDDEN UNTIL Would you like financial  ? is CLICKED -->
                <div id='financialAdvisorContent' class='hiddenContent'>

                    <!-- GIVE ME SPACE -->
                    <div class='clearfix margin-bottom-40'></div>
                    <!-- OK THAT IS ENOUGH :) -->

                    <div class='form-group form-md-line-input' id='advisorFirstName' >
                        <input type='text' class='form-control input-lg' value=''>
                        <label for='form_control_1'>Financial Advisor First Name</label>
                        <span class='help-block hiddenContent'></span>
                    </div>

                    <div class='form-group form-md-line-input' id='advisorSurname' >
                        <input type='text' class='form-control input-lg' value=''>
                        <label for='form_control_1'>Financial Advisor Surname</label>
                        <span class='help-block hiddenContent'></span>
                    </div>

                    <div class='form-group form-md-line-input' id='advisorFirstName' >
                        <input type='text' class='form-control input-lg' value=''>
                        <label for='form_control_1'>Name of Business</label>
                        <span class='help-block hiddenContent'></span>
                    </div>

                    <div class='form-group form-md-line-input' id='advisorFee'>
                        <select class='form-control edited input-lg' id='form_control_1'>
                            <option value='NONE' selected=''>Please select</option>
                            $ddlAdvisorFee
                        </select>
                        <label for='form_control_1'>Initial Fee %</label>
                        <span class='help-block hiddenContent'></span>
                    </div>
                </div>
            <!-- END: HIDDEN UNTIL Would you like contribute once off ? is CLICKED -->


            <div class='form-actions noborder 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>

        <div class='form-actions noborder hidden' id='updateBank'>
            <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");
?>

