korsygfhrfggfhfgfffgffg6655665dtggggggzangaiide
Elehhjhjjkjkfpf6df56fd65ffff
/
home2
/
apcagkk2
/
4msi.org
/
admin
/
Upload FileeE
HOME
<?php require_once '../config/connection.php'; session_start(); if(!isset($_SESSION["phoneno"])){ header("location:login.php"); } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>4MSI</title> <!-- plugins:css --> <link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css"> <link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css"> <link rel="stylesheet" href="assets/css/style.css"> <link href="../upload/favlogo.jpg" rel="icon"> </head> <body> <div class="container-scroller"> <!-- partial:partials/_navbar.html --> <nav class="navbar default-layout-navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row"> <div class="navbar-menu-wrapper d-flex align-items-stretch"> <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize"> <span class="mdi mdi-menu"></span> </button> <button class="navbar-toggler navbar-toggler-right align-self-center" type="button" data-toggle="offcanvas"> <span class="mdi mdi-menu"></span> </button> </div> </nav> <!-- partial --> <div class="container-fluid page-body-wrapper"> <!-- partial:partials/_sidebar.html --> <?php include 'header.php'; ?> <!-- partial --> <div class="main-panel"> <div class="content-wrapper"> <div class="page-header"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <button type="button" name="button" class="btn btn-gradient-secondary me-2"><a href="life_member.php">Back</a></button> </ol> </nav> </div> <div class="row"> <?php $vid = $_GET['edit_id']; $query="SELECT * FROM `lifemember` WHERE `spcl_id`= '$vid'"; $run=mysqli_query($conn,$query); while ($result =mysqli_fetch_assoc($run)) { $name =$result['name']; $email =$result['email']; $phone =$result['phone']; $gender =$result['gender']; $dob =$result['dob']; $image =$result['img_path']; $qual =$result['qual']; $spcl =$result['spcl']; $car =$result['career']; $adrs =$result['addrs']; } ?> <form class="row g-3 needs-validation" method="post" enctype="multipart/form-data" novalidate> <div class="col-md-6"> <label for="validationCustom01" class="form-label"> Name </label> <input type="text" class="form-control" id="validationCustom01" name="uname" value="<?php echo $name; ?>" required> <div class="invalid-feedback"> Please enter Name </div> </div> <div class="col-md-6"> <label for="validationCustom01" class="form-label"> Email </label> <input type="text" class="form-control" id="validationCustom01" name="email" value="<?php echo $email; ?>" required> <div class="invalid-feedback"> Please enter Email </div> </div> <div class="col-md-6"> <label for="validationCustom01" class="form-label"> Contact No. </label> <input type="text" class="form-control" id="validationCustom01" name="phone" value="<?php echo $phone; ?>" required> <div class="invalid-feedback"> Please enter Contact No. </div> </div> <div class="col-md-6"> <label for="validationCustom01" class="form-label"> DOB </label> <input type="date" class="form-control" id="validationCustom01" name="dob" value="<?php echo $dob; ?>" required> <div class="invalid-feedback"> Please enter DOB </div> </div> <div class="col-md-12"> <label for="validationCustom05" class="form-label">Gender</label> <select class="form-control form" name="gender" > <option value="Male" <?php echo($gender=='Male'?'selected':'')?> >Male</option> <option value="Female" <?php echo($gender=='Female'?'selected':'')?> >Female</option> </select> </div> <div class="col-md-12"> <input type="hidden" name="old_image" value="<?php echo $image; ?>"> <label for="validationCustom01" class="form-label"> Upload Image </label> <input type="file" class="form-control" name="image" > <img src="../image/<?php echo $image; ?>" width="80px" height="80px"> </div> <div class="col-md-12"> <label for="validationCustom01" class="form-label"> Qualification </label> <input type="text" class="form-control" id="validationCustom01" name="qual" value="<?php echo $qual; ?>" required> <div class="invalid-feedback"> Please enter Qualification </div> </div> <div class="col-md-12"> <label for="validationCustom01" class="form-label"> Specialization </label> <input type="text" class="form-control" id="validationCustom01" name="spcl" value="<?php echo $spcl; ?>" required> <div class="invalid-feedback"> Please enter Specialization </div> </div> <div class="col-md-12"> <label for="exampleTextarea1"> About Professional Career </label> <textarea class="form-control" name="career" id="exampleTextarea1" rows="4"> <?php echo $car; ?></textarea> </div> <div class="col-md-12"> <label for="validationCustom01" class="form-label"> Address</label> <input type="text" class="form-control" id="validationCustom01" name="adrs" value="<?php echo $adrs; ?>" required> <div class="invalid-feedback"> Please enter Address </div> </div> <div class="col-md-12"> <center> <button class="btn btn-primary" type="submit" name="submit">Submit</button> </center> </div> </form> </div> </div> <!-- content-wrapper ends --> <!-- partial:partials/_footer.html --> <?php include 'footer.php'; ?> <!-- partial --> </div> <!-- main-panel ends --> </div> <!-- page-body-wrapper ends --> </div> <!-- container-scroller --> <!-- plugins:js --> <script src="assets/vendors/js/vendor.bundle.base.js"></script> <!-- endinject --> <!-- Plugin js for this page --> <script src="assets/vendors/chart.js/Chart.min.js"></script> <script src="assets/js/jquery.cookie.js" type="text/javascript"></script> <!-- End plugin js for this page --> <!-- inject:js --> <script src="assets/js/off-canvas.js"></script> <script src="assets/js/hoverable-collapse.js"></script> <script src="assets/js/misc.js"></script> <!-- endinject --> <!-- Custom js for this page --> <script src="assets/js/dashboard.js"></script> <script src="assets/js/todolist.js"></script> <script> // Example starter JavaScript for disabling form submissions if there are invalid fields (function () { 'use strict' // Fetch all the forms we want to apply custom Bootstrap validation styles to var forms = document.querySelectorAll('.needs-validation') // Loop over them and prevent submission Array.prototype.slice.call(forms) .forEach(function (form) { form.addEventListener('submit', function (event) { if (!form.checkValidity()) { event.preventDefault() event.stopPropagation() } form.classList.add('was-validated') }, false) }) })() </script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> </body> </html> <?php if(isset($_POST['submit'])){ if(empty($_FILES['image']['name'])){ $fnlimg = $_POST['old_image']; }else{ $image = $_FILES['image']['name']; $img_name = preg_replace("/\s+/","_",$image); $img_temp = $_FILES['image']['tmp_name']; $img_ext = pathinfo($image, PATHINFO_EXTENSION); $img_name = pathinfo($image, PATHINFO_EXTENSION); $fnlimg = $img_name."_".date("SoYHis").".".$img_ext; } $sql = "UPDATE `lifemember` SET `name`='{$_POST["uname"]}',`email`='{$_POST["email"]}',`phone`='{$_POST["phone"]}',`gender`='{$_POST["gender"]}', `dob`='{$_POST["dob"]}',`img_path`='{$fnlimg}',`qual`='{$_POST["qual"]}',`spcl`='{$_POST["spcl"]}',`career`='{$_POST["career"]}', `addrs`='{$_POST["adrs"]}' WHERE `spcl_id`='{$vid}' "; $update = mysqli_query($conn,$sql); if($update){ echo "<script>swal({text: 'Updated Successfully!', type: 'success' }).then(function() {window.location = 'life_member.php';});</script>"; }else{ echo "<script>swal({text: 'Try Again!', type: 'error' }).then(function() {window.location = 'life_member.php';});</script>"; } if($update) { move_uploaded_file($_FILES['image']['tmp_name'],"../image/$fnlimg"); } } ?>