ok
Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/ |
Current File : //proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/subject-edit.php |
<?php include "header.php"; $ids = $_GET['id']; $statement = $pdo->prepare("SELECT * FROM tbl_subject WHERE id=".$ids); $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); ?> <div class="content-wrapper" style="background:white;"> <div class="clearfix"></div> <section class="content"> <div class="row"> <div class="col-xs-12"> <div> <div class="box-header"> <h3 class="box-title"><b>Edit Subject: </b></h3> </div> <div class="box-body"> <div class="col-lg-12"> <div id="content-div"> <form action="" id="add_subject_form" enctype="multipart/form-data" method="post" accept-charset="utf-8"> <input type="hidden" name="ids" id="question" value="<?= $ids ?>" autocomplete="off" required="required" /> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="required" for="file">Subject Name</label> <input type="Text" name="subject" id="question" value="<?= $result[0]['subject_name'] ?>" placeholder="Enter Question" class="form-control tip" autocomplete="off" required="required" /> </div> <div class="form-group"> <label class="required" for="subject_image">Subject Image</label> <input type="hidden" name="old_subject_image" id="sold_ubject_image" value="<?= $result[0]['image'] ?>" class="form-control tip" autocomplete="off" /> <input type="file" name="subject_image" id="subject_image" value="" class="form-control tip" autocomplete="off" /> <?php if(!empty($result[0]['image'])){ echo '<img src="'.$result[0]['image'].'" alt="No Images" style="width: 50%;">'; } ?> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="required" for="discription_content">Off Page Discription Content</label> <input type="Text" name="discription_content" id="discription_content" value="<?= $result[0]['discription_content'] ?>" placeholder="Enter Off Page Discription" class="form-control tip" autocomplete="off" required="required" /> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="required" for="subject_content">On Page Discription Content</label> <input type="Text" name="subject_content" id="subject_content" value="<?= $result[0]['subject_content'] ?>" placeholder="Enter On Page Discription " class="form-control tip" autocomplete="off" required="required" /> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="required" for="discription_keywords">Discription Keywords</label> <input type="Text" name="discription_keywords" id="discription_keywords" value="<?= $result[0]['discription_keywords'] ?>" placeholder="Enter Discription Keywords" class="form-control tip" autocomplete="off" required="required" /> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="required" for="discription_titles"> Discription Titles</label> <input type="Text" name="discription_titles" id="discription_titles" value="<?= $result[0]['discription_titles'] ?>" placeholder="Enter Discription Titles" class="form-control tip" autocomplete="off" required="required" /> </div> </div> </div> <div class="col-md-12" style="display: flex;justify-content: center;margin-top: 3%;"> <div class="form-group"> <input type="submit" id="add_subject" name="add_subject" value="Update Subject" class="btn btn-success" /> </div> </div> </form> </div> <div id="loading-div" style="display: none;"> <img src="images/gif/successfull.gif" style="margin-left: 37%;width: 25%;padding-bottom: 5%;"> </div> <div class="form-group" style="text-align:center;"> <a href="subject-edit.php"><button class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</button></a> <a href="subject-details.php"><button class="btn btn-warning" ><i class="fa fa-chevron-left"></i> Back to List</button></a> </div> <div class="clearfix"></div> </div> </div> </div> </div> </section> <style> table,td,th{ padding:5px; } th{ border: 1px solid black; } td{ border: 1px solid black; border-style: dashed; } </style> <script> $('#add_subject_form').on('submit', function(e){ console.log("Click And Form Working"); e.preventDefault(); $('#loading-div').show(); $('#content-div').hide(); var formData = new FormData(this); formData.append('type', 'edit_subject_form'); $.ajax({ url: 'add-api/edit-subject-form.php', type: 'post', dataType: 'json', data: formData, cache: false, contentType: false, processData: false, enctype: 'multipart/form-data', success: function (response) { if(response['status']==200){ alert(response['message']); $("#add_shifts .close").click(); $('#shift_add_form').trigger("reset"); emp_datas(); $('#loading-div').hide(); $('#content-div').show(); }else{ alert(response['message']); $('#loading-div').hide(); $('#content-div').show(); } } }); }); </script> <?php include "footer.php";?>