JezK
Edit File: settings.php
<?php include("header.php"); $checkBooking = $users->checkbooking(); ?> <style> div.dataTables_wrapper div.dataTables_filter { position: absolute; top: 154px; } </style> <section class="section-padding"> <div class="container"> <!-- Nav tabs --> <ul class="nav nav-tabs border-0" role="tablist"> <li class="nav-item"> <a class="nav-link active anc-Color" data-toggle="tab" href="#upcoming">CHANGE PASSWORD</a> </li> <!-- <li class="nav-item"> <a class="nav-link anc-Color" data-toggle="tab" href="#factor-auth">2 FACTOR AUTHENTICATION</a> </li> <li class="nav-item"> <a class="nav-link anc-Color" data-toggle="tab" href="#notification">NOTIFICATION SETTTING</a> </li> --> <li class="nav-item"> <a class="nav-link anc-Color" data-toggle="tab" href="#cancelled">DELETE ACCOUNT</a> </li> </ul> <!-- Tab panes --> <div class="tab-content bg-white my-3"> <div id="upcoming" class="container tab-pane active"><br> <div class="container pb-3"> <div class="row"> <form method="post" action="" class="col-sm-6"> <div class="form-group"> <label for="password" class="fieldName">Current Password</label> <div> <input type="password" class="form-control formField-control" name="oldpassword" id="oldpassword"> <span toggle="#oldpassword" class="showHide-1 field-icon-sh toggle-password-1 fieldName-forgot" id="show-1" onclick="showPassword()">Show</span> </div> </div> <div class="form-group"> <label for="password" class="fieldName">New Password</label> <div> <input type="password" class="form-control formField-control" name="newpassword" id="newpassword" onkeypress="return checkSpace(event)" onpaste="return false"> <span toggle="#newpassword" class="showHide-2 field-icon-sh toggle-password-2 fieldName-forgot" id="show-2" onclick="showPassword()">Show</span> </div> </div> <div class="form-group"> <label for="password" class="fieldName">Confirm Password</label> <div> <input type="password" class="form-control formField-control" name="confirmpassword" id="confirmpassword" onkeypress="return checkSpace(event)" onpaste="return false"> <span toggle="#confirmpassword" class="showHide-3 field-icon-sh toggle-password-3 fieldName-forgot" id="show-3" onclick="showPassword()">Show</span> </div> </div> <div class="form-group"> <div class=" " ><button class="btn btn-primary w-100" onclick="return changepassword();">Confirm</a></div> </div> </form> </div> </div> </div> <div id="factor-auth" class="container tab-pane fade"><br> <div class="container pb-3"> <div class=""> <p>Setup two-factor authentication</p> <p class="two-fact-msg-first">Two factor authentication adds an extra layer of security to your account. in addtion to your username and password, you'll need to enter a code that KFy sends ot you via text or an app on your phone</p> </div> <div class="row"> <div class="col-12 col-sm-6 col-xl-6 border-right "> <p>Setup using an App:</p> <p class="two-fact-msg">1. Install google Authenticator on your phone</p> <p class="two-fact-msg">2. Open the Google Authenticator App</p> <p class="two-fact-msg">3. Tap menu,then tap "Set up an account, then tap "Scan a Barcode".</p> <p class="two-fact-msg">4. Your phone will be "Scanning" mode.<br> When your on this mode, Scan QR code below:</p> <p class="two-fact-msg">Once you Scanned the QR enter the 6-digit code below:</p> <div class="form-group col-sm-6 px-0"> <label for="token" class="fieldName">Token</label> <input type="text" class="form-control formField-control w-100" name="token" id="token"> </div> <div class="form-group col-sm-6 px-0 "> <div class=" "><a href="" class="btn btn-primary w-100">Submit</a></div> </div> </div> <div class="col-12 col-sm-6 col-xl-6 "> <p>Setup using SMS:</p> <p class="two-fact-msg">Enter your mobile number to which we shall send you a token</p> <div class="form-group col-sm-6 px-0"> <label for="token" class="fieldName">Mobile number</label> <input type="text" class="form-control formField-control w-100" name="token" id="token"> </div> <div class="form-group col-sm-6 px-0"> <div class=" "><a href="" class="btn btn-primary w-100">Continue</a></div> </div> <div class="form-group col-sm-6 px-0"> <label for="token" class="fieldName">Token</label> <input type="text" class="form-control formField-control w-100" name="token" id="token"> </div> <div class="form-group col-sm-6 px-0"> <div class=" "><a href="" class="btn btn-primary w-100">Submit</a></div> </div> </div> </div> </div> </div> <div id="notification" class="container tab-pane fade"><br> <div class="container pb-3"> <div class=""> <p>Sms Settings</p> <p class="notication-s">you are currently receiving all promotional communications on +91 9876543210 <a href="#" class="text-primary">(change)</a></p> </div> <div class="row"> <div class="col-12 col-sm-4 col-xl-3"> <div class="form-group"> <input type="checkbox" id="test8" > <label for="test8" class=" pt-1">I want to receive:</label> <p class="notication-s">you cab Disable this any time</p> </div> </div> <div class="col-12 col-sm-4 col-xl-4 "> <div class="form-group"> <input type="checkbox" id="test9" > <label for="test9" class=" pt-1">FeedBack</label> <p class="notication-s pl-4">get beta invitations ,surveys and feedback forms for sharing your suggstions sent once in a month </p> </div> </div> <div class="col-12 col-sm-4 col-xl-4 "> <div class="form-group"> <input type="checkbox" id="test11" > <label for="test11" class=" pt-1">Savings</label> <p class="notication-s pl-4">Get exclusive discounts and offers to save money on your healthcare bill. sent usually one in a 15 days</p> </div> </div> </div> <div class="row"> <div class="col-12 col-sm-4 col-xl-3"> </div> <div class="col-12 col-sm-4 col-xl-4 "> <div class="form-group"> <input type="checkbox" id="test10" > <label for="test10" class=" pt-1">Announcements</label> <p class="notication-s pl-4">Most important updates on new and existing products. Sent around once in a month </p> </div> </div> <div class="col-12 col-sm-4 col-xl-4 "> <div class="form-group"> <input type="checkbox" id="test12" > <label for="test12" class=" pt-1">Informational</label> <p class="notication-s pl-4">Get to know what's the latest through our newsletters,product updates and morel . snet once in a month</p> </div> </div> </div> <hr> <div class=""> <p>WhatsApp Settings</p> <p class="notication-s">you are currently receiving all communications on +91 9876543210 <a href="#" class="text-primary">(change)</a></p> </div> <div class="form-group"> <input type="checkbox" id="test13" > <label for="test13" class=" pt-1">I want to receive important notifications and updates via whatsapp </label> <p class="notication-s">you cab Disable this any time</p> </div> <hr> <div class="form-group"> <input type="radio" id="test14" > <label for="test14" class=" pt-1">I want to unsubscribe entirely </label> </div> <!-- --> <!-- <div class="round"> <input type="checkbox" id="checkbox" class="custom-radio" /> <label for="checkbox" class="custom-label">I want to unsubscribe entirely </label> </div> --> <!-- --> </div> </div> <div id="cancelled" class="container tab-pane fade"><br> <div class="container pb-3"> <div class=""> <h4 class="pb-3">Delete Account</h4> <div class="pl-4"> <p class="delete-a text-dark">Are you sure? This will permanently delete your KFY account</p> <p class="delete-a text-dark">Once the deletion process begins, you won't be able to reactivate your account or retrieve any data or information. </p> </div> <hr class=""> <div class="form-group col-sm-3 px-0"> <div class=" "><button class="btn btn-primary w-100" onclick=" return deleteAccount()">Delete Account</button></div> </div> </div> </div> </div> </div> </div> </section> <input type="hidden" id="availablecnt" value='<?php echo $checkBooking ;?>'> <?php include("footer.php");?> <script> function checkSpace(e) { var key = e.keyCode if(key == 32) { alert("Space is not allowed in the password"); return false; } return true; } $(".toggle-password-1").click(function() { $(this).toggleClass("showHide-1"); var input = $($(this).attr("toggle")); if (input.attr("type") == "password") { input.attr("type", "text"); document.getElementById("show-1").innerHTML = "Hide"; } else { input.attr("type", "password"); document.getElementById("show-1").innerHTML = "Show"; } }); $(".toggle-password-2").click(function() { $(this).toggleClass("showHide-2"); var input = $($(this).attr("toggle")); if (input.attr("type") == "password") { input.attr("type", "text"); document.getElementById("show-2").innerHTML = "Hide"; } else { input.attr("type", "password"); document.getElementById("show-2").innerHTML = "Show"; } }); $(".toggle-password-3").click(function() { $(this).toggleClass("showHide-3"); var input = $($(this).attr("toggle")); if (input.attr("type") == "password") { input.attr("type", "text"); document.getElementById("show-3").innerHTML = "Hide"; } else { input.attr("type", "password"); document.getElementById("show-3").innerHTML = "Show"; } }); function changepassword() { if($('#oldpassword').val()=='') { alert('Please enter current password');return false; } else if($('#newpassword').val()=='') { alert('Please enter new password');return false; } else if($('#confirmpassword').val()=='') { alert('Please enter confirm password');return false; } else if(($('#newpassword').val()).length<=5) { alert('New password must be more than 5 characters');return false; } else if($('#newpassword').val() != $('#confirmpassword').val()) { alert('New Password and Confirm Password should be same');return false; } else if($('#oldpassword').val()==$('#newpassword').val()) { alert('Current Password and New Password should not be same');return false; } else{ var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { // alert(this.responseText);return false; if (this.readyState == 4 && this.status == 200) { if(this.responseText == 1){ alert("Your password is successfully updated"); window.location="appointment.php"; }else if(this.responseText==0){ alert("Password updation was failed"); return false; } else if(this.responseText==-1){ // alert(this.responseText); alert("Current Password is not matched"); return false; } } }; xmlhttp.open("POST", "ajax.php?oldpwd=" + $('#oldpassword').val() +"&newpwd="+$('#newpassword').val()+"&action=changePassword", true); xmlhttp.send(); return false; } } function deleteAccount(){ var msg="Are you sure wants to delete?"; if($('#availablecnt').val()>0) { msg="You have scheduled slots available do you want to delete?"; } if(confirm(msg)) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log(this.responseText); if(this.responseText == 1){ alert("Your account deleted successfully "); window.location="logout.php"; }else { alert("Account deletion was failed"); return false; } } }; xmlhttp.open("POST", "ajax.php?action=deleteaccount", true); xmlhttp.send(); } } </script>