<?php
session_start();
require_once '../../../../classconn/class.user.php';
require_once '../../../../action/usercontrol/setup.php';
require_once '../../../../action/sessiontimer/intimer.php';
require_once '../../../../action/usercontrol/logout.php';
require_once '../../../../action/changepassword/change.php';
require_once '../../../../action/getIP/ip.php';
$price_in_btc = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=" . $userRow['balance']);
$stmt = $actionParam->runQuery("SELECT SUM(amount) as amount FROM tbl_earning WHERE email=:email");
$stmt->execute(array(":email"=>$uemail));
$profitRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>


<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Sescentigate | ProfileSettings</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="images/favicon.png">
    <!-- Custom Stylesheet -->
    <link rel="stylesheet" href="vendor/waves/waves.min.css">
    <link rel="stylesheet" href="css/style.css">
</head>

<body>

    <div id="preloader">
        <div class="sk-three-bounce">
            <div class="sk-child sk-bounce1"></div>
            <div class="sk-child sk-bounce2"></div>
            <div class="sk-child sk-bounce3"></div>
        </div>
    </div>

    <div id="main-wrapper">

        <div class="header dashboard">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-xl-12">
                        <nav class="navbar navbar-expand-lg navbar-light px-0 justify-content-between">
                            <a class="navbar-brand"  href="index"><img src="images/logo.png" alt=""></a>

                            <div class="header-right d-flex my-2 align-items-center">
                                <div class="language">
                                    <div class="dropdown">
                                        
                                </div>
                                <div class="dashboard_log">
                                    <div class="profile_log dropdown">
                                        <div class="user" data-toggle="dropdown">
                                            <span class="thumb"><i class="mdi mdi-account"></i></span>
                                            <span class="arrow"><i class="la la-angle-down"></i></span>
                                        </div>

                                        <div class="dropdown-menu dropdown-menu-right">
                                            <div class="user-email">
                                                <div class="user">
                                                    <i class="thumb"><i class="mdi mdi-account"></i></i>
                                                    <div class="user-info">
                                                        <h6><?php echo ucfirst($userRow['fullname']); ?></h6>
                                                        <span><?php echo ucfirst($userRow['email']); ?></span>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="user-balance">
                                                <div class="available">
                                                    <p>Available</p>
                                                    <span><?php echo number_format($userRow['balance'],2); ?> USD</span>
                                                </div>
                                                <div class="total">
                                                    <p>Total Profits</p>
                                                    <span><?php echo number_format($userRow['profit'],2); ?> USD</span>
                                                </div>
                                            </div>
                                            <a href="profilesettings" class="dropdown-item">
                                                <i class="mdi mdi-account"></i> Profile
                                            </a>
                                            <a href="deposits" class="dropdown-item">
                                                <i class="mdi mdi-history"></i> History
                                            </a>
                                            <a href="?logout" class="dropdown-item logout">
                                                <i class="mdi mdi-logout"></i> Logout
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
        <div class="sidebar">
            <div class="menu">
                <ul>
                    <li>
                        <a href="index" data-toggle="tooltip" data-placement="right" title="Dashboard">
                            <span><i class="mdi mdi-view-dashboard"></i></span>
                        </a>
                    </li>
                    <li>
                        <a href="depositfunds" data-toggle="tooltip" data-placement="right" title="Deposit">
                            <span><i class="mdi mdi-face-profile"></i></span>
                        </a>
                    </li>
                    <li>
                        <a href="crypto" data-toggle="tooltip" data-placement="right" title="Buy Crypto">
                            <span><i class="mdi mdi-tumblr-reblog"></i></span>
                        </a>
                    </li>
                    <li>
                        <a href="deposits" data-toggle="tooltip" data-placement="right" title="Transactions">
                            <span><i class="mdi mdi-database"></i></span>
                        </a>
                    </li>
                    <li>
                        <a href="profilesettings" data-toggle="tooltip" data-placement="right" title="Profile">
                            <span><i class="mdi mdi-account"></i></span>
                        </a>
                    </li>
                    <li>
                        <a href="?logout" data-toggle="tooltip" data-placement="right" title="Logout">
                            <span><i class="mdi mdi-power"></i></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="page-title dashboard">
            <div class="container">
                <div class="row">
                    <div class="col-6">
                        <div class="page-title-content">
                            <p>Welcome Back,
                                <span><?php echo ucfirst($userRow['fullname']); ?></span>
                            </p>
                        </div>
                    </div>
                    <div class="col-6">
                        <ul class="text-right breadcrumbs list-unstyle">
                            
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="content-body">
            <div class="container">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="card sub-menu">
                            <div class="card-body">
                                <ul class="d-flex">
                                    <li class="nav-item">
                                        <a href="profilesettings" class="nav-link">
                                            <i class="mdi mdi-account-settings-variant"></i>
                                            <span>Edit Profile</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="affiliate" class="nav-link">
                                            <i class="mdi mdi-bank"></i>
                                            <span>Affiliate</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                 
                            <div class="col-xl-6 col-md-6">
                                <div class="card">
                                    <div class="card-header">
                                        <h4 class="card-title">Change Password</h4>
                                    </div>
                                    <div class="card-body">
                                        <form action="" method="post">
                                        <?php if(isset($msg)) echo $msg; ?>
                                    <?php if(isset($_GET['password-changed'])) { ?>
                                        <div class="alert alert-success alert-dismissible" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                            Your password has been changed successfully.
                                        </div>
                                    <?php } ?>
                                    <?php if(isset($_GET['incorrect-password'])) { ?>
                                        <div class="alert alert-danger alert-dismissible" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                            Sorry, the password you entered is incorrect.
                                        </div>
                                    <?php } ?>
                                            <div class="form-row">
                                                <div class="form-group col-xl-12">
                                                    <label class="mr-sm-2">Old Password</label>
                                                    <input type="password" class="form-control" placeholder="**********" id="oldpassword" name="oldpassword" required>
                                                </div>
                                                <div class="form-group col-xl-12">
                                                    <label class="mr-sm-2">New Password</label>
                                                    <input type="password" class="form-control"
                                                        placeholder="**********" id="newpassword" name="newpassword" required>
                                                   
                                                </div>
                                                <div class="col-12">
                                                    <button name="btn-change" type="submit" class="btn btn-success waves-effect px-4">Update</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xl-12">
                                <div class="card">
                                    <div class="card-header">
                                        <h4 class="card-title">Personal Information</h4>
                                    </div>
                                    <div class="card-body">
                                        <form method="post" name="myform" class="personal_validate">
                                            <div class="form-row">
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Your Name</label>
                                                    <input type="text" class="form-control" placeholder="<?php echo ucfirst($userRow['fullname']); ?>"
                                                        name="fullname" readonly>
                                                </div>
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Email</label>
                                                    <input type="email" class="form-control"
                                                        placeholder="<?php echo ucfirst($userRow['email']); ?>" name="email" readonly>
                                                </div>
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Country</label>
                                                    <input type="text" class="form-control"
                                                        placeholder="<?php echo ucfirst($userRow['country']); ?>"
                                                        name="permanentaddress" readonly>
                                                </div>
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Phone Number</label>
                                                    <input type="text" class="form-control" placeholder="<?php echo ucfirst($userRow['phone']); ?>"
                                                        name="city" readonly>
                                                </div>
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Wallet Address</label>
                                                    <input type="text" class="form-control" placeholder="<?php echo ucfirst($userRow['wallet_address']); ?>"
                                                        name="postal"readonly>
                                                </div>
                                                <div class="form-group col-xl-6 col-md-6">
                                                    <label class="mr-sm-2">Referral Email</label>
                                                    <input type="text" class="form-control" placeholder="<?php echo ucfirst($userRow['ref_email']); ?>"
                                                        name="postal" readonly>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="footer dashboard">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-8 col-12">
                        <div class="copyright">
                            <p>© Copyright
                                <script>
                                    var CurrentYear = new Date().getFullYear()
                                    document.write(CurrentYear)
                                </script> <a href="https://sescentigate.com">Sescentigate</a> All Rights Reserved
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-4 col-12">
                        <div class="footer-social">
                            <ul>
                            <div id="google_translate_element"></div>
                    <script type="text/javascript">
                    function googleTranslateElementInit() {
                      new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
                    }
                    </script>

                    <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <script src="js/global.js"></script>

    <script src="vendor/waves/waves.min.js"></script>
    <script src="vendor/jquery-ui/jquery-ui.min.js"></script>
    <script src="js/plugins/jquery-ui-init.js"></script>
    <script src="vendor/validator/jquery.validate.js"></script>
    <script src="vendor/validator/validator-init.js"></script>
    <script src="js/scripts.js"></script>

    <script>
    </script>
</body>
</html>