|
@@ -42,9 +42,9 @@
|
|
|
<div class="dropdown" style="top: 0.4px; position: absolute; right: 9px;">
|
|
|
<i class="fa fa-caret-down dropdown-toggle add_hover tooltips" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" data-original-title="Change Status" style="color: #8c9094;"></i>
|
|
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; transform: translate3d(10px, 13px, 0px); top: 0px; left: 0px; will-change: transform; margin-left: -75px; z-index: 2; margin-top: 10px;">
|
|
|
- <a class="dropdown-item status_change" data-value="1" data-id={{$row->id}}>Active</a>
|
|
|
- <a class="dropdown-item status_change" data-value="2" data-id={{$row->id}}>In active</a>
|
|
|
- <a class="dropdown-item status_change" data-value="3" data-id={{$row->id}}>Suspend</a>
|
|
|
+ <a class="dropdown-item active_inactive_status_change hand" data-value="1" data-id={{$row->id}}>Active</a>
|
|
|
+ <a class="dropdown-item active_inactive_status_change hand" data-value="2" data-id={{$row->id}}>In active</a>
|
|
|
+ <a class="dropdown-item active_inactive_status_change hand" data-value="3" data-id={{$row->id}}>Suspend</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -98,6 +98,46 @@
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ $('.active_inactive_status_change').on('click', function(e){
|
|
|
+ var self =$(this);
|
|
|
+ var id =$(this).data('id');
|
|
|
+ var value =$(this).data('value');
|
|
|
+
|
|
|
+ var form_data={
|
|
|
+ _token:"{{ csrf_token() }}",
|
|
|
+ 'id':id,
|
|
|
+ 'status':value
|
|
|
+ }
|
|
|
+ swal({
|
|
|
+ title: "Are you sure?",
|
|
|
+ text: "Do you want to change this status?",
|
|
|
+ type: "warning",
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonClass: "btn btn-md btn-success",
|
|
|
+ cancelButtonClass: 'btn btn-md btn-danger',
|
|
|
+ confirmButtonText: "Yes"
|
|
|
+ }, function(isConfirm){
|
|
|
+
|
|
|
+ if(isConfirm) {
|
|
|
+ $.post("{{ route('ajax-post', ['name'=>'teacher_user_status_change'])}}" ,form_data).done(function(res){
|
|
|
+
|
|
|
+ pop_up_msg(res.msg);
|
|
|
+ window.location.reload();
|
|
|
+
|
|
|
+ }).fail(function(error){
|
|
|
+
|
|
|
+ let msg='Sorry!, form submission failed try again later.';
|
|
|
+
|
|
|
+ if(error.responseJSON.msg){
|
|
|
+ msg=error.responseJSON.msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ pop_up_msg(msg, 'error');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
});
|
|
|
</script>
|