|
@@ -872,25 +872,10 @@ tbody, td, tfoot, th, thead, tr {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="single_glance_row mt-5">
|
|
|
- <div id="load_department"></div>
|
|
|
- {{-- <div style="display: flex">
|
|
|
- <div class="left" style="width: 80%;">
|
|
|
- <span class="title" style="font-size:11px;">Math</span>
|
|
|
- </div>
|
|
|
- <div class="right" style="width: 20%;">
|
|
|
- <span class="title" style="font-size:11px; font-weight: 600;">
|
|
|
- <a role="button" data-bs-toggle="collapse" data-bs-parent="#collapse" href="#collapse1" aria-expanded="true" aria-controls="collapse1">
|
|
|
- <button type="button" class="btn btn2" data-toggle="collapse" data-target="#demo16" style="padding: 2px 5px !important; font-size: 11px;"><i class="fa fa-pencil"></i></button>
|
|
|
- </a>
|
|
|
- </span>
|
|
|
- <span class="title" style="font-size:11px; font-weight: 600;">
|
|
|
- <button type="button" class="btn btn2" style="padding: 2px 5px !important; font-size: 11px;"><i class="fa fa-trash"></i></button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div> --}}
|
|
|
- <!-- Tab -->
|
|
|
- <div class="col-md-12">
|
|
|
- <div id="demo16" class="collapse mt-2">
|
|
|
+ <div id="load_department"></div>
|
|
|
+ <!-- Tab -->
|
|
|
+ <div class="col-md-12 d-none">
|
|
|
+ <div id="" class="mt-2">
|
|
|
<div class="panel-body" style="padding:10px; background-color: #4b4c6824; border: 1px solid #e9e5e5; border-radius: 5px;">
|
|
|
<form method="POST" action="">
|
|
|
<div class="row">
|
|
@@ -1104,6 +1089,58 @@ tbody, td, tfoot, th, thead, tr {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function ajax_form(form, cllback=null, config={spinner: true}){
|
|
|
+
|
|
|
+ $('.btn-submit').prop('disabled', true);
|
|
|
+ var redirect=$(form).data('redirect');
|
|
|
+
|
|
|
+ if(typeof config=='object'){
|
|
|
+
|
|
|
+ if(config.spinner) wait_me($(form));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $(form).ajaxSubmit({
|
|
|
+ success:function(res){
|
|
|
+
|
|
|
+ wait_me($(form), 'hide');
|
|
|
+
|
|
|
+ if(res.msg){
|
|
|
+
|
|
|
+ pop_up_msg(res.msg, 'success', function(){
|
|
|
+
|
|
|
+ //$('.btn-submit').prop('disabled', false);
|
|
|
+
|
|
|
+ if(redirect) window.location.replace(redirect);
|
|
|
+ else if(typeof cllback=='function'){
|
|
|
+ cllback(form);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //$.notify(res.msg, 'success');
|
|
|
+ },
|
|
|
+ error:function(res){
|
|
|
+
|
|
|
+ wait_me($(form), 'hide');
|
|
|
+
|
|
|
+ var msg="Request failed to process, try again later.";
|
|
|
+
|
|
|
+ if(res.responseJSON && res.responseJSON.msg){
|
|
|
+ msg=res.responseJSON.msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ pop_up_msg(msg, 'error');
|
|
|
+ $('.btn-submit').prop('disabled', false);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ } //End of ajax form definition
|
|
|
+
|
|
|
$(function(){
|
|
|
|
|
|
$('.status_change').on('click', function(e){
|
|
@@ -1211,6 +1248,8 @@ tbody, td, tfoot, th, thead, tr {
|
|
|
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|