����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 162.0.232.25 / Your IP : 3.142.135.24 Web Server : LiteSpeed System : Linux premium276.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : kwacuqig ( 988) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/kwacuqig/bm1holdings-ltd.com/ |
Upload File : |
<?php include './header.php'; include './assets/php/connect.php'; if (!loggedin()) { header('location:login'); } //selecting user data $user = $_COOKIE['uid']; $query1 = "SELECT `firstname`,`surname`,`email`,`mobile`,`password` FROM `users` WHERE `uid`='$user'"; if ($run1 = mysqli_query($conn, $query1)) { list($firstname, $surname, $email, $mobile, $password) = mysqli_fetch_array($run1); } else { die(mysqli_error($conn)); } ?> <div class="breadcrumbs"> <div class="container"> <div class="row"> <div class="col-12"> <div class="bread-inner"> <ul class="bread-list"> <li><a href="home">Home<i class="ti-arrow-right"></i></a></li> <li class="active"><a href="edit-profile">Edit Profile</a></li> </ul> </div> </div> </div> </div> </div> <?php if (isset($_POST['submit'])) { $fname = mysqli_real_escape_string($conn, htmlentities($_POST['fname'])); $lname = mysqli_real_escape_string($conn, htmlentities($_POST['lname'])); $email = mysqli_real_escape_string($conn, htmlentities($_POST['email'])); $mobile = mysqli_real_escape_string($conn, htmlentities($_POST['mobile'])); $password = mysqli_real_escape_string($conn, htmlentities($_POST['password'])); $hashed = md5($password); if (empty($password)) { $query2 = "UPDATE `users` SET `firstname`='$fname',`surname`='$lname',`email`='$email',`mobile`='$mobile' WHERE `uid`='$user'"; if ($run2 = mysqli_query($conn, $query2)) { ?> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { swal("SUCCESS", "Profile was successfully updated", "success"); setTimeout(function() { window.location = 'edit-profile' }, 2000); }); </script> <?php } else { die(mysqli_error($conn)); } } else { $query2 = "UPDATE `users` SET `firstname`='$fname',`surname`='$lname',`email`='$email',`mobile`='$mobile',`password`='$hashed' WHERE `uid`='$user'"; if ($run2 = mysqli_query($conn, $query2)) { ?> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { swal("SUCCESS", "Profile was successfully updated", "success"); setTimeout(function() { window.location = 'edit-profile' }, 2000); }); </script> <?php } else { die(mysqli_error($conn)); } } } ?> <section class="shop section"> <div class="container"> <div class="row"> <div class="col-l2"> <div class="account-content bg-white pt-0"> <h4 class="account-content-title"><i class="far fa-user"></i> Edit Profile</h4> <div class="edit-profile"> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST"> <div class="row"> <div class="col-lg-6"> <div class="mb-3"> <label for="fname" class="form-label">First Name</label> <input type="text" name="fname" class="form-control" value="<?php echo $firstname; ?>" id="fname"> </div> </div> <div class="col-lg-6"> <div class="mb-3"> <label for="lname" class="form-label">Last Name</label> <input type="text" name="lname" class="form-control" value="<?php echo $surname; ?>" id="lname"> </div> </div> <div class="col-lg-6"> <div class="mb-3"> <label for="email" class="form-label">Email</label> <input type="email" name="email" class="form-control" value="<?php echo $email; ?>" id="email"> </div> </div> <div class="col-lg-6"> <div class="mb-3"> <label for="phone" class="form-label">Phone</label> <input type="text" name="mobile" class="form-control" value="<?php echo $mobile; ?>" id="phone"> </div> </div> <div class="col-12-6"> <div class="mb-3"> <label for="password" class="form-label">Password</label> <input type="password" name="password" class="form-control" id="password"> </div> </div> </div> <button class="btn" type="submit" name="submit">Save Changes</button> </form> </div> </div> </div> </div> </div> </section> <?php include './footer.php'; include './scripts.php'; ?> <script> document.querySelector("title").innerText="BM 1 HOLDINGS LTD - PROFILE"; document.querySelectorAll(".menu-area ul li")[7].classList.add("active"); document.querySelectorAll(".slicknav_nav li a")[8].style.color="blue"; </script>