<!DOCTYPE html>
<html lang="zxx">
	<head>
    <?php include("head.php"); ?>
    <?php include("module/service.php"); ?>
    <link href="assets/stylesheet/jquery.growl.css" rel="stylesheet" type="text/css" />
    <?php include("module/usercheck.php"); ?>
	<?php include("module/userinfo.php"); ?>
    



<?php
		if(isset($_POST['passchange']))	{

			$oldpass=$_POST['oldpass'];
			$newpass=$_POST['newpass'];
			$confirmpass=$_POST['confirmpass'];
            if($newpass==$confirmpass){
                //chech old password correct
                $checkpass=$service_query->check_password($con,$oldpass,$userid);
                if($checkpass==0){
                    ?>
                    <script>
                    $(document).ready(function() {
                        $.growl.error({
                            message: "Old password Incorrect..!!"
                        });
                    });
                    </script>
                    <?php
                }else{
                    $uupdate=$service_query->update_password($con,$newpass,$userid);
                    if ($uupdate>0) {
                        ?>
                    <script>
                    $(document).ready(function() {
                        $.growl.notice({
                            message: "Profile Updated..!!"
                        });
                    });
                    </script>
                    <?php
                    
                    } else {
                        ?>
                    <script>
                    $(document).ready(function() {
                        $.growl.error({
                            message: "Server Problem..!!"
                        });
                    });
                    </script>
                    <?php
                    
                    }
                }
               
            }else{
                ?>
                <script>
                $(document).ready(function() {
                    $.growl.error({
                        message: "Password & Confirm Password should be same.!!"
                    });
                });
                </script>
                <?php
            }
			
		}
	?>
    </head>
	
    <body class="blue-skin dashboard">
        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->
        <div id="preloader"><div class="preloader"><span></span><span></span></div></div>
		
        <!-- ============================================================== -->
        <!-- Main wrapper - style you can find in pages.scss -->
        <!-- ============================================================== -->
        <div id="main-wrapper">
		
            <!-- ============================================================== -->
            <!-- Top header  -->
            <!-- ============================================================== -->
            <!-- Start Navigation -->
			<?php include("header1.php"); ?>
			<!-- End Navigation -->
			<div class="clearfix"></div>
			<!-- ============================================================== -->
			<!-- Top header  -->
			<!-- ============================================================== -->
			
			<!-- ============================ Page Title Start================================== -->
			<div class="page-title">
				<div class="container">
					<div class="row">
						<div class="col-lg-12 col-md-12">
							
							<h2 class="ipt-title">Welcome!</h2>
							<span class="ipn-subtitle">Welcome To Your Account</span>
							
						</div>
					</div>
				</div>
			</div>
			<!-- ============================ Page Title End ================================== -->
			
			<!-- ============================ User Dashboard ================================== -->
			<section class="bg-light">
				<div class="container-fluid">
					<div class="row">
						<div class="col-lg-12 col-md-12">
							<div class="filter_search_opt">
								<a href="javascript:void(0);" onclick="openFilterSearch()">Dashboard Navigation<i class="ml-2 ti-menu"></i></a>
							</div>
						</div>
					</div>
								
					<div class="row">
						
						<div class="col-lg-3 col-md-12">
							
							<div class="simple-sidebar sm-sidebar" id="filter_search">
								
								<div class="search-sidebar_header">
									<h4 class="ssh_heading">Close Filter</h4>
									<button onclick="closeFilterSearch()" class="w3-bar-item w3-button w3-large"><i class="ti-close"></i></button>
								</div>
								
								<?php include("dashboard-menu.php")?>
								
							</div>
						</div>
						
						<div class="col-lg-9 col-md-12">
							<div class="dashboard-wraper">
							<form action="" method="POST">
								<!-- Basic Information -->
								<div class="form-submit">	
									<h4>Change Your Password</h4>
									<div class="submit-section">
										<div class="row">
										
											<div class="form-group col-lg-12 col-md-6">
												<label>Old Password</label>
												<input type="password" name="oldpass" class="form-control">
											</div>
											
											<div class="form-group col-md-6">
												<label>New Password</label>
												<input type="password" name="newpass" class="form-control">
											</div>
											
											<div class="form-group col-md-6">
												<label>Confirm password</label>
												<input type="password" name="confirmpass" class="form-control">
											</div>
											
											<div class="form-group col-lg-12 col-md-12">
												<button class="btn btn-theme-light-2 rounded" name="passchange" type="submit">Save Changes</button>
											</div>
											
										</div>
									</div>
								</div>
                            </form>
							</div>
						</div>
						
					</div>
				</div>
			</section>
			<!-- ============================ User Dashboard End ================================== -->
			<!-- ============================ Call To Action ================================== -->
			<section class="theme-bg call-to-act-wrap">
				<div class="container">
					<div class="row">
						<div class="col-lg-12">
							
							<div class="call-to-act">
								<div class="call-to-act-head">
									<h3>Want to Become a Real Estate Agent?</h3>
									<span>We'll help you to grow your career and growth.</span>
								</div>
								<a href="#" class="btn btn-call-to-act">SignUp Today</a>
							</div>
							
						</div>
					</div>
				</div>
			</section>
			<!-- ============================ Call To Action End ================================== -->
			
			<!-- ============================ Footer Start ================================== -->
            <?php include("footer.php"); ?>
			
			<a id="back2Top" class="top-scroll" title="Back to top" href="#"><i class="ti-arrow-up"></i></a>
			

		</div>
		<!-- ============================================================== -->
		<!-- End Wrapper -->
		<!-- ============================================================== -->
		

		<!-- ============================================================== -->
		<!-- All Jquery -->
		<!-- ============================================================== -->
		<?php include("foot.php"); ?>
		<!-- ============================================================== -->
		<!-- This page plugins -->
		<!-- ============================================================== -->
		
		<script>
			function openFilterSearch() {
				document.getElementById("filter_search").style.display = "block";
			}
			function closeFilterSearch() {
				document.getElementById("filter_search").style.display = "none";
			}
		</script>
        <script src="assets/javascript/jquery.growl.js" type="text/javascript"></script>

	</body>
</html>