<?php
include($_SERVER['DOCUMENT_ROOT'] . "/COMPONENTS/root/path.php");
echo "<h5 class='userId' style='display:none;'>" . $_GET['userId'] . "</h5>";
?>
<style>
    .avatar-upload {
        position: relative;
        max-width: 210px;
        margin-left: 10px;
        margin: -5px auto;
    }

    .avatar-upload .avatar-edit {
        position: absolute;
        right: 12px;
        z-index: 1;
        top: 10px;
    }

    .avatar-upload .avatar-edit input {
        display: none;
    }

    .avatar-upload .avatar-edit input+label {
        display: inline-block;
        width: 34px;
        height: 34px;
        margin-bottom: 0;

        background: #FFFFFF;
        border: 1px solid transparent;
        -webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
        box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
        cursor: pointer;
        font-weight: normal;
        -webkit-transition: all .2s ease-in-out;
        transition: all .2s ease-in-out;
    }

    .avatar-upload .avatar-edit input+label:hover {
        background: #f1f1f1;
        border-color: #d6d6d6;
    }

    .avatar-upload .avatar-edit input+label:after {
        color: #757575;
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        text-align: center;
        margin: auto;
    }

    .avatar-upload .avatar-preview {
        width: 200px;
        height: 210px;
        position: relative;
        border: 6px solid #F8F8F8;
        -webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
        box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
    }

    .avatar-upload .avatar-preview>div {
        width: 100%;
        height: 100%;

        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }

    @media (max-width: 1024px) {
        .mobilePad {
            padding-left: 10px !important;
        }
    }

    #tableProfile {
        border: 1px solid #ccc;
        border-collapse: collapse;
        table-layout: fixed;
        width: 100%;
    }



    #tableProfile tr {
        border: 1px solid #ddd;
        padding: .15em;
    }

    #tableProfile tr:nth-child(even) {
        /* background: #f8f8f8; */
    }

    #tableProfile th,
    #tableProfile td {
        padding: .455em;
        text-align: left;
    }

    #tableProfile th {
        /* background: #999; */
        color: #fff;
        font-size: .85em;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    #tableProfile td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px !important;
    }

    #tableProfile td:nth-child(2) {
        color: rgb(102, 102, 102) !important;
        font-weight: 200 !important;
    }

    h1 {
        position: relative;
        padding: 0;
        margin: 0;
        font-family: "Raleway", sans-serif;
        font-weight: 300;
        font-size: 18px;
        color: #080808;
        -webkit-transition: all 0.4s ease 0s;
        -o-transition: all 0.4s ease 0s;
        transition: all 0.4s ease 0s;
    }

    h1 span {
        display: block;
        font-size: 0.5em;
        line-height: 0.2;
    }

    h1 em {
        font-style: normal;
        font-weight: 600;
    }

    /* === HEADING STYLE #1 === */

    .one h1 {
        text-align: center;
        text-transform: uppercase;
        padding-bottom: 2px;
        font-size: 12px;
        font-weight: 400;
    }

    .one h1:before {
        width: 28px;
        height: 5px;
        display: block;
        content: "";
        position: absolute;
        bottom: 2px;
        left: 50%;
        margin-left: -14px;
        background-color: #f15a2b;
    }

    .one h1:after {
        width: 100px;
        height: 1px;
        display: block;
        content: "";
        position: relative;
        margin-top: 10px;
        left: 50%;
        margin-left: -50px;
        background-color: #f15a2b;
    }
</style>


<div class="row">

    <div class='col-md-12' style='padding-top:20px;'>

        <div class="avatar-upload">
            <div class="avatar-preview ">
                <div class="imagePreview"></div>
            </div>
        </div>
        <div style='text-align:center; margin-top:10px;'>
            <h1 class="fullname" style='color:black;'>fullname</h1>
        </div>


        <div style='text-align:center; margin-top:10px;  '>
            <p style='font-size:18px; margin-top:-10px; font-size:13px;'><span class="status" style='color:black; font-weight:400; color:green;'>country</span></p>
        </div>


        <div>
            <div class="one">
                <h1>Basic Info</h1>
            </div>

            <table id="tableProfile">
                <tr>
                    <td style='color:black;'>Mlss SOS No:</td>
                    <td class="employer_id" style='color:black;'>N/A</td>
                </tr>
                <tr class="contact">
                    <td style='color:black;'>Email:</td>
                    <td class='email' style='color:black;'>N/A</td>
                </tr>
                <tr class="contact">
                    <td style='color:black;'>Mobile Number:</td>
                    <td class='phone' style='color:black;'>N/A</td>
                </tr>
                <tr>
                    <td style='color:black;'>Country:</td>
                    <td class='country' style='color:black;'>N/A</td>
                </tr>
                <tr>
                    <td style='color:black;'>Current Living Town:</td>
                    <td class='living_town' style='color:black;'>N/A</td>
                </tr>
                <tr class="contact">
                    <td style='color:black;'>Address:</td>
                    <td class='address' style='color:black;'>N/A</td>
                </tr>
                <tr>
                    <td style='color:black;'>Date Added:</td>
                    <td class='date_added' style='color:black;'>N/A</td>
                </tr>
            </table>
        </div>

        
    </div>
</div>


<script>
    var userId = $('.userId').html();
    $.getJSON(domain_api + "/users/users.php?userId=" + encodeURIComponent(userId), function(data) {
        sessionStorage.setItem("unique_user_id", data.user_information[0].unique_user_id);
        sessionStorage.setItem("profile_photo", data.user_information[0].profile_photo);
        sessionStorage.setItem("fullname", data.user_information[0].fullname);
        sessionStorage.setItem("nationality", data.user_information[0].nationality);
        sessionStorage.setItem("living_town", data.user_information[0].living_town);
        sessionStorage.setItem("email", data.user_information[0].email);
        sessionStorage.setItem("phone", data.user_information[0].phone);
        sessionStorage.setItem("address", data.user_information[0].address);
        sessionStorage.setItem("status", data.user_information[0].status);
        sessionStorage.setItem("date_added", data.user_information[0].date_added);
        
        var unique_user_id = sessionStorage.getItem("unique_user_id");
        var profile_photo = sessionStorage.getItem("profile_photo");
        var fullname = sessionStorage.getItem("fullname");
        var nationality = sessionStorage.getItem("nationality");
        var living_town = sessionStorage.getItem("living_town"); 
        var email = sessionStorage.getItem("email");
        var phone = sessionStorage.getItem("phone");
        var address = sessionStorage.getItem("address");
        var status = sessionStorage.getItem("status");
        var date_added = sessionStorage.getItem("date_added");
       
        $('.imagePreview').css('background-image', "url(" + domain_api + "/uploads/profile-photos/" + encodeURIComponent(profile_photo) + ")");
        $('.imagePreview').hide();
        $('.imagePreview').fadeIn(650);
        $(".fullname").html(fullname);
        $(".status").html(status);
        $(".employer_id").html(unique_user_id);
        $(".country").html(nationality);
        $(".living_town").html(living_town);
        $(".email").html(email);
        $(".phone").html(phone);
        $(".address").html(address);
        $(".date_added").html(date_added);
    });

</script>