Files
freeu-project/resources/views/Admin/permissions/index.blade.php
Ritikesh yadav c661166e1d first commit
2024-03-28 14:52:40 +05:30

229 lines
10 KiB
PHP

@extends('Admin.layouts.master')
@section('content')
<!-- <style>
.dataTable td button {
padding: 5px 10px;
border-radius: 15px;
background: #fff !important;
border: 0;
color: #fff;
font-size: 12px;
}
</style> -->
<!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/css/toastr.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" ></script> -->
<!--begin::Body-->
<!-- <body data-kt-name="metronic" id="kt_app_body"
data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="false" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default"> -->
<!--begin::Theme mode setup on page load-->
<!--end::Theme mode setup on page load-->
<!--begin::App-->
<!-- <div class="d-flex flex-column flex-root app-root" id="kt_app_root"> -->
<!--begin::Page-->
<!-- <div class="app-page flex-column flex-column-fluid" id="kt_app_page"> -->
<!--begin::Header-->
<!--end::Header-->
<!--begin::Wrapper-->
<!-- <div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper"> -->
<!--begin::sidebar-->
<!--end::sidebar-->
<!--begin::Main-->
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
<!--begin::Content wrapper-->
@if(session()->has('message'))<br>
<div class="alert alert-success fade-message">
{{ session()->get('message') }}
</div>
@endif
<div class="d-flex flex-column flex-column-fluid">
<div id="kt_app_content_container" class="app-container container-xxl">
<div class="row max-w-100 mt-10 index_table">
<div class="top_header d-flex justify-content-between align-items-center">
<p class='fs-2 m-0 fw-bold'>Master Permission </p>
<div class="table_right_options d-flex">
<div class="d-flex align-items-center position-relative">
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
{{-- <span class="svg-icon svg-icon-1 position-absolute ms-6">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546"
height="2" rx="1" transform="rotate(45 17.0365 15.1223)"
fill="currentColor" />
<path
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
fill="currentColor" />
</svg>
</span> --}}
<!--end::Svg Icon-->
{{-- <input type="text" data-kt-user-table-filter="search"
class="form-control bg-white form-control-solid w-250px ps-14"
placeholder="Search user" />
--}}
</div>
{{-- @can('Permission create') --}}
<a href="{{route('admin.permissions.create')}}" class="pointer">
<button type="button" class="btn btn-light-primary me-3" data-kt-menu-trigger="click" data-kt-menu-attach="parent" data-kt-menu-placement="bottom-start">
<!--begin::Svg Icon | path: icons/duotune/arrows/arr075.svg-->
<i class="fas fa-plus"></i> Add
</button>
</a>
{{-- @endcan --}}
</div>
</div>
{{-- @if(session('message'))
<div class="alert alert-success">
{{ session('message') }}
</div>
@endif --}}
<div class="dataTable_area my-5 mb-0">
<!--begin::Card-->
<div class="card">
<div class="card-header border-0 pt-0 h-0">
<!--begin::Card toolbar-->
<!--end::Card toolbar-->
</div>
<!--begin::Card body-->
<div class="card-body py-4 pt-0">
<!--begin::Table-->
<table class="table align-middle table-row-dashed fs-6 gy-5" id="faq-table">
<!--begin::Table head-->
<thead>
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
<th class="w-60px pe-2 align-top">Sr No.</th>
<th class="min-w-75px w-100px align-top text-left">Permission Name</th>
<th class="text-center w-225px min-w-100px align-top text-center">Actions</th>
</tr>
<!--begin::Table row-->
{{--<tr class="text-center text-muted fw-bold fs-7 text-uppercase gs-0">
<th>SrNo.</th>
<th>Permission Name</th>
<th>Action</th>
</tr>--}}
<!--end::Table row-->
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody class="text-gray-600 fw-semibold">
<!--begin::Table row-->
@php($count=0)
@forelse($permissions as $permission)
@php($count++)
<tr class="text-center">
<td>{{ $count }}</td>
<td>{{$permission->name }}</td>
<td>
{{-- @can('Permission edit') --}}
<a href="{{route('admin.permissions.edit',$permission->id)}}" class="text-grey-lighter font-bold py-1 px-3 rounded text-xs bg-green hover:bg-green-dark text-blue-400"><i class="fa fa-edit"></i></a>
{{-- @endcan --}}
{{-- @can('Permission delete') --}}
{{-- <form action="{{ route('admin.permissions.destroy', $permission->id) }}" method="POST" class="inline">
@csrf
{{-- @method('delete') --}}
{{--}} <button class="btn btn-sm pointer" style="color:black"><i class="fa fa-trash"></i> </button>
</form> --}}
{{-- @endcan --}}
<form action="{{route('admin.permissions.destroy',$permission->id)}}" method="POST" style="display: inline" onsubmit="return confirm('Are you sure?');">
<input type="hidden" name="_method" value="DELETE">
{{ csrf_field() }}
<button class="btn btn-sm" style="color:black"><i class="fa fa-trash"></i> </button>
</form>
</td>
</tr>
@empty
<tr align="center">
<td colspan="6">No entries found.</td>
</tr>
@endforelse
<!--end::Table row-->
</tbody>
<!--end::Table body-->
</table>
<!--end::Table-->
</div>
<!--end::Card body-->
</div>
<!--end::Card-->
</div>
</div>
</div>
</div>
<!--end::Content wrapper-->
</div>
@endsection
<!--end:::Main-->
<!-- </div> -->
<!--end::Wrapper-->
<!-- </div> -->
<!--end::Page-->
<!-- </div> -->
<!--end::App-->
<!-- </body> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/js/toastr.js"></script> -->
<!-- <script>
$(document).ready(function() {
toastr.options.timeOut = 3000;
@if (Session::has('error'))
toastr.error('{{ Session::get('error') }}');
{{ Session::forget('error') }} // Clear the 'error' session
setTimeout(function() {
location.reload();
}, 3000);
@elseif(Session::has('message'))
toastr.success('{{ Session::get('message') }}');
{{ Session::forget('message') }}
setTimeout(function() {
location.reload();
}, 3000);
// window.location.reload();// Clear the 'message' session data
@endif
});
</script> -->
<!-- <script src="https://code.jquery.com/jquery-3.5.1.min.js" ></script>
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js" defer></script>
<script src="https://cdn.datatables.net/1.10.24/js/dataTables.bootstrap4.min.js"defer></script> -->
@section('scripts')
<script>
$(document).ready(function() {
$('#faq-table').DataTable();
});
</script>
@endsection