Hacked By AnonymousFox

Current Path : /home/krishnamexports/www/
Upload File :
Current File : /home/krishnamexports/www/accounts.php

<?php include("common/header.php");?>
 <main>        
        <?php 
		if(!isset($_SESSION['KXloginId'])){ 
			header("location:".DEFAULT_URL);
		}else{
			$sqlCustomer     = mysqli_query($cn,"select * from `tbl_register` where `id`='".$_SESSION['KXloginId']."'");
			$sqlCustomerData = mysqli_fetch_array($sqlCustomer); 
		}?>        
        <div class="my-account-wrapper section-padding">
            <div class="container">
                <div class="section-bg-color">
                    <div class="row">
                        <div class="col-lg-12">
                            <!-- My Account Page Start -->
                            <div class="myaccount-page-wrapper">
                                <!-- My Account Tab Menu Start -->
                                <div class="row">
                                    <div class="col-lg-3 col-md-4">
                                        <div class="profile-name">
                                            <small>Hello</small>
                                            <p><?php echo $sqlCustomerData['name'];?></p>
                                        </div>
                                        <div class="myaccount-tab-menu nav" role="tablist">
                                            <a href="<?php echo DEFAULT_URL;?>accounts" class="active"><i class="fa fa-user"></i> ACCOUNT DETAILS</a>
                                            <a href="<?php echo DEFAULT_URL;?>orders"><i class="fa fa-cart-arrow-down"></i> ORDERS</a>                                                                                        
                                            <a href="<?php echo DEFAULT_URL;?>logout"><i class="fa fa-sign-out"></i> LOGOUT</a>
                                        </div>
                                    </div>
                                    <!-- My Account Tab Menu End -->

                                    <!-- My Account Tab Content Start -->
                                    <div class="col-lg-9 col-md-8">
                                        <div class="myaccount-content">
                                        	<?php if(isset($_SESSION['successMsg'])){ echo "<br>".$_SESSION['successMsg']; unset($_SESSION['successMsg']);}?>
                                            <h5>ACCOUNT DETAILS</h5>
                                            <div class="account-details-form">
                                                <form action="" method="post">
                                                    <div class="row">
                                                        <div class="col-lg-6">
                                                            <div class="single-input-item">
                                                                <label for="first-name" class="required">Full Name</label>
                                                                <input type="text" name="name" placeholder="Full Name" value="<?php echo $sqlCustomerData['name'];?>" required/>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-6">
                                                            <div class="single-input-item">
                                                                <label for="last-name" class="required">Mobile</label>
                                                                <input type="text" name="mobile" placeholder="Mobile" value="<?php echo $sqlCustomerData['mobile'];?>" minlength="10" maxlength="10"/>
                                                            </div>
                                                        </div>
                                                    </div>
                                                                                                                
                                                    <div class="single-input-item">
                                                        <label for="email" class="required">Email Addres</label>
                                                        <input type="email" name="email" placeholder="Email Address" value="<?php echo $sqlCustomerData['email'];?>" required/>
                                                    </div>
                                                    
                                                    <div class="single-input-item">
                                                        <button type="submit" name="account" class="btn btn-sqr">Save Changes</button>
                                                    </div>
                                                </form>
                                                
                                                <form action="" method="post"><br><br>                                                                                                                       
                                                    <fieldset>
                                                    	<?php if(isset($_SESSION['successMsg2'])){ echo "<br>".$_SESSION['successMsg2']; unset($_SESSION['successMsg2']);}?>
                                                        <legend>CHANGE PASSWORD</legend>
                                                        <div class="single-input-item">
                                                            <label for="current-pwd" class="required">Current Password</label>
                                                            <input type="password" name="password" placeholder="Current Password" required/>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-lg-6">
                                                                <div class="single-input-item">
                                                                    <label for="new-pwd" class="required">New Password</label>
                                                                    <input type="password" name="npassword" placeholder="New Password" required/>
                                                                </div>
                                                            </div>
                                                            <div class="col-lg-6">
                                                                <div class="single-input-item">
                                                                    <label for="confirm-pwd" class="required">Confirm Password</label>
                                                                    <input type="password" name="cpassword" placeholder="Confirm Password" required/>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </fieldset>
                                                    <div class="single-input-item">
                                                        <button type="submit" name="change" class="btn btn-sqr">Save Changes</button>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div> 
                                    <!-- My Account Tab Content End -->
                                </div>
                            </div> <!-- My Account Page End -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- checkout main wrapper end -->
    </main>
    <?php		
	if(isset($_POST['account']))
	{
		$name      = mysqli_real_escape_string($cn,$_POST['name']);
		$mobile    = mysqli_real_escape_string($cn,$_POST['mobile']);
		$email     = mysqli_real_escape_string($cn,$_POST['email']);
		$sqlOrder  = mysqli_query($cn,"update `tbl_register` SET `name`='".$name."', `mobile`='".$mobile."', `email`='".$email."' where `id`='".$_SESSION['KXloginId']."'");
		if($sqlOrder)
		{
			$_SESSION['successMsg'] =  '<div class="alert alert-success"><strong>Success!</strong> Profile Successfully Updated.</div>';
		}
		else
		{
			$_SESSION['successMsg'] = '<div class="alert alert-danger"><strong>Warring ! </strong> Sorry, something went wrong. Try Again.</div>';
		}
		header("location:".$_SERVER['REQUEST_URI']);
	}
	
	if(isset($_POST['change']))
	{
		$password  = $_POST['password'];	
		$npassword = $_POST['npassword'];
		$cpassword = $_POST['cpassword'];		
		if($npassword==$cpassword)
		{
			$password = $password;
			$sqlUser  = mysqli_query($cn, "select `id` from tbl_register where `id`='".$_SESSION['KXloginId']."' and `password`='".$password."'")or die(mysql_error("login issue"));
			if(mysqli_num_rows($sqlUser)>0)
			{
				$sqlUserData = mysqli_fetch_array($sqlUser);		
				mysqli_query($cn, "update tbl_register SET `password`='".$npassword."' where `id`='".$sqlUserData['id']."'");
				$_SESSION['successMsg2'] =  '<div class="alert alert-success"><strong>Success!</strong> Password Change Successfully.</div>';
			}
			else
			{
				$_SESSION['successMsg2'] = '<div class="alert alert-danger"><strong>Danger!</strong> Current Password Not Matched.</div>';				
			}		
		}
		else
		{
			$_SESSION['successMsg2'] = '<div class="alert alert-danger"><strong>Danger!</strong> New and confirm Password Not Matched.</div>';
		}
		header("location:".$_SERVER['REQUEST_URI']);	
	}
	?>
    <!-- footer area start -->    
 	<?php include("popup/loginsignup.php");?>
    <?php include("common/footer.php");?>
    <!-- footer area end -->    
    <!-- offcanvas mini cart start -->
    <?php include("popup/mini-cart.php");?>    
    <!-- Modernizer JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/vendor/modernizr-3.6.0.min.js"></script>
    <!-- jQuery JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/vendor/jquery-3.3.1.min.js"></script>
    <!-- Popper JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/vendor/popper.min.js"></script>
    <!-- Bootstrap JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/vendor/bootstrap.min.js"></script>
    <!-- slick Slider JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/slick.min.js"></script>
    <!-- Countdown JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/countdown.min.js"></script>
    <!-- Nice Select JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/nice-select.min.js"></script>
    <!-- jquery UI JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/jqueryui.min.js"></script>
    <!-- Image zoom JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/image-zoom.min.js"></script>
    <!-- Imagesloaded JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/imagesloaded.pkgd.min.js"></script>
    <!-- Instagram feed JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/instagramfeed.min.js"></script>
    <!-- mailchimp active js -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/ajaxchimp.js"></script>
    <!-- contact form dynamic js -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/ajax-mail.js"></script>
    <!-- google map api -->
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCfmCVTjRI007pC1Yk2o2d_EhgkjTsFVN8"></script>
    <!-- google map active js -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/plugins/google-map.js"></script>
    <!-- Main JS -->
    <script src="<?php echo DEFAULT_URL;?>assets/js/main.js"></script>
	<script src="<?php echo DEFAULT_URL;?>js/blockui.min.js"></script>    
	<script src="<?php echo DEFAULT_URL;?>js/function.js"></script>
	<script>
	$(document).ready(function(){
		$("#signup").click(function(){
		$(".log-in").css("display", "none");
		$(".sign-up").css("display", "block");
		});
	});
	$(document).ready(function(){
		$("#login").click(function(){
		$(".log-in").css("display", "block");
		$(".sign-up").css("display", "none");
		});
	});
    </script>
</body>
</html>

Hacked By AnonymousFox1.0, Coded By AnonymousFox