<?php

include("../config.php");
session_start();

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
}else{
		header("location: ../register-login.php");
	}
	

		//get user info
		
		$stmt="SELECT * FROM users WHERE userid = :userid";
		$stmt=$pdo->prepare($stmt);
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$row=$stmt->fetch();
		$userimage = (!empty($row["profilepix"]) ? "../img/users/".$row["profilepix"]: "../img/avatar.png");
		
	
	
?>

<style>
form label{
	font-weight:500!important;
	color:#444;
	cursor:pointer;
	font-size:16px!important;
}
</style>


<!DOCTYPE html>

<html lang="en">

<head>

        <meta charset="utf-8" />

        <title> Visitors Messages | Six Digital Assets</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <meta name="keywords" content="trade, trading, forex, investing, invest, investment, investor, money, chart, bitcoin, ethereum, USDT, coins, cryptocurrencies, crypto, profit, market, online money, money online,">
    <meta name="description" content="Six Digital Assets provides a full investment service focused on the Bitcoin and cryptocurrency trading market. A certified legal investment company incorporated and headquartered in Australia.">
    <meta name="author" content="Six Digital Assets">

        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

      

            <link rel="stylesheet" type="text/css" href="w3.css">

        <!-- Bootstrap Css -->

        <link href="assets/css/bootstrap.min.css" id="bootstrap-stylesheet" rel="stylesheet" type="text/css" />

        <!-- Icons Css -->

        <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

        <!-- App Css-->

        <link href="assets/css/app.min.css" id="app-stylesheet" rel="stylesheet" type="text/css" />

		<link href="../css/style7eda3860.css" rel="stylesheet">

    </head>



    <body>


	<div class='coversoverlay'>
	<center><img src="../img/loader.gif" style="width:60px; margin-top:20%;"></center>
	</div>

  <!-- Begin page -->
  <div id="wrapper" style="overflow:auto!important">

   
   
   <!-- Topbar Start -->
	<?php
	include("header.php");
	?>
    <!-- end Topbar -->
   

    <!-- ========== Left Sidebar Start ========== -->
    <div class="left-side-menu">

      <div class="slimscroll-menu">

        <!-- User box -->
        <div class="user-box text-center ">

          <div class="dropdown">
            <a href="#" class="user-name dropdown-toggle h5 mt-2 mb-1 d-block" data-toggle="dropdown" aria-expanded="false"></a>
            <div class="dropdown-menu user-pro-dropdown">




            </div>
          </div>


        </div>

        <!--- Sidemenu -->
        <?php include("sidebar.php");?>
		
        <!-- End Sidebar -->
        <div class="clearfix"></div>



                </div>

                <!-- Sidebar -left -->



            </div>

            <!-- Left Sidebar End -->







            <div class="content-page" >

                <div class="content" style="width: 100%;color: white;">



                    <!-- Start Content-->

                    <div class="container-fluid" >

                        <div id="google_translate_element"></div>

                         <div class="row">

                            <div class="col-md-12" style="padding-left:0px; padding-right:0px">
                            
						
						
				<div class="col-md-8" style="margin-top:20px!important;margin: auto;">
                <div class="card-box">
				
				
				
				
				
				<h3 class="text-center" style="">Support Messages</h3>
				<div class="dropdown-divider"></div><p><br><br>
				
		
			<?php
				
		$stmt=$pdo->prepare("SELECT * FROM visitorsmessage");
		$stmt->execute();
		if($stmt->rowCount()<1){
			echo '<h3 class="text-center" style="color:#bbb"><i class="fas fa-trash"></i> Inbox is empty</h3>';
		}else{
		
		$msgs=$stmt->fetchAll();
		foreach($msgs as $msg){
		
		
		?>	
				
			

			
			<div class="col-md-9" style="border-radius: 10px;padding: 10px;margin: auto;background: #fbfbfb;border: 1px solid #dfe1e3;">
		
			<div style="color: #50677b;margin: 10px 5px 10px;font-size: 18px;font-weight: 550;"><?php echo htmlspecialchars($msg["name"])?></div>
			<div style="font-size:13px; margin: 5px 5px 10px; color:#949cac;"><?php echo htmlspecialchars($msg["received"])?></div>
			<div class="dropdown-divider" style="border-color:#dfe1e3"></div>
			
			<div style="color: #6a6a6a;margin: 10px;font-size: 16px;line-height: 25px;">
			<?php echo htmlspecialchars($msg["message"])?>
			</div>	
			<br>
			<div class="dropdown-divider" style="border-color:#dfe1e3"></div>
		
			<a href="tel:<?php echo htmlspecialchars($msg["phone"])?>"><div style="font-size:13px; margin: 5px 5px 10px; color:#949cac;">
			<i class="fa fa-phone"></i> Phone - <?php echo htmlspecialchars($msg["phone"])?></div></a>
			
			<?php if(!empty($msg["email"])){?>
			<div style="display: block;height:25px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; font-size:13px; margin: 0px 5px 5px;color:#949cac;">
			<a href="mailto:<?php echo htmlspecialchars($msg["email"])?>" style="color:#949cac;">
			<i class="fa fa-envelope"></i>  Email - <?php echo htmlspecialchars($msg["email"]);?></a></div>
		
			
			</div><p><br>
			<?php } } ?>
			
			
			
		<?php }?>
			
			
					</div>
					</div> 



                </div> <!-- content -->
                </div> 
              
					</div> <!-- container-fluid -->
	
					</div>
               


       

        <!-- Vendor js -->

        <script src="assets/js/vendor.min.js"></script>



        <!-- knob plugin -->

        <script src="assets/libs/jquery-knob/jquery.knob.min.js"></script>



        <!--Morris Chart-->

        <script src="assets/libs/morris-js/morris.min.js"></script>

        <script src="assets/libs/raphael/raphael.min.js"></script>



        <!-- Dashboard init js-->

        <script src="assets/js/pages/dashboard.init.js"></script>



        <!-- App js -->

        <script src="assets/js/app.min.js"></script>

   
   
   
   
   
   
   
   
   
   <script>
   
   $(document).ready(function(){
	
	$('.coversoverlay').hide();
		 
 
 //send message
 
 $("#updatePass").click(function(e){
	 e.preventDefault();
	 
		let updatePass = "updatePass";
			
		let oldPassword = $("#oldPassword").val();
		let password = $("#password").val();
		let ConfirmPassword = $("#ConfirmPassword").val();
		

		$.ajax({
			url:'function.php',
			method:'POST',
			data:{updatePass:updatePass, password:password, ConfirmPassword:ConfirmPassword, oldPassword:oldPassword},
			beforeSend:function(){$(".coversoverlay").show()},
			success:function(data){
				$("#result").html(data);
				
				//console.log(data);
				$(".coversoverlay").hide();
				
			}
		});
		
		});
	
 
 
 
	 
   });
   
   
   
   
   </script>
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    </body>

</html>