KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/leadai/leadai.co.in/resources/views/superadmin/mother-occupation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/leadai/leadai.co.in/resources/views/superadmin/mother-occupation/list.blade.php
@extends('superadmin.layout')
@section('content')
    <!-- begin::main content -->
    <main class="main-content">
        <div class="container">
            <!-- begin::page header -->
            <div class="page-header">
                <h3>Mother Occupation List</h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{{ asset('superadmin/dashboard') }}">Dashboard</a></li>
                        <li class="breadcrumb-item active" aria-current="page">Mother Occupation List</li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->
            <div class="card">
                <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('add-mother-occcupation')){ ?>
                <div class="card-header">
                    <a href="{{ asset('superadmin/add-mother-occupation') }}"
                        class="form-group btn btn-primary text-white"><i class="fa fa-plus"></i>&nbsp;Add Mother
                        Occupation</a>
                </div>
                <?php } ?>
                <div class="card-body">

                    @if (isset($occupations))
                        <table id="example1" class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Name</th>
                                    <th>Name IN English</th>
                                    <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('edit-mother-occcupation')){ ?>
                                    <th>Enable/Disable</th>
                                    <?php } ?>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                @if (!empty($occupations))
                                    @foreach ($occupations as $occupation)
                                        <tr>
                                            <td>{{ $occupation->id }}</td>
                                            <td>{{ $occupation->name }}</td>
                                            <td>{{ $occupation->name_english }}</td>
                                            <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('edit-mother-occcupation')){ ?>
                                            <td>
                                                <div class="custom-control custom-switch custom-checkbox-success">
                                                    <label class="switch">
                                                        <input {{ $occupation->status == '1' ? 'checked' : '' }}
                                                            type="checkbox" name="admin_active"
                                                            data-id="{{ $occupation->id }}" value="1"
                                                            class="custom-control-input status-change" id="customSwitch2_">
                                                        <span class="slider round"></span>
                                                    </label>
                                                </div>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                @if ($occupation->status == 1)
                                                    <label for="" class="text-success">Active</label>
                                                @endif
                                                @if ($occupation->status == 0)
                                                    <label for="" class="text-danger">Inactive</label>
                                                @endif
                                            </td>
                                            <td>
                                                <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('edit-mother-occcupation')){ ?>
                                                <a
                                                    href="{{ asset('superadmin/edit-mother-occupation/' . $occupation->id) }}">
                                                    <i class="fa fa-edit text-success fa-lg"></i>
                                                </a>
                                                <?php } ?>
                                                <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('delete-mother-occcupation')){ ?>
                                                <a href="{{ asset('superadmin/delete-mother-occupation/' . $occupation->id) }}"
                                                    class="delete-confirm"><i
                                                        class="fa fa-trash  fa-lg text-danger"></i></a>
                                                <?php } ?>
                                            </td>
                                        </tr>
                                    @endforeach
                                @else
                                    <h1>No Record Found!!</h1>
                                @endif
                            </tbody>
                        </table>
                    @endif
                </div>
            </div>
        </div>
    </main>
    <!-- end::main content -->
@endsection
@push('footer-script')
    <!-- begin::dataTable -->
    <script src="{{ asset('public/admin/vendors/dataTable/jquery.dataTables.min.js') }}"></script>
    <script src="{{ asset('public/admin/vendors/dataTable/dataTables.bootstrap4.min.js') }}"></script>
    <script src="{{ asset('public/admin/vendors/dataTable/dataTables.responsive.min.js') }}"></script>
    <script src="{{ asset('public/admin/js/examples/datatable.js') }}"></script>
    <script>
        $('.status-change').on('change', function(e) {
            e.preventDefault();
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
            var id = $(this).data('id');
            var ckb = $(this).is(':checked');
            $.ajax({
                type: "post",
                data: {
                    "id": id,
                    "ckb": ckb
                },
                url: "{{ asset('superadmin/mother-occupation-change-status/') }}",
                success: function(result) {
                    if (ckb && data) {
                        toastr.success('Successfully Activated!');
                    } else if (ckb == false && data) {
                        toastr.warning('Successfully Deactivated!');
                    } else {
                        toastr.warning('Please Try Again!');
                    }
                }
            });
        });
    </script>
@endpush

Anon7 - 2021