ok
Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/old/ |
Current File : //proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/old/category-add.php |
<?php include "header.php";?> <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>Add Category: </b></h3> </div> <div class="box-body"> <div class="col-lg-12"> <!-- Content Section Starts Here --> <div id="content-div"> <form action="" enctype="multipart/form-data" method="post" id="add_form" accept-charset="utf-8"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="required" for="news_title">Category Name</label> <input type="text" name="category_name" id="category_name" class="form-control tip" required="required" placeholder="Enter Category Name" /> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label class="control-label" for="departement_id">Status</label> <select name="status" class="form-control select2" style="width:100%" id="status"> <option value="1">Active</option> <option value="0">In-Active</option> </select> </div> </div> <div class="row"> <div class="col-lg-12" style="padding: 0px;"><br> <div class="form-group" style="text-align:center;"> <input type="submit" id="add_category" name="add_category" value="Add Category" class="btn btn-success" /> </div> </div> </div> </div> </form> </div> <div id="loading-div" style="display: none;"> <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center> <br><br><br><br> </div> <div class="form-group" style="text-align:center;"> <a href="category-add.php"><button class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</button></a> <a href="category.php"><button class="btn btn-warning" ><i class="fa fa-chevron-left"></i> Back to List</button></a> </div> <!-- Content Section Endsss Here --> <div class="clearfix"></div> </div> </div> </div> </div> </section> <script> $(document).ready(function(){ $('#add_form').on('submit', function(e){ e.preventDefault(); $("#loading-div").show(); $("#content-div").hide(); $("#add_category").attr('disabled','disabled'); console.log('News Form Submit Option Start...'); var formData = new FormData(this); formData.append('type', 'category_add'); $.ajax({ url: 'apis/category-api.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){ //put success coode alert(response['message']); $("#loading-div").hide(); $("#content-div").show(); $('#add_form').trigger("reset"); $("#add_category").removeAttr('disabled'); }else{ //put falied code $("#loading-div").hide(); $("#content-div").show(); alert(response['message']); $("#add_category").removeAttr('disabled'); } } }); }); }); </script> <style> table,td,th{ padding:5px; } th{ border: 1px solid black; } td{ border: 1px solid black; border-style: dashed; } </style> <?php include "footer.php";?>