JezK
Edit File: settings.php
<?php include("header.php"); $countriesPaymentGateways = $videocon->countriesPaymentGateway(); // print_r($countriesPaymentGateways);exit; if(isset($_POST['submit']) && $_POST['submit'] =='Update Country') { // print_r($_POST);exit; $updatePractManCountry = $videocon->updatePractManCountry($_POST); if($updatePractManCountry){ echo "<script>alert('Updated Successfully');window.location='settings.php'</script>"; }else{ echo "<script>alert('Updation Failed');</script>"; } } ?> <style> .quantity::-webkit-inner-spin-button, .quantity::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } .changeflex { display: flex; flex-direction: column; align-items: center; } .text-align { text-align:center; } </style> <section class="dashboard-counts section-padding"> <div class="container-fluid bg-white px-5 py-3"> <div class="row bg-white"> <form class="form-horizontal col-sm-12 h-100" action="" method="POST" onsubmit="return validateForm()"> <div class="form-group"> <div class="row changeflex"> <div class="col-xl-6 col-sm-6 col-lg-6 text-align"> <h2>Practman SetUp Country</h2> </div> <div class="col-xl-6 col-sm-6 col-lg-6"> <label for="practman_country" class="fieldName">Choose Country</label> <select name="practman_country" id="practman_country" class="form-control formField-control filterby countries" style="background-color:#E8F2F6 !important"> <?php foreach($countriesPaymentGateways as $k=>$v){ ?> <option value="<?php echo $v['id'];?>" <?php if($v['practman_country']==1){ echo "selected";}?> ><?php echo $v['country_name'];?></option> <?php } ?> </select> </div> <div class="col-xl-6"> <label for="username" class="fieldName invisible">Update Country</label> <input type="submit" name="submit" value="Update Country" class="btn btn-primary w-100" > </div> </div> <div class="row"> </div> </div> </form> </div> </div> </section> <script> function checkSpace(e) { var key = e.keyCode if(key == 32) { alert("Space is not allowed in the password"); return false; } return true; } function validateForm() { var newPassword = document.getElementById('newPassword'); var confirmPassword = document.getElementById('confirmPassword'); var oldPassword = document.getElementById('oldPassword'); if(oldPassword.value.trim().length == 0) { alert('Password must not be empty.'); oldPassword.value = ""; newPassword.value = ""; confirmPassword.value = ""; oldPassword.focus(); return false; } if(newPassword.value.trim().length == 0 || confirmPassword.value.trim().length == 0) { alert('Password must not be empty.'); newPassword.value = ""; confirmPassword.value = ""; newPassword.focus(); return false; } if(newPassword.value.trim().length < 6 || confirmPassword.value.trim().length < 6) { alert('Password must be minimum 6 characters.'); newPassword.value = ""; confirmPassword.value = ""; newPassword.focus(); return false; } if(confirmPassword.value != newPassword.value) { alert('Password mismatch.'); newPassword.value = ""; confirmPassword.value = ""; newPassword.focus(); return false; } return true; } </script> <?php include("footer.php");?>