update module directorat

This commit is contained in:
daeng.deni@dharma.or.id 2023-04-12 08:30:25 +07:00
parent c08a8d8f47
commit 8fe5096964
10 changed files with 10806 additions and 42 deletions

View File

@ -57,7 +57,6 @@ class DirectoratDataTable extends DataTable
->setTableId('directorat-table')
->columns($this->getColumns())
->minifiedAjax()
//->dom('Bfrtip')
->orderBy(1)
->selectStyleSingle()
->buttons([
@ -65,7 +64,6 @@ class DirectoratDataTable extends DataTable
Button::make('csv'),
Button::make('pdf'),
Button::make('print'),
Button::make('reset'),
Button::make('reload')
])
->parameters([

View File

@ -15,7 +15,7 @@ class DirectoratController extends Controller
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->user = Auth::guard('web')->user();
//$this->user = Auth::guard('web')->user();
return $next($request);
});
}

67
composer.lock generated
View File

@ -1043,16 +1043,16 @@
},
{
"name": "laravel/framework",
"version": "v10.6.2",
"version": "v10.7.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "13dc93889617427352f72b6aa8b195b252af1197"
"reference": "ddbbb2b50388721fe63312bb4469cae13163fd36"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/13dc93889617427352f72b6aa8b195b252af1197",
"reference": "13dc93889617427352f72b6aa8b195b252af1197",
"url": "https://api.github.com/repos/laravel/framework/zipball/ddbbb2b50388721fe63312bb4469cae13163fd36",
"reference": "ddbbb2b50388721fe63312bb4469cae13163fd36",
"shasum": ""
},
"require": {
@ -1239,7 +1239,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-04-05T15:28:17+00:00"
"time": "2023-04-11T14:11:49+00:00"
},
{
"name": "laravel/sanctum",
@ -3032,21 +3032,21 @@
},
{
"name": "psr/http-client",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
@ -3066,7 +3066,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
@ -3078,27 +3078,27 @@
"psr-18"
],
"support": {
"source": "https://github.com/php-fig/http-client/tree/master"
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
},
"time": "2020-06-29T06:28:15+00:00"
"time": "2023-04-10T20:12:12+00:00"
},
{
"name": "psr/http-factory",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
"reference": "e616d01114759c4c489f93b099585439f795fe35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
"reference": "e616d01114759c4c489f93b099585439f795fe35",
"shasum": ""
},
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
@ -3118,7 +3118,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for PSR-7 HTTP message factories",
@ -3133,9 +3133,9 @@
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory/tree/master"
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
},
"time": "2019-04-30T12:38:16+00:00"
"time": "2023-04-10T20:10:41+00:00"
},
{
"name": "psr/http-message",
@ -3293,16 +3293,16 @@
},
{
"name": "psy/psysh",
"version": "v0.11.14",
"version": "v0.11.15",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17"
"reference": "5350ce0ec8ecf2c5b5cf554cd2496f97b444af85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/8c2e264def7a8263a68ef6f0b55ce90b77d41e17",
"reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/5350ce0ec8ecf2c5b5cf554cd2496f97b444af85",
"reference": "5350ce0ec8ecf2c5b5cf554cd2496f97b444af85",
"shasum": ""
},
"require": {
@ -3363,9 +3363,9 @@
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.11.14"
"source": "https://github.com/bobthecow/psysh/tree/v0.11.15"
},
"time": "2023-03-28T03:41:01+00:00"
"time": "2023-04-07T21:57:09+00:00"
},
{
"name": "ralouphie/getallheaders",
@ -8230,16 +8230,16 @@
},
{
"name": "sebastian/environment",
"version": "6.0.0",
"version": "6.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc"
"reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc",
"reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951",
"reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951",
"shasum": ""
},
"require": {
@ -8281,7 +8281,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"source": "https://github.com/sebastianbergmann/environment/tree/6.0.0"
"security": "https://github.com/sebastianbergmann/environment/security/policy",
"source": "https://github.com/sebastianbergmann/environment/tree/6.0.1"
},
"funding": [
{
@ -8289,7 +8290,7 @@
"type": "github"
}
],
"time": "2023-02-03T07:03:04+00:00"
"time": "2023-04-11T05:39:26+00:00"
},
{
"name": "sebastian/exporter",

View File

@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('directorates', function (Blueprint $table) {
Schema::create('directorats', function (Blueprint $table) {
$table->id();
$table->string('kode',2);
$table->string('nama',50);
@ -25,6 +25,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('directorates');
Schema::dropIfExists('directorats');
}
};

View File

@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('sub_directorates', function (Blueprint $table) {
Schema::create('sub_directorats', function (Blueprint $table) {
$table->id();
$table->foreignId('directorate_id');
$table->string('kode',2);
@ -26,6 +26,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('sub_directorates');
Schema::dropIfExists('sub_directorats');
}
};

View File

@ -37,6 +37,8 @@
{!! sprintf('<link rel="stylesheet" href="%s">', asset($path)) !!}
@endforeach
<!--end::Custom Stylesheets-->
@yield('styles')
</head>
<!--end::Head-->
@ -66,7 +68,8 @@
@endforeach
<!--end::Custom Javascript-->
<!--end::Javascript-->
@yield('scripts')
@stack('customscript')
</body>
<!--end::Body-->

View File

@ -40,7 +40,7 @@
<!--begin:Menu item-->
<div class="menu-item">
<!--begin:Menu link-->
<a class="menu-link" href="/">
<a class="menu-link" href="{{ route('directorat.index') }}">
<span class="menu-bullet">
<span class="bullet bullet-dot"></span>
</span>

View File

@ -0,0 +1,80 @@
<!--begin::Table-->
{{ $dataTable->table() }}
<!--end::Table-->
{{-- Inject Scripts --}}
@section('scripts')
{{ $dataTable->scripts() }}
@endsection
@push('customscript')
<script src="https://cdn.datatables.net/buttons/1.0.3/js/dataTables.buttons.min.js"></script>
<script>
$("#searchbox").on("keyup search input paste cut", function () {
LaravelDataTables["directorat-table"].search(this.value).draw();
});
$(function () {
const documentTitle = 'Transaction Report';
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["directorat-table"], {
buttons: [
{
extend: 'excel',
title: documentTitle
},
{
extend: 'pdfHtml5',
title: documentTitle,
}
]
}).container().appendTo($('#kt_datatable_example_buttons'));
// Hook dropdown menu click event to datatable export buttons
const exportButtons = document.querySelectorAll('#kt_datatable_example_export_menu [data-kt-export]');
exportButtons.forEach(exportButton => {
exportButton.addEventListener('click', e => {
e.preventDefault();
// Get clicked export value
const exportValue = e.target.getAttribute('data-kt-export');
const target = document.querySelector('.dt-buttons .buttons-' + exportValue);
// Trigger click event on hidden datatable export buttons
target.click();
});
});
LaravelDataTables["directorat-table"].on('click', '.delete', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
form.submit();
Swal.fire(
'Deleted!',
'Directorat has been deleted.',
'success'
)
}
})
})
})
</script>
@endpush
@section('styles')
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.0.3/css/buttons.dataTables.min.css">
<style>
.dataTables_filter {
display: none;
}
</style>
@endsection

View File

@ -21,6 +21,10 @@
<div class="card-toolbar" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-trigger="hover"
title=""
data-bs-original-title="Click to add a role">
<!--begin::Export buttons-->
<div id="kt_datatable_example_1_export" class="d-none"></div>
<!--end::Export buttons-->
<a href="{{ route('directorat.create') }}" class="btn btn-sm btn-light-primary">
<!--begin::Svg Icon | path: /var/www/preview.keenthemes.com/kt-products/metronic/releases/2022-07-14-092914/core/html/src/media/icons/duotune/arrows/arr013.svg-->
<span class="svg-icon svg-icon-muted svg-icon-2hx">
@ -32,6 +36,8 @@
<!--end::Svg Icon-->
New Directorat
</a>
</div>
</div>
<div class="card-body pt-6">

10676
yarn.lock Normal file

File diff suppressed because it is too large Load Diff