⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
erp.dev-unit.com
/
resources
/
views
/
role
/
View File Name :
create.blade.php
@extends('layouts.main') @section('page-title') {{ __('Create Role') }} @endsection @section('page-breadcrumb') {{ __('Role') }} @endsection @section('content') <div class="mt-4"> {{ Form::open(['url' => 'roles', 'method' => 'post', 'class' => 'needs-validation', 'novalidate']) }} <div class="row "> <!-- Sidebar --> <div class="col-xl-3 col-12"> <div class="card"> <div class="card-body pt-1"> <div class=""> {{ Form::label('name', __('Name'), ['class' => 'col-form-label']) }}<x-required></x-required> {{ Form::text('name', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => __('Enter Role Name')]) }} @error('name') <small class="invalid-name" role="alert"> <strong class="text-danger">{{ $message }}</strong> </small> @enderror </div> </div> </div> <div class="card sticky-top roles-sidebar"> <div class="list-group rounded" id="pills-tab" role="tablist"> @foreach ($modules as $module) @if (module_is_active($module) || $module == 'General') <button class="nav-link p-3 d-flex align-items-center justify-content-between w-100 text-capitalize text-black text-start gap-2 border-0 {{ $loop->index == 0 ? 'active' : '' }}" id="pills-{{ strtolower($module) }}-tab" data-bs-toggle="pill" data-bs-target="#pills-{{ strtolower($module) }}" type="button"> {{ Module_Alias_Name($module) }} <i class="ti ti-chevron-right"></i> </button> @endif @endforeach </div> </div> </div> <!-- Main Content --> <div class="col-xl-9 col-12 setting-menu-div roles-menu mb-4"> @foreach ($modules as $module) <div class="card tab-pane h-100 mb-0 fade {{ $loop->index == 0 ? 'show active' : '' }}" id="pills-{{ strtolower($module) }}" role="tabpanel" aria-labelledby="pills-{{ strtolower($module) }}-tab"> <div class="card-header p-3"> <h5>{{ Module_Alias_Name($module) }}</h5> </div> <div class="card-body p-3"> <div class="tab-content" id="pills-tabContent"> @if (module_is_active($module) || $module == 'General') <div> <!-- Tab Content --> <input type="checkbox" class="form-check-input pointer" name="checkall-{{ strtolower($module) }}" id="checkall-{{ strtolower($module) }}" onclick="Checkall('{{ strtolower($module) }}')"> <small class="text-muted mx-2"> {{ Form::label('checkall-' . strtolower($module), 'Assign ' . Module_Alias_Name($module) . ' Permission to Roles', ['class' => 'form-check-label pointer']) }} </small> <div class="table-responsive"> <table class="table table-striped table-roles mb-0 mt-3"> <thead> <tr> <th class="bg-primary"></th> <th class="bg-primary text-white">{{ __('Module') }}</th> <th class="bg-primary text-white">{{ __('Permissions') }}</th> </tr> </thead> <tbody> @php $permissions = get_permission_by_module($module); $m_permissions = array_column($permissions->toArray(), 'name'); $module_list = []; foreach ($m_permissions as $key => $value) { array_push($module_list, strtok($value, ' ')); } $module_list = array_unique($module_list); @endphp @foreach ($module_list as $key => $list) <tr> <td> <input type="checkbox" class="form-check-input ischeck pointer" onclick="CheckModule('module_checkbox_{{ $key }}_{{ $list }}')" id="module_checkbox_{{ $key }}_{{ $list }}"> </td> <td> {{ Form::label('module_checkbox_' . $key . '_' . $list, str_replace('_', ' ', $list), ['class' => 'form-check-label pointer', 'style' => 'word-break: break-word;']) }} </td> <td class="module_checkbox_{{ $key }}_{{ $list }} ps-4"> <div class="row"> @foreach ($permissions as $key => $prermission) @php $check = strtok($prermission->name, ' '); $name = str_replace( $check, '', $prermission->name, ); @endphp @if ($list == $check) <div class="col-xl-3 col-sm-6 form-check mb-2"> {{ Form::checkbox('permissions[]', $prermission->id, false, ['class' => 'form-check-input pointer checkbox-' . strtolower($module), 'id' => 'permission_' . $key . '_' . $prermission->id]) }} {{ Form::label('permission_' . $key . '_' . $prermission->id, $name, ['class' => 'form-check-label pointer', 'style' => 'white-space: normal; word-break: break-word;']) }} </div> @endif @endforeach </div> </td> </tr> @endforeach </tbody> </table> </div> </div> @endif </div> </div> <div class="card-footer p-3 d-flex justify-content-end gap-2"> <input type="button" onclick="location.href = '{{ route('roles.index') }}';" value="{{ __('Cancel') }}" class="btn btn-secondary text-white" data-bs-dismiss="modal"> <input type="submit" value="{{ __('Create') }}" class="btn btn-primary"> </div> </div> @endforeach </div> </div> {{ Form::close() }} </div> @endsection <script> function Checkall(module = null) { console.log(module); var ischecked = $("#checkall-" + module).prop('checked'); if (ischecked == true) { $('.checkbox-' + module).prop('checked', true); } else { $('.checkbox-' + module).prop('checked', false); } } </script> <script type="text/javascript"> function CheckModule(cl = null) { var ischecked = $("#" + cl).prop('checked'); if (ischecked == true) { $('.' + cl).find("input[type=checkbox]").prop('checked', true); } else { $('.' + cl).find("input[type=checkbox]").prop('checked', false); } } </script>