ok
Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/www/y1jobportal.in/admin/ |
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/www/y1jobportal.in/admin/state-edit.php |
<?php include 'header.php'; $ids = $_GET['id']; $statement = $pdo->prepare("SELECT * FROM `state` WHERE id=?"); $statement->execute(array($ids)); $query = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); if($totalData>0){ $name = $query[0]['state_name']; $status = $query[0]['status']; ?> <div class="page-wrapper" > <div class="page-content"> <form id="form_details" autocomplete="off"> <input type="hidden" class="form-control" id="ids" name="ids" value="<?=$ids?>" required> <div class="row" style="margin-top: 25px;" id="content-div"> <div class="col-lg-12"> <div class="card" style="margin: 0px 10px 30px 10px; box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;"> <div class="card-body"> <div class="row"> <div class="col-12 col-lg-12"> <a href="state.php" class="btn btn-danger btn-sm" style="float: right;"><i class="bi bi-arrow-left-circle"></i> Back to List</a> <b style="font-weight: bolder;font-size: 17px;">Update State Details</b> <hr> </div> <div class="col-md-4 p-2"> <div class="form-group"> <label class="required pb-1" for="name">Stages Name </label> <input type="text" name="name" class="form-control" value="<?=$name?>"> </div> </div> <div class="col-md-4 p-2"> <label class="required pb-1">Status</label> <select class="form-control" name="status"> <option value="1" <?php if( $status == 1){ echo 'selected'; } ?> >Active</option> <option value="0" <?php if( $status == 0){ echo 'selected'; } ?> >In-Active</option> </select> </div> </div> </div> </div> <div class="col text-center"> <button type="submit" class="btn btn-primary px-5">Update Details</button> </div> </div> </div> </form> <div class="container" id="loading-div" style="display: none;"> <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center> </div> <div class="container" id="success-div" style="display: none; margin-top: 40px;"> <center><b class="blinking" style="font-size:22px;">State Updated Successfully...</b><br> <img src="img/success.gif" style="width: 250px;"> <br><br><a href="state.php"><button class="btn btn-danger"><i class="fa fa-list"></i> Back to State's List</button></a> <a href="state-edit.php?id=<?=$ids?>"><button class="btn btn-info"><i class="fa fa-refresh"></i> Reset Form</button></a> </center> </div> </div> </div> <?php } ?> <?php include 'footer.php'; ?> <script> $(document).ready(function(){ $('.select2').select2(); $('#form_details').on('submit', function(e){ e.preventDefault(); console.log("Form Submitted Successfully !!!") $('#loading-div').show(); $('#content-div').hide(); var formData = new FormData(this); formData.append('type', 'edit_state'); $.ajax({ url: 'apis/state.php', type: 'post', dataType: 'json', data: formData, cache: false, contentType: false, processData: false, enctype: 'multipart/form-data', success: function (response) { if(response['status']==200){ success(response['message']); $('#loading-div').hide(); $('#form_details').trigger("reset"); $('#success-div').show(); }else{ warning(response['message']); $('#loading-div').hide(); $('#content-div').show(); } } }); }); }); </script>