ok
Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/www/salemgovtitialumni.in/ |
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/www/salemgovtitialumni.in/profile-update.php |
<?php include 'header.php' ?> <?php if(!isset($_SESSION['salemgov-iti'])){ header("login.php"); }else{ $statement_member = $pdo->prepare("SELECT * FROM tbl_member where id = ".$_SESSION['salemgov-iti']['id']); $statement_member->execute(); $member_result = $statement_member->fetchAll(PDO::FETCH_ASSOC); $total_member = $statement_member -> rowCount(); } ?> <!-- Page Banner Start --> <div class="section page-banner-section" style="background-image: url(assets/images/bg/page-banner.jpg);margin-top: 15%;min-height: 130px;"> <div class="container"> <div class="page-banner-wrap"> <div class="row"> <div class="col-lg-12"> <!-- Page Banner Content Start --> <div class="page-banner text-center" style="margin-top: -8%;"> <h2 class="title" style="color: #f17a28;">My Profile</h2> </div> <!-- Page Banner Content End --> </div> </div> </div> </div> </div> <!-- Page Banner End --> <!-- Contact Start --> <div class="section contact-section section-padding" style="padding-top: 50px;"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2 style="color: #2e3092;text-align: center;">Hi <?= $_SESSION['salemgov-iti']['name'] ?></h2> <!-- Contact Form Wrap Start --> <div id="content-div" class="contact-form-wrap"> <form action="" method="POST" id="member_regitration" enctype="multipart/form-data" > <div class="row"> <div class="col-md-6"> <div class="single-form"> <label>Name:</label> <input class="form-control" type="text" name="name" value="<?=$member_result[0]['name']?>" placeholder="Your Name" required> <input class="form-control" type="hidden" name="ids" value="<?=$member_result[0]['id']?>" placeholder="Your Name" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Father's Name:</label> <input class="form-control" type="text" name="father_name" value="<?=$member_result[0]['father_name']?>" placeholder="Your Father's Name" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Present Address:</label> <textarea class="form-control" name="present_address" placeholder="Enter Present Address" required><?=$member_result[0]['present_address']?></textarea> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Permanent Address:</label> <textarea class="form-control" name="permanent_address" placeholder="Enter Permanent Address" required><?=$member_result[0]['permanent_address']?></textarea> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Phone/Mobile No:</label> <input class="form-control" type="text" name="mobile" value="<?=$member_result[0]['phone_no']?>" placeholder="Your Mobile No" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Email:</label> <input class="form-control" type="email" name="email" value="<?=$member_result[0]['email']?>" placeholder="Your Email" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Educational Qualification:</label> <input class="form-control" type="text" name="education" value="<?=$member_result[0]['education']?>" placeholder="Your Qualification" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Profession or Business:</label> <input class="form-control" type="text" name="profession" value="<?=$member_result[0]['business']?>" placeholder="Profession" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Training Period:</label> <input class="form-control" type="text" name="training" value="<?=$member_result[0]['training']?>"placeholder="Training Period" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Trade:</label> <input class="form-control" type="text" name="trade" value="<?=$member_result[0]['trade']?>"placeholder="Your Trade" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Password:</label> <input class="form-control" id="password" value="<?=$member_result[0]['password']?>" type="passwrod" name="password" placeholder="Your Password" required> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Confirm Passowrd:</label> <input class="form-control" onkeyup="confirmPassword()" value="<?=$member_result[0]['password']?>" type="password" id="confirm_password" name="connfirm_password" placeholder="Your Confirm Password" required> <span style="color:red;" id="password_error"></span> </div> </div> <div class="col-md-6"> <div class="single-form"> <label>Profile Image</label> <input class="form-control" type="file" id="profile_image" name="profile_image" accept="image/*" > <span>(Recommended Size 400*400)</span> <input class="form-control" type="hidden" value="<?= $member_result[0]['profile'] ?>" id="old_profile_image" name="old_profile_image" accept="image/*" > </div> <div class="form-group"> <img id="image_preview" src="" alt="Image Preview" class="img-thumbnail" style="display: none; max-width: 200px;"> </div> <?php if($member_result[0]['profile'] != ""){ echo '<img src="'.$member_result[0]['profile'].'" alt="Image Preview" class="img-thumbnail" style="max-width: 200px;">'; } ?> </div> <div class="col-md-6"> <div class="single-form"> <label>Blood Group:</label> <input class="form-control" id="blood_group" value="<?= htmlspecialchars($member_result[0]['blood_group']) ?>" type="blood_group" name="blood_group" placeholder="Your Blood Group" required> </div> </div> <div class="col-md-12"> <div class="form-btn"> <button class="btn" name="submit_form" type="submit">Update Profile</button> </div> </div> </div> </form> <div class="col-md-12" style="margin-top: 4%;" > <a class="btn" href="test.php?id=<?= $member_result[0]['id'] ?>" > Downlaod ID Card </a> </div> </div> <div id="loading-div" class="contact-form-wrap"> <h2 style="color: #2e3092;text-align: center;">Loading..</h2> </div> <!-- Contact Form Wrap End --> </div> </div> </div> </div> <!-- Contact End --> <!-- Contact Map Start --> <!--<div class="section contact-map-section"> <div class="contact-map-wrap"> <iframe id="gmap_canvas" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3907.0526080363265!2d78.160305588855!3d11.690684200000014!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3babf1071ccac523%3A0x1419eb7ced5d97ae!2sGovernment%20Industrial%20Training%20Institute!5e0!3m2!1sen!2sin!4v1695996873885!5m2!1sen!2sin" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> </div> </div>--> <!-- Contact Map End --> <?php include 'footer.php' ?> <script> $(document).ready(function(){ $('#loading-div').hide(); $('#content-div').show(); }); $('#member_regitration').on('submit', function(e){ console.log("Click And Form Working"); e.preventDefault(); $('#loading-div').show(); $('#content-div').hide(); $('#completed-div').hide(); $('#final_submit').prop('disabled', true); var formData = new FormData(this); formData.append('type', 'update_member'); $.ajax({ url: 'api/add-member.php', type: 'post', dataType: 'json', data: formData, cache: false, contentType: false, processData: false, enctype: 'multipart/form-data', success: function (response) { console.log(response); if(response['status']==200){ alert(response['message']); location.reload(); $("#member_regitration").trigger("reset"); $("#done1").trigger("reset"); $('#loading-div').hide(); $('#content-div').show(); $('#completed-div').show(); }else{ alert(response['message']); $('#loading-div').hide(); $('#content-div').show(); } } }); }); function confirmPassword(){ $("#password_error").empty(); var password = $("#password").val(); var confirm_password = $("#confirm_password").val(); var condi =""; if(password == confirm_password){ condi = "Password Matched"; }else{ condi = "Password not Matched"; } $("#password_error").html(condi); } // Profile image Preview Start Here $(document).ready(function() { $('#profile_image').on('change', function() { var file = this.files[0]; if (file) { var reader = new FileReader(); reader.onload = function(e) { $('#image_preview').attr('src', e.target.result).show(); } reader.readAsDataURL(file); } else { $('#image_preview').hide(); } }); }); // Profile image Preview End Here </script> <script> $(document).ready(function() { $('input[name="blood_group"]').on('input', function() { var maxLength = 5; if ($(this).val().length > maxLength) { $(this).val($(this).val().slice(0, maxLength)); } }); }); </script>