Commit c3ba484f by fezrul

update base

parent 00c27679
<?php
namespace Overdrive\Web\Database\Seeder;
use Illuminate\Database\Seeder;
use Carbon\Carbon;
use DB;
class Menu extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// DB::statement('SET FOREIGN_KEY_CHECKS=0');
// DB::table('acl_roles')->truncate();
DB::table('menu')->insert([
[
'nama_bm' => 'Pengurusan Sistem',
'nama_en' => 'System Management',
'type' => '2',
'parent_id' => null,
'route' => null,
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'nama_bm' => 'Pengurusan Menu',
'nama_en' => 'Menu Management',
'type' => '1',
'parent_id' => '1',
'route' => 'menu/index',
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'nama_bm' => 'Pengurusan Pengguna',
'nama_en' => 'User Management',
'type' => '1',
'parent_id' => '1',
'route' => 'user/index',
'permission' => '["*"]',
'order' => '2',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'nama_bm' => 'Pengurusan Hak',
'nama_en' => 'Permission Settings',
'type' => '1',
'parent_id' => '4',
'route' => 'user/permissions',
'permission' => '["*"]',
'order' => '2',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'nama_bm' => 'Tetapan Pengguna',
'nama_en' => 'User Settings',
'type' => '1',
'parent_id' => '4',
'route' => 'user/index',
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'nama_bm' => 'Pengurusan Peranan',
'nama_en' => 'Role Setting',
'type' => '1',
'parent_id' => '4',
'route' => 'user/role',
'permission' => '["*"]',
'order' => '3',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
]
]);
}
}
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'title' => 'Menu Management',
'addbutton' => 'Add Main Menu',
'cancelbutton' => 'Cancel',
'savebutton' => 'Save',
'addtitle' => 'Add Main Menu',
'addsubtitle' => 'Add Sub Menu',
'addsubbutton' => 'Add',
'menutitle_ms' => 'Menu Name (Bahasa)',
'menutitle_en' => 'Menu Name (English)',
'url' => 'Menu route',
'url_note' => 'Not required if this manu have sub-menu',
'permission' => 'Permission Control',
'status' => 'Activate/Deactivate',
'active' => 'ACTIVE',
'inactive' => 'INACTIVE',
'order' => 'Order',
'orderup' => 'Up',
'orderdown' => 'Down',
'edit' => 'Edit',
'deleteinfo' => 'You cannot remove menu that has child',
'deletebutton' => 'Remove',
'changeicon' => 'Change Menu Icon',
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
// USER INDEX
'title' => 'User Management',
'button-add' => 'Add New User',
'table-name' => 'Name',
'table-email' => 'Email',
'table-role' => 'Role',
'table-status' => 'Status',
'table-action' => 'Action',
// USER EDIT
'edit-name' => 'User Name',
'edit-title' => 'Default Value',
'edit-label-name' => 'Name',
'edit-label-email' => 'Email',
'edit-label-status' => 'Status',
'edit-label-role' => 'Roles',
'edit-label-option' => 'Choose your option',
'edit-label-option-active' => 'ACTIVE',
'edit-label-option-inactive' => 'INACTIVE',
'edit-button-label-back' => 'Back',
'edit-button-label-save' => 'Save',
'edit-message-update' => 'Account Updated',
// USER CREATE
'create-header' => 'Add new user',
'create-title' => 'Default Value',
'create-label-name' => 'Name',
'create-label-email' => 'Email',
'create-label-role' => 'Roles',
'create-button-label-back' => 'Back',
'create-button-label-save' => 'Save',
'user-create' => 'User is successfully created',
// PERMISSION INDEX
'permission-index' => 'Total number of permissions',
'permission-label' => 'Permissions',
'permission-list' => 'Permissions list',
'permission-title' => 'Name',
'permission-desc' => 'No description',
// PERMISSION EDIT
'permission-edit-header' => 'Edit Permission',
'permission-edit-name' => 'Permission Name',
'permission-edit-label-name' => 'Name',
'permission-edit-label-desc' => 'Description',
'permission-edit-button-label-back' => 'Back',
'permission-edit-button-label-save' => 'Save',
'permission-edit-button-label-delete' => 'Delete',
'permission-edit-info-label-delete' => 'Make sure permission is not use in roles',
'permission-edit-title-label-delete' => 'Delete Permission',
'permission-edit-confirm-label-delete' => 'Are you sure want to delete this permission ?',
'permission-edit-message-update' => 'Permission Updated',
'permission-edit-message-delete' => 'Permission Deleted',
// ROLES INDEX
'role-index' => 'Total number of roles',
'role-label' => 'Roles',
'role-add-button-label' => 'ADD',
'role-list' => 'Permissions list',
'role-title' => 'Name',
'role-desc' => 'No description',
// ROLES EDIT
'role-edit-header' => 'Edit Role',
'role-edit-name' => 'Role Name',
'role-edit-label-name' => 'Permissions',
'role-edit-label-desc' => 'Description',
'role-edit-button-label-back' => 'Back',
'role-edit-button-label-save' => 'Save',
'role-edit-button-label-all' => 'Select All',
'role-edit-info-label-delete' => 'Make sure permission is not use in roles',
'role-edit-title-label-delete' => 'Delete Permission',
'role-edit-confirm-label-delete' => 'Are you sure want to delete this permission ?',
'role-edit-message-update' => 'Role Updated',
'role-edit-message-create' => 'New role created',
'role-edit-message-delete' => 'Permission Deleted',
// ROLES ADD
'role-create-index' => 'Add new role',
'role-label' => 'Roles',
'role-create-name' => 'Role Name',
'role-add-button-label' => 'ADD',
'role-list' => 'Permissions list',
'role-title' => 'Name',
'role-desc' => 'No description',
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'title' => 'Pengurusan Menu',
'addbutton' => 'Tambah Menu',
'cancelbutton' => 'Batal',
'savebutton' => 'Simpan',
'addtitle' => 'Tambah Menu',
'addsubtitle' => 'Tambah Sub Menu',
'addsubbutton' => 'Tambah',
'menutitle_ms' => 'Menu Name (Bahasa)',
'menutitle_en' => 'Menu Name (English)',
'url' => 'Pautan Menu',
'url_note' => 'Sila kosongkan jika menu mempunyai sub-menu',
'permission' => 'Hak Akses',
'status' => 'Aktif/Nyah-aktif',
'active' => 'AKTIF',
'inactive' => 'TAK AKTIF',
'order' => 'Susunan',
'orderup' => 'Atas',
'orderdown' => 'Bawah',
'edit' => 'Edit',
'deleteinfo' => 'Menu mempunyai sub-menu tidak dapat dihapuskan',
'deletebutton' => 'Hapus',
'changeicon' => 'Tukar Icon Menu',
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
// USER INDEX
'title' => 'User Management',
'button-add' => 'Add New User',
'table-name' => 'Name',
'table-email' => 'Email',
'table-role' => 'Role',
'table-status' => 'Status',
'table-action' => 'Action',
// USER EDIT
'edit-name' => 'User Name',
'edit-title' => 'Default Value',
'edit-label-name' => 'Name',
'edit-label-email' => 'Email',
'edit-label-status' => 'Status',
'edit-label-role' => 'Roles',
'edit-label-option' => 'Choose your option',
'edit-label-option-active' => 'ACTIVE',
'edit-label-option-inactive' => 'INACTIVE',
'edit-button-label-back' => 'Back',
'edit-button-label-save' => 'Save',
'edit-message-update' => 'Account Updated',
// USER CREATE
'create-header' => 'Add new user',
'create-title' => 'Default Value',
'create-label-name' => 'Name',
'create-label-email' => 'Email',
'create-label-role' => 'Roles',
'create-button-label-back' => 'Back',
'create-button-label-save' => 'Save',
'user-create' => 'User is successfully created',
// PERMISSION INDEX
'permission-index' => 'Total number of permissions',
'permission-label' => 'Permissions',
'permission-list' => 'Permissions list',
'permission-title' => 'Name',
'permission-desc' => 'No description',
// PERMISSION EDIT
'permission-edit-header' => 'Edit Permission',
'permission-edit-name' => 'Permission Name',
'permission-edit-label-name' => 'Name',
'permission-edit-label-desc' => 'Description',
'permission-edit-button-label-back' => 'Back',
'permission-edit-button-label-save' => 'Save',
'permission-edit-button-label-delete' => 'Delete',
'permission-edit-info-label-delete' => 'Make sure permission is not use in roles',
'permission-edit-title-label-delete' => 'Delete Permission',
'permission-edit-confirm-label-delete' => 'Are you sure want to delete this permission ?',
'permission-edit-message-update' => 'Permission Updated',
'permission-edit-message-delete' => 'Permission Deleted',
// ROLES INDEX
'role-index' => 'Total number of roles',
'role-label' => 'Roles',
'role-add-button-label' => 'ADD',
'role-list' => 'Permissions list',
'role-title' => 'Name',
'role-desc' => 'No description',
];
...@@ -22,6 +22,41 @@ ...@@ -22,6 +22,41 @@
</style> </style>
<div class="row"> <div class="row">
sini isi <div class="grid grid-cols-11 gap-x-6 mt-5 pb-20">
<!-- BEGIN: Notification -->
<div class="intro-y col-span-11 alert alert-primary alert-dismissible show flex items-center mb-6" role="alert">
<span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="info" data-lucide="info" class="lucide lucide-info w-4 h-4 mr-2"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg></span>
<span>Before anything, please create your menu using menu managmenet here <a href="/menu/index" class="underline ml-1" target="blank">Create</a></span>
<button type="button" class="btn-close text-white" data-tw-dismiss="alert" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="x" data-lucide="x" class="lucide lucide-x w-4 h-4"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<!-- BEGIN: Notification -->
<div class="intro-y col-span-11 2xl:col-span-9">
<div class="intro-y box col-span-12 2xl:col-span-6">
<div class="flex items-center px-5 py-3 border-b border-slate-200/60 dark:border-darkmode-400">
<h2 class="font-medium text-base mr-auto">Announcement</h2>
<button data-carousel="announcement" data-target="prev" class="tiny-slider-navigator btn btn-outline-secondary px-2 mr-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="chevron-left" data-lucide="chevron-left" class="lucide lucide-chevron-left w-4 h-4"><polyline points="15 18 9 12 15 6"></polyline></svg>
</button>
<button data-carousel="announcement" data-target="next" class="tiny-slider-navigator btn btn-outline-secondary px-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="chevron-right" data-lucide="chevron-right" class="lucide lucide-chevron-right w-4 h-4"><polyline points="9 18 15 12 9 6"></polyline></svg>
</button>
</div>
<div class="tns-outer" id="announcement-ow"><button type="button" data-action="stop"><span class="tns-visually-hidden">stop animation</span>stop</button><div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">2</span> of 3</div><div id="announcement-mw" class="tns-ovh"><div class="tns-inner" id="announcement-iw"><div class="tiny-slider py-5 tns-slider tns-carousel tns-subpixel tns-calc tns-horizontal" id="announcement" style="transform: translate3d(-20%, 0px, 0px); transition-duration: 0s;"><div class="px-5 tns-item tns-slide-cloned" aria-hidden="true" tabindex="-1">
<div class="font-medium text-lg">Midone Admin Template</div>
<div class="text-slate-600 dark:text-slate-500 mt-2">Check here how to use this template </div>
<div class="flex items-center mt-5">
<div class="px-3 py-2 text-primary bg-primary/10 dark:bg-darkmode-400 dark:text-slate-300 rounded font-medium">02 June 2021</div>
<a class="btn btn-secondary ml-auto" href="http://rubick-laravel.left4code.com/?layout=side-menu">View Details</a>
</div>
</div>
</div></div></div></div></div>
</div>
</div>
</div>
</div> </div>
@endsection @endsection
\ No newline at end of file
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
<link rel="stylesheet" type="text/css" href="{{asset('overide/web/themes/apim/default/vendors/redactor/plugins/alignment/alignment.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('overide/web/themes/apim/default/vendors/redactor/plugins/alignment/alignment.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('overide/web/themes/apim/default/css/pages/widget-timeline.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('overide/web/themes/apim/default/css/pages/widget-timeline.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('overide/web/themes/apim/default/css/pages/page-maintenance.css')}}">
</head> </head>
......
...@@ -11,7 +11,7 @@ $notisall = \Overdrive\Web\Model\NotificationTable::where('status','=',0)->where ...@@ -11,7 +11,7 @@ $notisall = \Overdrive\Web\Model\NotificationTable::where('status','=',0)->where
.backcolor .backcolor
{ {
background-color: #616161 !important; background-color: #EFF3F6 !important;
} }
......
...@@ -18,12 +18,12 @@ if (Session::has('locale')) { ...@@ -18,12 +18,12 @@ if (Session::has('locale')) {
<style type="text/css"> <style type="text/css">
#backcolor { #backcolor {
background-color: #EFEFEF !important; background-color: #EFF3F6 !important;
/*#616161*/ /*#616161*/
} }
.backcolor { .backcolor {
background-color: #EFEFEF !important; background-color: #EFF3F6 !important;
/*#616161*/ /*#616161*/
} }
...@@ -46,7 +46,7 @@ if (Session::has('locale')) { ...@@ -46,7 +46,7 @@ if (Session::has('locale')) {
<!-- BEGIN: Side Menu --> <!-- BEGIN: Side Menu -->
<nav class="side-nav" style="font-size: small; width: 200px; !important"> <nav class="side-nav" style="font-size: small; width: 200px; !important">
<a href="" class="intro-x flex items-center pl-5 pt-4"> <a href="/home" class="intro-x flex items-center pl-5 pt-4">
<img alt="Rubick Tailwind HTML Admin Template" src="{{ asset('overide/web/themes/apim/assets/images/logo/materialize-logo-big.png') }}"> <img alt="Rubick Tailwind HTML Admin Template" src="{{ asset('overide/web/themes/apim/assets/images/logo/materialize-logo-big.png') }}">
</a> </a>
...@@ -55,7 +55,7 @@ if (Session::has('locale')) { ...@@ -55,7 +55,7 @@ if (Session::has('locale')) {
<!-- Menu start --> <!-- Menu start -->
<ul> <ul>
<!-- @if (auth()->user()->status == 1) --> @if ((auth()->user()->status == 'ACTIVE') OR (auth()->user()->status == 1))
@foreach($menu as $key => $mainmenu ) @foreach($menu as $key => $mainmenu )
@if($mainmenu->status == 1) @if($mainmenu->status == 1)
...@@ -223,7 +223,7 @@ if (Session::has('locale')) { ...@@ -223,7 +223,7 @@ if (Session::has('locale')) {
@endforeach @endforeach
<!-- @elseif(auth()->user()->status == 2) @elseif(auth()->user()->status == 2)
<li> <li>
<a href="" class="side-menu side-menu {{ request()->is('home') ? '--active' : '' }}"> <a href="" class="side-menu side-menu {{ request()->is('home') ? '--active' : '' }}">
<div class="side-menu__icon"> <i data-feather="home"></i> </div> <div class="side-menu__icon"> <i data-feather="home"></i> </div>
...@@ -241,7 +241,7 @@ if (Session::has('locale')) { ...@@ -241,7 +241,7 @@ if (Session::has('locale')) {
</div> </div>
</a> </a>
</li> </li>
@endif --> @endif
</ul> </ul>
</nav> </nav>
......
{!! form()->open()->post()->action(route('menum::menu.addsub'))!!}
<input name="parent" type="hidden" class="form-control" value="{{$menu->id}}">
<div class="modal-body p-10 text-left">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i> @lang('web::page.addsubtitle') @if($locale == 'en') for {{$menu->name_en}} @else untuk {{$menu->name_bm}} @endif
</div>
<br>
<hr>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_ms') <sup>*</sup></label>
<input id="title_ms" name="title_ms" type="text" class="form-control" required="">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_en') <sup>*</sup></label>
<input id="title_en" name="title_en" type="text" class="form-control" required="">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-6" class="form-label"> @lang('web::page.permission')</label>
<select class="select2 w-full" multiple name="permission[]">
@foreach($permissions as $key => $pemlist)
<option value="{{$pemlist->name}}">{{$pemlist->description}}</option>
@endforeach
</select>
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.url')</label>
<input id="url" name="url" type="text" class="form-control" placeholder="@lang('web::page.url_note')">
</div>
<br>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<button type="button" data-dismiss="modal" class="btn btn-outline-secondary w-24 mr-2">@lang('web::page.cancelbutton')</button>
<button type="submit" class="btn btn-success w-24">@lang('web::page.savebutton')</button>
</div>
{!! form()->close() !!}
</div>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<div class="modal-body p-10 text-left" style="height: 60%;overflow-x: scroll;">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i>
@lang('web::page.changeicon')
</div>
<br>
<hr>
<br>
<br>
@foreach($icons as $iconlist)
<a href="/menu/icon/{{$id}}/{{$iconlist}}" style="margin:10px !important;"><i data-feather="{{$iconlist}}" style="height: 40px;width: 40px;"></i>
</a>
@endforeach
</div>
<script>
feather.replace()
</script>
@extends('web::backend.layouts.base')
@section('content')
<style type="text/css">
.modal { overflow: visible !important; }
.modal-body { overflow-y: visible !important; }
.render {
border: 1px solid #323232;
width: 96px;
min-height: 96px;
padding: 8px;
font-size: 14px;
display: flex;
align-items: center;
flex-flow: wrap;
justify-content: center;
text-align: center;
}
</style>
<?php
?>
<div class="row blocking">
<div class="col s12 m12 l12">
<div id="html-validations" class="card card-tabs">
<div id="prepdata" class="col s12" style="display: block;padding:unset;">
<div class="intro-y box px-5 pt-5 mt-5 mb-5 pb-5" style="">
<div class="font-medium text-base mr-auto"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bookmark"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path></svg> @lang('web::page.title') </div>
<br>
<hr>
<div class="row">
<div class="col s12">
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<a href="#" data-toggle="modal" data-target="#modeldetail" class="btn btn-primary"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="plus" class="lucide lucide-plus w-4 h-4 mr-5" data-lucide="plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> @lang('web::page.addbutton')</a>
</div>
</div>
<!-- modal -->
<div id="modeldetail" class="modal" data-backdrop="static" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
{!! form()->open()->post()->action(route('menum::menu.add'))!!}
<div class="modal-body p-10 text-left">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i> @lang('web::page.addtitle') </div>
<br>
<hr>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_ms') <sup>*</sup></label>
<input id="title_ms" name="title_ms" type="text" class="form-control" required="">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_en') <sup>*</sup></label>
<input id="title_en" name="title_en" type="text" class="form-control" required="">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-6" class="form-label"> @lang('web::page.permission')</label>
<select class="tom-select w-full" multiple name="permission[]">
@foreach($permissions as $key => $pemlist)
<option value="{{$pemlist->name}}">{{$pemlist->description}}</option>
@endforeach
</select>
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.url')</label>
<input id="url" name="url" type="text" class="form-control" placeholder="@lang('web::page.url_note')">
</div>
<br>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<button type="button" data-dismiss="modal" class="btn btn-outline-secondary w-24 mr-2">@lang('web::page.cancelbutton')</button>
<button type="submit" class="btn btn-success w-24">@lang('web::page.savebutton')</button>
</div>
{!! form()->close() !!}
</div>
</div>
</div>
</div>
<!-- end modal -->
</div>
</div>
<br>
<hr>
<br>
<div class="col-span-12 xl:col-span-4 mt-6">
<!-- global modal -->
<div id="giconmodal" class="modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content" id="iconmodalcontent">
</div>
</div>
</div>
<div id="modeladdsub" class="modal" data-backdrop="static" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content" id="modeladdsubdata">
</div>
</div>
</div>
<!-- end global modal -->
<div class="mt-5">
<?php $totalp = count($parent); ?>
@foreach($parent as $key => $menu)
<div class="intro-y">
<div class="box px-4 py-4 mb-3 flex items-center ">
<div class="w-13 h-13 flex-none image-fit rounded-md overflow-hidden">
<a class="cursor-pointer font-medium" data-toggle="modal" data-target="#giconmodal" onclick="openIcon({{$menu->id}})">
@if($menu->icon)
<i data-feather="{{$menu->icon}}" style="height: 40px;width: 40px;"></i>
@else
<i data-feather="layout" style="height: 40px;width: 40px;"></i>
@endif
</a>
</div>
<!-- modal -->
<!-- end modal -->
<div class="mr-auto" style="margin-left:10px !important;">
<div class="font-medium">
@if($locale == 'en') {{$menu->name_en}} @else {{$menu->name_bm}} @endif
</div>
<div class="text-gray-600 text-xs mt-0.5"> @if($menu->status == 2) <span style="color:red;font-weight: bolder;">@lang('web::page.inactive')</span> @else <span style="color:blue;font-weight: bolder;">@lang('web::page.active') @endif </span>|| ({{$menu->route}})</div>
</div>
<!-- <div class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2">Change Icon</div> -->
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end">
<a class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2" data-toggle="modal" data-target="#modeladdsub" onclick="addsubjs({{$menu->id}})"> @lang('web::page.addsubbutton')</a>
<!-- modal -->
<!-- end modal -->
<a class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2" data-toggle="modal" data-target="#modeleditp{{$menu->id}}">@lang('web::page.edit')</a>
<!-- modal -->
<div id="modeleditp{{$menu->id}}" class="modal" data-backdrop="static" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
{!! form()->open()->post()->action(route('menum::menu.edit'))!!}
<input name="mid" type="hidden" class="form-control" value="{{$menu->id}}">
<div class="modal-body p-10 text-left">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i> @lang('web::page.edit') @if($locale == 'en') for {{$menu->name_en}} @else untuk {{$menu->name_bm}} @endif </div>
<br>
<hr>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_ms') <sup>*</sup></label>
<input id="title_ms" name="title_ms" type="text" class="form-control" required="" value="{{$menu->name_bm}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_en') <sup>*</sup></label>
<input id="title_en" name="title_en" type="text" class="form-control" required="" value="{{$menu->name_en}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-6" class="form-label"> @lang('web::page.permission')</label>
<select data-header="Actors" class="tom-select w-full" multiple name="permission[]">
@foreach($permissions as $key => $pemlist)
<option value="{{data_get($pemlist,'name')}}" @if(in_array($pemlist->name,json_decode($menu->permission))) selected="" @endif>{{$pemlist->description}}</option>
@endforeach
</select>
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.url')</label>
<input id="url" name="url" type="text" class="form-control" placeholder="@lang('web::page.url_note')" value="{{$menu->route}}">
</div>
<br>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
@if(count($menu->child) > 0)
<div class="alert alert-pending show flex items-center" role="alert" style="float:left ">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="alert-triangle" data-lucide="alert-triangle" class="lucide lucide-alert-triangle w-6 h-6 mr-2"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg> @lang('web::page.deleteinfo')
</div>
@else
<a class="btn btn-outline-secondary w-24 mr-2" href="/menu/delete/{{$menu->id}}">@lang('web::page.deletebutton')</a>
@endif
<button type="button" data-dismiss="modal" class="btn btn-outline-secondary w-24 mr-2">@lang('web::page.cancelbutton')</button>
<button type="submit" class="btn btn-success w-24">@lang('web::page.savebutton')</button>
</div>
{!! form()->close() !!}
</div>
</div>
</div>
</div>
<!-- end modal -->
<a href="/menu/action/{{$menu->id}}" class="py-1 px-2 rounded-full text-xs bg-theme-8 text-grey cursor-pointer font-medium mr-2">@lang('web::page.status')</a>
<select class="sm:w-auto form-select box" style="width: unset !important;padding:unset !important;padding-right: 30px !important;" onchange="location = this.value;">
<option value="javascript:void(0)" selected>@lang('web::page.order')</option>
@if($totalp == 1)
@elseif($menu->order == 1)
<option value="/menu/order/{{$menu->id}}/2">@lang('web::page.orderdown')</option>
@elseif($totalp <= $menu->order)
<option value="/menu/order/{{$menu->id}}/1">@lang('web::page.orderup')</option>
@elseif(($menu->order > 1) AND ($totalp >= $menu->order))
<option value="/menu/order/{{$menu->id}}/2">@lang('web::page.orderdown')</option>
<option value="/menu/order/{{$menu->id}}/1">@lang('web::page.orderup')</option>
@endif
</select>
</div>
</div>
</div>
<?php $totalc = count($menu->child); ?>
@foreach($menu->child as $childkey => $child)
<div class="intro-y">
<div class="box px-4 py-4 mb-3 flex items-center " style="margin-left:50px">
<div class="w-13 h-13 flex-none image-fit rounded-md overflow-hidden">
<a class="cursor-pointer font-medium" data-toggle="modal" data-target="#giconmodal" onclick="openIcon({{$child->id}})">
@if($child->icon)
<i data-feather="{{$child->icon}}" style="height: 40px;width: 40px;"></i>
@else
<i data-feather="layout" style="height: 40px;width: 40px;"></i>
@endif
</a>
</div>
<div class="mr-auto" style="margin-left:10px !important;">
<div class="font-medium">
@if($locale == 'en') {{$child->name_en}} @else {{$child->name_bm}} @endif
</div>
<div class="text-gray-600 text-xs mt-0.5"> @if($child->status == 2) <span style="color:red;font-weight: bolder;">@lang('web::page.inactive')</span> @else <span style="color:blue;font-weight: bolder;">@lang('web::page.active') @endif </span>|| ({{$child->route}})</div>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end">
<!-- <div class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2">Change Icon</div> -->
<a class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2" data-toggle="modal" data-target="#modeladdsub" onclick="addsubjs({{$child->id}})">@lang('web::page.addsubbutton')</a>
<!-- modal -->
<!-- end modal -->
<a class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2" data-toggle="modal" data-target="#modeleditc{{$child->id}}">@lang('web::page.edit')</a>
<!-- modal -->
<div id="modeleditc{{$child->id}}" class="modal" data-backdrop="static" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
{!! form()->open()->post()->action(route('menum::menu.edit'))!!}
<input name="mid" type="hidden" class="form-control" value="{{$child->id}}">
<div class="modal-body p-10 text-left">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i> @lang('web::page.edit') @if($locale == 'en') for {{$child->name_en}} @else untuk {{$child->name_bm}} @endif </div>
<br>
<hr>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_ms') <sup>*</sup></label>
<input id="title_ms" name="title_ms" type="text" class="form-control" required="" value="{{$child->name_bm}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_en') <sup>*</sup></label>
<input id="title_en" name="title_en" type="text" class="form-control" required="" value="{{$child->name_en}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-6" class="form-label"> @lang('web::page.permission')</label>
<select data-header="Actors" class="tom-select w-full" multiple name="permission[]">
@foreach($permissions as $key => $pemlist)
<option value="{{$pemlist->name}}" @if(in_array($pemlist->name,json_decode($child->permission))) selected="" @endif>{{$pemlist->description}}</option>
@endforeach
</select>
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.url')</label>
<input id="url" name="url" type="text" class="form-control" placeholder="@lang('web::page.url_note')" value="{{$child->route}}">
</div>
<br>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
@if(count($child->submenu) > 0)
<div class="alert alert-pending show flex items-center" role="alert" style="float:left ">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" icon-name="alert-triangle" data-lucide="alert-triangle" class="lucide lucide-alert-triangle w-6 h-6 mr-2"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg> @lang('web::page.deleteinfo')
</div>
@else
<a class="btn btn-outline-secondary w-24 mr-2" href="/menu/delete/{{$child->id}}">@lang('web::page.deletebutton')</a>
@endif
<button type="button" data-dismiss="modal" class="btn btn-outline-secondary w-24 mr-2">@lang('web::page.cancelbutton')</button>
<button type="submit" class="btn btn-success w-24">@lang('web::page.savebutton')</button>
</div>
{!! form()->close() !!}
</div>
</div>
</div>
</div>
<!-- end modal -->
<a href="/menu/action/{{$child->id}}" class="py-1 px-2 rounded-full text-xs bg-theme-8 text-grey cursor-pointer font-medium mr-2">@lang('web::page.status')</a>
<select class="sm:w-auto form-select box" style="width: unset !important;padding:unset !important;padding-right: 30px !important;" onchange="location = this.value;">
<option value="javascript:void(0)" selected>@lang('web::page.order')</option>
@if($totalc == 1)
@elseif($childkey == 0)
<option value="/menu/order/{{$child->id}}/2">@lang('web::page.orderdown')</option>
@elseif($totalc <= $child->order)
<option value="/menu/order/{{$child->id}}/1">@lang('web::page.orderup')</option>
@elseif(($childkey > 1) AND ($totalc >= $child->order))
<option value="/menu/order/{{$child->id}}/2">@lang('web::page.orderdown')</option>
<option value="/menu/order/{{$child->id}}/1">@lang('web::page.orderup')</option>
@endif
</select>
</div>
</div>
</div>
<?php $totals = count($child->submenu); ?>
@foreach($child->submenu as $subkey => $sub)
<div class="intro-y">
<div class="box px-4 py-4 mb-3 flex items-center " style="margin-left:100px">
<div class="w-10 h-10 flex-none image-fit rounded-md overflow-hidden">
<a class="cursor-pointer font-medium" data-toggle="modal" data-target="#giconmodal" onclick="openIcon({{$sub->id}})">
@if($sub->icon)
<i data-feather="{{$sub->icon}}" style="height: 40px;width: 40px;"></i>
@else
<i data-feather="layout" style="height: 40px;width: 40px;"></i>
@endif
</a>
</div>
<div class="mr-auto" style="margin-left:10px !important;">
<div class="font-medium">
@if($locale == 'en') {{$sub->name_en}} @else {{$sub->name_bm}} @endif
</div>
<div class="text-gray-600 text-xs mt-0.5"> @if($sub->status == 2) <span style="color:red;font-weight: bolder;">@lang('web::page.inactive')</span> @else <span style="color:blue;font-weight: bolder;">@lang('web::page.active') @endif </span>|| ({{$sub->route}})</div>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end">
<!-- <div class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2">Change Icon</div> -->
<a class="py-1 px-2 rounded-full text-xs bg-theme-9 text-white cursor-pointer font-medium mr-2" data-toggle="modal" data-target="#modeledits{{$sub->id}}">@lang('web::page.edit')</a>
<!-- modal -->
<div id="modeledits{{$sub->id}}" class="modal" data-backdrop="static" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
{!! form()->open()->post()->action(route('menum::menu.edit'))!!}
<input name="mid" type="hidden" class="form-control" value="{{$sub->id}}">
<div class="modal-body p-10 text-left">
<div class="font-medium text-base mr-auto"> <i data-feather="bookmark"></i> @lang('web::page.edit') @if($locale == 'en') for {{$sub->name_en}} @else untuk {{$sub->name_bm}} @endif </div>
<br>
<hr>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_ms') <sup>*</sup></label>
<input id="title_ms" name="title_ms" type="text" class="form-control" required="" value="{{$sub->name_bm}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.menutitle_en') <sup>*</sup></label>
<input id="title_en" name="title_en" type="text" class="form-control" required="" value="{{$sub->name_en}}">
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-6" class="form-label"> @lang('web::page.permission')</label>
<select data-header="Actors" class="tom-select w-full" multiple name="permission[]">
@foreach($permissions as $key => $pemlist)
<option value="{{$pemlist->name}}" @if(in_array($pemlist->name,json_decode($sub->permission))) selected="" @endif>{{$pemlist->description}}</option>
@endforeach
</select>
</div>
<div class="intro-y col-span-12 sm:col-span-6">
<label for="input-wizard-1" class="form-label">@lang('web::page.url')</label>
<input id="url" name="url" type="text" class="form-control" placeholder="@lang('web::page.url_note')" value="{{$sub->route}}">
</div>
<br>
</div>
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<a class="btn btn-outline-secondary w-24 mr-2" href="/menu/delete/{{$sub->id}}">@lang('web::page.deletebutton')</a>
<button type="button" data-dismiss="modal" class="btn btn-outline-secondary w-24 mr-2">@lang('web::page.cancelbutton')</button>
<button type="submit" class="btn btn-success w-24">@lang('web::page.savebutton')</button>
</div>
{!! form()->close() !!}
</div>
</div>
</div>
</div>
<!-- end modal -->
<a href="/menu/action/{{$sub->id}}" class="py-1 px-2 rounded-full text-xs bg-theme-8 text-grey cursor-pointer font-medium mr-2">@lang('web::page.status')</a>
<select class="sm:w-auto form-select box" style="width: unset !important;padding:unset !important;padding-right: 30px !important;" onchange="location = this.value;">
<option value="javascript:void(0)" selected>@lang('web::page.order')</option>
@if($totals == 1)
@elseif($subkey == 0)
<option value="/menu/order/{{$sub->id}}/2">@lang('web::page.orderdown')</option>
@elseif($totals <= $sub->order)
<option value="/menu/order/{{$sub->id}}/1">@lang('web::page.orderup')</option>
@elseif(($subkey > 0) AND ($totals >= $sub->order))
<option value="/menu/order/{{$sub->id}}/2">@lang('web::page.orderdown')</option>
<option value="/menu/order/{{$sub->id}}/1">@lang('web::page.orderup')</option>
@endif
</select>
</div>
</div>
</div>
@endforeach
@endforeach
<br>
<hr>
<br>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script type="text/javascript">
function openIcon(id) {
$.ajax({
type: "GET",
url: "{{ URL::to('menu/ajax/icon')}}"+"/"+id,
beforeSend: function ()
{
$('#iconmodalcontent').html('<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-2" id="indeterminate-linear-alamat"><div class="col-span-6 sm:col-span-3 xl:col-span-10 flex flex-col items-center"><svg width="20" viewBox="0 0 135 140" xmlns="http://www.w3.org/2000/svg" fill="rgb(45, 55, 72)" class="w-8 h-8"><rect y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.5s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.5s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="30" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.25s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.25s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="60" width="15" height="140" rx="6"><animate attributeName="height" begin="0s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="90" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.25s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.25s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="120" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.5s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.5s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect></svg><div class="text-center text-xs mt-2">Sila Tunggu</div></div></div>');
},
success: function(data)
{
$('#iconmodalcontent').html(data);
}
});
};
</script>
<script type="text/javascript">
function addsubjs(id) {
// $('#giconmodal').modal('open');
$.ajax({
type: "GET",
url: "{{ URL::to('menu/ajax/addsubs')}}"+"/"+id,
beforeSend: function ()
{
$('#modeladdsubdata').html('<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-2" id="indeterminate-linear-alamat"><div class="col-span-6 sm:col-span-3 xl:col-span-10 flex flex-col items-center"><svg width="20" viewBox="0 0 135 140" xmlns="http://www.w3.org/2000/svg" fill="rgb(45, 55, 72)" class="w-8 h-8"><rect y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.5s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.5s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="30" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.25s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.25s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="60" width="15" height="140" rx="6"><animate attributeName="height" begin="0s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="90" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.25s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.25s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect><rect x="120" y="10" width="15" height="120" rx="6"><animate attributeName="height" begin="0.5s" dur="1s" values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="y" begin="0.5s" dur="1s" values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear" repeatCount="indefinite"></animate></rect></svg><div class="text-center text-xs mt-2">Sila Tunggu</div></div></div>');
},
success: function(data)
{
$( ".select2-single, .select2-multiple" ).select2( {
theme: "bootstrap",
containerCssClass: ':all:'
} );
$('#modeladdsubdata').html(data);
// unblock('blocking');
}
});
};
</script>
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="container">
<div class="contact-overlay"></div>
<div class="sidebar-left sidebar-fixed">
<div class="sidebar">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="sidebar-details">
<h5 class="m-0 sidebar-title" style="font-size: 30;"><i data-feather="aperture" class="w-14 h-14 mr-2"></i>@lang('web::user-management.permission-edit-header')
</h5>
<br>
<a href="/user/permissions" class="btn btn-sm btn-warning w-32 mr-2 mb-2"><i data-feather="plus" class="w-4 h-4 mr-2"></i>@lang('web::user-management.permission-edit-button-label-back') </a>
</div>
</div>
</div>
</div>
</div>
<!-- Sidebar Area Ends -->
<!-- Content Area Starts -->
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.permission-edit-name') : {{$permission->name}}
</h2>
</div>
{!! form()->open()->post()->action(route('backend::permissions.update'))->attribute('id', 'saveuser')->horizontal() !!}
<input type="hidden" name="id" value="{{data_get($permission,'id')}}"/>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
<div><label for="vertical-form-1" class="form-label">@lang('web::user-management.permission-edit-label-name')</label>
<input type="text" id="name" name="name" readonly="readonly" class="form-control" value="{{$permission->name}}" required="required" placeholder="@lang('web::user-management.permission-edit-label-name')">
</div>
<br>
<div> <label for="vertical-form-1" class="form-label">@lang('web::user-management.permission-edit-label-desc')</label>
<input type="text" id="description" name="description" class="form-control" value="{{$permission->description}}" required="required" placeholder="@lang('web::user-management.permission-edit-label-desc')">
</div>
<br>
</div>
<br>
</div>
</div>
</div>
</div>
<hr>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<button class="btn btn-primary w-24 ml-2" type="submit" name="action">@lang('web::user-management.permission-edit-button-label-save')</button>
</div>
</div>
</div>
</div>
</div>
{!! form()->close() !!}
<hr>
<div class="col s12" style="display: none">
<div class="container">
<div class="card-content p-5" style="background-color: #ef1c1c;">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
<div class="intro-y box p-5 bg-theme-1 text-white mt-5" style="background-color: #d21616;">
<span class="card-title"> @lang('web::user-management.permission-edit-title-label-delete')</span>
<p>
@lang('web::user-management.permission-edit-info-label-delete')
</p>
<br>
<br>
{!! form()->open()->get()->action(route('backend::permission.delete', $permission['id']))->horizontal() !!}
<button class="btn waves-effect waves-light red accent-2" type="submit" name="submit" value="1"
onclick="return confirm('Are you sure want to delete this permission')">@lang('web::user-management.permission-edit-button-label-delete')
</button>
{!! form()->close() !!}
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script')
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="container">
<div class="contact-overlay"></div>
<div class="sidebar-left sidebar-fixed">
<div class="sidebar">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="sidebar-details">
<h5 class="m-0 sidebar-title" style="font-size: 30;"><i data-feather="aperture" class="w-14 h-14 mr-2"></i> @lang('web::user-management.permission-label') &nbsp;
<!-- <a href="/admin/permissionadd" data-toggle="modal" data-target="#modeladd" class="btn btn-sm btn-warning w-32 mr-2 mb-2"><i data-feather="plus" class="w-4 h-4 mr-2"></i>ADD</a> -->
</h5>
<div class="mt-10 pt-2" >
<p class="m-0 subtitle font-weight-700" style="color:#000480"><b style="font-size: 20px">@lang('web::user-management.permission-index')</b></p>
<p class="m-0 text-muted " style="color:purple"><b style="font-size: 20px">{{$permission->count()}} @lang('web::user-management.permission-label')</b></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Sidebar Area Ends -->
<!-- Content Area Starts -->
<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-5">
<div class="col-span-12 lg:col-span-4 xxl:col-span-3">
<div class="intro-y pr-1">
<div class="box p-2">
<div class="chat__tabs nav nav-tabs justify-center" role="tablist">
<a id="all-tab" data-toggle="tab" data-target="#all" href="javascript:;" class="flex-1 py-2 rounded-md text-center active" role="tab" aria-controls="all" aria-selected="true">@lang('web::user-management.permission-list')</a>
<!-- <a id="manager-tab" data-toggle="tab" data-target="#manager" href="javascript:;" class="flex-1 py-2 rounded-md text-center" role="tab" aria-controls="manager" aria-selected="false">Manager</a>
<a id="provider-tab" data-toggle="tab" data-target="#provider" href="javascript:;" class="flex-1 py-2 rounded-md text-center" role="tab" aria-controls="provider" aria-selected="false">Provider</a>
<a id="consumer-tab" data-toggle="tab" data-target="#consumer" href="javascript:;" class="flex-1 py-2 rounded-md text-center" role="tab" aria-controls="consumer" aria-selected="false">Consumer</a> -->
</div>
</div>
</div>
<div class="tab-content">
<div id="all" class="tab-pane active" role="tabpanel" aria-labelledby="all-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
@foreach($permission->sortBy('type') as $key => $perm)
<div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
<a href="/user/editpermission/{{$perm->id}}" style="color:white !important" onclick="">
<div class="report-box zoom-in">
<div class="box p-5 zoom-in" style="background: linear-gradient(45deg, #00CCB0, #00B89A) !important;height: 120px;font-size: 14px">
<div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>@lang('web::user-management.permission-title') : {{$perm->name}}</b></div>
<div>&nbsp;</div>
<span>@if($perm->description) {{$perm->description}} @else @lang('web::user-management.permission-desc') @endif</span>
</div>
</div>
</a>
</div>
@endforeach
</div>
</div>
<div id="manager" class="tab-pane" role="tabpanel" aria-labelledby="manager-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
@foreach($permission->where('type','=',1) as $key => $perm)
<div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
<a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
<div class="report-box zoom-in">
<div class="box p-5 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
<div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type : @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
<div>&nbsp;</div>
<span>{{ $perm->description ?? "No description" }}</span>
</div>
</div>
</a>
</div>
@endforeach
</div>
</div>
<div id="provider" class="tab-pane" role="tabpanel" aria-labelledby="provider-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
@foreach($permission->where('type','=',2) as $key => $perm)
<div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
<a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
<div class="report-box zoom-in">
<div class="box p-5 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
<div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type : @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
<div>&nbsp;</div>
<span>{{ $perm->description ?? "No description" }}</span>
</div>
</div>
</a>
</div>
@endforeach
</div>
</div>
<div id="consumer" class="tab-pane" role="tabpanel" aria-labelledby="consumer-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
@foreach($permission->where('type','=',3) as $key => $perm)
<div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
<a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
<div class="report-box zoom-in">
<div class="box p-5 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
<div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type : @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
<div>&nbsp;</div>
<span>{{ $perm->description ?? "No description" }}</span>
</div>
</div>
</a>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="container">
<div class="contact-overlay"></div>
<div class="sidebar-left sidebar-fixed">
<div class="sidebar">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="sidebar-details">
<h5 class="m-0 sidebar-title" style="font-size: 30;"><i data-feather="user" class="w-14 h-14 mr-2"></i> @lang('web::user-management.role-label')
</h5>
<br>
<a href="/user/roles" class="btn btn-sm btn-warning w-32 mr-2 mb-2"><i data-feather="plus" class="w-4 h-4 mr-2"></i>@lang('web::user-management.role-edit-button-label-back')</a>
</div>
</div>
</div>
</div>
</div>
<!-- Sidebar Area Ends -->
<!-- Content Area Starts -->
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.role-create-index')
</h2>
</div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
{!! form()->open()->post()->action(route('backend::role.save'))->horizontal() !!}
<label for="name3">@lang('web::user-management.role-create-name') </label>
<input type="text"d="name" name="name" class="form-control" required="required">
</div>
<br>
</div>
</div>
</div>
</div>
<hr>
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.role-edit-label-name')
</h2>
</div>
<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-5">
<div class="col-span-12 lg:col-span-4 xxl:col-span-3">
<div class="intro-y pr-1">
</div>
<div class="tab-content">
<div id="manager" class="tab-pane active" role="tabpanel" aria-labelledby="manager-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
<div class="intro-y col-span-12">
<div class="preview">
<div class="form-check mt-2">
<input id="select-all-1" class="form-check-input" type="checkbox">
&nbsp;<span style="padding-left:10px">@lang('web::user-management.role-edit-button-label-all')</span>
</div>
</div>
</div>
<hr>
@foreach($permissions as $key => $permission)
<div class="intro-y col-span-12">
<div class="preview">
<div class="form-check mt-2">
<input id="checkbox-switch-1" name="permissions[]" class="form-check-input" type="checkbox" value="{{ $permission->id }}" data-type='1'/>
&nbsp;<span style="padding-left:10px">{{ $permission->description ?? "No description" }}</span>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<button class="btn btn-primary w-24 ml-2" type="submit" name="action">@lang('web::user-management.role-edit-button-label-save')</button>
</div>
</div>
</div>
</div>
</div>
{!! form()->close() !!}
<hr>
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script type="text/javascript">
document.getElementById('select-all-1').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='1']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
document.getElementById('select-all-2').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='2']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
document.getElementById('select-all-3').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='3']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
</script>
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="container">
<div class="contact-overlay"></div>
<div class="sidebar-left sidebar-fixed">
<div class="sidebar">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="sidebar-details">
<h5 class="m-0 sidebar-title" style="font-size: 30;"><i data-feather="user" class="w-14 h-14 mr-2"></i> @lang('web::user-management.role-edit-header')
</h5>
<br>
<a href="/user/roles" data-toggle="modal" data-target="#modeladd" class="btn btn-sm btn-warning w-32 mr-2 mb-2"><i data-feather="plus" class="w-4 h-4 mr-2"></i>@lang('web::user-management.role-edit-button-label-back')</a>
</div>
</div>
</div>
</div>
</div>
<!-- Sidebar Area Ends -->
<!-- Content Area Starts -->
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.role-edit-name') : {{$role->name}}
</h2>
</div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
{!! form()->open()->put()->action(route('backend::role.update',$role['id']))->horizontal() !!}
<input type="hidden" name="id" value="{{data_get($role,'id')}}"/>
@if(($role->id == '1') OR ($role->id == '2') OR ($role->id == '3') OR ($role->id == '4'))
<input type="text" name="name" class="form-control" value="{{data_get($role,'name')}}" readonly="" />
@else
<input type="text" name="name"class="form-control" value="{{ old('name', $role['name']) }}" />
@endif
</div>
<br>
</div>
</div>
</div>
</div>
<hr>
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.role-edit-label-name')
</h2>
</div>
<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-5">
<div class="col-span-12 lg:col-span-4 xxl:col-span-3">
<div class="tab-content">
<div id="manager" class="tab-pane active" role="tabpanel" aria-labelledby="manager-tab">
<div class="grid grid-cols-12 gap-6 mt-5">
<div class="intro-y col-span-12">
<div class="preview">
<div class="form-check mt-2">
<input id="select-all-1" class="form-check-input" type="checkbox">
&nbsp;<span style="padding-left:10px">@lang('web::user-management.role-edit-button-label-all')</span>
</div>
</div>
</div>
<hr>
@foreach($permissions as $key => $permission)
<div class="intro-y col-span-12">
<div class="preview">
<div class="form-check mt-2">
<input id="checkbox-switch-1" name="permissions[]" class="form-check-input" type="checkbox" value="{{ $permission->id }}" {{ (in_array($permission->id, $assignedPermissions))?'checked=checked':'' }} data-type="1">
&nbsp;<span style="padding-left:10px">{{ $permission->description ?? "No description" }}</span>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 flex items-center justify-center sm:justify-end mt-5">
<button class="btn btn-primary w-24 ml-2" type="submit" name="action">@lang('web::user-management.role-edit-button-label-save')</button>
</div>
</div>
</div>
</div>
</div>
{!! form()->close() !!}
<hr>
@if($role->name !== 'admin')
<div class="col s12" style="display: none">
<div class="container">
<div class="card-content p-5" style="background-color: #ef1c1c;">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
<div class="intro-y box p-5 bg-theme-1 text-white mt-5" style="background-color: #d21616;">
<span class="card-title">@lang('laravolt::label.delete_role')</span>
<p>
@lang('laravolt::message.delete_role_intro', ['count' => ''])
</p>
<br>
<br>
<button class="btn waves-effect waves-light red accent-2" type="submit" name="submit" value="1"
onclick="return confirm('@lang('laravolt::message.role_deletion_confirmation')')">@lang('laravolt::action.delete')
</button>
{!! form()->close() !!}
</div>
</div>
<br>
</div>
</div>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script type="text/javascript">
document.getElementById('select-all-1').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='1']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
document.getElementById('select-all-2').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='2']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
document.getElementById('select-all-3').onclick = function() {
var checkboxes = document.querySelectorAll("[data-type='3']")
for (var checkbox of checkboxes) {
checkbox.checked = this.checked;
}
};
</script>
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="container">
<div class="contact-overlay"></div>
<div class="sidebar-left sidebar-fixed">
<div class="sidebar">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="sidebar-details">
<h5 class="m-0 sidebar-title" style="font-size: 30;"><i data-feather="user" class="w-14 h-14 mr-2"></i> @lang('web::user-management.role-label') &nbsp;
<a href="/user/addrole" data-toggle="modal" data-target="#modeladd" class="btn btn-sm btn-warning w-32 mr-2 mb-2"><i data-feather="plus" class="w-4 h-4 mr-2"></i>@lang('web::user-management.role-add-button-label')</a>
</h5>
<div class="mt-10 pt-2" >
<p class="m-0 subtitle font-weight-700" style="color:#000480"><b style="font-size: 20px">@lang('web::user-management.role-index')</b></p>
<p class="m-0 text-muted " style="color:purple"><b style="font-size: 20px">{{$role->count()}} @lang('web::user-management.role-label')</b></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Sidebar Area Ends -->
<!-- Content Area Starts -->
<div class="intro-y grid grid-cols-6 sm:gap-6 gap-y-6 box px-5 py-8 mt-5">
<div class="grid grid-cols-12 gap-6 mt-5">
@foreach($role as $key => $roles)
<div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
<a href="/user/editrole/{{$roles->id}}" style="color:white !important" onclick="">
<div class="report-box zoom-in">
<div class="box p-5 zoom-in" style="background: linear-gradient(45deg, #00CCB0, #00B89A) !important;height: 120px;font-size: 14px">
<div class="text-base"><b><i data-feather="user" class="w-14 h-14 mr-2"></i>{{$roles->name}}</b></div>
<div>&nbsp;</div>
<span>{{$roles->permission->count()}} <br> @lang('web::user-management.permission-label')</span>
</div>
</div>
</a>
</div>
@endforeach
</div>
</div>
</div>
@endsection
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.create-header')
</h2>
</div>
{!! form()->open()->post()->action(route('backend::user.store'))->horizontal() !!}
<input type="hidden" name="password" value="secret"/>
<div class="p-5" style="width: 100%">
<div class="preview">
<div class="text-gray-600 text-center mt-2 sm:py-3 border-b border-gray-200 dark:border-dark-5"><b>@lang('web::user-management.create-title')</b></div>
<div>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="user" class="w-4 h-4 mr-2"></i>@lang('web::user-management.create-label-name')</label>
<input type="text" class="form-control" placeholder="@lang('web::user-management.create-label-name')" id="name" name="name" required="required" value="">
</div>
<div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="mail" class="w-4 h-4 mr-2"></i>@lang('web::user-management.create-label-email')</label>
<input type="text" class="form-control" placeholder="@lang('web::user-management.create-label-email')" id="email" name="email" required="required" value="">
</div>
<!-- <div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="phone" class="w-4 h-4 mr-2"></i>Phone No.</label>
<input type="text" class="form-control" placeholder="Phone No." id="phone" name="phone" required="required" value="">
</div> -->
</div>
</div>
<br>
<div class="text-gray-600 text-center mt-2 sm:py-3 border-b border-gray-200 dark:border-dark-5"><b>@lang('web::user-management.create-label-role')</b></div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<div class="preview">
@foreach($acl_role as $key => $role)
<div class="form-check mt-2">
<input name="roles[]" type="checkbox" class="form-check-input" value="{{$role->id}}"/>
<label class="form-check-label" for="checkbox-switch-1">{{$role->name}}</label>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
<div class="intro-y col-span-12 flex items-center justiqwfy-center sm:justify-end mt-5">
<a class="btn btn-primary w-24 ml-2" href="/user/index"><span>@lang('web::user-management.create-button-label-back')</span></a>
<button class="btn btn-primary w-24 ml-2" type="submit" name="action">@lang('web::user-management.create-button-label-save')</button>
</div>
</div>
</div>
{!! form()->close() !!}
</div>
</div>
</div>
</div>
@endsection
@push('script')
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.edit-name') : {{$user->name}}
</h2>
</div>
{!! form()->open()->post()->action(route('backend::user.update'))->horizontal() !!}
<input type="hidden" name="id" value="{{data_get($user,'id')}}"/>
<div class="p-5" style="width: 100%">
<div class="preview">
<div class="text-gray-600 text-center mt-2 sm:py-3 border-b border-gray-200 dark:border-dark-5"><b>@lang('web::user-management.edit-title')</b></div>
<div>
<div class="grid grid-cols-12 gap-4 gap-y-5 mt-5">
<div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="user" class="w-4 h-4 mr-2"></i>@lang('web::user-management.edit-label-name')</label>
<input type="text" class="form-control" placeholder="@lang('web::user-management.edit-label-name')" id="name" name="name" required="required" value="{{$user->name}}">
</div>
<div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="mail" class="w-4 h-4 mr-2"></i>@lang('web::user-management.edit-label-email')</label>
<input type="text" class="form-control" placeholder="@lang('web::user-management.edit-label-email')" id="email" name="email" required="required" value="{{$user->email}}">
</div>
<!-- <div class="intro-y col-span-12 sm:col-span-12">
<label for="input-wizard-1" class="form-label"><i data-feather="phone" class="w-4 h-4 mr-2"></i>Phone No.</label>
<input type="text" class="form-control" placeholder="Phone No." id="phone" name="phone" required="required" value="{{data_get($user,'profile.phone_no')}}">
</div> -->
</div>
</div>
<br>
<br>
<div class="mt-3"> <label>@lang('web::user-management.edit-label-status')</label>
<div class="mt-2">
<select name="status" class="form-select" id="status" required="required">
<option value="" disabled selected>@lang('web::user-management.edit-label-option')</option>
<option value="1" @if($user->status == '1') selected @endif>@lang('web::user-management.edit-label-option-active')</option>
<option value="0" @if($user->status == '0') selected @endif>@lang('web::user-management.edit-label-option-inactive')</option>
</select>
</div>
<div class="input-field">
</div>
</div> <!-- END: Nested Select -->
<div class="text-gray-600 text-center mt-2 sm:py-3 border-b border-gray-200 dark:border-dark-5"><b>@lang('web::user-management.edit-label-role')</b></div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<div class="grid grid-cols-12 gap-4 gap-y-5 form-inline mt-5">
<div class="intro-y col-span-12 sm:col-span-6">
<div class="preview">
@foreach($acl_role as $key => $role)
<div class="form-check mt-2">
<input name="roles[]" type="checkbox" value="{{$role->id}}" {{ ($user->hasRole($role))?'checked=checked':'' }} />
<label class="form-check-label" for="checkbox-switch-1">{{$role->name}}</label>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
<div class="intro-y col-span-12 flex items-center justiqwfy-center sm:justify-end mt-5">
<a class="btn btn-primary w-24 ml-2" href="/user/index"><span>@lang('web::user-management.edit-button-label-back')</span></a>
<button class="btn btn-primary w-24 ml-2" type="submit" name="action">@lang('web::user-management.edit-button-label-save')</button>
</div>
</div>
</div>
<!-- {!! form()->close() !!} -->
</div>
</div>
</div>
</div>
@endsection
@push('script')
@endpush
\ No newline at end of file
@extends('web::backend.layouts.base')
@section('content')
<div class="tab-content mt-5">
<div id="profile" class="tab-pane active" role="tabpanel" aria-labelledby="profile-tab">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: Latest Uploads -->
<div class="intro-y box col-span-12 lg:col-span-12">
<div class="flex items-center px-5 py-5 sm:py-3 border-b border-gray-200 dark:border-dark-5">
<h2 class="font-medium text-base mr-auto">
@lang('web::user-management.title')
</h2>
<a href="/user/create" data-toggle="modal" data-target="#modeladd" class="btn btn-success btnadd"><i data-feather="plus" class="w-4 h-4 mr-2"></i>@lang('web::user-management.button-add')</a>
</div>
<div class="col s12">
<div class="container">
<div class="card-content p-5">
<table id="page-length-option" class="display" style="width:100%;font-size: 12px;background-color:#87b0fb">
<thead>
<tr>
<th style="text-align: left;">@lang('web::user-management.table-name')</th>
<th style="text-align: left;">@lang('web::user-management.table-email')</th>
<th style="text-align: left;">@lang('web::user-management.table-role')</th>
<th style="text-align: left;">@lang('web::user-management.table-status')</th>
<th style="text-align: left;">@lang('web::user-management.table-action')</th>
</tr>
</thead>
<tbody>
@foreach($useractive as $key =>$data)
<tr>
<td><b>{{$data->name}}</b></td>
<td>{{$data->email}}</td>
<td><b>{{$data->roles->implode('name', ', ')}}</b></td>
<td>@if($data->status == 0) PENDING / INACTIVE @else ACTIVE @endif</td>
<td><a href="/user/edit/{{$data->id}}" class="invoice-action-edit">
<i data-feather="edit-2" class="w-4 h-4 mr-2"></i>
</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END: Latest Uploads -->
@endsection
@push('script')
@endpush
\ No newline at end of file
<?php
use Illuminate\Support\Facades\Route;
use Overdrive\Web\Http\Controllers\Backend\DefaultController;
use Overdrive\Web\Http\Controllers\Backend\PermissionController;
use Overdrive\Web\Http\Controllers\Backend\RoleController;
use Overdrive\Web\Http\Controllers\Backend\User\AccountController;
use Overdrive\Web\Http\Controllers\Backend\User\Password\Generate;
use Overdrive\Web\Http\Controllers\Backend\User\Password\PasswordController;
use Overdrive\Web\Http\Controllers\Backend\User\Password\Reset;
use Overdrive\Web\Http\Controllers\Backend\User\UserController;
use Laravolt\Platform\Enums\Permission;
Route::group(
[
// 'namespace' => '\Overdrive\Web\Http\Controllers\Backend',
'prefix' => '',
'as' => 'backend::',
'middleware' => config('laravolt.platform.middleware'),
],
function () {
// Route::get('/', [DefaultController::class, 'index'])->name('index');
Route::middleware('can:'.Permission::MANAGE_USER)
->group(
function () {
Route::resource('/user/index', UserController::class)->except('show');
Route::get('/user/edit/{id}', [AccountController::class, 'edit'])->name('user.edit');
Route::post('/user/save', [AccountController::class, 'saveuser'])->name('user.update');
Route::get('/user/create/', [UserController::class, 'create'])->name('user.create');
Route::post('/user/store', [UserController::class, 'store'])->name('user.store');
Route::resource('password', PasswordController::class)->only('edit');
Route::post('password/{id}/reset', Reset::class)->name('password.reset');
Route::post('password/{id}/generate', Generate::class)->name('password.generate');
}
);
Route::middleware('can:'.Permission::MANAGE_ROLE)->resource('roles', RoleController::class);
Route::middleware('can:'.Permission::MANAGE_PERMISSION)
->group(
function () {
Route::get('/user/permissions', [PermissionController::class, 'index'])->name('permissions.index');
Route::get('/user/editpermission/{id}', [PermissionController::class, 'edit'])->name('permissions.edit');
Route::post('/permissions', [PermissionController::class, 'update'])->name('permissions.update');
Route::get('/user/deletepermission/{id}', [PermissionController::class, 'delete'])->name('permission.delete');
Route::get('/user/roles', [RoleController::class, 'index'])->name('role.index');
Route::get('/user/editrole/{id}', [RoleController::class, 'edit'])->name('role.edit');
Route::put('/user/roleupdate/', [RoleController::class, 'update'])->name('role.update');
Route::get('/user/addrole', [RoleController::class, 'add'])->name('role.add');
Route::post('/user/rolesave',[RoleController::class, 'save'])->name('role.save');
}
);
}
);
<?php
Route::group(
[
'namespace' => '\Overdrive\Web\Http\Controllers\Backend',
'prefix' => '',
'as' => 'menum::',
'middleware' => ['web', 'auth'],
],
function () {
Route::get('/menu/index/', 'MenuController@index')->name('menu.index');
Route::post('/menu/add/', 'MenuController@add')->name('menu.add');
Route::post('/menu/addsub/', 'MenuController@addsub')->name('menu.addsub');
Route::get('/menu/action/{id}', 'MenuController@togle')->name('menu.togle');
Route::get('/menu/order/{id}/{type}', 'MenuController@order')->name('menu.order');
Route::post('/menu/edit/', 'MenuController@edit')->name('menu.edit');
Route::get('/menu/delete/{id}', 'MenuController@delete')->name('menu.delete');
Route::get('/menu/icon/{id}/{icon}', 'MenuController@icon')->name('menu.delete');
Route::get('/menu/ajax/icon/{id}', 'MenuController@loadicon')->name('menu.loadicon');
Route::get('/menu/ajax/addsubs/{id}', 'MenuController@addsubs')->name('menu.addsubs');
}
);
\ No newline at end of file
...@@ -32,3 +32,7 @@ Route::group( ...@@ -32,3 +32,7 @@ Route::group(
...@@ -6,6 +6,9 @@ use Illuminate\Console\Command; ...@@ -6,6 +6,9 @@ use Illuminate\Console\Command;
use Overdrive\Web\Commands\AuthAssetCommand; use Overdrive\Web\Commands\AuthAssetCommand;
use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
class AuthAssetCommand extends Command class AuthAssetCommand extends Command
{ {
...@@ -14,7 +17,7 @@ class AuthAssetCommand extends Command ...@@ -14,7 +17,7 @@ class AuthAssetCommand extends Command
* *
* @var string * @var string
*/ */
protected $signature = 'overide:asset'; protected $signature = 'overide:asset {--refresh}';
/** /**
* The console command description. * The console command description.
...@@ -52,6 +55,18 @@ class AuthAssetCommand extends Command ...@@ -52,6 +55,18 @@ class AuthAssetCommand extends Command
$this->info('The routing auth file has being ovveriden.'); $this->info('The routing auth file has being ovveriden.');
$this->info('Synchronize Permissions Entries');
$this->syncPermission(['*','laravolt::manage-user','laravolt::manage-role','laravolt::manage-permission','laravolt::manage-system','laravolt::manage-settings']);
$this->info('Synchronize Permissions Successfull');
$this->info('database migration');
$this->call('migrate');
$this->call('db:seed', ['--class' => 'Menu']);
} }
private function publishConfiguration($forcePublish = false) private function publishConfiguration($forcePublish = false)
...@@ -67,4 +82,35 @@ class AuthAssetCommand extends Command ...@@ -67,4 +82,35 @@ class AuthAssetCommand extends Command
$this->call('vendor:publish', $params); $this->call('vendor:publish', $params);
} }
public function syncPermission(array $permissions)
{
$refresh = true;
// Schema::disableForeignKeyConstraints();
// app(config('laravolt.epicentrum.models.permission'))->truncate();
// Schema::enableForeignKeyConstraints();
// $items = collect();
$ids = collect($permissions)->transform(function ($name) {
$items = collect();
$permission = app(config('laravolt.epicentrum.models.permission'))->firstOrNew(['name' => $name]);
$status = 'No Change';
if (!$permission->exists) {
$permission->save();
$status = 'New';
}
$items->push(['id' => $permission->getKey(), 'name' => $name, 'status' => $status]);
return $items;
});
}
} }
<?php
namespace Overdrive\Web\Http\Controllers\Backend;
use Illuminate\Routing\Controller;
class DefaultController extends Controller
{
public function index()
{
return redirect()->route('epicentrum::users.index');
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use Mail;
use Curl;
use Overdrive\Web\Model\Menus;
use Overdrive\Web\Model\Mpermission;
use Session;
use App;
use Config;
use Lang;
use Overdrive\Web\Service\MenuServices;
use Overdrive\Web\Service\SubmenuServices;
use Overdrive\Web\Service\OrderingServices;
use Overdrive\Web\Service\ManageServices;
class MenuController extends Controller
{
public function index()
{
$segment = Menus::label()->with('child','child.submenu')->get();
$parent = Menus::main()->with('child','child.submenu')->get();
$permissions = Mpermission::get();
$icons = [
"activity",
"airplay",
"alert-circle",
"alert-octagon",
"alert-triangle",
"align-center",
"align-justify",
"align-left",
"align-right",
"anchor",
"aperture",
"arrow-down-left",
"arrow-down-right",
"arrow-down",
"arrow-left",
"arrow-right",
"arrow-up-left",
"arrow-up-right",
"arrow-up",
"at-sign",
"award",
"bar-chart-2",
"bar-chart",
"battery-charging",
"battery",
"bell-off",
"bell",
"bluetooth",
"bold",
"book",
"bookmark",
"box",
"briefcase",
"calendar",
"camera-off",
"camera",
"cast",
"check-circle",
"check-square",
"check",
"chevron-down",
"chevron-left",
"chevron-right",
"chevron-up",
"chevrons-down",
"chevrons-left",
"chevrons-right",
"chevrons-up",
"chrome",
"circle",
"clipboard",
"clock",
"cloud-drizzle",
"cloud-lightning",
"cloud-off",
"cloud-rain",
"cloud-snow",
"cloud",
"codepen",
"command",
"compass",
"copy",
"corner-down-left",
"corner-down-right",
"corner-left-down",
"corner-left-up",
"corner-right-down",
"corner-right-up",
"corner-up-left",
"corner-up-right",
"cpu",
"credit-card",
"crop",
"crosshair",
"delete",
"disc",
"download-cloud",
"download",
"droplet",
"edit-2",
"edit-3",
"edit",
"external-link",
"eye-off",
"eye",
"facebook",
"fast-forward",
"feather",
"file-minus",
"file-plus",
"file-text",
"file",
"film",
"filter",
"flag",
"folder",
"github",
"gitlab",
"globe",
"grid",
"hash",
"headphones",
"heart",
"help-circle",
"home",
"image",
"inbox",
"info",
"instagram",
"italic",
"layers",
"layout",
"life-buoy",
"link-2",
"link",
"list",
"loader",
"lock",
"log-in",
"log-out",
"mail",
"map-pin",
"map",
"maximize-2",
"maximize",
"menu",
"message-circle",
"message-square",
"mic-off",
"mic",
"minimize-2",
"minimize",
"minus-circle",
"minus-square",
"minus",
"monitor",
"moon",
"more-horizontal",
"more-vertical",
"move",
"music",
"navigation-2",
"navigation",
"octagon",
"package",
"paperclip",
"pause-circle",
"pause",
"percent",
"phone-call",
"phone-forwarded",
"phone-incoming",
"phone-missed",
"phone-off",
"phone-outgoing",
"phone",
"pie-chart",
"play-circle",
"play",
"plus-circle",
"plus-square",
"plus",
"pocket",
"power",
"printer",
"radio",
"refresh-ccw",
"refresh-cw",
"repeat",
"rewind",
"rotate-ccw",
"rotate-cw",
"save",
"scissors",
"search",
"server",
"settings",
"share-2",
"share",
"shield",
"shopping-cart",
"shuffle",
"sidebar",
"skip-back",
"skip-forward",
"slack",
"slash",
"sliders",
"smartphone",
"speaker",
"square",
"star",
"stop-circle",
"sun",
"sunrise",
"sunset",
"tablet",
"tag",
"target",
"thermometer",
"thumbs-down",
"thumbs-up",
"toggle-left",
"toggle-right",
"trash-2",
"trash",
"trending-down",
"trending-up",
"triangle",
"tv",
"twitter",
"type",
"umbrella",
"underline",
"unlock",
"upload-cloud",
"upload",
"user-check",
"user-minus",
"user-plus",
"user-x",
"user",
"users",
"video-off",
"video",
"voicemail",
"volume-1",
"volume-2",
"volume-x",
"volume",
"watch",
"wifi-off",
"wifi",
"wind",
"x-circle",
"x-square",
"x",
"zap",
"zoom-in",
"zoom-out"
];
if (Session::has('locale')) {
$locale = Session::get('locale', Config::get('app.locale'));
} else {
$locale = Lang::locale();
}
// $routeCollection = \Illuminate\Support\Facades\Route::getRoutes();
// dd($routeCollection);
return view('web::backend.menu.index', compact('segment','parent','permissions','locale','icons'));
}
//For Main Menu
public function loadicon($id)
{
$icons = [
"activity",
"airplay",
"alert-circle",
"alert-octagon",
"alert-triangle",
"align-center",
"align-justify",
"align-left",
"align-right",
"anchor",
"aperture",
"arrow-down-left",
"arrow-down-right",
"arrow-down",
"arrow-left",
"arrow-right",
"arrow-up-left",
"arrow-up-right",
"arrow-up",
"at-sign",
"award",
"bar-chart-2",
"bar-chart",
"battery-charging",
"battery",
"bell-off",
"bell",
"bluetooth",
"bold",
"book",
"bookmark",
"box",
"briefcase",
"calendar",
"camera-off",
"camera",
"cast",
"check-circle",
"check-square",
"check",
"chevron-down",
"chevron-left",
"chevron-right",
"chevron-up",
"chevrons-down",
"chevrons-left",
"chevrons-right",
"chevrons-up",
"chrome",
"circle",
"clipboard",
"clock",
"cloud-drizzle",
"cloud-lightning",
"cloud-off",
"cloud-rain",
"cloud-snow",
"cloud",
"codepen",
"command",
"compass",
"copy",
"corner-down-left",
"corner-down-right",
"corner-left-down",
"corner-left-up",
"corner-right-down",
"corner-right-up",
"corner-up-left",
"corner-up-right",
"cpu",
"credit-card",
"crop",
"crosshair",
"delete",
"disc",
"download-cloud",
"download",
"droplet",
"edit-2",
"edit-3",
"edit",
"external-link",
"eye-off",
"eye",
"facebook",
"fast-forward",
"feather",
"file-minus",
"file-plus",
"file-text",
"file",
"film",
"filter",
"flag",
"folder",
"github",
"gitlab",
"globe",
"grid",
"hash",
"headphones",
"heart",
"help-circle",
"home",
"image",
"inbox",
"info",
"instagram",
"italic",
"layers",
"layout",
"life-buoy",
"link-2",
"link",
"list",
"loader",
"lock",
"log-in",
"log-out",
"mail",
"map-pin",
"map",
"maximize-2",
"maximize",
"menu",
"message-circle",
"message-square",
"mic-off",
"mic",
"minimize-2",
"minimize",
"minus-circle",
"minus-square",
"minus",
"monitor",
"moon",
"more-horizontal",
"more-vertical",
"move",
"music",
"navigation-2",
"navigation",
"octagon",
"package",
"paperclip",
"pause-circle",
"pause",
"percent",
"phone-call",
"phone-forwarded",
"phone-incoming",
"phone-missed",
"phone-off",
"phone-outgoing",
"phone",
"pie-chart",
"play-circle",
"play",
"plus-circle",
"plus-square",
"plus",
"pocket",
"power",
"printer",
"radio",
"refresh-ccw",
"refresh-cw",
"repeat",
"rewind",
"rotate-ccw",
"rotate-cw",
"save",
"scissors",
"search",
"server",
"settings",
"share-2",
"share",
"shield",
"shopping-cart",
"shuffle",
"sidebar",
"skip-back",
"skip-forward",
"slack",
"slash",
"sliders",
"smartphone",
"speaker",
"square",
"star",
"stop-circle",
"sun",
"sunrise",
"sunset",
"tablet",
"tag",
"target",
"thermometer",
"thumbs-down",
"thumbs-up",
"toggle-left",
"toggle-right",
"trash-2",
"trash",
"trending-down",
"trending-up",
"triangle",
"tv",
"twitter",
"type",
"umbrella",
"underline",
"unlock",
"upload-cloud",
"upload",
"user-check",
"user-minus",
"user-plus",
"user-x",
"user",
"users",
"video-off",
"video",
"voicemail",
"volume-1",
"volume-2",
"volume-x",
"volume",
"watch",
"wifi-off",
"wifi",
"wind",
"x-circle",
"x-square",
"x",
"zap",
"zoom-in",
"zoom-out"
];
return view('web::backend.menu.ajax.icon', compact('icons','id'));
}
public function addsubs($id)
{
$permissions = Mpermission::get();
$menu = Menus::where('id',$id)->first();
if (Session::has('locale')) {
$locale = Session::get('locale', Config::get('app.locale'));
} else {
$locale = Lang::locale();
}
return view('web::backend.menu.ajax.addsub', compact('menu','permissions','locale'));
}
public function add(Request $request)
{
return (new MenuServices())->create($request);
}
// edit all menu
public function edit(Request $request)
{
return (new MenuServices())->update($request);
}
// delete all menu
public function delete($id)
{
return MenuServices::delete($id);
}
//for Sub menu
public function addsub(Request $request)
{
return (new SubmenuServices())->create($request);
}
//for Other menu manager
public function togle($id)
{
return ManageServices::status($id);
}
public function order($id,$type)
{
return OrderingServices::reorder($id,$type);
}
public function icon($id,$name)
{
return ManageServices::icon($id,$name);
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend;
use Illuminate\Routing\Controller;
use Overdrive\Web\Model\Mpermission;
use Illuminate\Http\Request;
class PermissionController extends Controller
{
public function index()
{
$permission = config('laravolt.epicentrum.models.permission')::all()->sortBy(function ($item) {
return strtolower($item->name);
});
return view('web::backend.permission.index', compact('permission'));
}
public function edit($id)
{
$permission = Mpermission::where('id','=',$id)->first();
return view('web::backend.permission.edit', compact('permission'));
}
public function update(Request $request)
{
$data = Mpermission::where('id','=',$request->id)->first();
$permission = Mpermission::where('id','=',$request->id)->first();
$permission->name = $request->name;
$permission->description = $request->description;
$permission->update();
// $userid = auth()->user()->name;
// $main_app = 'Permission';
// $desc = 'Editing record id '.$request->id;
//$this->auditTrail($userid,$main_app,$desc);
$userid = auth()->user()->name;
$fk_lkp_activities = '39';
$activities = 'Edit Permission';
$new_value =$request->except(['_token','action']);
// Event::dispatch(new AuditLog('',auth()->user()->id,$fk_lkp_activities,$activities,$old_value,json_encode($new_value),''));
return redirect()->route('backend::permissions.index')->withSuccess(trans('web::user-management.permission-edit-message-update'));
}
public function delete($id)
{
$old_value='permission_id ='.$id;
$permission = Mpermission::where('id','=',$id)->delete();
// $userid = auth()->user()->name;
// $main_app = 'Permission';
// $desc = 'Deleting record id '.$id;
//$this->auditTrail($userid,$main_app,$desc);
//$userid = auth()->user()->name;
$fk_lkp_activities = '39';
$activities = 'Delete Permission';
$new_value ='';
// Event::dispatch(new AuditLog('',auth()->user()->id,$fk_lkp_activities,$activities,$old_value,'',''));
return redirect()->route('backend::permissions.index')->withSuccess(trans('web::user-management.permission-edit-message-delete'));
}
public function addpermission()
{
return view('site::system.permission.add');
}
public function savepermission(Request $request)
{
$permission = new Mpermission;
$permission->name = $request->name;
$permission->description = $request->description;
$permission->type = $request->type;
$permission->save();
// $userid = auth()->user()->name;
// $main_app = 'Permission';
// $desc = 'Adding new record';
// $this->auditTrail($userid,$main_app,$desc);
$userid = auth()->user()->name;
$fk_lkp_activities = '38';
$activities = 'Add Permission';
$new_value =$request->except(['_token','action']);
// Event::dispatch(new AuditLog('',auth()->user()->id,$fk_lkp_activities,$activities,'',json_encode($new_value),''));
// return redirect()->route('site::system.permission')->withSuccess('New Permission Created');
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend;
use Illuminate\Routing\Controller;
use Laravolt\Epicentrum\Http\Requests\Role\Store;
use Laravolt\Epicentrum\Http\Requests\Role\Update;
use Laravolt\Epicentrum\Repositories\RoleRepository;
use Laravolt\Epicentrum\Repositories\RoleRepositoryInterface;
use Overdrive\Web\Model\Arole;
use Illuminate\Http\Request;
class RoleController extends Controller
{
/**
* @var RoleRepositorye
*/
protected $repository;
/**
* UserController constructor.
*
* @param RoleRepository $repository
*/
public function __construct(RoleRepositoryInterface $repository)
{
$this->repository = $repository;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$role = ARole::get();
return view('web::backend.role.index', compact('role'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function add()
{
$permissions = config('laravolt.epicentrum.models.permission')::all();
return view('web::backend.role.add', compact('permissions'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function save(Store $request)
{
$role = $this->repository->create($request->all());
return redirect()->route('backend::role.index')->withSuccess(trans('web::user-management.role-edit-message-create'));
}
public function edit($id)
{
$role = $this->repository->findById($id);
$permissions = config('laravolt.epicentrum.models.permission')::all();
$assignedPermissions = old('permissions', $role->permissions()->pluck('id')->toArray());
return view('web::backend.role.edit', compact('role','permissions','assignedPermissions'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edits($id)
{
$role = $this->repository->findById($id);
$permissions = config('laravolt.epicentrum.models.permission')::all();
$assignedPermissions = old('permissions', $role->permissions()->pluck('id')->toArray());
return view('laravolt::roles.edit', compact('role', 'permissions', 'assignedPermissions'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function update(Request $request)
{
$id = $request->id;
$role = $this->repository->update($id, $request->all());
return redirect()->route('backend::role.index')->withSuccess(trans('web::user-management.role-edit-message-update'));
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$this->repository->delete($id);
return redirect()->route('epicentrum::roles.index')->withSuccess(trans('laravolt::message.role_deleted'));
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend\User;
use Laravolt\Epicentrum\Contracts\Requests\Account\Update;
use Laravolt\Platform\Models\User as Users;
use Illuminate\Http\Request;
use Overdrive\Web\Model\Urole;
class AccountController extends UserController
{
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
// dd('sini');
$user = $this->repository->findById($id);
$statuses = $this->repository->availableStatus();
$timezones = $this->timezone->all();
$roles = app('laravolt.epicentrum.role')->all()->pluck('name', 'id');
$multipleRole = config('laravolt.epicentrum.role.multiple');
$roleEditable = config('laravolt.epicentrum.role.editable');
$acl_role = app('laravolt.epicentrum.role')->all();
return view('web::backend.user.edit', compact('user', 'statuses', 'timezones', 'roles', 'multipleRole', 'roleEditable','acl_role'));
}
public function saveuser(Request $request)
{
$roles = $request->get('roles', []);
$id = $request->id;
try {
$this->repository->updateAccount($id, $request->except('_token', '_method'), $request->get('roles', []));
} catch (\Exception $e) {
return redirect()->back()->withError($e->getMessage());
}
$roleslist = Urole::where('user_id','=',$id)->get();
$objb = (object)[];
$objb->role = $roleslist;
if($roles !== [])
{
$roleslist = Urole::where('user_id','=',$id)->delete();
foreach ($roles as $key => $value) {
$newrole = new Urole;
$newrole->user_id = $id;
$newrole->role_id = $value;
$newrole->save();
}
}
$user = Users::where('id','=',$id)->first();
$objb->user = $user;
$user->email_verified_at = date('Y-m-d h:m:s');
$user->update();
return redirect()->back()->withSuccess(trans('web::user-management.edit-message-update'));
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend\User\Password;
use Laravolt\Epicentrum\Repositories\RepositoryInterface;
class Generate
{
public function __invoke(RepositoryInterface $repository, $id)
{
$user = $repository->findById($id);
app('laravolt.password')->sendNewPassword($user, request()->has('must_change_password'));
return redirect()->back()->withSuccess(trans('laravolt::message.password_changed_and_sent_to_email'));
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend\User\Password;
use Illuminate\Routing\Controller;
use Laravolt\Epicentrum\Repositories\RepositoryInterface;
class PasswordController extends Controller
{
/**
* @var UserRepositoryEloquent
*/
private $repository;
/**
* PasswordController constructor.
*
* @param UserRepositoryEloquent $repository
*/
public function __construct(RepositoryInterface $repository)
{
$this->repository = $repository;
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = $this->repository->findById($id);
return view('laravolt::password.edit', compact('user'));
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend\User\Password;
use Laravolt\Epicentrum\Repositories\RepositoryInterface;
class Reset
{
public function __invoke(RepositoryInterface $repository, $id)
{
$user = $repository->findById($id);
app('laravolt.password')->sendResetLink($user);
return redirect()->back()->withSuccess(trans('laravolt::message.password_reset_sent'));
}
}
<?php
namespace Overdrive\Web\Http\Controllers\Backend\User;
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Mail;
use Laravolt\Epicentrum\Contracts\Requests\Account\Delete;
use Laravolt\Epicentrum\Contracts\Requests\Account\Store;
use Laravolt\Epicentrum\Mail\AccountInformation;
use Laravolt\Epicentrum\Repositories\RepositoryInterface;
use App\Models\User;
use Laravolt\Support\Contracts\TimezoneRepository;
use Illuminate\Http\Request;
class UserController extends Controller
{
use AuthorizesRequests;
protected RepositoryInterface $repository;
protected TimezoneRepository $timezone;
/**
* UserController constructor.
*
* @param \Laravolt\Epicentrum\Repositories\RepositoryInterface $repository
* @param \Laravolt\Support\Contracts\TimezoneRepository $timezone
*/
public function __construct(RepositoryInterface $repository, TimezoneRepository $timezone)
{
$this->repository = $repository;
$this->timezone = $timezone;
}
/**
* Display a listing of the resource.
*
* @throws \Exception
*/
public function index()
{
// dd('sini');
// return view('laravolt::users.index');
$useractive = User::get();
// $userinactive = Users::where('status','=','PENDING')->get();
return view('web::backend.user.index', compact('useractive'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$this->authorize('create', User::class);
$statuses = $this->repository->availableStatus();
$roles = app('laravolt.epicentrum.role')->all()->pluck('name', 'id');
$multipleRole = config('laravolt.epicentrum.role.multiple');
$timezones = $this->timezone->all();
$acl_role = app('laravolt.epicentrum.role')->all();
return view('web::backend.user.create', compact('statuses', 'roles', 'multipleRole', 'timezones','acl_role'));
}
/**
* Store the specified resource.
*
* @param Store $request
*
* @return Response
*/
public function store(Request $request)
{
$checkfirst = User::where('email','=',$request->email)->first();
if($checkfirst)
{
return redirect()->back()->withError('Error : You cannot create a user with same email. Email is already exist in system');
}
$roles = $request->get('roles', []);
$user = $this->repository->createByAdmin($request->all(), $roles);
$password = $request->get('password');
$states = $request->get('permissions', []);
$newuser = User::where('id','=',$user->id)->first();
$newuser->status = 1;
$newuser->email_verified_at = date('Y-m-d h:m:s');
$newuser->update();
return redirect('user/index')->withSuccess(trans('web:user-management.user_created'));
}
public function destroy(Delete $request, $id)
{
try {
$this->repository->delete($id);
return redirect(route('epicentrum::users.index'))->withSuccess(trans('laravolt::message.user_deleted'));
} catch (QueryException $e) {
return redirect()->back()->withError($e->getMessage());
}
}
}
<?php
namespace Overdrive\Web\Model;
use Illuminate\Database\Eloquent\Model;
class ARole extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'acl_roles';
/**
* undocumented function
*
* @return void
* @author
**/
// public function permission()
// {
// return $this->hasMany('Overdrive\Web\Model\Mpermission','role_id','id');
// }
public function permission()
{
return $this->hasMany('Overdrive\Web\Model\Permission','role_id','id');
}
}
<?php
namespace Overdrive\Web\Model;
use Illuminate\Database\Eloquent\Model;
class Mpermission extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'acl_permissions';
/**
* undocumented function
*
* @return void
* @author
**/
}
<?php
namespace Overdrive\Web\Model;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'acl_permission_role';
/**
* undocumented function
*
* @return void
* @author
**/
public function name()
{
return $this->hasOne('Workbench\Site\Model\APermission','id','permission_id');
}
}
<?php
namespace Overdrive\Web\Model;
use Illuminate\Database\Eloquent\Model;
class Urole extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'acl_role_user';
public $timestamps = false;
/**
* undocumented function
*
* @return void
* @author
**/
public function permission()
{
return $this->hasMany('Overdrive\Web\Model\Mpermission','role_id','role_id');
}
public function name()
{
return $this->hasOne('Overdrive\Web\Model\ARole','id','role_id');
}
}
<?php
declare(strict_types=1);
namespace Overdrive\Web\Service;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class Acl
{
/**
* All of the registered permissions.
*
* @var array
*/
protected $permissions = [];
public function permissions(): array
{
return $this->permissions;
}
public function clearPermissions(): self
{
$this->permissions = [];
return $this;
}
public function registerPermission($permission): self
{
$this->permissions = array_unique(array_merge($this->permissions, (array) $permission));
return $this;
}
public function syncPermission($refresh = false): Collection
{
return DB::transaction(function () use ($refresh) {
if ($refresh) {
Schema::disableForeignKeyConstraints();
app(config('laravolt.epicentrum.models.permission'))->truncate();
Schema::enableForeignKeyConstraints();
}
$items = collect();
foreach ($this->permissions() as $name) {
$permission = app(config('laravolt.epicentrum.models.permission'))->firstOrNew(['name' => $name]);
$status = 'No Change';
if (!$permission->exists) {
$permission->save();
$status = 'New';
}
$items->push(['id' => $permission->getKey(), 'name' => $name, 'status' => $status]);
}
// delete unused permissions
$permissions = $this->permissions() + ['*'];
$unusedPermissions = app(config('laravolt.epicentrum.models.permission'))
->whereNotIn('name', $permissions)
->get();
foreach ($unusedPermissions as $permission) {
$items->push(['id' => $permission->getKey(), 'name' => $permission->name, 'status' => 'Deleted']);
$permission->delete();
}
$items = $items->sortBy('name');
return $items;
});
}
}
<?php
namespace Overdrive\Web\Service;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use Mail;
use Curl;
use Overdrive\Web\Model\Menus;
use Overdrive\Web\Model\Mpermission;
use Session;
use App;
use Config;
class ManageServices
{
public static function status($id)
{
$menu = Menus::where('id',$id)->first();
if($menu)
{
if($menu->status == 2)
{
$menu->status = 1;
$menu->update();
}
else
{
$menu->status = 2;
$menu->update();
}
}
return redirect()->route('menum::menu.index')->withSuccess('Status Dikemaskini');
}
public static function icon($id,$name)
{
$menu = Menus::where('id',$id)->first();
if($menu)
{
$menu->icon = $name;
$menu->update();
}
return redirect()->route('menum::menu.index')->withSuccess('Icon Dikemaskini');
}
}
<?php
namespace Overdrive\Web\Service;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use Mail;
use Curl;
use Overdrive\Web\Model\Menus;
use Overdrive\Web\Model\Mpermission;
use Session;
use App;
use Config;
use Overdrive\Web\Service\OrderingServices;
class MenuServices extends OrderingServices
{
public function create(Request $request)
{
$neworder = $this->mainorder();
$newmenu = new Menus;
$newmenu->name_bm = $request->title_ms;
$newmenu->name_en = $request->title_en;
$newmenu->permission = json_encode($request->permission);
$newmenu->route = $request->url;
$newmenu->status = 2;
$newmenu->type = 2;
$newmenu->order = $neworder+1;
$newmenu->save();
return redirect()->route('menum::menu.index')->withSuccess('Menu Baharu Ditambah');
}
public function update(Request $request)
{
$newmenu = Menus::where('id',$request->mid)->first();
$newmenu->name_bm = $request->title_ms;
$newmenu->name_en = $request->title_en;
$newmenu->permission = json_encode($request->permission);
$newmenu->route = $request->url;
$newmenu->update();
return redirect()->route('menum::menu.index')->withSuccess('Menu Dikemaskini');
}
public static function delete($id)
{
$menu = Menus::where('id',$id)->delete();
return redirect()->route('menum::menu.index')->withSuccess('Menu Dihapuskan');
}
}
<?php
namespace Overdrive\Web\Service;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use Mail;
use Curl;
use Overdrive\Web\Model\Menus;
use Overdrive\Web\Model\Mpermission;
use Session;
use App;
use Config;
class OrderingServices
{
public function mainorder()
{
$data = Menus::where('type', '2')->max('order');
return $data;
}
public function suborder($id)
{
$data = Menus::where('parent_id', $id)->max('order');
return $data;
}
public static function reorder($id,$type)
{
$menu = Menus::where('id',$id)->first();
if($menu->parent_id)
{
//kes child and sub child
//first cari id asal punye order
$current = $menu->order;
if($type == 1)
{
$neworder = $current-1;
}
else
{
$neworder = $current+1;
}
$oldmenu = Menus::where('parent_id',$menu->parent_id)->where('order',$neworder)->first();
$oldmenu->order = $current;
$oldmenu->update();
$menu->order = $neworder;
$menu->update();
}else
{
//kes main menu
//first cari id asal punye order
$current = $menu->order;
if($type == 1)
{
$neworder = $current-1;
}
else
{
$neworder = $current+1;
}
$oldmenu = Menus::where('type',2)->where('order',$neworder)->first();
$oldmenu->order = $current;
$oldmenu->update();
$menu->order = $neworder;
$menu->update();
}
return redirect()->route('menum::menu.index')->withSuccess('Susunan Dikemaskini');
}
}
<?php
namespace Overdrive\Web\Service;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use Mail;
use Curl;
use Overdrive\Web\Model\Menus;
use Overdrive\Web\Model\Mpermission;
use Session;
use App;
use Config;
use Overdrive\Web\Service\OrderingServices;
class SubmenuServices extends OrderingServices
{
public function create(Request $request)
{
$neworder = $this->suborder($request->parent);
$newmenu = new Menus;
$newmenu->name_bm = $request->title_ms;
$newmenu->name_en = $request->title_en;
$newmenu->permission = json_encode($request->permission);
$newmenu->route = $request->url;
$newmenu->status = 2;
$newmenu->parent_id = $request->parent;
$newmenu->type = 1;
$newmenu->order = $neworder+1;
$newmenu->save();
return redirect()->route('menum::menu.index')->withSuccess('Submenu Ditambah');
}
}
...@@ -59,6 +59,8 @@ class ServiceProvider extends BaseServiceProvider ...@@ -59,6 +59,8 @@ class ServiceProvider extends BaseServiceProvider
public function boot() public function boot()
{ {
$this->loadRoutesFrom(__DIR__.'/../routes/web.php'); $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
$this->loadRoutesFrom(__DIR__.'/../routes/user.php');
$this->loadRoutesFrom(__DIR__.'/../routes/menu.php');
$this->loadViewsFrom(__DIR__.'/../resources/views', 'web'); $this->loadViewsFrom(__DIR__.'/../resources/views', 'web');
$this->menu(); $this->menu();
$this->loadMigrationsFrom(__DIR__.'/../database/migrations'); $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
......
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Carbon\Carbon;
use DB;
class Menu extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// DB::statement('SET FOREIGN_KEY_CHECKS=0');
// DB::table('acl_roles')->truncate();
DB::table('menu')->insert([
[
'name_bm' => 'Pengurusan Sistem',
'name_en' => 'System Management',
'type' => '2',
'parent_id' => null,
'route' => null,
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'name_bm' => 'Pengurusan Menu',
'name_en' => 'Menu Management',
'type' => '1',
'parent_id' => '1',
'route' => 'menu/index',
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'name_bm' => 'Pengurusan Pengguna',
'name_en' => 'User Management',
'type' => '1',
'parent_id' => '1',
'route' => 'user/index',
'permission' => '["*"]',
'order' => '2',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'name_bm' => 'Pengurusan Hak',
'name_en' => 'Permission Settings',
'type' => '1',
'parent_id' => '3',
'route' => 'user/permissions',
'permission' => '["*"]',
'order' => '2',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'name_bm' => 'Tetapan Pengguna',
'name_en' => 'User Settings',
'type' => '1',
'parent_id' => '3',
'route' => 'user/index',
'permission' => '["*"]',
'order' => '1',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
],
[
'name_bm' => 'Pengurusan Peranan',
'name_en' => 'Role Setting',
'type' => '1',
'parent_id' => '3',
'route' => 'user/role',
'permission' => '["*"]',
'order' => '3',
'status' => '1',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now()
]
]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment