<?php
/**
 * profile.php -- Profile page
 */

include '../inc/config.inc.php'; // Configuration

ob_start();
session_start();

//date_default_timezone_set('Africa/Lagos');

error_reporting(E_ALL);
ini_set('display_errors', 1);

if ( !isset($_SESSION['user']) || $_SESSION["loggedin"] !== true || trim($_SESSION['user']) == '' ){
	header('Location: ' . $BASE_URL . 'signin');
	exit;
}

// User Details
$stmt = $db_con->prepare("SELECT * FROM users WHERE id=:user_id");
$stmt->execute(array(":user_id"=>$_SESSION['user']));
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);

?>

<!doctype html>
<html lang="en-uk">
<head>
    <!-- Required meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="keywords" content="investment, Forex, Trading, Bitcoin, Cryptocurrency, Global investment, Live Trade, Trading class, indics">
    <meta name="author" content="Paul HubWeb & Tech">
    <meta name="theme-color" content="#313131" />
    <!-- Site Properties -->
    <title>Profile - mextrades</title>
    <link rel="shortcut icon" href="../img/Signals-Alert-3.png" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" href="../img/Signals-Alert-3.png">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Typography CSS -->
    <link rel="stylesheet" href="css/typography.css">
    <!-- Style CSS -->
    <link rel="stylesheet" href="css/style.css">
    <!-- Responsive CSS -->
    <link rel="stylesheet" href="css/responsive.css">
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }

        .header {
            overflow: none;
            background-color: none;
            padding: 20px 10px;
            padding-left: 5px;
            position: fixed;
        }

                /*.header a {
        float: center;
        width:30px;
        color: #fff;
        text-align: center;
        padding: 12px;
        text-decoration: none;
        font-size: 18px; 
        line-height: 25px;
        border-radius: 4px;
        background-color:rgb(196, 0, 0);
        border-color: rgb(196, 0, 0);
        }*/

        .header a.logo {
            font-size: 25px;
            font-weight: bold;
        }

                /*.header a:hover {
        background-color:  #010847;
        color: #fff;
        }*/

                /*.header a.active {
        background-color: dodgerblue;
        color: white;
        }*/

        .header-center {
            float: left;
        }

        @media screen and (max-width: 500px) {
            .header a {
                float: none;
                display: block;
                text-align: left;
            }

            .header-right {
                float: none;
            }
        }
    </style>

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" rel="stylesheet" />
    <style>
        /*------ Google Font Style ------ */
        body {font-family:'Roboto'!important;}
    </style>

</head>
<body class="sidebar-main-active right-column-fixed">
    <!-- loader Start -->
    <!-- loader END -->
    <!-- Wrapper Start -->
    <div class="wrapper">
        
        <!-- Page Content  -->
        <div id="content-page" class="content-page" style="margin-top:50px;">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="iq-card">
                            <div class="iq-card-body profile-page p-0">
                                <div class="profile-header">
                                    <div class="cover-container">
                                        <!--images/page-img/profile-bg.jpg-->
                                        <img src="images/page-img/profile-bg.jpg" alt="profile-bg" class="rounded img-fluid w-100">
                                        <ul class="header-nav d-flex flex-wrap justify-end p-0 m-0">
                                            <li><span class="d-inline-block" data-trigger="hover" data-toggle="popover" data-content="Edit Profile Details"><a href="edit"><i class="ri-pencil-line"></i></a></span></li>
                                            <li><span class="d-inline-block" data-trigger="hover" data-toggle="popover" data-content="Change Password"><a href="edit"><i class="ri-settings-4-line"></i></a></span></li>
                                        </ul>
                                    </div>
                                    <div class="profile-info iq-card-body">
                                        <div class="row align-items-center">
                                            <div class="col-sm-12 col-md-6">
                                                <div class="user-detail">
                                                    <div class="d-flex flex-wrap align-items-center">
                                       
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12 profile-center">
                        <div class="tab-content">
                            <div class="tab-pane fade active show" id="profile-feed" role="tabpanel">
                                <div class="iq-card">
                                    <div class="iq-card-body p-0">
                                        <div class="user-post-data p-3">
                                            <div class="d-flex flex-wrap">
                                                <div class="media-support-user-img mr-3">
                                                    <?php
                                                            if ( empty($userRow['picture']) ){
                                                                echo '<img class="profile-pic" src="images/user/11.png" alt="profile-pic" style="width:120px; height:180px; padding-bottom:50px">';
                                                            } else {
                                                                echo '<img class="profile-pic" src="uploads/'.$userRow['picture'].'" alt="profile-pic" style="width:120px; height:180px; padding-bottom:50px">';
                                                            }
                                                            ?></a> <a href="profile" style="color:#000; padding-left:40px;"><b style="font-size:20px;"><?= $userRow['fullname']; ?>
                                                </div>
                                                <div class="iq-header-title">
                                                    <h4 class="card-title">Profile</h4>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="comment-area p-3">
                                            <div class="iq-card-header d-flex justify-content-between">
                                                <div class="iq-header-title">
                                                    <h4 class="card-title">About User</h4>
                                                </div>
                                            </div>
                                            <div class="iq-card-body">
                                                <div class="mt-2">
                                                    <h6>Name:</h6>
                                                    <p><?= $userRow['fullname']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Username:</h6>
                                                    <p><?= $userRow['username']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Gender:</h6>
                                                    <p><?= $userRow['gender']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Date of Birth:</h6>
                                                    <p><?= $userRow['dob']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Age:</h6>
                                                    <p><?= $userRow['age']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Marital Status:</h6>
                                                    <p><?= $userRow['marital_status']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Contact:</h6>
                                                    <p><a href="callto:<?= $userRow['phone']; ?>"><?= $userRow['phone']; ?></a></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Email:</h6>
                                                    <p><a href="mailto:<?= $userRow['email']; ?>"><?= $userRow['email']; ?></a></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Address:</h6>
                                                    <p><?= $userRow['home_address']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>City:</h6>
                                                    <p><?= $userRow['city']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Zip/Postal Code:</h6>
                                                    <p><?= $userRow['postal_code']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Country:</h6>
                                                    <p><?= $userRow['country']; ?></p>
                                                </div>
                                                <div class="mt-2">
                                                    <h6>Currency:</h6>
                                                    <p><?= $userRow['currency']; ?></p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Wrapper END -->
    <?php include 'footer.php' ?>
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- Appear JavaScript -->
    <script src="js/jquery.appear.js"></script>
    <!-- Countdown JavaScript -->
    <script src="js/countdown.min.js"></script>
    <!-- Counterup JavaScript -->
    <script src="js/waypoints.min.js"></script>
    <script src="js/jquery.counterup.min.js"></script>
    <!-- Wow JavaScript -->
    <script src="js/wow.min.js"></script>
    <!-- Apexcharts JavaScript -->
    <script src="js/apexcharts.js"></script>
    <!-- Slick JavaScript -->
    <script src="js/slick.min.js"></script>
    <!-- Select2 JavaScript -->
    <script src="js/select2.min.js"></script>
    <!-- Owl Carousel JavaScript -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- Magnific Popup JavaScript -->
    <script src="js/jquery.magnific-popup.min.js"></script>
    <!-- Smooth Scrollbar JavaScript -->
    <script src="js/smooth-scrollbar.js"></script>
    <!-- lottie JavaScript -->
    <script src="js/lottie.js"></script>
    <!-- am core JavaScript -->
    <script src="js/core.js"></script>
    <!-- am charts JavaScript -->
    <script src="js/charts.js"></script>
    <!-- am animated JavaScript -->
    <script src="js/animated.js"></script>
    <!-- am kelly JavaScript -->
    <script src="js/kelly.js"></script>
    <!-- am maps JavaScript -->
    <script src="js/maps.js"></script>
    <!-- am worldLow JavaScript -->
    <script src="js/worldLow.js"></script>
    <!-- Style Customizer -->
    <script src="js/style-customizer.js"></script>
    <!-- Chart Custom JavaScript -->
    <script src="js/chart-custom.js"></script>
    <!-- Custom JavaScript -->
    <script src="js/custom.js"></script>

</body>
</html>