Parcourir la source

Merge branch 'master' of https://revinr.site/mostafij-revinr/student-admission

Israat Zarin il y a 1 an
Parent
commit
57c2dd7b41

+ 43 - 3
resources/views/admin/sub_contents/register_pending_teacher_load.blade.php

@@ -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>

+ 6 - 2
resources/views/application.blade.php

@@ -65,9 +65,13 @@
                                                         <span>.</span>
                                                         @php
                                                                $proposal =\DB::table('proposal')->where('id',$row->proposal_id)->first();
-                                                               $department =model('Department')::find($proposal->department);
+                                                               @if($proposal->department)
+                                                                $department =model('Department')::find($proposal->department);
+                                                               @endif
                                                             @endphp
-                                                        <span style="font-size:10px;">{{$department->name ?? ''}}</span>
+                                                            @if($department)
+                                                                <span style="font-size:10px;">{{$department->name ?? ''}}</span>
+                                                            @endif
                                                         <span>.</span>
                                                         <span style="font-size:10px;">{{cn($row,'proposal.status','')}}</span>
                                                     </div>