Module Cetak Label
This commit is contained in:
commit
82fa06d832
0
Config/.gitkeep
Normal file
0
Config/.gitkeep
Normal file
5
Config/config.php
Normal file
5
Config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'CetakLabel'
|
||||
];
|
112
Config/database.php
Normal file
112
Config/database.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'mysql'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
'cetaklabel' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => 'cetak',
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
0
Console/.gitkeep
Normal file
0
Console/.gitkeep
Normal file
91
DataTables/DirectoratDataTable.php
Normal file
91
DataTables/DirectoratDataTable.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class DirectoratDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query)
|
||||
: EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%");
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('action', 'cetaklabel::masters.directorat._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(Directorat $model)
|
||||
: QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html()
|
||||
: HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('directorat-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns()
|
||||
: array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename()
|
||||
: string
|
||||
{
|
||||
return 'Directorat_' . date('YmdHis');
|
||||
}
|
||||
}
|
125
DataTables/DocumentDataTable.php
Normal file
125
DataTables/DocumentDataTable.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\Document;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class DocumentDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%");
|
||||
}
|
||||
})
|
||||
->addColumn('kode_directorat',function($model){
|
||||
return $model->directorat->kode;
|
||||
})
|
||||
->addColumn('name_directorat',function($model){
|
||||
return $model->directorat->name;
|
||||
})
|
||||
->addColumn('kode_sub_directorat',function($model){
|
||||
return $model->sub_directorat->kode;
|
||||
})
|
||||
->addColumn('name_sub_directorat',function($model){
|
||||
return $model->sub_directorat->name;
|
||||
})
|
||||
->addColumn('kode_pekerjaan',function($model){
|
||||
return $model->job->kode;
|
||||
})
|
||||
->addColumn('name_pekerjaan',function($model){
|
||||
return $model->job->name;
|
||||
})
|
||||
->addColumn('kode_sub_pekerjaan',function($model){
|
||||
return $model->sub_job->kode;
|
||||
})
|
||||
->addColumn('name_sub_pekerjaan',function($model){
|
||||
return $model->sub_job->name;
|
||||
})
|
||||
->addColumn('kode_sub_sub_pekerjaan',function($model){
|
||||
return $model->sub_sub_job->kode;
|
||||
})
|
||||
->addColumn('name_sub_sub_pekerjaan',function($model){
|
||||
return $model->sub_sub_job->name;
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('action', 'cetaklabel::app.document._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(Document $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('document-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('kode'),
|
||||
Column::make('kode_directorat')->title('Kode Direktorat'),
|
||||
Column::make('name_directorat')->title('Nama Direktorat'),
|
||||
Column::make('kode_sub_directorat')->title('Kode Sub Direktorat'),
|
||||
Column::make('name_sub_directorat')->title('Nama Sub Direktorat'),
|
||||
Column::make('kode_pekerjaan')->title('Kode Pekerjaan'),
|
||||
Column::make('name_pekerjaan')->title('Nama Pekerjaan'),
|
||||
Column::make('kode_sub_pekerjaan')->title('Kode Sub Pekerjaan'),
|
||||
Column::make('name_sub_pekerjaan')->title('Nama Sub Pekerjaan'),
|
||||
Column::make('kode_sub_sub_pekerjaan')->title('Kode Sub Sub Pekerjaan'),
|
||||
Column::make('name_sub_sub_pekerjaan')->title('Nama Sub Sub Pekerjaan'),
|
||||
Column::make('status'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Document_' . date('YmdHis');
|
||||
}
|
||||
}
|
86
DataTables/DocumentTypeDataTable.php
Normal file
86
DataTables/DocumentTypeDataTable.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\DocumentType;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class DocumentTypeDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%");
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('action', 'cetaklabel::masters.document-type._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(DocumentType $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('document-type-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Document_Type_' . date('YmdHis');
|
||||
}
|
||||
}
|
96
DataTables/JobDataTable.php
Normal file
96
DataTables/JobDataTable.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class JobDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%")
|
||||
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('subDirectorat', 'name', 'like', '%'.$search['value'].'%');
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('directorat', function ($job) {
|
||||
return $job->directorat->name;
|
||||
})
|
||||
->addColumn('sub_directorat', function ($job) {
|
||||
return $job->subDirectorat->name;
|
||||
})
|
||||
->addColumn('action', 'cetaklabel::masters.job._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(Job $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('job-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('directorat'),
|
||||
Column::make('sub_directorat'),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Job_' . date('YmdHis');
|
||||
}
|
||||
}
|
86
DataTables/SpecialCodeDataTable.php
Normal file
86
DataTables/SpecialCodeDataTable.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class SpecialCodeDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%");
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('action', 'cetaklabel::masters.special-code._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(SpecialCode $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('special-code-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Special_Code_' . date('YmdHis');
|
||||
}
|
||||
}
|
91
DataTables/SubDirectoratDataTable.php
Normal file
91
DataTables/SubDirectoratDataTable.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class SubDirectoratDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%")
|
||||
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%');
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('directorat', function ($subDirectorat) {
|
||||
return $subDirectorat->directorat->name;
|
||||
})
|
||||
->addColumn('action', 'cetaklabel::masters.sub-directorat._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(SubDirectorat $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('sub-directorat-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('directorat'),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Sub_Directorat_' . date('YmdHis');
|
||||
}
|
||||
}
|
101
DataTables/SubJobDataTable.php
Normal file
101
DataTables/SubJobDataTable.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class SubJobDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%")
|
||||
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('sub_directorat', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('job', 'name', 'like', '%'.$search['value'].'%');
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('directorat', function ($subJob) {
|
||||
return $subJob->directorat->name;
|
||||
})
|
||||
->addColumn('sub_directorat', function ($subJob) {
|
||||
return $subJob->subDirectorat->name;
|
||||
})
|
||||
->addColumn('job', function ($subJob) {
|
||||
return $subJob->job->name;
|
||||
})
|
||||
->addColumn('action', 'cetaklabel::masters.sub-job._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(SubJob $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('sub-job-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('directorat'),
|
||||
Column::make('sub_directorat'),
|
||||
Column::make('job'),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Sub_Job_' . date('YmdHis');
|
||||
}
|
||||
}
|
106
DataTables/SubSubJobDataTable.php
Normal file
106
DataTables/SubSubJobDataTable.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\DataTables;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
use Yajra\DataTables\Html\Builder as HtmlBuilder;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class SubSubJobDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build the DataTable class.
|
||||
*
|
||||
* @param QueryBuilder $query Results from query() method.
|
||||
*/
|
||||
public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
{
|
||||
return (new EloquentDataTable($query))
|
||||
->filter(function ($query) {
|
||||
if (request()->has('search')) {
|
||||
$search = request()->get('search');
|
||||
$query->where('kode', 'like', "%" . $search['value'] . "%")
|
||||
->orWhere('name', 'like', "%" . $search['value'] . "%")
|
||||
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('sub_directorat', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('job', 'name', 'like', '%'.$search['value'].'%')
|
||||
->orWhereRelation('subJob', 'name', 'like', '%'.$search['value'].'%');
|
||||
}
|
||||
})
|
||||
->addIndexColumn()
|
||||
->addColumn('directorat', function ($subJob) {
|
||||
return $subJob->directorat->name;
|
||||
})
|
||||
->addColumn('sub_directorat', function ($subJob) {
|
||||
return $subJob->subDirectorat->name;
|
||||
})
|
||||
->addColumn('job', function ($subJob) {
|
||||
return $subJob->job->name;
|
||||
})
|
||||
->addColumn('sub_job', function ($subJob) {
|
||||
return $subJob->subJob->name;
|
||||
})
|
||||
->addColumn('action', 'cetaklabel::masters.sub-sub-job._action')
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query source of dataTable.
|
||||
*/
|
||||
public function query(SubSubJob $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use the html builder.
|
||||
*/
|
||||
public function html(): HtmlBuilder
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('sub-sub-job-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->stateSave(false)
|
||||
->responsive()
|
||||
->autoWidth(true)
|
||||
->orderBy(1)
|
||||
->parameters([
|
||||
'scrollX' => true,
|
||||
'drawCallback' => 'function() { KTMenu.createInstances(); }',
|
||||
])
|
||||
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dataTable columns definition.
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
|
||||
Column::make('directorat'),
|
||||
Column::make('sub_directorat'),
|
||||
Column::make('job'),
|
||||
Column::make('sub_job'),
|
||||
Column::make('kode'),
|
||||
Column::make('name'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'Sub_Sub_Job_' . date('YmdHis');
|
||||
}
|
||||
}
|
0
Database/Migrations/.gitkeep
Normal file
0
Database/Migrations/.gitkeep
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('directorats', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode',2);
|
||||
$table->string('name',50);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('directorats');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sub_directorats', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
|
||||
$table->string('kode',2);
|
||||
$table->string('name',50);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sub_directorats');
|
||||
}
|
||||
};
|
36
Database/Migrations/2023_04_10_024809_create_jobs_table.php
Normal file
36
Database/Migrations/2023_04_10_024809_create_jobs_table.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
|
||||
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
|
||||
$table->string('kode',2);
|
||||
$table->string('name',50);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
}
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sub_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
|
||||
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
|
||||
$table->foreignId('job_id')->constrained('jobs')->onDelete('cascade');
|
||||
$table->string('kode',2);
|
||||
$table->string('name',50);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sub_jobs');
|
||||
}
|
||||
};
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sub_sub_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('sub_job_id')->constrained('sub_jobs')->onDelete('cascade');
|
||||
$table->foreignId('job_id')->constrained('jobs')->onDelete('cascade');
|
||||
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
|
||||
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
|
||||
$table->string('kode');
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sub_sub_jobs');
|
||||
}
|
||||
};
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('document_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode', 2);
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('special_codes');
|
||||
}
|
||||
};
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('special_codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode', 2);
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('special_codes');
|
||||
}
|
||||
};
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('documents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Directorat::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(SubDirectorat::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(Job::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(SubJob::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(SubSubJob::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(SpecialCode::class)->nullable()->constrained()->onDelete('cascade');
|
||||
$table->string('no_urut',3)->nullable();
|
||||
$table->string('sequence',100)->nullable();
|
||||
$table->string('kode', 15);
|
||||
$table->string('status')->nullable();
|
||||
$table->string('keterangan')->nullable();
|
||||
$table->enum('jenis_dokumen',['nasabah','non nasabah'])->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('documents');
|
||||
}
|
||||
};
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('document_details', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('document_id')->constrained('documents')->onDelete('cascade');
|
||||
$table->foreignId('document_type_id')->nullable()->constrained('document_types')->onDelete('cascade');
|
||||
|
||||
$table->string('nama_nasabah')->nullable();
|
||||
$table->string('no_rekening')->nullable();
|
||||
$table->string('no_cif')->nullable();
|
||||
$table->string('group')->nullable();
|
||||
|
||||
$table->date('tanggal_upload')->nullable();
|
||||
$table->date('tanggal_dokumen')->nullable();
|
||||
$table->string('nomor_dokumen')->nullable();
|
||||
$table->string('perihal')->nullable();
|
||||
$table->string('kode_cabang')->nullable();
|
||||
$table->string('jumlah_halaman')->nullable();
|
||||
$table->string('custom_field_1')->nullable();
|
||||
$table->string('custom_field_2')->nullable();
|
||||
$table->string('custom_field_3')->nullable();
|
||||
$table->string('custom_field_4')->nullable();
|
||||
$table->string('status')->nullable();
|
||||
$table->string('keterangan')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('document_details');
|
||||
}
|
||||
};
|
0
Database/Seeders/.gitkeep
Normal file
0
Database/Seeders/.gitkeep
Normal file
23
Database/Seeders/CetakLabelDatabaseSeeder.php
Normal file
23
Database/Seeders/CetakLabelDatabaseSeeder.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CetakLabelDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
$this->call([
|
||||
CetakLabelSeeder::class
|
||||
]);
|
||||
}
|
||||
}
|
68
Database/Seeders/CetakLabelSeeder.php
Normal file
68
Database/Seeders/CetakLabelSeeder.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Database\Seeders;
|
||||
|
||||
use Faker\Generator;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
|
||||
class CetakLabelSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(Generator $faker)
|
||||
{
|
||||
$direktorat = Directorat::create ([
|
||||
'kode' => '01',
|
||||
'name' => 'Direktorat Jenderal Perhubungan Darat',
|
||||
]);
|
||||
|
||||
$subdirektorat = SubDirectorat::create ([
|
||||
'kode' => '01',
|
||||
'name' => 'Subdirektorat Jenderal Perhubungan Darat',
|
||||
'directorat_id' => $direktorat->id,
|
||||
]);
|
||||
|
||||
$job = Job::create ([
|
||||
'kode' => '01',
|
||||
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
|
||||
'sub_directorat_id' => $subdirektorat->id,
|
||||
'directorat_id' => $direktorat->id,
|
||||
]);
|
||||
|
||||
$subjob = SubJob::create ([
|
||||
'kode' => '01',
|
||||
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
|
||||
'job_id' => $job->id,
|
||||
'sub_directorat_id' => $subdirektorat->id,
|
||||
'directorat_id' => $direktorat->id,
|
||||
]);
|
||||
|
||||
$subsubjob = SubSubJob::create ([
|
||||
'kode' => '01',
|
||||
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
|
||||
'sub_job_id' => $subjob->id,
|
||||
'job_id' => $job->id,
|
||||
'sub_directorat_id' => $subdirektorat->id,
|
||||
'directorat_id' => $direktorat->id,
|
||||
]);
|
||||
|
||||
$SpecialCode = SpecialCode::create ([
|
||||
'kode' => '00',
|
||||
'name' => 'Archive'
|
||||
]);
|
||||
|
||||
$SpecialCode = SpecialCode::create ([
|
||||
'kode' => '98',
|
||||
'name' => 'Softcopy'
|
||||
]);
|
||||
}
|
||||
}
|
0
Database/factories/.gitkeep
Normal file
0
Database/factories/.gitkeep
Normal file
0
Entities/.gitkeep
Normal file
0
Entities/.gitkeep
Normal file
34
Entities/BaseModel.php
Normal file
34
Entities/BaseModel.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
|
||||
class BaseModel extends Model
|
||||
{
|
||||
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
|
||||
|
||||
protected $connection;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$module = file_get_contents(dirname(__FILE__, 2) . '/module.json');
|
||||
$module = json_decode($module);
|
||||
|
||||
$this->connection = $module->database;
|
||||
}
|
||||
|
||||
public function getActivitylogOptions()
|
||||
: LogOptions
|
||||
{
|
||||
return LogOptions::defaults()->logAll()
|
||||
->useLogName('Cetak Label : ');
|
||||
}
|
||||
|
||||
}
|
14
Entities/Directorat.php
Normal file
14
Entities/Directorat.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class Directorat extends BaseModel
|
||||
{
|
||||
|
||||
protected $fillable = ['kode', 'name'];
|
||||
|
||||
public function sub_directorat()
|
||||
{
|
||||
return $this->hasMany (SubDirectorat::class);
|
||||
}
|
||||
}
|
55
Entities/Document.php
Normal file
55
Entities/Document.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class Document extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'directorat_id',
|
||||
'sub_directorat_id',
|
||||
'job_id',
|
||||
'sub_job_id',
|
||||
'sub_sub_job_id',
|
||||
'special_code_id',
|
||||
'no_urut',
|
||||
'kode',
|
||||
'sequence',
|
||||
'jenis_dokumen'
|
||||
];
|
||||
|
||||
|
||||
public function directorat()
|
||||
{
|
||||
return $this->belongsTo (Directorat::class);
|
||||
}
|
||||
|
||||
public function sub_directorat()
|
||||
{
|
||||
return $this->belongsTo (SubDirectorat::class);
|
||||
}
|
||||
|
||||
public function job()
|
||||
{
|
||||
return $this->belongsTo (Job::class);
|
||||
}
|
||||
|
||||
public function sub_job()
|
||||
{
|
||||
return $this->belongsTo (SubJob::class);
|
||||
}
|
||||
|
||||
public function sub_sub_job()
|
||||
{
|
||||
return $this->belongsTo (SubSubJob::class);
|
||||
}
|
||||
|
||||
public function special_code()
|
||||
{
|
||||
return $this->belongsTo (SpecialCode::class);
|
||||
}
|
||||
|
||||
public function document_details()
|
||||
{
|
||||
return $this->hasMany (DocumentDetail::class);
|
||||
}
|
||||
}
|
36
Entities/DocumentDetail.php
Normal file
36
Entities/DocumentDetail.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class DocumentDetail extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'document_id',
|
||||
'document_type_id',
|
||||
'nama_nasabah',
|
||||
'no_rekening',
|
||||
'no_cif',
|
||||
'group',
|
||||
'group',
|
||||
'tanggal_upload',
|
||||
'tanggal_dokumen',
|
||||
'nomor_dokumen',
|
||||
'perihal',
|
||||
'kode_cabang',
|
||||
'jumlah_halaman',
|
||||
'custom_field_1',
|
||||
'custom_field_2',
|
||||
'custom_field_3',
|
||||
'custom_field_4'
|
||||
];
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo (Document::class);
|
||||
}
|
||||
|
||||
public function document_type()
|
||||
{
|
||||
return $this->belongsTo (DocumentType::class);
|
||||
}
|
||||
}
|
16
Entities/DocumentType.php
Normal file
16
Entities/DocumentType.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class DocumentType extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function document_detail()
|
||||
{
|
||||
return $this->hasMany (DocumentDetail::class);
|
||||
}
|
||||
}
|
30
Entities/Job.php
Normal file
30
Entities/Job.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class Job extends BaseModel
|
||||
{
|
||||
|
||||
protected $fillable = [
|
||||
'directorat_id',
|
||||
'sub_directorat_id',
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
|
||||
public function directorat()
|
||||
{
|
||||
return $this->belongsTo (Directorat::class);
|
||||
}
|
||||
|
||||
public function sub_directorat()
|
||||
{
|
||||
return $this->belongsTo (SubDirectorat::class);
|
||||
}
|
||||
|
||||
public function sub_job()
|
||||
{
|
||||
return $this->hasMany (SubJob::class);
|
||||
}
|
||||
}
|
17
Entities/SpecialCode.php
Normal file
17
Entities/SpecialCode.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class SpecialCode extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->hasMany (Document::class);
|
||||
}
|
||||
|
||||
}
|
27
Entities/SubDirectorat.php
Normal file
27
Entities/SubDirectorat.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class SubDirectorat extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'directorat_id',
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function directorat()
|
||||
{
|
||||
return $this->belongsTo (Directorat::class);
|
||||
}
|
||||
|
||||
public function sub_jobs()
|
||||
{
|
||||
return $this->hasMany (SubJob::class);
|
||||
}
|
||||
|
||||
public function jobs()
|
||||
{
|
||||
return $this->hasManyThrough (Job::class, SubJob::class);
|
||||
}
|
||||
}
|
35
Entities/SubJob.php
Normal file
35
Entities/SubJob.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class SubJob extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'directorat_id',
|
||||
'sub_directorat_id',
|
||||
'job_id',
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
|
||||
public function directorat()
|
||||
{
|
||||
return $this->belongsTo (Directorat::class);
|
||||
}
|
||||
|
||||
public function sub_directorat()
|
||||
{
|
||||
return $this->belongsTo (SubDirectorat::class);
|
||||
}
|
||||
|
||||
public function job()
|
||||
{
|
||||
return $this->belongsTo (Job::class);
|
||||
}
|
||||
|
||||
public function sub_sub_job()
|
||||
{
|
||||
return $this->hasMany (SubSubJob::class);
|
||||
}
|
||||
}
|
36
Entities/SubSubJob.php
Normal file
36
Entities/SubSubJob.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Entities;
|
||||
|
||||
class SubSubJob extends BaseModel
|
||||
{
|
||||
protected $fillable = [
|
||||
'directorat_id',
|
||||
'sub_directorat_id',
|
||||
'job_id',
|
||||
'sub_job_id',
|
||||
'kode',
|
||||
'name'
|
||||
];
|
||||
|
||||
|
||||
public function directorat()
|
||||
{
|
||||
return $this->belongsTo (Directorat::class);
|
||||
}
|
||||
|
||||
public function sub_directorat()
|
||||
{
|
||||
return $this->belongsTo (SubDirectorat::class);
|
||||
}
|
||||
|
||||
public function job()
|
||||
{
|
||||
return $this->belongsTo (Job::class);
|
||||
}
|
||||
|
||||
public function sub_job()
|
||||
{
|
||||
return $this->belongsTo (SubJob::class);
|
||||
}
|
||||
}
|
0
Http/Controllers/.gitkeep
Normal file
0
Http/Controllers/.gitkeep
Normal file
84
Http/Controllers/Api/DirectoratController.php
Normal file
84
Http/Controllers/Api/DirectoratController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Http\Requests\Directorat\StoreDirectoratRequest;
|
||||
use Modules\CetakLabel\Http\Requests\Directorat\UpdateDirectoratRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class DirectoratController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$directorats = Directorat::all();
|
||||
|
||||
return $this->sendResponse($directorats, 'Directorats retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($directorat): JsonResponse
|
||||
{
|
||||
$directorat = Directorat::find($directorat);
|
||||
if (is_null($directorat)) {
|
||||
return $this->sendError('Directorat not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($directorat, 'Directorat retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreDirectoratRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = Directorat::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Directorat created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Directorat created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateDirectoratRequest $request, Directorat $directorat): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $directorat->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Directorat updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Directorat created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$directorat = Directorat::find($id);
|
||||
if (is_null($directorat)) {
|
||||
return $this->sendError('Directorat not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$directorat->delete();
|
||||
|
||||
return $this->sendResponse($directorat, 'Directorat deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
84
Http/Controllers/Api/JobController.php
Normal file
84
Http/Controllers/Api/JobController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Modules\CetakLabel\Http\Requests\Job\StoreJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\Job\UpdateJobRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class JobController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$jobs = Job::all();
|
||||
|
||||
return $this->sendResponse($jobs, 'Jobs retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($job): JsonResponse
|
||||
{
|
||||
$job = Job::find($job);
|
||||
if (is_null($job)) {
|
||||
return $this->sendError('Job not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($job, 'Job retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreJobRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Job...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = Job::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Job created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateJobRequest $request, Job $job): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Job...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $job->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Job updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$job = Job::find($id);
|
||||
if (is_null($job)) {
|
||||
return $this->sendError('Job not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$job->delete();
|
||||
|
||||
return $this->sendResponse($job, 'Job deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
84
Http/Controllers/Api/SpecialCodeController.php
Normal file
84
Http/Controllers/Api/SpecialCodeController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Modules\CetakLabel\Http\Requests\SpecialCode\StoreSpecialCodeRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SpecialCode\UpdateSpecialCodeRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class SpecialCodeController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$special_codes = SpecialCode::all();
|
||||
|
||||
return $this->sendResponse($special_codes, 'Special Codes retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($special_code): JsonResponse
|
||||
{
|
||||
$special_code = SpecialCode::find($special_code);
|
||||
if (is_null($special_code)) {
|
||||
return $this->sendError('Special Code not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($special_code, 'Special Code retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreSpecialCodeRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SpecialCode...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = SpecialCode::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Special Code created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Special Code created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateSpecialCodeRequest $request, SpecialCode $special_code): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SpecialCode...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $special_code->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Special Code updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Special Code created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$special_code = SpecialCode::find($id);
|
||||
if (is_null($special_code)) {
|
||||
return $this->sendError('Special Code not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$special_code->delete();
|
||||
|
||||
return $this->sendResponse($special_code, 'Special Code deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
84
Http/Controllers/Api/SubDirectoratController.php
Normal file
84
Http/Controllers/Api/SubDirectoratController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Modules\CetakLabel\Http\Requests\SubDirectorat\StoreSubDirectoratRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubDirectorat\UpdateSubDirectoratRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class SubDirectoratController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$sub_directorats = SubDirectorat::all();
|
||||
|
||||
return $this->sendResponse($sub_directorats, 'Sub Directorats retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($sub_directorat): JsonResponse
|
||||
{
|
||||
$sub_directorat = SubDirectorat::find($sub_directorat);
|
||||
if (is_null($sub_directorat)) {
|
||||
return $this->sendError('Sub Directorat not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($sub_directorat, 'Sub Directorat retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreSubDirectoratRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubDirectorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = SubDirectorat::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Directorat created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Directorat created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateSubDirectoratRequest $request, SubDirectorat $sub_directorat): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubDirectorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $sub_directorat->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Directorat updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Directorat created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$sub_directorat = SubDirectorat::find($id);
|
||||
if (is_null($sub_directorat)) {
|
||||
return $this->sendError('Sub Directorat not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$sub_directorat->delete();
|
||||
|
||||
return $this->sendResponse($sub_directorat, 'Sub Directorat deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
84
Http/Controllers/Api/SubJobController.php
Normal file
84
Http/Controllers/Api/SubJobController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Modules\CetakLabel\Http\Requests\SubJob\StoreSubJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubJob\UpdateSubJobRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class SubJobController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$sub_jobs = SubJob::all();
|
||||
|
||||
return $this->sendResponse($sub_jobs, 'Sub Jobs retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($sub_job): JsonResponse
|
||||
{
|
||||
$sub_job = SubJob::find($sub_job);
|
||||
if (is_null($sub_job)) {
|
||||
return $this->sendError('Sub Job not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($sub_job, 'Sub Job retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreSubJobRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = SubJob::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Job created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateSubJobRequest $request, SubJob $sub_job): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $sub_job->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Job updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$sub_job = SubJob::find($id);
|
||||
if (is_null($sub_job)) {
|
||||
return $this->sendError('Sub Job not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$sub_job->delete();
|
||||
|
||||
return $this->sendResponse($sub_job, 'Sub Job deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
84
Http/Controllers/Api/SubSubJobController.php
Normal file
84
Http/Controllers/Api/SubSubJobController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\ApiController;
|
||||
use Exception;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
use Modules\CetakLabel\Http\Requests\SubSubJob\StoreSubSubJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubSubJob\UpdateSubSubJobRequest;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class SubSubJobController extends ApiController
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$sub_sub_jobs = SubSubJob::all();
|
||||
|
||||
return $this->sendResponse($sub_sub_jobs, 'Sub Sub Jobs retrieved successfully.');
|
||||
}
|
||||
|
||||
public function show($sub_sub_job): JsonResponse
|
||||
{
|
||||
$sub_sub_job = SubSubJob::find($sub_sub_job);
|
||||
if (is_null($sub_sub_job)) {
|
||||
return $this->sendError('Sub Sub Job not found.');
|
||||
}
|
||||
|
||||
return $this->sendResponse($sub_sub_job, 'Sub Sub Job retrieved successfully.');
|
||||
}
|
||||
|
||||
public function store(StoreSubSubJobRequest $request): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubSubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = SubSubJob::create($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Sub Job created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Sub Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function update(UpdateSubSubJobRequest $request, SubSubJob $sub_sub_job): JsonResponse
|
||||
{
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubSubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$data = $sub_sub_job->update($validated);
|
||||
|
||||
return $this->sendResponse($data, 'Sub Sub Job updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return $this->sendError('Sub Sub Job created failed.', 400);
|
||||
}
|
||||
|
||||
public function destroy($id): JsonResponse
|
||||
{
|
||||
$sub_sub_job = SubSubJob::find($id);
|
||||
if (is_null($sub_sub_job)) {
|
||||
return $this->sendError('Sub Sub Job not found.');
|
||||
}
|
||||
|
||||
try {
|
||||
$sub_sub_job->delete();
|
||||
|
||||
return $this->sendResponse($sub_sub_job, 'Sub Sub Job deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
return $this->sendError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
160
Http/Controllers/DirectoratController.php
Normal file
160
Http/Controllers/DirectoratController.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\DirectoratDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Http\Requests\Directorat\StoreDirectoratRequest;
|
||||
use Modules\CetakLabel\Http\Requests\Directorat\UpdateDirectoratRequest;
|
||||
|
||||
class DirectoratController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Directorats.
|
||||
*
|
||||
* @param \App\DataTables\DirectoratDataTable $dataTable
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function index(DirectoratDataTable $dataTable, Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
return $dataTable->render('cetaklabel::masters.directorat.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Directorat in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\StoreDirectoratRequest $request
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function store(StoreDirectoratRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
Directorat::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Directorat created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Directorat created failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Directorat created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Directorat.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Directorat.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Entities\Directorat $directorat
|
||||
*/
|
||||
public function show(Directorat $directorat)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Directorat.
|
||||
*
|
||||
* @param $id
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$directorat = Directorat::find($id);
|
||||
echo json_encode($directorat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Directorat in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\UpdateDirectoratRequest $request
|
||||
* @param \Modules\CetakLabel\Entities\Directorat $directorat
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function update(UpdateDirectoratRequest $request, Directorat $directorat)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$directorat->update($validated);
|
||||
|
||||
echo json_encode(['status' => 'success', 'message' => 'Directorat updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Directorat updated failed.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Directorat updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Directorat from storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Entities\Directorat $directorat
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function destroy(Directorat $directorat)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$directorat->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Directorat deleted successfully.']);
|
||||
}
|
||||
}
|
191
Http/Controllers/DocumentController.php
Normal file
191
Http/Controllers/DocumentController.php
Normal file
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\DocumentDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\Document;
|
||||
use Modules\CetakLabel\Entities\DocumentDetail;
|
||||
use Modules\CetakLabel\Entities\DocumentType;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
use Modules\CetakLabel\Http\Requests\Document\StoreDocumentRequest;
|
||||
use Modules\CetakLabel\Http\Requests\Document\UpdateDocumentRequest;
|
||||
|
||||
class DocumentController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(DocumentDataTable $dataTable)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
return $dataTable->render('cetaklabel::app.document.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreDocumentRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Document...
|
||||
if ($validated) {
|
||||
$validated['sequence'] = 1;
|
||||
try {
|
||||
$created = Document::create($validated);
|
||||
|
||||
if ($created) {
|
||||
$detail = [
|
||||
'document_id' => $created->id,
|
||||
'document_type_id' => $request->document_type_id,
|
||||
'tanggal_upload' => date('Y-m-d'),
|
||||
'tanggal_dokumen' => $request->tanggal_dokumen,
|
||||
'nomor_dokumen' => $request->nomor_dokumen,
|
||||
'perihal' => $request->perihal,
|
||||
'kode_cabang' => $request->kode_cabang,
|
||||
'jumlah_halaman' => $request->jumlah_halaman,
|
||||
'custom_field_1' => $request->custom_field_1,
|
||||
'custom_field_2' => $request->custom_field_2,
|
||||
'custom_field_3' => $request->custom_field_3,
|
||||
'custom_field_4' => $request->custom_field_4,
|
||||
|
||||
'nama_nasabah' => $request->nama_nasabah,
|
||||
'no_rekening' => $request->no_rekening,
|
||||
'no_cif' => $request->no_cif,
|
||||
'group' => $request->group,
|
||||
];
|
||||
|
||||
|
||||
DocumentDetail::create($detail);
|
||||
}
|
||||
|
||||
return redirect()->route('document.index')->with('success', 'Document created successfully.');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('document.index')->with('error', 'Document created failed.');
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
addVendor('chained-select');
|
||||
|
||||
$directorat = Directorat::all();
|
||||
$special_code = SpecialCode::all();
|
||||
$document_type = DocumentType::all();
|
||||
return view('cetaklabel::app.document.create', compact('directorat', 'special_code', 'document_type'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Document $documents)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
abort(404, 'Page not found !');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$document = Document::find($id);
|
||||
$directorat = Directorat::all();
|
||||
$sub_directorat = SubDirectorat::where('directorat_id', $document->directorat_id)->get();
|
||||
$job = Job::where('sub_directorat_id', $document->sub_directorat_id)->get();
|
||||
$sub_job = SubJob::where('job_id', $document->job_id)->get();
|
||||
$sub_sub_job = SubSubJob::where('sub_job_id', $document->sub_job_id)->get();
|
||||
$special_code = SpecialCode::all();
|
||||
$document_type = DocumentType::all();
|
||||
|
||||
return view('cetaklabel::app.document.edit', compact('document', 'directorat', 'sub_directorat', 'job', 'sub_job', 'sub_sub_job', 'special_code', 'document_type'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateDocumentRequest $request, Document $documents)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the Document...
|
||||
if ($validated) {
|
||||
try {
|
||||
$document = Document::find($request->id);
|
||||
$update = $document->update($validated);
|
||||
|
||||
|
||||
return redirect()->route('document.index')->with('success', 'Document updated successfully.');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('document.index')->with('error', 'Document updated failed.');
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('app.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$documents = Document::find($request->document);
|
||||
$documents->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Document deleted successfully.']);
|
||||
}
|
||||
}
|
143
Http/Controllers/DocumentTypeController.php
Normal file
143
Http/Controllers/DocumentTypeController.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\DocumentTypeDataTable;
|
||||
use Modules\CetakLabel\Entities\DocumentType;
|
||||
use Modules\CetakLabel\Http\Requests\DocumentType\StoreDocumentTypeRequest;
|
||||
use Modules\CetakLabel\Http\Requests\DocumentType\UpdateDocumentTypeRequest;
|
||||
|
||||
class DocumentTypeController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(DocumentTypeDataTable $dataTable)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
return $dataTable->render('cetaklabel::masters.document-type.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreDocumentTypeRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Document Type...
|
||||
if ($validated) {
|
||||
try {
|
||||
DocumentType::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Document Type created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Document Type created failed.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Document Type created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}*/
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(DocumentType $document_type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$document_type = DocumentType::find($id);
|
||||
echo json_encode($document_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateDocumentTypeRequest $request, DocumentType $document_type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$document_type->update($validated);
|
||||
|
||||
echo json_encode(['status' => 'success', 'message' => 'Document Type updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Document Type updated failed.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Document Type updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(DocumentType $document_type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$document_type->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Document Type deleted successfully.']);
|
||||
}
|
||||
}
|
186
Http/Controllers/JobController.php
Normal file
186
Http/Controllers/JobController.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\JobDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\Job;
|
||||
use Modules\CetakLabel\Http\Requests\Job\StoreJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\Job\UpdateJobRequest;
|
||||
|
||||
class JobController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Jobs.
|
||||
*
|
||||
* @param \Modules\CetakLabel\DataTables\JobDataTable $dataTable
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function index(JobDataTable $dataTable, Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
// Add Vendor
|
||||
addVendor('chained-select');
|
||||
|
||||
if (isset($request->sub_directorat_id) && !empty($request->sub_directorat_id)) {
|
||||
$this->show($request);
|
||||
return;
|
||||
}
|
||||
|
||||
$directorat = Directorat::all();
|
||||
return $dataTable->render('cetaklabel::masters.job.index', compact('directorat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the specified Job by Sub Directorat ID.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
$jobs = Job::where('sub_directorat_id', $request->sub_directorat_id)->get();
|
||||
|
||||
$data = [];
|
||||
foreach ($jobs as $row) {
|
||||
$result = [
|
||||
$row->id => $row->name,
|
||||
];
|
||||
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Job in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\Job\StoreJobRequest $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function store(StoreJobRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Job...
|
||||
if ($validated) {
|
||||
try {
|
||||
Job::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Job created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Job.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Job.
|
||||
*
|
||||
* @param $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$job = Job::find($id);
|
||||
echo json_encode($job);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Job in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\Job\UpdateJobRequest $request
|
||||
* @param \Modules\CetakLabel\Entities\Job $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update(UpdateJobRequest $request, Job $job)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the Job...
|
||||
if ($validated) {
|
||||
try {
|
||||
$job->update($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Job updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Job updated failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Job updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Job from storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Entities\Job $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function destroy(Job $job)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$job->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Job deleted successfully.']);
|
||||
}
|
||||
}
|
142
Http/Controllers/SpecialCodeController.php
Normal file
142
Http/Controllers/SpecialCodeController.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\SpecialCodeDataTable;
|
||||
use Modules\CetakLabel\Entities\SpecialCode;
|
||||
use Modules\CetakLabel\Http\Requests\SpecialCode\StoreSpecialCodeRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SpecialCode\UpdateSpecialCodeRequest;
|
||||
|
||||
class SpecialCodeController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(SpecialCodeDataTable $dataTable)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
return $dataTable->render('cetaklabel::masters.special-code.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreSpecialCodeRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the Special Code...
|
||||
if ($validated) {
|
||||
try {
|
||||
SpecialCode::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Special Code created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Special Code created failed.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Special Code created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(SpecialCode $special_code)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$special_code = SpecialCode::find($id);
|
||||
echo json_encode($special_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateSpecialCodeRequest $request, SpecialCode $special_code)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the Directorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$special_code->update($validated);
|
||||
|
||||
echo json_encode(['status' => 'success', 'message' => 'Special Code updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Special Code updated failed.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Special Code updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(SpecialCode $special_code)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$special_code->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Special Code deleted successfully.']);
|
||||
}
|
||||
}
|
179
Http/Controllers/SubDirectoratController.php
Normal file
179
Http/Controllers/SubDirectoratController.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\SubDirectoratDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\SubDirectorat;
|
||||
use Modules\CetakLabel\Http\Requests\SubDirectorat\StoreSubDirectoratRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubDirectorat\UpdateSubDirectoratRequest;
|
||||
|
||||
class SubDirectoratController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Sub Directorats.
|
||||
*
|
||||
* @param \Modules\CetakLabel\DataTables\SubDirectoratDataTable $dataTable
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function index(SubDirectoratDataTable $dataTable, Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
if (isset($request->directorat_id) && !empty($request->directorat_id)) {
|
||||
$this->show($request);
|
||||
return;
|
||||
}
|
||||
|
||||
$directorat = Directorat::all();
|
||||
return $dataTable->render('cetaklabel::masters.sub-directorat.index', compact('directorat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the specified Sub Directorat by Directorat ID.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
$subdirectorats = SubDirectorat::where('directorat_id', $request->directorat_id)->get();
|
||||
|
||||
$data = [];
|
||||
foreach ($subdirectorats as $row) {
|
||||
$result = [
|
||||
$row->id => $row->name,
|
||||
];
|
||||
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Sub Directorat in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\SubDirectorat\StoreSubDirectoratRequest $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function store(StoreSubDirectoratRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubDirectorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
SubDirectorat::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Sub Directorat.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Sub Directorat.
|
||||
*
|
||||
* @param $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$subDirectorat = SubDirectorat::find($id);
|
||||
echo json_encode($subDirectorat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Sub Directorat in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\SubDirectorat\UpdateSubDirectoratRequest $request
|
||||
* @param \Modules\CetakLabel\Entities\SubDirectorat $subDirectorat
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update(UpdateSubDirectoratRequest $request, SubDirectorat $subDirectorat)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the SubDirectorat...
|
||||
if ($validated) {
|
||||
try {
|
||||
$subDirectorat->update($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat updated failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Sub Directorat from storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Entities\SubDirectorat $subDirectorat
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function destroy(SubDirectorat $subDirectorat)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$subDirectorat->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat deleted successfully.']);
|
||||
}
|
||||
}
|
187
Http/Controllers/SubJobController.php
Normal file
187
Http/Controllers/SubJobController.php
Normal file
@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\SubJobDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\SubJob;
|
||||
use Modules\CetakLabel\Http\Requests\SubJob\StoreSubJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubJob\UpdateSubJobRequest;
|
||||
|
||||
class SubJobController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Sub Jobs.
|
||||
*
|
||||
* @param \Modules\CetakLabel\DataTables\SubJobDataTable $dataTable
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function index(SubJobDataTable $dataTable, Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
addVendor('chained-select');
|
||||
|
||||
if (isset($request->job_id) && !empty($request->job_id)) {
|
||||
$this->show($request);
|
||||
return;
|
||||
}
|
||||
|
||||
$directorat = Directorat::all();
|
||||
return $dataTable->render('cetaklabel::masters.sub-job.index', compact('directorat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the specified Sub Job by Job ID.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
$subJob = SubJob::where('job_id', $request->job_id)->get();
|
||||
|
||||
$data = [];
|
||||
foreach ($subJob as $row) {
|
||||
$result = [
|
||||
$row->id => $row->name,
|
||||
];
|
||||
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Sub Job in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\SubJob\StoreSubJobRequest $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function store(StoreSubJobRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
SubJob::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Job created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Sub Job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Sub Job.
|
||||
*
|
||||
* @param $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$subJob = SubJob::find($id);
|
||||
echo json_encode($subJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Sub Job in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\SubJob\UpdateSubJobRequest $request
|
||||
* @param \Modules\CetakLabel\Entities\SubJob $subJob
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public function update(UpdateSubJobRequest $request, SubJob $subJob)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Update the SubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$subJob->update($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Job updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Job updated failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Job updated failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Sub Job from storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Entities\SubJob $subJob
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function destroy(SubJob $subJob)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.delete')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to delete any master data !');
|
||||
}
|
||||
|
||||
$subJob->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Job deleted successfully.']);
|
||||
}
|
||||
}
|
169
Http/Controllers/SubSubjobController.php
Normal file
169
Http/Controllers/SubSubjobController.php
Normal file
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\CetakLabel\DataTables\SubSubJobDataTable;
|
||||
use Modules\CetakLabel\Entities\Directorat;
|
||||
use Modules\CetakLabel\Entities\SubSubJob;
|
||||
use Modules\CetakLabel\Http\Requests\SubSubJob\StoreSubSubJobRequest;
|
||||
use Modules\CetakLabel\Http\Requests\SubSubJob\UpdateSubSubJobRequest;
|
||||
|
||||
class SubSubJobController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = Auth::guard('web')->user();
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Sub Sub Jobs.
|
||||
*
|
||||
* @param \Modules\CetakLabel\DataTables\SubSubJobDataTable $dataTable
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function index(SubSubJobDataTable $dataTable, Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
if (isset($request->sub_job_id) && !empty($request->sub_job_id)) {
|
||||
$this->show($request);
|
||||
return;
|
||||
}
|
||||
|
||||
addVendor('chained-select');
|
||||
|
||||
$directorat = Directorat::all();
|
||||
return $dataTable->render('cetaklabel::masters.sub-sub-job.index', compact('directorat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the specified Sub Sub Job by Sub Job ID.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.read')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||||
}
|
||||
|
||||
$subSubJob = SubSubJob::where('sub_job_id', $request->sub_job_id)->get();
|
||||
|
||||
$data = [];
|
||||
foreach ($subSubJob as $row) {
|
||||
$result = [
|
||||
$row->id => $row->name,
|
||||
];
|
||||
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Sub Sub Job in storage.
|
||||
*
|
||||
* @param \Modules\CetakLabel\Http\Requests\SubSubJob\StoreSubSubJobRequest $request
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public function store(StoreSubSubJobRequest $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
|
||||
// Store the SubSubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
SubSubJob::create($validated);
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job created successfully.']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job created failed.']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job created failed.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.create')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
$subJob = SubSubJob::find($id);
|
||||
echo json_encode($subJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateSubSubJobRequest $request, SubSubJob $subSubJob)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('masters.update')) {
|
||||
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
|
||||
}
|
||||
|
||||
// Validate the request...
|
||||
$validated = $request->validated();
|
||||
// Update the SubSubJob...
|
||||
if ($validated) {
|
||||
try {
|
||||
$subSubJob->update($validated);
|
||||
//return redirect()->route('job.index')->with('success', 'SubSubJob updated successfully.');
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job updated successfully.']);
|
||||
} catch (Exception $e) {
|
||||
//return redirect()->route('job.index')->with('error', 'SubSubJob updated failed.');
|
||||
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job updated failed.']);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(SubSubJob $subSubJob)
|
||||
{
|
||||
$subSubJob->delete();
|
||||
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job deleted successfully.']);
|
||||
}
|
||||
}
|
0
Http/Middleware/.gitkeep
Normal file
0
Http/Middleware/.gitkeep
Normal file
0
Http/Requests/.gitkeep
Normal file
0
Http/Requests/.gitkeep
Normal file
63
Http/Requests/Directorat/StoreDirectoratRequest.php
Normal file
63
Http/Requests/Directorat/StoreDirectoratRequest.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Directorat;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreDirectoratRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:directorats,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$errors = json_decode ($validator->errors ()->toJson (), true);
|
||||
|
||||
|
||||
foreach ($errors as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
return redirect ()->route ('directorat.index')->with ('error', 'Directorat created failed.');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Directorat created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
64
Http/Requests/Directorat/UpdateDirectoratRequest.php
Normal file
64
Http/Requests/Directorat/UpdateDirectoratRequest.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Directorat;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateDirectoratRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:directorats,kode,' . $this->directorat->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator)
|
||||
: void
|
||||
{
|
||||
$validator->after(function (Validator $validator) {
|
||||
if ($validator->errors()->any()) {
|
||||
$error = json_decode($validator->errors()->toJson(), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash($value[0]);
|
||||
}
|
||||
|
||||
return redirect()->route('directorat.index')->with('error', 'Directorat updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Directorat updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
71
Http/Requests/Document/StoreDocumentRequest.php
Normal file
71
Http/Requests/Document/StoreDocumentRequest.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Document;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreDocumentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|unique:documents,kode',
|
||||
'directorat_id' => 'required|integer|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|integer|exists:sub_directorats,id',
|
||||
'job_id' => 'required|integer|exists:jobs,id',
|
||||
'sub_job_id' => 'required|integer|exists:sub_jobs,id',
|
||||
'sub_sub_job_id' => 'required|integer|exists:sub_sub_jobs,id',
|
||||
'special_code_id' => 'nullable|integer|exists:special_codes,id',
|
||||
'no_urut' => 'nullable|integer|min:1|max:999',
|
||||
'sequence' => 'nullable|integer|min:1|max:999',
|
||||
'status' => 'nullable|integer',
|
||||
'keterangan' => 'nullable|string|max:255',
|
||||
'jenis_dokumen' => 'nullable|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('document.index')->with ('error', 'Document created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Document created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
71
Http/Requests/Document/UpdateDocumentRequest.php
Normal file
71
Http/Requests/Document/UpdateDocumentRequest.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Document;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateDocumentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|unique:documents,kode,' . $this->document->id,
|
||||
'directorat_id' => 'required|integer|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|integer|exists:sub_directorats,id',
|
||||
'job_id' => 'required|integer|exists:jobs,id',
|
||||
'sub_job_id' => 'required|integer|exists:sub_jobs,id',
|
||||
'sub_sub_job_id' => 'required|integer|exists:sub_sub_jobs,id',
|
||||
'special_code_id' => 'nullable|integer|exists:special_codes,id',
|
||||
'no_urut' => 'nullable|integer|min:1|max:999',
|
||||
'sequence' => 'nullable|integer|min:1|max:999',
|
||||
'status' => 'nullable|integer',
|
||||
'keterangan' => 'nullable|string|max:255',
|
||||
'jenis_dokumen' => 'nullable|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('document.index')->with ('error', 'Document updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Document updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
61
Http/Requests/DocumentType/StoreDocumentTypeRequest.php
Normal file
61
Http/Requests/DocumentType/StoreDocumentTypeRequest.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\DocumentType;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreDocumentTypeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:document_types,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('document-type.index')->with ('error', 'Document Type created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Document Type created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
61
Http/Requests/DocumentType/UpdateDocumentTypeRequest.php
Normal file
61
Http/Requests/DocumentType/UpdateDocumentTypeRequest.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\DocumentType;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateDocumentTypeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:document_types,kode,' . $this->document_type->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('document-type.index')->with ('error', 'Document Type updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Document Type updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
63
Http/Requests/Job/StoreJobRequest.php
Normal file
63
Http/Requests/Job/StoreJobRequest.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Job;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:jobs,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('job.index')->with ('error', 'Job created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Job created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
63
Http/Requests/Job/UpdateJobRequest.php
Normal file
63
Http/Requests/Job/UpdateJobRequest.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\Job;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:jobs,kode,' . $this->job->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('jobs.index')->with ('error', 'Job updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Job updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
61
Http/Requests/SpecialCode/StoreSpecialCodeRequest.php
Normal file
61
Http/Requests/SpecialCode/StoreSpecialCodeRequest.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SpecialCode;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreSpecialCodeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:special_codes,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('special-code.index')->with ('error', 'Special Code created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Special Code created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
61
Http/Requests/SpecialCode/UpdateSpecialCodeRequest.php
Normal file
61
Http/Requests/SpecialCode/UpdateSpecialCodeRequest.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SpecialCode;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateSpecialCodeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kode' => 'required|string|max:2|min:2|unique:special_codes,kode,' . $this->special_code->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('special-code.index')->with ('error', 'Special Code updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Special Code updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
62
Http/Requests/SubDirectorat/StoreSubDirectoratRequest.php
Normal file
62
Http/Requests/SubDirectorat/StoreSubDirectoratRequest.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubDirectorat;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreSubDirectoratRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_directorats',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('sub-directorat.index')->with ('error', 'Sub Directorat created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Directorat created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
62
Http/Requests/SubDirectorat/UpdateSubDirectoratRequest.php
Normal file
62
Http/Requests/SubDirectorat/UpdateSubDirectoratRequest.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubDirectorat;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateSubDirectoratRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_directorats,kode,' . $this->sub_directorat->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('sub-directorat.index')->with ('error', 'Sub Directorat updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Directorat updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
64
Http/Requests/SubJob/StoreSubJobRequest.php
Normal file
64
Http/Requests/SubJob/StoreSubJobRequest.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubJob;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreSubJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'job_id' => 'required|exists:jobs,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_jobs,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('job.index')->with ('error', 'Sub Job created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Job created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
64
Http/Requests/SubJob/UpdateSubJobRequest.php
Normal file
64
Http/Requests/SubJob/UpdateSubJobRequest.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubJob;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateSubJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'job_id' => 'required|exists:jobs,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_jobs,kode,' . $this->sub_job->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('jobs.index')->with ('error', 'Sub Job updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Job updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
66
Http/Requests/SubSubJob/StoreSubSubJobRequest.php
Normal file
66
Http/Requests/SubSubJob/StoreSubSubJobRequest.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubSubJob;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class StoreSubSubJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'job_id' => 'required|exists:jobs,id',
|
||||
'sub_job_id' => 'required|exists:sub_jobs,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_sub_jobs,kode',
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('job.index')->with ('error', 'Sub Sub Job created failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Sub Job created failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
66
Http/Requests/SubSubJob/UpdateSubSubJobRequest.php
Normal file
66
Http/Requests/SubSubJob/UpdateSubSubJobRequest.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Http\Requests\SubSubJob;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class UpdateSubSubJobRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'directorat_id' => 'required|exists:directorats,id',
|
||||
'sub_directorat_id' => 'required|exists:sub_directorats,id',
|
||||
'job_id' => 'required|exists:jobs,id',
|
||||
'sub_job_id' => 'required|exists:sub_jobs,id',
|
||||
'kode' => 'required|string|max:2|min:2|unique:sub_sub_jobs,kode,' . $this->sub_sub_job->id,
|
||||
'name' => 'required|string|max:50'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after (function (Validator $validator) {
|
||||
if ($validator->errors ()->any ()) {
|
||||
$error = json_decode ($validator->errors ()->toJson (), true);
|
||||
foreach ($error as $key => $value) {
|
||||
flash ($value[0]);
|
||||
}
|
||||
|
||||
return redirect ()->route ('jobs.index')->with ('error', 'Sub Sub Job updated failed.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator|\Illuminate\Contracts\Validation\Validator $validator): JsonResponse
|
||||
{
|
||||
$errors = (new ValidationException($validator))->errors ();
|
||||
|
||||
throw new HttpResponseException(response ()->json ([
|
||||
'success' => false,
|
||||
'errors' => $errors,
|
||||
'messages' => 'Sub Sub Job updated failed.'
|
||||
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
|
||||
}
|
||||
}
|
0
Providers/.gitkeep
Normal file
0
Providers/.gitkeep
Normal file
128
Providers/CetakLabelServiceProvider.php
Normal file
128
Providers/CetakLabelServiceProvider.php
Normal file
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Factory;
|
||||
|
||||
class CetakLabelServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* @var string $moduleName
|
||||
*/
|
||||
protected $moduleName = 'CetakLabel';
|
||||
|
||||
/**
|
||||
* @var string $moduleNameLower
|
||||
*/
|
||||
protected $moduleNameLower = 'cetaklabel';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->registerDatabase();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
|
||||
], 'config');
|
||||
$this->mergeConfigFrom(
|
||||
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
|
||||
);
|
||||
}
|
||||
|
||||
protected function registerDatabase()
|
||||
{
|
||||
$this->publishes([
|
||||
module_path($this->moduleName, 'Config/database.php') => config_path($this->moduleNameLower . '.php'),
|
||||
], 'database');
|
||||
|
||||
|
||||
array_merge(
|
||||
require base_path().'/config/database.php',
|
||||
require base_path().'/Modules/CetakLabel/Config/database.php'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerViews()
|
||||
{
|
||||
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
|
||||
|
||||
$sourcePath = module_path($this->moduleName, 'Resources/views');
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => $viewPath
|
||||
], ['views', $this->moduleNameLower . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerTranslations()
|
||||
{
|
||||
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (\Config::get('view.paths') as $path) {
|
||||
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
|
||||
$paths[] = $path . '/modules/' . $this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
return $paths;
|
||||
}
|
||||
}
|
69
Providers/RouteServiceProvider.php
Normal file
69
Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CetakLabel\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The module namespace to assume when generating URLs to actions.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $moduleNamespace = 'Modules\CetakLabel\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('CetakLabel', '/Routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('CetakLabel', '/Routes/api.php'));
|
||||
}
|
||||
}
|
0
Resources/lang/.gitkeep
Normal file
0
Resources/lang/.gitkeep
Normal file
0
Resources/views/.gitkeep
Normal file
0
Resources/views/.gitkeep
Normal file
13
Resources/views/app/document/_action.blade.php
Normal file
13
Resources/views/app/document/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['document' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
223
Resources/views/app/document/_edit.blade.php
Normal file
223
Resources/views/app/document/_edit.blade.php
Normal file
@ -0,0 +1,223 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.update',['document' => $document->id]) }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="id" name="id" value="{{ $document->id }}" />
|
||||
<input type="text" id="kode" class="form-control form-control-solid" placeholder="This Kode Generate Automatically" name="kode" value="{{ $document->kode }}" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<div class="row gx-5 mb-5">
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="directorat_id">
|
||||
<span class="required">Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="directorat_id" id="directorat_id">
|
||||
<option>Select Directorat</option>
|
||||
@foreach($directorat as $item)
|
||||
@if($item->id == $document->directorat_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_directorat_id">
|
||||
<span class="required">Sub Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_directorat_id" id="sub_directorat_id">
|
||||
<option>Select Sub Directorat</option>
|
||||
@foreach($sub_directorat as $item)
|
||||
@if($item->id == $document->sub_directorat_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="job_id">
|
||||
<span class="required">Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="job_id" id="job_id">
|
||||
<option>Select Job</option>
|
||||
@foreach($job as $item)
|
||||
@if($item->id == $document->job_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_job_id">
|
||||
<span class="required">Sub Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_job_id" id="sub_job_id">
|
||||
<option>Select Sub Job</option>
|
||||
@foreach($sub_job as $item)
|
||||
@if($item->id == $document->sub_job_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_sub_job_id">
|
||||
<span class="required">Sub Sub Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_sub_job_id" id="sub_sub_job_id">
|
||||
<option>Select Sub Sub Job</option>
|
||||
@foreach($sub_sub_job as $item)
|
||||
@if($item->id == $document->sub_sub_job_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="special_code_id">
|
||||
<span class="required">Special Code</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="special_code_id" id="special_code_id">
|
||||
<option>Special Code</option>
|
||||
@foreach($special_code as $item)
|
||||
@if($item->id == $document->special_code_id)
|
||||
<option value="{{$item->id}}" selected>{{$item->name}}</option>
|
||||
@else
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span >No Urut</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" placeholder="This Kode Generate Automatically" name="no_urut" value="{{ $document->no_urut }}" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="jenis_dokumen">
|
||||
<span class="required">Jenis Dokumen</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="jenis_dokumen" id="jenis_dokumen">
|
||||
<option value="nasabah" {{ $document->jenis_dokumen == 'nasabah' ? 'selected' : '' }} >Nasabah</option>
|
||||
<option value="non nasabah" {{ $document->jenis_dokumen == 'non nasabah' ? 'selected' : '' }}>Non Nasabah</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
|
||||
@push('customscript')
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#sub_directorat_id").remoteChained({
|
||||
parents : "#directorat_id",
|
||||
url : "/sub-directorat"
|
||||
});
|
||||
|
||||
$("#job_id").remoteChained({
|
||||
parents : "#sub_directorat_id",
|
||||
url : "/job"
|
||||
});
|
||||
|
||||
$("#sub_job_id").remoteChained({
|
||||
parents : "#job_id",
|
||||
url : "/sub-job"
|
||||
});
|
||||
|
||||
$("#sub_sub_job_id").remoteChained({
|
||||
parents : "#sub_job_id",
|
||||
url : "/sub-sub-job"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
388
Resources/views/app/document/_form.blade.php
Normal file
388
Resources/views/app/document/_form.blade.php
Normal file
@ -0,0 +1,388 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="id" name="id" />
|
||||
<input type="text" id="kode" class="form-control form-control-solid" placeholder="This Kode Generate Automatically" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<div class="row gx-5 mb-5">
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="directorat_id">
|
||||
<span class="required">Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="directorat_id" id="directorat_id">
|
||||
<option>Select Directorat</option>
|
||||
@foreach($directorat as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_directorat_id">
|
||||
<span class="required">Sub Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_directorat_id" id="sub_directorat_id">
|
||||
<option>Select Sub Directorat</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="job_id">
|
||||
<span class="required">Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="job_id" id="job_id">
|
||||
<option>Select Job</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_job_id">
|
||||
<span class="required">Sub Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_job_id" id="sub_job_id">
|
||||
<option>Select Sub Job</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_sub_job_id">
|
||||
<span class="required">Sub Sub Job</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_sub_job_id" id="sub_sub_job_id">
|
||||
<option>Select Sub Sub Job</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="special_code_id">
|
||||
<span class="required">Special Code</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="special_code_id" id="special_code_id">
|
||||
<option>Special Code</option>
|
||||
@foreach($special_code as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>No Urut</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="no_urut" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="jenis_dokumen">
|
||||
<span class="required">Jenis Dokumen</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="jenis_dokumen" id="jenis_dokumen">
|
||||
<option value="nasabah" >Nasabah</option>
|
||||
<option value="non nasabah">Non Nasabah</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div id="nasabah" class="row">
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Nama Nasabah</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="nama_nasabah" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>No Rekening</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="no_rekening" Placeholder="Nomor Rekening Giro/Tabungan/Loan/Deposito" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>No CIF</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="no_cif" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Group</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="group" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="special_code_id">
|
||||
<span class="required">Document Type</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="document_type_id" id="document_type_id">
|
||||
<option>Document Type</option>
|
||||
@foreach($document_type as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Tanggal Dokumen</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="date" class="form-control form-control-solid" name="tanggal_dokumen" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Nomor Dokumen</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="nomor_dokumen" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Perihal</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="perihal" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Kode Cabang</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="kode_cabang" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Jumlah Halaman</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="jumlah_halaman" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Custom Field 1</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="custom_field_1" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Custom Field 2</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="custom_field_2" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Custom Field 3</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="custom_field_3" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span>Custom Field 4</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" class="form-control form-control-solid" name="custom_field_4" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
|
||||
@push('customscript')
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#sub_directorat_id").remoteChained({
|
||||
parents : "#directorat_id",
|
||||
url : "/sub-directorat"
|
||||
});
|
||||
|
||||
$("#job_id").remoteChained({
|
||||
parents : "#sub_directorat_id",
|
||||
url : "/job"
|
||||
});
|
||||
|
||||
$("#sub_job_id").remoteChained({
|
||||
parents : "#job_id",
|
||||
url : "/sub-job"
|
||||
});
|
||||
|
||||
$("#sub_sub_job_id").remoteChained({
|
||||
parents : "#sub_job_id",
|
||||
url : "/sub-sub-job"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
100
Resources/views/app/document/_table.blade.php
Normal file
100
Resources/views/app/document/_table.blade.php
Normal file
@ -0,0 +1,100 @@
|
||||
<!--begin::Table-->
|
||||
{{ $dataTable->table() }}
|
||||
<!--end::Table-->
|
||||
|
||||
{{-- Inject Scripts --}}
|
||||
@section('scripts')
|
||||
{{ $dataTable->scripts() }}
|
||||
@endsection
|
||||
|
||||
@push('customscript')
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$("#searchbox").on("keyup search input paste cut", function () {
|
||||
LaravelDataTables["{{$route[0]}}-table"].search(this.value).draw();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
||||
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{$route[0]}}-table"], {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
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();
|
||||
console.log(e.target.getAttribute('data-kt-export'));
|
||||
// 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["{{$route[0]}}-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) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.dataTables_filter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
16
Resources/views/app/document/create.blade.php
Normal file
16
Resources/views/app/document/create.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<h3 class="card-title align-items-start flex-column">
|
||||
Upload New Document
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::app.document._form')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
</x-default-layout>
|
16
Resources/views/app/document/edit.blade.php
Normal file
16
Resources/views/app/document/edit.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<h3 class="card-title align-items-start flex-column">
|
||||
Edit Document {{ $document->kode }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('app.document._edit')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
</x-default-layout>
|
91
Resources/views/app/document/index.blade.php
Normal file
91
Resources/views/app/document/index.blade.php
Normal file
@ -0,0 +1,91 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<div class="card-title align-items-start flex-column">
|
||||
<div class="d-flex align-items-center position-relative my-1">
|
||||
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
|
||||
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1"
|
||||
transform="rotate(45 17.0365 15.1223)" fill="currentColor"></rect>
|
||||
<path
|
||||
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<!--end::Svg Icon-->
|
||||
<input type="text" id="searchbox"
|
||||
class="form-control form-control-solid border border-gray-300 w-250px ps-15"
|
||||
placeholder="Search Document">
|
||||
</div>
|
||||
|
||||
<!--begin::Export buttons-->
|
||||
<div id="kt_datatable_example_1_export" class="d-none"></div>
|
||||
<!--end::Export buttons-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-toolbar">
|
||||
|
||||
<!--begin::Export dropdown-->
|
||||
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click"
|
||||
data-kt-menu-placement="bottom-end">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<!--begin::Menu-->
|
||||
<div id="kt_datatable_example_export_menu"
|
||||
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4"
|
||||
data-kt-menu="true">
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="copy">
|
||||
Copy to clipboard
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="excel">
|
||||
Export as Excel
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="csv">
|
||||
Export as CSV
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="pdf">
|
||||
Export as PDF
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="print">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
</div>
|
||||
|
||||
<!--begin::Hide default export buttons-->
|
||||
<div id="kt_datatable_example_buttons" class="d-none"></div>
|
||||
<!--end::Hide default export buttons-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::app.document._table')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
</x-default-layout>
|
13
Resources/views/masters/directorat/_action.blade.php
Normal file
13
Resources/views/masters/directorat/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['directorat' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
70
Resources/views/masters/directorat/_form.blade.php
Normal file
70
Resources/views/masters/directorat/_form.blade.php
Normal file
@ -0,0 +1,70 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Modal - New Target-->
|
||||
<div class="modal fade" id="kt_modal_directorat" tabindex="-1" aria-hidden="true">
|
||||
<!--begin::Modal dialog-->
|
||||
<div class="modal-dialog modal-dialog-centered mw-650px">
|
||||
<!--begin::Modal content-->
|
||||
<div class="modal-content rounded">
|
||||
<!--begin::Modal header-->
|
||||
<div class="modal-header pb-0 border-0 justify-content-end">
|
||||
<!--begin::Close-->
|
||||
<div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">{!! getIcon('cross', 'fs-1') !!}</div>
|
||||
<!--end::Close-->
|
||||
</div>
|
||||
<!--begin::Modal header-->
|
||||
<!--begin::Modal body-->
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Heading-->
|
||||
<div class="mb-13 text-center">
|
||||
<!--begin::Title-->
|
||||
<h1 class="mb-3 text-capitalize" id="title_form">{{ str_replace('-',' ',$route[0]) }}</h1>
|
||||
<!--end::Title-->
|
||||
</div>
|
||||
<!--end::Heading-->
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="directorat_id" name="id" />
|
||||
<input type="text" id="directorat_kode" minlength="2" maxlength="2" pattern="[0-9]{2,2}" class="form-control form-control-solid" placeholder="Enter Kode Directorat" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Name</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" id="directorat_name" maxlength="50" class="form-control form-control-solid" placeholder="Enter Directorat Name" name="name" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
</div>
|
||||
<!--end::Modal body-->
|
||||
</div>
|
||||
<!--end::Modal content-->
|
||||
</div>
|
||||
<!--end::Modal dialog-->
|
||||
</div>
|
||||
<!--end::Modal - New Target-->
|
116
Resources/views/masters/directorat/_table.blade.php
Normal file
116
Resources/views/masters/directorat/_table.blade.php
Normal file
@ -0,0 +1,116 @@
|
||||
<!--begin::Table-->
|
||||
{{ $dataTable->table() }}
|
||||
<!--end::Table-->
|
||||
|
||||
{{-- Inject Scripts --}}
|
||||
@section('scripts')
|
||||
{{ $dataTable->scripts() }}
|
||||
@endsection
|
||||
|
||||
@push('customscript')
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$("#searchbox").on("keyup search input paste cut", function () {
|
||||
LaravelDataTables["{{$route[0]}}-table"].search(this.value).draw();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
||||
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{$route[0]}}-table"], {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
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();
|
||||
console.log(e.target.getAttribute('data-kt-export'));
|
||||
// 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["{{$route[0]}}-table"].on('click','.kt_edit_form',function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url: $(this).attr('href'),
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
$('#title_form').text('Edit {{ ucfirst(str_replace('-',' ',$route[0])) }}');
|
||||
$('#{{$route[0]}}_id').val(response.id);
|
||||
$('#{{$route[0]}}_name').val(response.name);
|
||||
$('#{{$route[0]}}_kode').val(response.kode);
|
||||
$('.form_{{$route[0]}}').attr('action', '{{ URL::to('/'.$route[0].'/') }}/' + response.id).append('<input type="hidden" name="_method" value="PUT">');
|
||||
$('#kt_modal_{{$route[0]}}').modal('show');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
LaravelDataTables["{{$route[0]}}-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) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.dataTables_filter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
131
Resources/views/masters/directorat/index.blade.php
Normal file
131
Resources/views/masters/directorat/index.blade.php
Normal file
@ -0,0 +1,131 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<div class="card-title align-items-start flex-column">
|
||||
<div class="d-flex align-items-center position-relative my-1">
|
||||
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
|
||||
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1"
|
||||
transform="rotate(45 17.0365 15.1223)" fill="currentColor"></rect>
|
||||
<path
|
||||
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<!--end::Svg Icon-->
|
||||
<input type="text" id="searchbox"
|
||||
class="form-control form-control-solid border border-gray-300 w-250px ps-15"
|
||||
placeholder="Search Directorat">
|
||||
</div>
|
||||
|
||||
<!--begin::Export buttons-->
|
||||
<div id="kt_datatable_example_1_export" class="d-none"></div>
|
||||
<!--end::Export buttons-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-toolbar">
|
||||
|
||||
<!--begin::Export dropdown-->
|
||||
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click"
|
||||
data-kt-menu-placement="bottom-end">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<!--begin::Menu-->
|
||||
<div id="kt_datatable_example_export_menu"
|
||||
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4"
|
||||
data-kt-menu="true">
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="copy">
|
||||
Copy to clipboard
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="excel">
|
||||
Export as Excel
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="csv">
|
||||
Export as CSV
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="pdf">
|
||||
Export as PDF
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="print">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
</div>
|
||||
|
||||
<!--begin::Hide default export buttons-->
|
||||
<div id="kt_datatable_example_buttons" class="d-none"></div>
|
||||
<!--end::Hide default export buttons-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::masters.directorat._table')
|
||||
@include('cetaklabel::masters.directorat._form')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
@push('customscript')
|
||||
<script>
|
||||
$(function () {
|
||||
$(".form_directorat").submit(function (e) {
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
|
||||
var form = $(this);
|
||||
var actionUrl = form.attr('action');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: actionUrl,
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function (data) {
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
form[0].reset();
|
||||
LaravelDataTables["directorat-table"].ajax.reload();
|
||||
$('#kt_modal_directorat').modal('hide');
|
||||
|
||||
},
|
||||
error: function (data, textStatus, errorThrown) {
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function (key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#kt_modal_directorat').on('hidden.bs.modal', function (e) {
|
||||
$(".form_directorat")[0].reset();
|
||||
$(".form_directorat").attr('action', "{{ route('directorat.store') }}");
|
||||
$(".form_directorat").find('input[name="_method"]').remove();
|
||||
$("#title_form").html("Create Directorat");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</x-default-layout>
|
13
Resources/views/masters/document-type/_action.blade.php
Normal file
13
Resources/views/masters/document-type/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['document_type' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
71
Resources/views/masters/document-type/_form.blade.php
Normal file
71
Resources/views/masters/document-type/_form.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Modal - New Target-->
|
||||
<div class="modal fade" id="kt_modal_{{$route[0]}}" tabindex="-1" aria-hidden="true">
|
||||
<!--begin::Modal dialog-->
|
||||
<div class="modal-dialog modal-dialog-centered mw-650px">
|
||||
<!--begin::Modal content-->
|
||||
<div class="modal-content rounded">
|
||||
<!--begin::Modal header-->
|
||||
<div class="modal-header pb-0 border-0 justify-content-end">
|
||||
<!--begin::Close-->
|
||||
<div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">{!! getIcon('cross', 'fs-1') !!}</div>
|
||||
<!--end::Close-->
|
||||
</div>
|
||||
<!--begin::Modal header-->
|
||||
<!--begin::Modal body-->
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Heading-->
|
||||
<div class="mb-13 text-center">
|
||||
<!--begin::Title-->
|
||||
<h1 class="mb-3 text-capitalize" id="title_form">{{ str_replace('-',' ',$route[0])}}</h1>
|
||||
<!--end::Title-->
|
||||
</div>
|
||||
<!--end::Heading-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="{{$route[0]}}_id" name="id" />
|
||||
<input type="text" id="{{$route[0]}}_kode" minlength="2" maxlength="2" pattern="[0-9]{2,2}" class="form-control form-control-solid" placeholder="Enter Kode" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Name</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" id="{{$route[0]}}_name" maxlength="50" class="form-control form-control-solid" placeholder="Enter Document Type Name" name="name" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
</div>
|
||||
<!--end::Modal body-->
|
||||
</div>
|
||||
<!--end::Modal content-->
|
||||
</div>
|
||||
<!--end::Modal dialog-->
|
||||
</div>
|
||||
<!--end::Modal - New Target-->
|
117
Resources/views/masters/document-type/_table.blade.php
Normal file
117
Resources/views/masters/document-type/_table.blade.php
Normal file
@ -0,0 +1,117 @@
|
||||
<!--begin::Table-->
|
||||
{{ $dataTable->table() }}
|
||||
<!--end::Table-->
|
||||
|
||||
{{-- Inject Scripts --}}
|
||||
@section('scripts')
|
||||
{{ $dataTable->scripts() }}
|
||||
@endsection
|
||||
|
||||
@push('customscript')
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$("#searchbox").on("keyup search input paste cut", function () {
|
||||
LaravelDataTables["{{$route[0]}}-table"].search(this.value).draw();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
||||
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{$route[0]}}-table"], {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
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();
|
||||
console.log(e.target.getAttribute('data-kt-export'));
|
||||
// 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["{{$route[0]}}-table"].on('click','.kt_edit_form',function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url: $(this).attr('href'),
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
$('#title_form').text('Edit {{ ucfirst(str_replace('-',' ',$route[0])) }}');
|
||||
$('#{{$route[0]}}_id').val(response.id);
|
||||
$('#{{$route[0]}}_name').val(response.name);
|
||||
$('#{{$route[0]}}_kode').val(response.kode);
|
||||
$('.form_{{$route[0]}}').attr('action', '{{ URL::to('/'.$route[0].'/') }}/' + response.id).append('<input type="hidden" name="_method" value="PUT">');
|
||||
$('#kt_modal_{{$route[0]}}').modal('show');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
LaravelDataTables["{{$route[0]}}-table"].on('click', '.delete', function (event) {
|
||||
var form = $(this).closest("form");
|
||||
event.preventDefault();
|
||||
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) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
toastr.success('{{ucfirst(str_replace('-',' ',$route[0]))}} has been deleted.', 'Success!', {timeOut: 5000});
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.dataTables_filter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
136
Resources/views/masters/document-type/index.blade.php
Normal file
136
Resources/views/masters/document-type/index.blade.php
Normal file
@ -0,0 +1,136 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<div class="card-title align-items-start flex-column">
|
||||
<div class="d-flex align-items-center position-relative my-1">
|
||||
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
|
||||
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1"
|
||||
transform="rotate(45 17.0365 15.1223)" fill="currentColor"></rect>
|
||||
<path
|
||||
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<!--end::Svg Icon-->
|
||||
<input type="text" id="searchbox"
|
||||
class="form-control form-control-solid border border-gray-300 w-250px ps-15"
|
||||
placeholder="Search Document Type">
|
||||
</div>
|
||||
|
||||
<!--begin::Export buttons-->
|
||||
<div id="kt_datatable_example_1_export" class="d-none"></div>
|
||||
<!--end::Export buttons-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-toolbar">
|
||||
|
||||
<!--begin::Export dropdown-->
|
||||
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click"
|
||||
data-kt-menu-placement="bottom-end">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<!--begin::Menu-->
|
||||
<div id="kt_datatable_example_export_menu"
|
||||
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4"
|
||||
data-kt-menu="true">
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="copy">
|
||||
Copy to clipboard
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="excel">
|
||||
Export as Excel
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="csv">
|
||||
Export as CSV
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="pdf">
|
||||
Export as PDF
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="print">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
</div>
|
||||
|
||||
<!--begin::Hide default export buttons-->
|
||||
<div id="kt_datatable_example_buttons" class="d-none"></div>
|
||||
<!--end::Hide default export buttons-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::masters.document-type._table')
|
||||
@include('cetaklabel::masters.document-type._form')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
@push('customscript')
|
||||
<script>
|
||||
$(function () {
|
||||
$(".form_document-type").submit(function (e) {
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
|
||||
var form = $(this);
|
||||
var actionUrl = form.attr('action');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: actionUrl,
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function (data) {
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
form[0].reset();
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
$('#kt_modal_{{$route[0]}}').modal('hide');
|
||||
|
||||
},
|
||||
error: function (data, textStatus, errorThrown) {
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function (key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#kt_modal_{{$route[0]}}').on('hidden.bs.modal', function (e) {
|
||||
$(".form_document-type")[0].reset();
|
||||
$(".form_document-type").attr('action', "{{ route('document-type.store') }}");
|
||||
$(".form_document-type").find('input[name="_method"]').remove();
|
||||
$("#title_form").html("Create Document Type");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</x-default-layout>
|
13
Resources/views/masters/job/_action.blade.php
Normal file
13
Resources/views/masters/job/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['job' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
102
Resources/views/masters/job/_form.blade.php
Normal file
102
Resources/views/masters/job/_form.blade.php
Normal file
@ -0,0 +1,102 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Modal - New Target-->
|
||||
<div class="modal fade" id="kt_modal_{{$route[0]}}" tabindex="-1" aria-hidden="true">
|
||||
<!--begin::Modal dialog-->
|
||||
<div class="modal-dialog modal-dialog-centered mw-650px">
|
||||
<!--begin::Modal content-->
|
||||
<div class="modal-content rounded">
|
||||
<!--begin::Modal header-->
|
||||
<div class="modal-header pb-0 border-0 justify-content-end">
|
||||
<!--begin::Close-->
|
||||
<div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">{!! getIcon('cross', 'fs-1') !!}</div>
|
||||
<!--end::Close-->
|
||||
</div>
|
||||
<!--begin::Modal header-->
|
||||
<!--begin::Modal body-->
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Heading-->
|
||||
<div class="mb-13 text-center">
|
||||
<!--begin::Title-->
|
||||
<h1 class="mb-3 text-capitalize" id="title_form">{{ str_replace('-',' ',$route[0]) }}</h1>
|
||||
<!--end::Title-->
|
||||
</div>
|
||||
<!--end::Heading-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="directorat_id">
|
||||
<span class="required">Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="directorat_id" id="directorat_id">
|
||||
<option>Select Directorat</option>
|
||||
@foreach($directorat as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="sub_directorat_id">
|
||||
<span class="required">Sub Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="sub_directorat_id" id="sub_directorat_id">
|
||||
<option>Select Sub Directorat</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="job_id" name="id" />
|
||||
<input type="text" id="job_kode" minlength="2" maxlength="2" pattern="[0-9]{2,2}" class="form-control form-control-solid" placeholder="Enter Kode Job" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Name</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" id="job_name" maxlength="50" class="form-control form-control-solid" placeholder="Enter Job Name" name="name" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
</div>
|
||||
<!--end::Modal body-->
|
||||
</div>
|
||||
<!--end::Modal content-->
|
||||
</div>
|
||||
<!--end::Modal dialog-->
|
||||
</div>
|
||||
<!--end::Modal - New Target-->
|
118
Resources/views/masters/job/_table.blade.php
Normal file
118
Resources/views/masters/job/_table.blade.php
Normal file
@ -0,0 +1,118 @@
|
||||
<!--begin::Table-->
|
||||
{{ $dataTable->table() }}
|
||||
<!--end::Table-->
|
||||
|
||||
{{-- Inject Scripts --}}
|
||||
@section('scripts')
|
||||
{{ $dataTable->scripts() }}
|
||||
@endsection
|
||||
|
||||
@push('customscript')
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$("#searchbox").on("keyup search input paste cut", function () {
|
||||
LaravelDataTables["{{$route[0]}}-table"].search(this.value).draw();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
||||
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{$route[0]}}-table"], {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
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();
|
||||
console.log(e.target.getAttribute('data-kt-export'));
|
||||
// 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["{{$route[0]}}-table"].on('click','.kt_edit_form',function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url: $(this).attr('href'),
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
$('#title_form').text('Edit {{ ucfirst(str_replace('-',' ',$route[0])) }}');
|
||||
$('#directorat_id').val(response.directorat_id).change();
|
||||
$('#sub_directorat_id').val(response.sub_directorat_id).change();
|
||||
$('#{{$route[0]}}_id').val(response.id);
|
||||
$('#{{$route[0]}}_name').val(response.name);
|
||||
$('#{{$route[0]}}_kode').val(response.kode);
|
||||
$('.form_{{$route[0]}}').attr('action', '{{ URL::to('/'.$route[0].'/') }}/' + response.id).append('<input type="hidden" name="_method" value="PUT">');
|
||||
$('#kt_modal_{{$route[0]}}').modal('show');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
LaravelDataTables["{{$route[0]}}-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) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.dataTables_filter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
137
Resources/views/masters/job/index.blade.php
Normal file
137
Resources/views/masters/job/index.blade.php
Normal file
@ -0,0 +1,137 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<div class="card-title align-items-start flex-column">
|
||||
<div class="d-flex align-items-center position-relative my-1">
|
||||
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
|
||||
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1"
|
||||
transform="rotate(45 17.0365 15.1223)" fill="currentColor"></rect>
|
||||
<path
|
||||
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<!--end::Svg Icon-->
|
||||
<input type="text" id="searchbox"
|
||||
class="form-control form-control-solid border border-gray-300 w-250px ps-15"
|
||||
placeholder="Search Job">
|
||||
</div>
|
||||
|
||||
<!--begin::Export buttons-->
|
||||
<div id="kt_datatable_example_1_export" class="d-none"></div>
|
||||
<!--end::Export buttons-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-toolbar">
|
||||
|
||||
<!--begin::Export dropdown-->
|
||||
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click"
|
||||
data-kt-menu-placement="bottom-end">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<!--begin::Menu-->
|
||||
<div id="kt_datatable_example_export_menu"
|
||||
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4"
|
||||
data-kt-menu="true">
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="copy">
|
||||
Copy to clipboard
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="excel">
|
||||
Export as Excel
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="csv">
|
||||
Export as CSV
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="pdf">
|
||||
Export as PDF
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="print">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
</div>
|
||||
|
||||
<!--begin::Hide default export buttons-->
|
||||
<div id="kt_datatable_example_buttons" class="d-none"></div>
|
||||
<!--end::Hide default export buttons-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::masters.job._table')
|
||||
@include('cetaklabel::masters.job._form')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
@push('customscript')
|
||||
<script>
|
||||
$(function () {
|
||||
$(".form_job").submit(function (e) {
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
|
||||
var form = $(this);
|
||||
var actionUrl = form.attr('action');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: actionUrl,
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function (data) {
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
form[0].reset();
|
||||
LaravelDataTables["job-table"].ajax.reload();
|
||||
$('#kt_modal_job').modal('hide');
|
||||
|
||||
},
|
||||
error: function (data, textStatus, errorThrown) {
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function (key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#kt_modal_job').on('hidden.bs.modal', function (e) {
|
||||
$(".form_job")[0].reset();
|
||||
$("#sub_directorat_id").html("").append("<option value=''>Select Sub Directorat</option>");
|
||||
$(".form_job").attr('action', "{{ route('job.store') }}");
|
||||
$(".form_job").find('input[name="_method"]').remove();
|
||||
$("#title_form").html("Create Job");
|
||||
})
|
||||
|
||||
$("#sub_directorat_id").remoteChained({
|
||||
parents : "#directorat_id",
|
||||
url : "/sub-directorat"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</x-default-layout>
|
13
Resources/views/masters/special-code/_action.blade.php
Normal file
13
Resources/views/masters/special-code/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['special_code' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
71
Resources/views/masters/special-code/_form.blade.php
Normal file
71
Resources/views/masters/special-code/_form.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Modal - New Target-->
|
||||
<div class="modal fade" id="kt_modal_{{$route[0]}}" tabindex="-1" aria-hidden="true">
|
||||
<!--begin::Modal dialog-->
|
||||
<div class="modal-dialog modal-dialog-centered mw-650px">
|
||||
<!--begin::Modal content-->
|
||||
<div class="modal-content rounded">
|
||||
<!--begin::Modal header-->
|
||||
<div class="modal-header pb-0 border-0 justify-content-end">
|
||||
<!--begin::Close-->
|
||||
<div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">{!! getIcon('cross', 'fs-1') !!}</div>
|
||||
<!--end::Close-->
|
||||
</div>
|
||||
<!--begin::Modal header-->
|
||||
<!--begin::Modal body-->
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Heading-->
|
||||
<div class="mb-13 text-center">
|
||||
<!--begin::Title-->
|
||||
<h1 class="mb-3 text-capitalize" id="title_form">{{ str_replace('-',' ',$route[0])}}</h1>
|
||||
<!--end::Title-->
|
||||
</div>
|
||||
<!--end::Heading-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="{{$route[0]}}_id" name="id" />
|
||||
<input type="text" id="{{$route[0]}}_kode" minlength="2" maxlength="2" pattern="[0-9]{2,2}" class="form-control form-control-solid" placeholder="Enter Kode" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Name</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" id="{{$route[0]}}_name" maxlength="50" class="form-control form-control-solid" placeholder="Enter Special Code Name" name="name" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
</div>
|
||||
<!--end::Modal body-->
|
||||
</div>
|
||||
<!--end::Modal content-->
|
||||
</div>
|
||||
<!--end::Modal dialog-->
|
||||
</div>
|
||||
<!--end::Modal - New Target-->
|
117
Resources/views/masters/special-code/_table.blade.php
Normal file
117
Resources/views/masters/special-code/_table.blade.php
Normal file
@ -0,0 +1,117 @@
|
||||
<!--begin::Table-->
|
||||
{{ $dataTable->table() }}
|
||||
<!--end::Table-->
|
||||
|
||||
{{-- Inject Scripts --}}
|
||||
@section('scripts')
|
||||
{{ $dataTable->scripts() }}
|
||||
@endsection
|
||||
|
||||
@push('customscript')
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$("#searchbox").on("keyup search input paste cut", function () {
|
||||
LaravelDataTables["{{$route[0]}}-table"].search(this.value).draw();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
||||
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{$route[0]}}-table"], {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
title: documentTitle
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
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();
|
||||
console.log(e.target.getAttribute('data-kt-export'));
|
||||
// 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["{{$route[0]}}-table"].on('click','.kt_edit_form',function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url: $(this).attr('href'),
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
$('#title_form').text('Edit {{ ucfirst(str_replace('-',' ',$route[0])) }}');
|
||||
$('#{{$route[0]}}_id').val(response.id);
|
||||
$('#{{$route[0]}}_name').val(response.name);
|
||||
$('#{{$route[0]}}_kode').val(response.kode);
|
||||
$('.form_{{$route[0]}}').attr('action', '{{ URL::to('/'.$route[0].'/') }}/' + response.id).append('<input type="hidden" name="_method" value="PUT">');
|
||||
$('#kt_modal_{{$route[0]}}').modal('show');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
LaravelDataTables["{{$route[0]}}-table"].on('click', '.delete', function (event) {
|
||||
var form = $(this).closest("form");
|
||||
event.preventDefault();
|
||||
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) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
toastr.success('{{ucfirst(str_replace('-',' ',$route[0]))}} has been deleted.', 'Success!', {timeOut: 5000});
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
.dataTables_filter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
136
Resources/views/masters/special-code/index.blade.php
Normal file
136
Resources/views/masters/special-code/index.blade.php
Normal file
@ -0,0 +1,136 @@
|
||||
<x-default-layout>
|
||||
<!--begin::Card-->
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<div class="card-title align-items-start flex-column">
|
||||
<div class="d-flex align-items-center position-relative my-1">
|
||||
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
|
||||
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1"
|
||||
transform="rotate(45 17.0365 15.1223)" fill="currentColor"></rect>
|
||||
<path
|
||||
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<!--end::Svg Icon-->
|
||||
<input type="text" id="searchbox"
|
||||
class="form-control form-control-solid border border-gray-300 w-250px ps-15"
|
||||
placeholder="Search Special Code">
|
||||
</div>
|
||||
|
||||
<!--begin::Export buttons-->
|
||||
<div id="kt_datatable_example_1_export" class="d-none"></div>
|
||||
<!--end::Export buttons-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-toolbar">
|
||||
|
||||
<!--begin::Export dropdown-->
|
||||
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click"
|
||||
data-kt-menu-placement="bottom-end">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<!--begin::Menu-->
|
||||
<div id="kt_datatable_example_export_menu"
|
||||
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4"
|
||||
data-kt-menu="true">
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="copy">
|
||||
Copy to clipboard
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="excel">
|
||||
Export as Excel
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="csv">
|
||||
Export as CSV
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="pdf">
|
||||
Export as PDF
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
<!--begin::Menu item-->
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-export="print">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Menu item-->
|
||||
</div>
|
||||
|
||||
<!--begin::Hide default export buttons-->
|
||||
<div id="kt_datatable_example_buttons" class="d-none"></div>
|
||||
<!--end::Hide default export buttons-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
@include('cetaklabel::masters.special-code._table')
|
||||
@include('cetaklabel::masters.special-code._form')
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
<!--end::Card-->
|
||||
@push('customscript')
|
||||
<script>
|
||||
$(function () {
|
||||
$(".form_special-code").submit(function (e) {
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
|
||||
var form = $(this);
|
||||
var actionUrl = form.attr('action');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: actionUrl,
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function (data) {
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
form[0].reset();
|
||||
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
|
||||
$('#kt_modal_{{$route[0]}}').modal('hide');
|
||||
|
||||
},
|
||||
error: function (data, textStatus, errorThrown) {
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function (key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#kt_modal_{{$route[0]}}').on('hidden.bs.modal', function (e) {
|
||||
$(".form_special-code")[0].reset();
|
||||
$(".form_special-code").attr('action', "{{ route('special-code.store') }}");
|
||||
$(".form_special-code").find('input[name="_method"]').remove();
|
||||
$("#title_form").html("Create Special Code");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</x-default-layout>
|
13
Resources/views/masters/sub-directorat/_action.blade.php
Normal file
13
Resources/views/masters/sub-directorat/_action.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
<div class="d-flex flex-row flex-center">
|
||||
<a href="{{ route($route[0].'.edit',['sub_directorat' => $model->id]) }}"
|
||||
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
|
||||
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
|
||||
</a>
|
||||
|
||||
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
|
||||
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
87
Resources/views/masters/sub-directorat/_form.blade.php
Normal file
87
Resources/views/masters/sub-directorat/_form.blade.php
Normal file
@ -0,0 +1,87 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Modal - New Target-->
|
||||
<div class="modal fade" id="kt_modal_{{$route[0]}}" tabindex="-1" aria-hidden="true">
|
||||
<!--begin::Modal dialog-->
|
||||
<div class="modal-dialog modal-dialog-centered mw-650px">
|
||||
<!--begin::Modal content-->
|
||||
<div class="modal-content rounded">
|
||||
<!--begin::Modal header-->
|
||||
<div class="modal-header pb-0 border-0 justify-content-end">
|
||||
<!--begin::Close-->
|
||||
<div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">{!! getIcon('cross', 'fs-1') !!}</div>
|
||||
<!--end::Close-->
|
||||
</div>
|
||||
<!--begin::Modal header-->
|
||||
<!--begin::Modal body-->
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
|
||||
<!--begin:Form-->
|
||||
<form class="form_{{$route[0]}}" method="POST" action="{{ route($route[0].'.store') }}">
|
||||
@csrf
|
||||
<!--begin::Heading-->
|
||||
<div class="mb-13 text-center">
|
||||
<!--begin::Title-->
|
||||
<h1 class="mb-3 text-capitalize" id="title_form">{{ str_replace('-',' ',$route[0])}}</h1>
|
||||
<!--end::Title-->
|
||||
</div>
|
||||
<!--end::Heading-->
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2" for="directorat_id">
|
||||
<span class="required">Directorat</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<select class="form-select" name="directorat_id" id="directorat_id">
|
||||
<option>Select Directorat</option>
|
||||
@foreach($directorat as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Kode</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="hidden" id="{{$route[0]}}_id" name="id" />
|
||||
<input type="text" id="{{$route[0]}}_kode" minlength="2" maxlength="2" pattern="[0-9]{2,2}" class="form-control form-control-solid" placeholder="Enter Kode Directorat" name="kode" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Input group-->
|
||||
<div class="d-flex flex-column mb-8 fv-row">
|
||||
<!--begin::Label-->
|
||||
<label class="d-flex align-items-center fs-6 fw-semibold mb-2">
|
||||
<span class="required">Name</span>
|
||||
<span class="ms-1" data-bs-toggle="tooltip" title="Specify a target name for future usage and reference"></span>
|
||||
</label>
|
||||
<!--end::Label-->
|
||||
<input type="text" id="{{$route[0]}}_name" maxlength="50" class="form-control form-control-solid" placeholder="Enter Sub Directorat Name" name="name" />
|
||||
</div>
|
||||
<!--end::Input group-->
|
||||
|
||||
<!--begin::Actions-->
|
||||
<div class="text-center">
|
||||
<button type="reset" data-bs-dismiss="modal" class="btn btn-light me-3">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<!--end::Actions-->
|
||||
</form>
|
||||
<!--end:Form-->
|
||||
</div>
|
||||
<!--end::Modal body-->
|
||||
</div>
|
||||
<!--end::Modal content-->
|
||||
</div>
|
||||
<!--end::Modal dialog-->
|
||||
</div>
|
||||
<!--end::Modal - New Target-->
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user