ok
Direktori : /home2/selectio/public_html/tnpsctestbatch.com/admin/ |
Current File : /home2/selectio/public_html/tnpsctestbatch.com/admin/edit-desription.php |
<?php include "header.php"; $ids = $_GET['id']; $statement = $pdo->prepare("SELECT * FROM tbl_current_affars_description 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 Current Affair Description: </b></h3> </div> <div class="box-body"> <div class="col-lg-12"> <div id="content-div"> <form action="" id="edit_description" enctype="multipart/form-data" method="post" accept-charset="utf-8"> <input type="hidden" name="ids" id="ids" value="<?=$result[0]['id']?>" > <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="required" for="file">Description Content</label> <input type="text" name="content" id="content" value="<?=$result[0]['description']?>" placeholder="Enter Content" class="form-control tip" required="required"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="required" for="file">Description Title</label> <input type="text" name="title" id="title" value="<?=$result[0]['title']?>" placeholder="Enter Title" class="form-control tip" required="required"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="required" for="file">Description KeyWord</label> <input type="text" name="keyword" id="keyword" value="<?=$result[0]['keyword']?>" placeholder="Enter Keyword" class="form-control tip" required="required"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="required" for="types">Type</label> <Select type="text" name="types" id="types" class="form-control tip" > <option value="">Select Type</option> <option value="1" <?php if($result[0]['type']==1){ echo 'selected'; } ?> >Home page</option> <option value="2" <?php if($result[0]['type']==2){ echo 'selected'; } ?> >Current affairs page</option> </Select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="required" for="status">Status</label> <select class="form-control tip" name="status" required="required"> <option value="1" <?php if($result[0]['status']==1){ echo 'selected'; } ?> >Active</otion> <option value="0" <?php if($result[0]['status']==0){ echo 'selected'; } ?> >In-active</otion> </select> </div> </div> </div> <div class="col-md-12" style="display: flex;justify-content: center;margin-top: 3%;"> <div class="form-group"> <!--<label class="required" for="file">Action</label><br>--> <input type="submit" id="add_Description" name="add_Description" value="Update Description" 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="edit-desription.php?id=<?= $ids ?>" ><button class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</button></a> <a href="description-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> $('#edit_description').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_decription_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";?>