Browse Source

change update APi

master
unknown 1 year ago
parent
commit
b7348853b5
  1. 27
      app/Exports/StokOpNameExport.php
  2. 13
      app/Http/Controllers/Auth/RedirectAuthController.php
  3. 7
      app/Http/Controllers/DisposalController.php
  4. 6
      app/Http/Controllers/HistoryController.php
  5. 37
      app/Http/Controllers/HomeController.php
  6. 6
      app/Http/Controllers/PeminjamanController.php
  7. 3
      app/Http/Controllers/PetternLotPetiController.php
  8. 22
      app/Http/Controllers/StokOpNameController.php
  9. 2
      app/Http/Controllers/TransaksiKeluarMasukController.php
  10. 12
      app/Http/Requests/Disposal/ValidasiCreateDisposal.php
  11. 12
      app/Http/Requests/Disposal/ValidasiUpdateDisposal.php
  12. 5
      app/Models/Disposal.php
  13. 26
      app/Models/Peti.php
  14. 8
      app/Models/Transfer.php
  15. 5
      app/Models/User.php
  16. 30
      app/Models/asset_status.php
  17. 4
      database/migrations/2023_10_23_075245_create_users_table.php
  18. 8
      database/migrations/2023_11_06_085238_create_petis_table.php
  19. 2
      database/migrations/2023_11_08_132316_create_transfers_table.php
  20. 4
      database/migrations/2023_11_17_075418_create_disposals_table.php
  21. 100
      database/seeders/PetiSeeder.php
  22. 119
      resources/views/dashboard/Disposal/index.blade.php
  23. 81
      resources/views/dashboard/History/Peminjaman/index.blade.php
  24. 179
      resources/views/dashboard/History/Pengembalian/index.blade.php
  25. 1
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  26. 108
      resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php
  27. 3
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  28. 5
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  29. 1
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php
  30. 6
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php
  31. 4
      resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php
  32. 1
      resources/views/dashboard/Master_Data/User/index.blade.php
  33. 4
      resources/views/dashboard/Master_Data/Warehouse/index.blade.php
  34. 142
      resources/views/dashboard/Peminjaman/index.blade.php
  35. 192
      resources/views/dashboard/Pengembalian/index.blade.php
  36. 1
      resources/views/dashboard/Transaksi/index.blade.php
  37. 3
      resources/views/dashboard/Transfer/index.blade.php
  38. 562
      resources/views/dashboard/index.blade.php
  39. 8
      resources/views/layouts/navbar.blade.php
  40. 19
      resources/views/layouts/navbar_list.blade.php
  41. 118
      resources/views/pages/layouts/sidebar_user.blade.php
  42. 24
      resources/views/pages/user/Master_Data/Customer/index.blade.php
  43. 36
      resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php
  44. 62
      resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  45. 20
      resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php
  46. 38
      resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php
  47. 59
      resources/views/pages/user/Master_Data/User/index.blade.php
  48. 4
      resources/views/pages/user/Master_Data/Warehouse/index.blade.php
  49. 65
      resources/views/pages/user/Peminjaman/index.blade.php
  50. 88
      resources/views/pages/user/Pengembalian/index.blade.php
  51. 42
      resources/views/pages/user/dashboard/disposal/index.blade.php
  52. 288
      resources/views/pages/user/dashboard/index.blade.php
  53. 194
      resources/views/pages/user/index.blade.php
  54. 3
      routes/web.php

27
app/Exports/StokOpNameExport.php

@ -12,12 +12,14 @@ class StokOpNameExport implements FromCollection, WithHeadings
protected $stokOpnames; protected $stokOpnames;
protected $todayStokOpnames; protected $todayStokOpnames;
protected $yesterdayStokOpnames; protected $yesterdayStokOpnames;
protected $gudangStokOpnames;
public function __construct($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames) public function __construct($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames, $gudangStokOpnames)
{ {
$this->stokOpnames = $stokOpnames; $this->stokOpnames = $stokOpnames;
$this->todayStokOpnames = $todayStokOpnames; $this->todayStokOpnames = $todayStokOpnames;
$this->yesterdayStokOpnames = $yesterdayStokOpnames; $this->yesterdayStokOpnames = $yesterdayStokOpnames;
$this->gudangStokOpnames = $gudangStokOpnames;
} }
public function collection() public function collection()
@ -36,6 +38,11 @@ class StokOpNameExport implements FromCollection, WithHeadings
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id) ->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->first(); ->first();
$gudangData = $this->gudangStokOpnames
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->keyBy('warehouse_id');
$data->push([ $data->push([
'No' => $nomor++, 'No' => $nomor++,
'Customer' => $data_StokOpname->customer->name, 'Customer' => $data_StokOpname->customer->name,
@ -44,11 +51,10 @@ class StokOpNameExport implements FromCollection, WithHeadings
'Bagging Stok' => $yesterdayStokOpname ? $yesterdayStokOpname->total_petis : '-', 'Bagging Stok' => $yesterdayStokOpname ? $yesterdayStokOpname->total_petis : '-',
'Add' => $todayStokOpname ? $todayStokOpname->total_petis : '0', 'Add' => $todayStokOpname ? $todayStokOpname->total_petis : '0',
'Total' => $data_StokOpname->total_petis ?? '0', 'Total' => $data_StokOpname->total_petis ?? '0',
'DI ISTW' => 'Belum', 'Jakarta' => $gudangData->get(1)->total_petis ?? '0',
'Gudang A' => 'Belum', 'Bekasi' => $gudangData->get(2)->total_petis ?? '0',
'Gudang B' => 'Belum', 'Semarang' => $gudangData->get(3)->total_petis ?? '0',
'Gudang C' => 'Belum', 'Surabaya' => $gudangData->get(4)->total_petis ?? '0',
'Stok Opname' => 'Belum',
'Total Stok' => $data_StokOpname->total_petis ?? '0', 'Total Stok' => $data_StokOpname->total_petis ?? '0',
]); ]);
} }
@ -66,11 +72,10 @@ class StokOpNameExport implements FromCollection, WithHeadings
'Bagging Stok', 'Bagging Stok',
'Add', 'Add',
'Total', 'Total',
'DI ISTW', 'Jakarta',
'Gudang A', 'Bekasi',
'Gudang B', 'Semarang',
'Gudang C', 'Surabaya',
'Stok Opname',
'Total Stok', 'Total Stok',
]; ];
} }

13
app/Http/Controllers/Auth/RedirectAuthController.php

@ -11,12 +11,13 @@ class RedirectAuthController extends Controller
public function redirectAuth() public function redirectAuth()
{ {
if (Auth::check()) { if (Auth::check()) {
if (Auth::user()->role_id == 1) { return redirect()->route('dashboard.home.admin');
// Admin // if (Auth::user()->role_id == 1) {
return redirect()->route('dashboard.home.admin'); // // Admin
} else { // return redirect()->route('dashboard.home.admin');
return redirect()->route('dashboard.home.user'); // } else {
} // return redirect()->route('dashboard.home.user');
// }
} else { } else {
// Tidak ada akun atau kesalahan login // Tidak ada akun atau kesalahan login
return redirect()->route('login')->with('error', 'Kesalahan email atau password.'); return redirect()->route('login')->with('error', 'Kesalahan email atau password.');

7
app/Http/Controllers/DisposalController.php

@ -16,14 +16,17 @@ class DisposalController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
'disposal' => Disposal::where('status_disposal', 'INAKTIF')->orderBy('created_at', 'desc')->get(), 'disposal' => Disposal::where('status_disposal', 'INAKTIF')
// 'disposal' => Disposal::orderBy('created_at', 'desc')->get(), ->orderBy('created_at', 'desc')
->get(),
'active' => 'menu-disposal', 'active' => 'menu-disposal',
]; ];
return view('dashboard.Disposal.index', $data); return view('dashboard.Disposal.index', $data);
} }
/** /**
* Show the form for creating a new resource. * Show the form for creating a new resource.
*/ */

6
app/Http/Controllers/HistoryController.php

@ -14,7 +14,7 @@ class HistoryController extends Controller
$data = [ $data = [
// 'peminjaman' => asset_status::get(), // 'peminjaman' => asset_status::get(),
'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(), 'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'active' => 'history-peminjaman', 'active' => 'history-peminjaman',
]; ];
@ -25,7 +25,7 @@ class HistoryController extends Controller
public function historyPengembalian() public function historyPengembalian()
{ {
$data = [ $data = [
'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(), 'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-pengembalian', 'active' => 'history-pengembalian',
]; ];
return view('dashboard.History.Pengembalian.index', $data); return view('dashboard.History.Pengembalian.index', $data);
@ -34,7 +34,7 @@ class HistoryController extends Controller
public function historyTransfer() public function historyTransfer()
{ {
$data = [ $data = [
'transfer' => Transfer::orderBy('created_at', 'desc')->get(), 'transfer' => Transfer::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-transfer', 'active' => 'history-transfer',
]; ];
return view('dashboard.History.Transfer.index', $data); return view('dashboard.History.Transfer.index', $data);

37
app/Http/Controllers/HomeController.php

@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Auth;
class HomeController extends Controller class HomeController extends Controller
{ {
//halaman Admin
public function index() public function index()
{ {
$data = [ $data = [
@ -20,29 +20,34 @@ class HomeController extends Controller
return view('dashboard.index', $data); return view('dashboard.index', $data);
} }
//halaman User
// public function indexUser()
// {
// $data = [
// 'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(),
// 'jumlahPeti' => \App\Models\Peti::count(),
// 'jumlahPeminjaman' => \App\Models\asset_status::count(),
// 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
// 'active' => 'menu-admin',
// ];
// return view('pages.user.index', $data);
// }
public function notification() public function notification()
{ {
$notification = \App\Models\asset_status::whereNull('enter_at')
->whereDate('est_pengembalian', \Carbon\Carbon::today())
->get();
$data = [ $data = [
'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), 'notifikasi' => $notification,
'jumlahPeti' => \App\Models\Peti::count(),
'jumlahPeminjaman' => \App\Models\asset_status::count(),
'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
'active' => 'menu-admin', 'active' => 'menu-admin',
]; ];
return view('layouts.navbar_list', $data); return view('layouts.navbar_list', $data);
} }
public function indexUser()
{
$data = [
'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(),
'jumlahPeminjaman' => \App\Models\asset_status::count(),
'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
'active' => 'menu-user',
];
return view('pages.user.index', $data);
}
//data pertahun untuk bar chart //data pertahun untuk bar chart
public function generateChartData() public function generateChartData()

6
app/Http/Controllers/PeminjamanController.php

@ -39,18 +39,12 @@ class PeminjamanController extends Controller
$subquery->where('status', '!=', 0); $subquery->where('status', '!=', 0);
})->orWhereDoesntHave('assetStatuses'); })->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get(); })->where('status', 'aktif')->get();
// $petiTransfer = Peti::where('id', $PetiId)
// ->leftJoin('category', 'product.category', '=', 'category.id')
// ->select('product.id','category.name')->first();
$data = [ $data = [
// 'peti' => Peti::all(), // 'peti' => Peti::all(),
'peminjaman' => asset_status::get(), 'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'peti_block' => $petiWithStatusNotZeroOrEmptyAndActive, 'peti_block' => $petiWithStatusNotZeroOrEmptyAndActive,
// 'peti_block' => Peti::whereNotIn('id', asset_status::where('status', 0)->pluck('peti_id')->toArray())
// ->where('status', 'AKTIF') // Sesuaikan dengan nama kolom yang benar
// ->get(),
'customer' => Customer::get(), 'customer' => Customer::get(),
'existingPeti' => asset_status::pluck('peti_id')->toArray(), 'existingPeti' => asset_status::pluck('peti_id')->toArray(),
'active' => 'menu-peminjaman', 'active' => 'menu-peminjaman',

3
app/Http/Controllers/PetternLotPetiController.php

@ -13,8 +13,7 @@ class PetternLotPetiController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
// 'warehouses' => m_warehouse::orderBy('created_at', 'desc')->get(), 'peti' => Peti::withTrashed()->get(),
'peti' => Peti::get(),
'active' => 'menu-Pettern_Lot_Peti' 'active' => 'menu-Pettern_Lot_Peti'
]; ];
return view('dashboard.Master_Data.Report.Pattern_lot_peti.index', $data); return view('dashboard.Master_Data.Report.Pattern_lot_peti.index', $data);

22
app/Http/Controllers/StokOpNameController.php

@ -14,27 +14,27 @@ class StokOpNameController extends Controller
public function index() public function index()
{ {
// Total Peti Berdasarkan Gudang // Total Peti Berdasarkan Gudang
$gudangStokOpnames = Peti::with('customer', 'tipe_peti', 'warehouse') $gudangStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti', 'warehouse')
->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id') ->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sekarang // Total Peti Berdasarkan Tanggal Sekarang
$todayStokOpnames = Peti::with('customer', 'tipe_peti') $todayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today()) ->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
$yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') $yesterdayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini ->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti // Total Peti
$stokOpnames = Peti::with('customer', 'tipe_peti') $stokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
@ -52,25 +52,31 @@ class StokOpNameController extends Controller
public function export() public function export()
{ {
//total peti //total peti
$stokOpnames = Peti::with('customer', 'tipe_peti') $stokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sekarang // Total Peti Berdasarkan Tanggal Sekarang
$todayStokOpnames = Peti::with('customer', 'tipe_peti') $todayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today()) ->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
$yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') $yesterdayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini ->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
return Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames), 'stok_opname.xlsx'); // Total Peti Berdasarkan Gudang
$gudangStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti', 'warehouse')
->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get();
return Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames, $gudangStokOpnames), 'stok_opname.xlsx');
} }
} }

2
app/Http/Controllers/TransaksiKeluarMasukController.php

@ -14,7 +14,7 @@ class TransaksiKeluarMasukController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
'peminjaman' => asset_status::all(), 'peminjaman' => asset_status::withTrashed()->all(),
'active' => 'menu-transaksi', 'active' => 'menu-transaksi',
]; ];
return view('dashboard.transaksi.index', $data); return view('dashboard.transaksi.index', $data);

12
app/Http/Requests/Disposal/ValidasiCreateDisposal.php

@ -22,9 +22,9 @@ class ValidasiCreateDisposal extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required', 'peti_id' => 'required|integer',
'customer_id' => 'nullable', 'customer_id' => 'required|integer',
'warehouse_id' => 'nullable', 'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date', 'date_disposal' => 'nullable|date',
'description' => 'nullable|string', 'description' => 'nullable|string',
'status_disposal' => 'nullable', 'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiCreateDisposal extends FormRequest
public function messages(): array public function messages(): array
{ {
return [ return [
'peti_id.required' => 'Peti harus dipilih.',
'peti_id.integer' => 'Peti harus berupa angka.',
'customer_id.required' => 'Customer harus dipilih.',
'customer_id.integer' => 'Customer harus berupa angka.',
'warehouse_id.required' => 'Gudang harus dipilih.',
'warehouse_id.integer' => 'Gudang harus berupa angka.',
'date_disposal.date' => 'Format tanggal disposal tidak valid.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.',
'description.string' => 'Deskripsi harus berupa teks.', 'description.string' => 'Deskripsi harus berupa teks.',
]; ];

12
app/Http/Requests/Disposal/ValidasiUpdateDisposal.php

@ -22,9 +22,9 @@ class ValidasiUpdateDisposal extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required', 'peti_id' => 'required|integer',
'customer_id' => 'nullable', 'customer_id' => 'required|integer',
'warehouse_id' => 'nullable', 'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date', 'date_disposal' => 'nullable|date',
'description' => 'nullable|string', 'description' => 'nullable|string',
'status_disposal' => 'nullable', 'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiUpdateDisposal extends FormRequest
public function messages(): array public function messages(): array
{ {
return [ return [
'peti_id.required' => 'Peti harus dipilih.',
'peti_id.integer' => 'Peti harus berupa angka.',
'customer_id.required' => 'Customer harus dipilih.',
'customer_id.integer' => 'Customer harus berupa angka.',
'warehouse_id.required' => 'Gudang harus dipilih.',
'warehouse_id.integer' => 'Gudang harus berupa angka.',
'date_disposal.date' => 'Format tanggal disposal tidak valid.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.',
'description.string' => 'Deskripsi harus berupa teks.', 'description.string' => 'Deskripsi harus berupa teks.',
]; ];

5
app/Models/Disposal.php

@ -35,13 +35,14 @@ class Disposal extends Model
'kondisipeti_id', 'kondisipeti_id',
'fix_lot', 'fix_lot',
'updated_by', 'updated_by',
); )->withTrashed();
} }
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'customer_id')->select( return $this->belongsTo(Customer::class, 'customer_id')->select(
'name', 'name',
'code_customer', 'code_customer',
); )->withTrashed();
} }
} }

26
app/Models/Peti.php

@ -31,29 +31,43 @@ class Peti extends Model
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'customer_id')->select('id', 'name', 'code_customer', 'lot_no'); return $this->belongsTo(Customer::class, 'customer_id')->select(
'id',
'name',
'code_customer',
'lot_no'
)->withTrashed();
} }
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address'); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed();
} }
public function tipe_peti() public function tipe_peti()
{ {
return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select('id', 'type', 'size_peti', 'description'); return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select(
'id',
'type',
'size_peti',
'description'
)->withTrashed();
} }
public function kondisipeti() public function kondisipeti()
{ {
return $this->belongsTo(Kondisi_Peti::class, 'kondisipeti_id')->select('id', 'nama_kondisi', 'deskripsi_kondisi'); return $this->belongsTo(Kondisi_Peti::class, 'kondisipeti_id')->select(
'id',
'nama_kondisi',
'deskripsi_kondisi'
)->withTrashed();
} }
public function transfer() public function transfer()
{ {
return $this->hasOne(Transfer::class, 'peti_id'); return $this->hasOne(Transfer::class, 'peti_id')->withTrashed();
} }
// proses pengambilan data // proses pengambilan data
public function assetStatuses() public function assetStatuses()
{ {
return $this->hasMany(asset_status::class, 'peti_id'); return $this->hasMany(asset_status::class, 'peti_id')->withTrashed();
} }
} }

8
app/Models/Transfer.php

@ -35,27 +35,27 @@ class Transfer extends Model
'kondisipeti_id', 'kondisipeti_id',
'fix_lot', 'fix_lot',
'updated_by', 'updated_by',
); )->withTrashed();
} }
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'name_customer')->select( return $this->belongsTo(Customer::class, 'name_customer')->select(
'name', 'name',
'code_customer', 'code_customer',
); )->withTrashed();
} }
public function sourceWarehouse() public function sourceWarehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select( return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select(
'name', 'name',
'address', 'address',
); )->withTrashed();
} }
public function destinationWarehouse() public function destinationWarehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select( return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select(
'name', 'name',
'address', 'address',
); )->withTrashed();
} }
} }

5
app/Models/User.php

@ -8,11 +8,12 @@ use Laravel\Sanctum\HasApiTokens;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject; use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements JWTSubject class User extends Authenticatable implements JWTSubject
{ {
use HasApiTokens, HasFactory, Notifiable; use HasApiTokens, HasFactory, Notifiable, SoftDeletes;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
@ -40,7 +41,7 @@ class User extends Authenticatable implements JWTSubject
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'warehouse_id'); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->withTrashed();
} }
/** /**

30
app/Models/asset_status.php

@ -7,11 +7,12 @@ use App\Traits\UUID;
use App\Models\Customer; use App\Models\Customer;
use App\Models\Type_peti; use App\Models\Type_peti;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
class asset_status extends Model class asset_status extends Model
{ {
use HasFactory; use HasFactory, SoftDeletes;
protected $table = 'asset_statuses'; protected $table = 'asset_statuses';
protected $fillable = [ protected $fillable = [
@ -34,41 +35,52 @@ class asset_status extends Model
public function asset() public function asset()
{ {
return $this->belongsTo(m_asset::class, 'asset_id'); return $this->belongsTo(m_asset::class, 'asset_id')->withTrashed();
} }
public function warehouseId() public function warehouseId()
{ {
return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address'); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed();
} }
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address'); return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address')->withTrashed();
} }
public function warehouseEnter() public function warehouseEnter()
{ {
return $this->belongsTo(m_warehouse::class, 'enter_warehouse')->select('id', 'name', 'address'); return $this->belongsTo(m_warehouse::class, 'enter_warehouse')->select('id', 'name', 'address')->withTrashed();
} }
public function peti() public function peti()
{ {
return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'kondisipeti_id'); return $this->belongsTo(Peti::class, 'peti_id')->select(
'id',
'tipe_peti_id',
'warna',
'fix_lot',
'packing_no',
'customer_id',
'jumlah',
'date_pembuatan',
'warehouse_id',
'kondisipeti_id'
)->withTrashed();
} }
public function tipe_peti() public function tipe_peti()
{ {
return $this->belongsTo(Type_peti::class, 'type')->select('id', 'type', 'size_peti', 'description'); return $this->belongsTo(Type_peti::class, 'type')->select('id', 'type', 'size_peti', 'description')->withTrashed();
} }
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'customer_id'); return $this->belongsTo(Customer::class, 'customer_id')->withTrashed();
} }
public function kondisi_peti() public function kondisi_peti()
{ {
return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id'); return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id')->withTrashed();
} }
} }

4
database/migrations/2023_10_23_075245_create_users_table.php

@ -25,8 +25,8 @@ return new class extends Migration
$table->string('foto', 255)->nullable(); $table->string('foto', 255)->nullable();
$table->string('jenis_kelamin', 20)->nullable(); $table->string('jenis_kelamin', 20)->nullable();
$table->string('agama', 15)->nullable(); $table->string('agama', 15)->nullable();
$table->foreignId('role_id')->nullable()->constrained('m_roles')->onDelete('set null'); $table->foreignId('role_id')->nullable()->constrained('m_roles');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->text('address')->nullable(); $table->text('address')->nullable();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password', 255)->nullable(); $table->string('password', 255)->nullable();

8
database/migrations/2023_11_06_085238_create_petis_table.php

@ -13,15 +13,15 @@ return new class extends Migration
{ {
Schema::create('petis', function (Blueprint $table) { Schema::create('petis', function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignId('tipe_peti_id')->nullable()->constrained('type_petis')->onDelete('set null'); $table->foreignId('tipe_peti_id')->nullable()->constrained('type_petis');
$table->string('warna', 50); $table->string('warna', 50);
$table->string('fix_lot', 100); $table->string('fix_lot', 100);
$table->integer('packing_no'); $table->integer('packing_no');
$table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null'); $table->foreignId('customer_id')->nullable()->constrained('customers');
$table->integer('jumlah')->nullable(); $table->integer('jumlah')->nullable();
$table->date('date_pembuatan', 100)->nullable(); $table->date('date_pembuatan', 100)->nullable();
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis')->onDelete('set null'); $table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis');
$table->string('status', 50)->default('AKTIF'); $table->string('status', 50)->default('AKTIF');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();

2
database/migrations/2023_11_08_132316_create_transfers_table.php

@ -17,7 +17,7 @@ return new class extends Migration
$table->foreignId('peti_id')->nullable()->constrained('petis'); $table->foreignId('peti_id')->nullable()->constrained('petis');
$table->foreignId('name_customer')->nullable()->constrained('customers'); $table->foreignId('name_customer')->nullable()->constrained('customers');
$table->foreignId('source_warehouse')->nullable()->constrained('m_warehouses'); $table->foreignId('source_warehouse')->nullable()->constrained('m_warehouses');
$table->foreignId('destination_warehouse')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('destination_warehouse')->nullable()->constrained('m_warehouses');
$table->date('date'); $table->date('date');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();

4
database/migrations/2023_11_17_075418_create_disposals_table.php

@ -15,8 +15,8 @@ return new class extends Migration
$table->id('id'); $table->id('id');
$table->uuid('mobile_id')->nullable(); $table->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->constrained('petis'); $table->foreignId('peti_id')->constrained('petis');
$table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null'); $table->foreignId('customer_id')->constrained('customers');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->constrained('m_warehouses');
$table->date('date_disposal'); $table->date('date_disposal');
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->string('status_disposal', 50); $table->string('status_disposal', 50);

100
database/seeders/PetiSeeder.php

@ -15,24 +15,106 @@ class PetiSeeder extends Seeder
public function run() public function run()
{ {
// Generate 5 dummy data // Generate 5 dummy data
for ($i = 0; $i < 5; $i++) { // for ($i = 0; $i < 5; $i++) {
DB::table('petis')->insert([ // DB::table('petis')->insert([
// 'tipe_peti_id' => $this->getRandomId('type_petis'),
// 'warna' => 'Warna',
// 'fix_lot' => 'Dummy Fix Lot ' . ($i + 1),
// 'packing_no' => rand(1, 100),
// 'customer_id' => $this->getRandomId('customers'),
// 'jumlah' => rand(1, 10),
// 'date_pembuatan' => now(),
// 'warehouse_id' => $this->getRandomId('m_warehouses'),
// 'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
// 'status' => 'AKTIF',
// 'created_at' => now(),
// 'updated_at' => now(),
// 'created_by' => 'Seeder',
// 'updated_by' => 'Seeder',
// ]);
// }
DB::table('petis')->insert([
[
'tipe_peti_id' => $this->getRandomId('type_petis'), 'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Dummy Warna ' . ($i + 1), 'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), 'fix_lot' => 'Dummy Fix Lot 1',
'packing_no' => rand(1, 100), 'packing_no' => 1,
'customer_id' => $this->getRandomId('customers'), 'customer_id' => $this->getRandomId('customers'),
'jumlah' => rand(1, 10), 'jumlah' => 1,
'date_pembuatan' => now(), 'date_pembuatan' => now(),
'warehouse_id' => $this->getRandomId('m_warehouses'), 'warehouse_id' => 1,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF', 'status' => 'AKTIF',
'created_at' => now(), 'created_at' => now(),
'updated_at' => now(), 'updated_at' => now(),
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ],
} [
'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot 2',
'packing_no' => 2,
'customer_id' => $this->getRandomId('customers'),
'jumlah' => 2,
'date_pembuatan' => now(),
'warehouse_id' => 2,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF',
'created_at' => now(),
'updated_at' => now(),
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
],
[
'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot 3',
'packing_no' => 3,
'customer_id' => $this->getRandomId('customers'),
'jumlah' => 3,
'date_pembuatan' => now(),
'warehouse_id' => 3,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF',
'created_at' => now(),
'updated_at' => now(),
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
],
[
'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot 4',
'packing_no' => 4,
'customer_id' => $this->getRandomId('customers'),
'jumlah' => 4,
'date_pembuatan' => now(),
'warehouse_id' => 4,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF',
'created_at' => now(),
'updated_at' => now(),
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
],
[
'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot 5',
'packing_no' => 5,
'customer_id' => $this->getRandomId('customers'),
'jumlah' => 5,
'date_pembuatan' => now(),
'warehouse_id' => 1,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF',
'created_at' => now(),
'updated_at' => now(),
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
],
]);
} }
/** /**

119
resources/views/dashboard/Disposal/index.blade.php

@ -10,69 +10,72 @@
} }
</style> </style>
@include('layouts.components.alert-prompt') @include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> @if (auth()->user()->role_id == 1)
<div class="card-header py-3"> <div class="card shadow mb-4">
<div class="row"> <div class="card-header py-3">
<div class="col-6"> <div class="row">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Disposal</h5> <div class="col-6">
</div> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Disposal</h5>
<div class="col-6 text-right"> </div>
<a href="{{ route('dashboard.disposal.create') }}" class="btn btn-success btn-icon-split"> <div class="col-6 text-right">
<span class="text">Disposal Peti</span> <a href="{{ route('dashboard.disposal.create') }}" class="btn btn-success btn-icon-split">
</a> <span class="text">Disposal Peti</span>
</a> </a>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Tanggal Disposal</th>
<th>Alasan Disposal</th>
<th>Status Peti</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nodisposal = 1;
@endphp
@forelse ($disposal as $data_disposal)
<tr> <tr>
<td>{{ $nodisposal++ }}</td> <th class="text-center">No</th>
<td>{{ $data_disposal->peti->fix_lot }}</td> <th>Kode Peti</th>
<td>{{ $data_disposal->customer->name }}</td> <th>Nama Customer</th>
<td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td> <th>Tanggal Disposal</th>
<td>{{ $data_disposal->description }}</td> <th>Alasan Disposal</th>
<td>{{ $data_disposal->status_disposal }}</td> <th>Status Peti</th>
<td class="text-center"> <th class="text-center">Action</th>
<a href="{{ route('dashboard.disposal.edit', $data_disposal->id) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.disposal.destroy', $data_disposal->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @php
</tbody> $nodisposal = 1;
</table> @endphp
@forelse ($disposal as $data_disposal)
<tr>
<td>{{ $nodisposal++ }}</td>
<td>{{ optional($data_disposal->peti)->fix_lot }}</td>
<td>{{ optional($data_disposal->customer)->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td>
<td>{{ $data_disposal->description }}</td>
<td>{{ $data_disposal->status_disposal }}</td>
<td class="text-center">
<a href="{{ route('dashboard.disposal.edit', $data_disposal->id) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.disposal.destroy', $data_disposal->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> @elseif (auth()->user()->role_id == 2)
@include('pages.user.dashboard.disposal.index')
@endif
@endsection @endsection

81
resources/views/dashboard/History/Peminjaman/index.blade.php

@ -9,53 +9,48 @@
white-space: nowrap; white-space: nowrap;
} }
</style> </style>
@if (auth()->user()->role_id == 1) <div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <div class="row">
<div class="row"> <div class="col-6">
<div class="col-6"> <h5 class="m-0 font-weight-bold text-primary mt-2">Histori Peminjaman</h5>
<h5 class="m-0 font-weight-bold text-primary mt-2">Histori Peminjaman</h5>
</div>
</div> </div>
</div> </div>
<div class="card-body"> </div>
<div class="table-responsive"> <div class="card-body">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <div class="table-responsive">
<thead> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Kode</th>
<th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th>
<th>WH Peminjam</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data_peminjaman)
<tr> <tr>
<th class="text-center">No</th> <td class="text-center">{{ $no_peminjaman++ }}</td>
<th>Kode Peti</th> <td>{{ $data_peminjaman->peti->fix_lot }}</td>
<th>Nama Customer</th> <td>{{ $data_peminjaman->peti->customer->name }}</td>
<th>Kode</th> <td>{{ $data_peminjaman->peti->customer->code_customer }} -
<th>Tgl Peminjaman</th> {{ $data_peminjaman->peti->tipe_peti->type }}</td>
<th>PJ Peminjaman</th> <td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<th>WH Peminjam</th> <td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
</tr> </tr>
</thead> @empty
<tbody> @endforelse
@php </tbody>
$no_peminjaman = 1; </table>
@endphp
@forelse ($peminjaman as $data_peminjaman)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div> </div>
</div> </div>
@else </div>
@include('pages.user.Peminjaman.index')
@endif
@endsection @endsection

179
resources/views/dashboard/History/Pengembalian/index.blade.php

@ -9,100 +9,95 @@
white-space: nowrap; white-space: nowrap;
} }
</style> </style>
@if (auth()->user()->role_id == 1) <div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <div class="row">
<div class="row"> <div class="col-6">
<div class="col-6"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Pengembalian</h5>
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Pengembalian</h5>
</div>
</div> </div>
</div> </div>
<div class="card-body"> </div>
<div class="table-responsive"> <div class="card-body">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <div class="table-responsive">
<thead> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<tr> <thead>
<th>No</th> <tr>
<th>Kode Peti</th> <th>No</th>
<th>Customer</th> <th>Kode Peti</th>
<th>Tgl Peinjaman</th> <th>Customer</th>
<th>Estimasi Pengembalian</th> <th>Tgl Peinjaman</th>
<th>PJ Peminjaman</th> <th>Estimasi Pengembalian</th>
<th>Asal WH Peminjaman</th> <th>PJ Peminjaman</th>
<th>Tgl Pengembalian</th> <th>Asal WH Peminjaman</th>
<th>PJ Pengembalian</th> <th>Tgl Pengembalian</th>
<th>Tujuan WH Pengembalian</th> <th>PJ Pengembalian</th>
<th>Kondisi Peti</th> <th>Tujuan WH Pengembalian</th>
<th>Status</th> <th>Kondisi Peti</th>
</tr> <th>Status</th>
</thead> </tr>
<tbody> </thead>
@php <tbody>
$no_peminjaman = 1; @php
@endphp $no_peminjaman = 1;
@forelse ($peminjaman as $data) @endphp
@if ($data->enter_warehouse !== null) @forelse ($peminjaman as $data)
<tr> @if ($data->enter_warehouse !== null)
<td>{{ $no_peminjaman++ }}</td> <tr>
<td>{{ $data->peti->fix_lot }}</td> <td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->customer->name }}</td> <td>{{ $data->peti->fix_lot }}</td>
<td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td> <td>{{ $data->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data->exit_pic }}</td> <td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td>
<td> <td>{{ $data->exit_pic }}</td>
@if ($data->exit_warehouse) <td>
{{ $data->warehouse->name }} @if ($data->exit_warehouse)
@else {{ $data->warehouse->name }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_at) <td>
{{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} @if ($data->enter_at)
@else {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_pic) <td>
{{ $data->enter_pic }} @if ($data->enter_pic)
@else {{ $data->enter_pic }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_warehouse) <td>
{{ $data->warehouseEnter->name }} @if ($data->enter_warehouse)
@else {{ $data->warehouseEnter->name }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->kondisi_peti) <td>
{{ $data->kondisi_peti->nama_kondisi }} @if ($data->kondisi_peti)
@else {{ $data->kondisi_peti->nama_kondisi }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_warehouse === null) <td>
Not Return @if ($data->enter_warehouse === null)
@else Not Return
Return @else
@endif Return
</td> @endif
</tr> </td>
@endif </tr>
@empty @endif
<p>Data Kosong</p> @empty
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
@else </div>
@include('pages.user.Pengembalian.index')
@endif
@endsection @endsection

1
resources/views/dashboard/Master_Data/Customer/index.blade.php

@ -63,7 +63,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

108
resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php

@ -1,64 +1,68 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt') @include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> @if (auth()->user()->role_id == 1)
<div class="card-header py-3"> <div class="card shadow mb-4">
<div class="row"> <div class="card-header py-3">
<div class="col-6"> <div class="row">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Kondisi Peti</h5> <div class="col-6">
</div> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Kondisi Peti</h5>
<div class="col-6 text-right"> </div>
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal"> <div class="col-6 text-right">
<span class="text">Tambah Kondisi Peti</span> <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
</a> data-target="#tambahDataModal">
<span class="text">Tambah Kondisi Peti</span>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center" style="width: 20px">No</th>
<th>Kondisi Peti</th>
<th>Deskripsi</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nokondisi = 1;
@endphp
@forelse ($kondisiPeti as $data_kondisiPeti)
<tr> <tr>
<td class="text-center">{{ $nokondisi++ }}</td> <th class="text-center" style="width: 20px">No</th>
<td>{{ $data_kondisiPeti->nama_kondisi }}</td> <th>Kondisi Peti</th>
<td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td> <th>Deskripsi</th>
<td class="text-center"> <th class="text-center">Action</th>
<a href="#" data-toggle="modal"
data-target="#editDataModal{{ $data_kondisiPeti->id }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.kondisipeti.destroy', $data_kondisiPeti->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @php
</tbody> $nokondisi = 1;
</table> @endphp
@foreach ($kondisiPeti as $data_kondisiPeti)
<tr>
<td class="text-center">{{ $nokondisi++ }}</td>
<td>{{ $data_kondisiPeti->nama_kondisi }}</td>
<td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td>
<td class="text-center">
<a href="#" data-toggle="modal"
data-target="#editDataModal{{ $data_kondisiPeti->id }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.kondisipeti.destroy', $data_kondisiPeti->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> @elseif (auth()->user()->role_id == 2)
@include('pages.user.master_data.manajemen_peti.kondisi_peti.index')
@endif
<!-- Tambah Data Modal--> <!-- Tambah Data Modal-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" <div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"

3
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php

@ -92,7 +92,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
@ -100,7 +99,7 @@
</div> </div>
</div> </div>
</div> </div>
@else @elseif (auth()->user()->role_id == 2)
@include('pages.user.Master_Data.Manajemen_Peti.Peti.index') @include('pages.user.Master_Data.Manajemen_Peti.Peti.index')
@endif @endif

5
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php

@ -57,14 +57,13 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
@else @elseif (auth()->user()->role_id == 2)
@include('pages.user.Master_Data.Manajemen_Peti.Type_peti.index') @include('pages.user.master_data.manajemen_peti.tipe_peti.index')
@endif @endif
@endsection @endsection

1
resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php

@ -86,7 +86,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

6
resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php

@ -17,9 +17,6 @@
<h5 class="m-0 font-weight-bold text-primary mt-2">Report Pettern Lot Peti</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Report Pettern Lot Peti</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
{{-- <a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank">
<span class="text">Cetak PDF</span>
</a> --}}
<a href="{{ route('dashboard.Pettern_Lot_Peti.export') }}" class="btn btn-info btn-icon-split ml-auto" <a href="{{ route('dashboard.Pettern_Lot_Peti.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank"> target="_blank">
<span class="text">Cetak Exel</span> <span class="text">Cetak Exel</span>
@ -42,6 +39,7 @@
<th>LOT NO</th> <th>LOT NO</th>
<th>PACKING NO</th> <th>PACKING NO</th>
<th>FIX LOT</th> <th>FIX LOT</th>
<th>STATUS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -63,9 +61,9 @@
<a <a
href="{{ route('dashboard.Pettern_Lot_Peti.show', $data_peti->id) }}">{{ $data_peti->fix_lot }}</a> href="{{ route('dashboard.Pettern_Lot_Peti.show', $data_peti->id) }}">{{ $data_peti->fix_lot }}</a>
</td> </td>
<td>{{ $data_peti->status }}</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

4
resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php

@ -9,7 +9,6 @@
white-space: nowrap; white-space: nowrap;
} }
</style> </style>
{{-- <p>Halaman Stop Op Name</p> --}}
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
@ -17,8 +16,6 @@
<h5 class="m-0 font-weight-bold text-primary mt-2">Report Stok Opname</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Report Stok Opname</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
{{-- <a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank">
<span class="text">Cetak PDF</span> --}}
</a> </a>
<a href="{{ route('dashboard.StokOpname.export') }}" class="btn btn-info btn-icon-split ml-auto" <a href="{{ route('dashboard.StokOpname.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank"> target="_blank">
@ -168,7 +165,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Master_Data/User/index.blade.php

@ -72,7 +72,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

4
resources/views/dashboard/Master_Data/Warehouse/index.blade.php

@ -65,8 +65,8 @@
</div> </div>
</div> </div>
@else @elseif(auth()->user()->role_id == 2)
@include('pages.user.Master_Data.Warehouse.index') @include('pages.user.master_data.warehouse.index')
@endif @endif
<!-- Modal Tambah--> <!-- Modal Tambah-->

142
resources/views/dashboard/Peminjaman/index.blade.php

@ -11,82 +11,76 @@
</style> </style>
@include('layouts.components.alert-prompt') @include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1) <div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <div class="row">
<div class="row"> <div class="col-6">
<div class="col-6"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Peminjaman</h5>
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peminjaman</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.peminjaman.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Peminjaman</span>
</a>
</div>
</div> </div>
</div> <div class="col-6 text-right">
<div class="card-body"> <a href="{{ route('dashboard.peminjaman.create') }}" class="btn btn-success btn-icon-split">
<div class="table-responsive"> <span class="text">Tambah Peminjaman</span>
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> </a>
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Kode</th>
<th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th>
<th>Tujuan WH Peminjam</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data_peminjaman)
@if ($data_peminjaman->enter_warehouse == null)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.pengembalian.edit', $data_peminjaman->id) }}"
title="Pengembalian">
<i class="fa fa-reply mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}"
title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form
action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endif
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@else <div class="card-body">
@include('pages.user.Peminjaman.index') <div class="table-responsive">
@endif <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Kode</th>
<th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th>
<th>Tujuan WH Peminjam</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data_peminjaman)
@if ($data_peminjaman->enter_warehouse == null)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.pengembalian.edit', $data_peminjaman->id) }}"
title="Pengembalian">
<i class="fa fa-reply mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}"
title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endif
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
@endsection @endsection

192
resources/views/dashboard/Pengembalian/index.blade.php

@ -10,107 +10,101 @@
white-space: nowrap; white-space: nowrap;
} }
</style> </style>
@if (auth()->user()->role_id == 1) <div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <div class="row">
<div class="row"> <div class="col-6">
<div class="col-6"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Pengembalian</h5>
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Pengembalian</h5>
</div>
</div> </div>
</div> </div>
<div class="card-body"> </div>
<div class="table-responsive"> <div class="card-body">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <div class="table-responsive">
<thead> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<tr> <thead>
<th>No</th> <tr>
<th>Kode Peti</th> <th>No</th>
<th>Customer</th> <th>Kode Peti</th>
<th>Tgl Peinjaman</th> <th>Customer</th>
<th>Estimasi Pengembalian</th> <th>Tgl Peinjaman</th>
<th>PJ Peminjaman</th> <th>Estimasi Pengembalian</th>
<th>WH Peminjam</th> <th>PJ Peminjaman</th>
<th>Tgl Pengembalian</th> <th>WH Peminjam</th>
<th>PJ Pengembalian</th> <th>Tgl Pengembalian</th>
<th>WH Pengembalian</th> <th>PJ Pengembalian</th>
<th>Kondisi Peti</th> <th>WH Pengembalian</th>
<th>Status</th> <th>Kondisi Peti</th>
<th class="text-center">Action</th> <th>Status</th>
</tr> <th class="text-center">Action</th>
</thead> </tr>
<tbody> </thead>
@php <tbody>
$no_peminjaman = 1; @php
@endphp $no_peminjaman = 1;
@forelse ($peminjaman as $data) @endphp
@if ($data->enter_warehouse !== null) @forelse ($peminjaman as $data)
<tr> @if ($data->enter_warehouse !== null)
<td>{{ $no_peminjaman++ }}</td> <tr>
<td>{{ $data->peti->fix_lot }}</td> <td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->customer->name }}</td> <td>{{ $data->peti->fix_lot }}</td>
<td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td> <td>{{ $data->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data->exit_pic }}</td> <td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td>
<td> <td>{{ $data->exit_pic }}</td>
@if ($data->exit_warehouse) <td>
{{ $data->warehouse->name }} @if ($data->exit_warehouse)
@else {{ $data->warehouse->name }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_at) <td>
{{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} @if ($data->enter_at)
@else {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_pic) <td>
{{ $data->enter_pic }} @if ($data->enter_pic)
@else {{ $data->enter_pic }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_warehouse) <td>
{{ $data->warehouseEnter->name }} @if ($data->enter_warehouse)
@else {{ $data->warehouseEnter->name }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->kondisi_peti) <td>
{{ $data->kondisi_peti->nama_kondisi }} @if ($data->kondisi_peti)
@else {{ $data->kondisi_peti->nama_kondisi }}
<p class="text-center font-weight-bold">-</p> @else
@endif <p class="text-center font-weight-bold">-</p>
</td> @endif
<td> </td>
@if ($data->enter_warehouse === null) <td>
Not Return @if ($data->enter_warehouse === null)
@else Not Return
Return @else
@endif Return
</td> @endif
<td class="text-center"> </td>
<a href="{{ route('dashboard.pengembalian.edit', [$data->id]) }}" <td class="text-center">
title="Edit"> <a href="{{ route('dashboard.pengembalian.edit', [$data->id]) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i> <i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a> </a>
</td> </td>
</tr> </tr>
@endif @endif
@empty @empty
<p>Data Kosong</p> @endforelse
@endforelse </tbody>
</tbody> </table>
</table>
</div>
</div> </div>
</div> </div>
@else </div>
@include('pages.user.Pengembalian.index')
@endif
@endsection @endsection

1
resources/views/dashboard/Transaksi/index.blade.php

@ -90,7 +90,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

3
resources/views/dashboard/Transfer/index.blade.php

@ -44,7 +44,8 @@
@foreach ($transfer as $data_transfer) @foreach ($transfer as $data_transfer)
<tr> <tr>
<td>{{ $notransfer++ }}</td> <td>{{ $notransfer++ }}</td>
<td>{{ $data_transfer->peti->fix_lot }}</td> {{-- <td>{{ $data_transfer->peti->fix_lot }}</td> --}}
<td>{{ optional($data_transfer->peti)->fix_lot }}</td>
<td>{{ $data_transfer->customer->name ?? '' }}</td> <td>{{ $data_transfer->customer->name ?? '' }}</td>
<td>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td>
<td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td> <td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td>

562
resources/views/dashboard/index.blade.php

@ -1,376 +1,318 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<div class="d-sm-flex align-items-center justify-content-between mb-4"> @if (auth()->user()->role_id == 1)
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i <h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> <a href="#" id="generateReportBtn" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
</div> class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
<div class="row"> </div>
<div class="col-xl-3 col-md-6 mb-4"> <div class="row">
<div class="card border-left-primary shadow h-100 py-2"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card-body"> <div class="card border-left-primary shadow h-100 py-2">
<div class="row no-gutters align-items-center"> <div class="card-body">
<div class="col mr-2"> <div class="row no-gutters align-items-center">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;"> <div class="col mr-2">
<strong>Pengadaan</strong> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1"
style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeti }}
</div>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;"> <div class="col-auto">
{{ $jumlahPeti }} <i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Earnings (Monthly) Card Example --> <!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2"> <div class="card border-left-success shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1" style="font-size: 14px;"> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"
<strong>Peminjaman</strong> style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Earnings (Monthly) Card Example --> <!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2"> <div class="card border-left-info shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1" style="font-size: 14px;"> <div class="text-xs font-weight-bold text-info text-uppercase mb-1"
<strong>Pengembalian</strong> style="font-size: 14px;">
<strong>Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Pending Requests Card Example --> <!-- Pending Requests Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2"> <div class="card border-left-warning shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1" style="font-size: 13px;"> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"
<strong>Reminder Pengembalian</strong> style="font-size: 13px;">
<strong>Reminder Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $reminder }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $reminder }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Area Bar Chart --> <!-- Area Bar Chart -->
<div class="col-xl-7 col-lg-7"> <div class="col-xl-7 col-lg-7">
<div class="card shadow mb-4" style="max-height: 600px;"> <div class="card shadow mb-4" style="max-height: 600px;">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian</h6> <h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian</h6>
</div> </div>
@php @php
$chartData = app('App\Http\Controllers\HomeController')->generateChartData(); $chartData = app('App\Http\Controllers\HomeController')->generateChartData();
@endphp @endphp
<div class="card-body" style="height: 80%;"> <!-- Sesuaikan persentase tinggi konten yang diinginkan --> <div class="card-body" style="height: 80%;"> <!-- Sesuaikan persentase tinggi konten yang diinginkan -->
<label for="yearFilter">Pilih Tahun:</label> <label for="yearFilter">Pilih Tahun:</label>
<select id="yearFilter" class="form-control"> <select id="yearFilter" class="form-control">
@foreach ($chartData['years'] as $year) @foreach ($chartData['years'] as $year)
@if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index]) @if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option> <option value="{{ $year }}">{{ $year }}</option>
@endif @endif
@endforeach @endforeach
</select> </select>
<canvas id="ChartAssetStatus" style="width: 100px; height: 68px;"></canvas> <canvas id="ChartAssetStatus" style="width: 100px; height: 68px;"></canvas>
</div>
</div> </div>
</div> </div>
</div>
<!-- Area Pie Chart --> <!-- Area Pie Chart -->
<div class="col-xl-5 col-lg-5"> <div class="col-xl-5 col-lg-5">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<!-- Card Header - Dropdown --> <!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Peti</h6> <h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Peti</h6>
</div> </div>
@php @php
$chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie(); $chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie();
@endphp @endphp
<div class="card-body"> <div class="card-body">
<label for="yearFilterPie">Pilih Tahun:</label> <label for="yearFilterPie">Pilih Tahun:</label>
<select id="yearFilterPie" class="form-control"> <select id="yearFilterPie" class="form-control">
@foreach ($chartDataPie['years'] as $year) @foreach ($chartDataPie['years'] as $year)
@if (count($chartDataPie['enterData']) > 0 && $chartDataPie['enterData'][$loop->index]) @if (count($chartDataPie['enterData']) > 0 && $chartDataPie['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option> <option value="{{ $year }}">{{ $year }}</option>
@endif @endif
@endforeach @endforeach
</select> </select>
<canvas id="myPieChartsiopas"></canvas> <canvas id="myPieChartsiopas"></canvas>
</div>
</div> </div>
</div> </div>
</div> </div>
{{-- <div class="col-xl-5 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Peti</h6>
</div>
@php
$chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie();
@endphp
<div class="card-body">
<label for="yearFilterPie">Pilih Tahun:</label>
<select id="yearFilterPie" class="form-control">
@foreach ($chartDataPie['years'] as $year)
@if (count($chartDataPie['enterData']) > 0 && $chartDataPie['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="myPieChartsiopas"></canvas>
</div>
</div>
</div> --}}
</div>
@push('script') @push('script')
<!-- script pie chart --> <!-- script pie chart -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script> <script>
// Function to update the pie chart based on selected year // Function to update the pie chart based on selected year
function updatePieChart(selectedYear) { function updatePieChart(selectedYear) {
// Call the controller function to get data for the selected year // Call the controller function to get data for the selected year
var chartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!}; var chartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
var yearIndex = chartDataPie.years.indexOf(selectedYear); var yearIndex = chartDataPie.years.indexOf(selectedYear);
// Update the pie chart data // Update the pie chart data
myPieChart.data.datasets[0].data = chartDataPie.enterData[yearIndex]; myPieChart.data.datasets[0].data = chartDataPie.enterData[yearIndex];
myPieChart.update(); myPieChart.update();
// Save selected year to local storage // Save selected year to local storage
localStorage.setItem('selectedYearPie', selectedYear); localStorage.setItem('selectedYearPie', selectedYear);
} }
// Initial chart data // Initial chart data
var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!}; var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
// Get the canvas element for the pie chart // Get the canvas element for the pie chart
var ctxPie = document.getElementById("myPieChartsiopas").getContext('2d'); var ctxPie = document.getElementById("myPieChartsiopas").getContext('2d');
// Create the initial pie chart instance // Create the initial pie chart instance
var myPieChart = new Chart(ctxPie, { var myPieChart = new Chart(ctxPie, {
type: 'pie', type: 'pie',
data: { data: {
labels: initialChartDataPie.monthNames, labels: initialChartDataPie.monthNames,
datasets: [{ datasets: [{
data: initialChartDataPie.enterData[0], data: initialChartDataPie.enterData[0],
backgroundColor: ["#4e73df", "#1cc88a", "#36b9cc", "#ff6384", "#ff9f40", "#9966ff", backgroundColor: ["#4e73df", "#1cc88a", "#36b9cc", "#ff6384", "#ff9f40", "#9966ff",
"#cc65fe", "#cc65fe",
"#ffcc29", "#a4e56d", "#ff3d00", "#9c9c9c", "#0d47a1" "#ffcc29", "#a4e56d", "#ff3d00", "#9c9c9c", "#0d47a1"
], ],
}] }]
}, },
options: { options: {
responsive: true, responsive: true,
plugins: { plugins: {
legend: { legend: {
position: 'right', position: 'right',
maxHeight: 200, maxHeight: 200,
}, },
tooltip: { tooltip: {
callbacks: { callbacks: {
label: function(context) { label: function(context) {
var label = context.label || ''; var label = context.label || '';
if (label) { if (label) {
label += ' : '; label += ' : ';
}
label += Math.round(context.parsed * 1) + ' Peti';
return label;
} }
label += Math.round(context.parsed * 1) + ' Peti';
return label;
} }
} }
} }
},
});
// Event listener for year filter change
document.getElementById('yearFilterPie').addEventListener('change', function() {
var selectedYear = this.value;
updatePieChart(selectedYear);
});
// On page load, try to retrieve the selected year from local storage
document.addEventListener('DOMContentLoaded', function() {
var selectedYear = localStorage.getItem('selectedYearPie');
if (selectedYear) {
// If a year is found, set the dropdown value and update the chart
document.getElementById('yearFilterPie').value = selectedYear;
updatePieChart(selectedYear);
} }
}, });
}); </script>
// Event listener for year filter change <!-- script bar chart -->
document.getElementById('yearFilterPie').addEventListener('change', function() { <script>
var selectedYear = this.value; document.addEventListener('DOMContentLoaded', function() {
updatePieChart(selectedYear); var ctx = document.getElementById('ChartAssetStatus').getContext('2d');
}); var myChart;
var chartData = @json($chartData);
// On page load, try to retrieve the selected year from local storage function updateChart(selectedYear) {
document.addEventListener('DOMContentLoaded', function() { var selectedYearIndex = chartData.years.indexOf(selectedYear);
var selectedYear = localStorage.getItem('selectedYearPie');
if (selectedYear) {
// If a year is found, set the dropdown value and update the chart
document.getElementById('yearFilterPie').value = selectedYear;
updatePieChart(selectedYear);
}
});
</script>
{{-- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Function to update the pie chart based on selected year
function updatePieChart(selectedYear) {
// Call the controller function to get data for the selected year
var chartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
var yearIndex = chartDataPie.years.indexOf(selectedYear);
// Update the pie chart data // Mengambil data berdasarkan tahun yang dipilih
myPieChart.data.datasets[0].data = chartDataPie.enterData[yearIndex]; var updatedExitData = chartData.exitData[selectedYearIndex];
myPieChart.update(); var updatedEnterData = chartData.enterData[selectedYearIndex];
}
// Initial chart data // Memperbarui chart hanya dengan data tahun yang dipilih
var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!}; myChart.data.labels = chartData.monthNames;
myChart.data.datasets[0].data = updatedExitData;
myChart.data.datasets[1].data = updatedEnterData;
// Get the canvas element for the pie chart myChart.update();
var ctxPie = document.getElementById("myPieChartsiopas").getContext('2d'); }
// Create the initial pie chart instance myChart = new Chart(ctx, {
var myPieChart = new Chart(ctxPie, { type: 'bar',
type: 'pie', data: {
data: { labels: chartData.monthNames, // Menggunakan nama bulan sebagai label
labels: initialChartDataPie.monthNames, datasets: [{
datasets: [{ label: 'Peminjaman',
data: initialChartDataPie.enterData[0], data: chartData.exitData[
backgroundColor: ["#4e73df", "#1cc88a", "#36b9cc", "#ff6384", "#ff9f40", "#9966ff", 0], // Menggunakan data tahun saat ini sebagai awalan
"#cc65fe", backgroundColor: 'rgba(75, 192, 192, 0.2)',
"#ffcc29", "#a4e56d", "#ff3d00", "#9c9c9c", "#0d47a1" borderColor: 'rgba(75, 192, 192, 1)',
], borderWidth: 1
}] }, {
}, label: 'Pengembalian',
options: { data: chartData.enterData[
responsive: true, 0], // Menggunakan data tahun saat ini sebagai awalan
plugins: { backgroundColor: 'rgba(255, 159, 64, 0.2)',
legend: { borderColor: 'rgba(255, 159, 64, 1)',
position: 'right', borderWidth: 1
maxHeight: 200, }]
}, },
tooltip: { options: {
callbacks: { scales: {
label: function(context) { y: {
var label = context.label || ''; beginAtZero: true
if (label) {
label += ' : ';
}
label += Math.round(context.parsed * 1) + ' Peti';
return label;
} }
} }
} }
} });
},
});
// Event listener for year filter change
document.getElementById('yearFilterPie').addEventListener('change', function() {
var selectedYear = this.value;
updatePieChart(selectedYear);
});
</script> --}}
<!-- script bar chart --> var yearFilter = document.getElementById('yearFilter');
<script> yearFilter.addEventListener('change', function() {
document.addEventListener('DOMContentLoaded', function() { var selectedYear = yearFilter.value;
var ctx = document.getElementById('ChartAssetStatus').getContext('2d'); updateChart(selectedYear);
var myChart; // Simpan tahun yang dipilih ke local storage
var chartData = @json($chartData); localStorage.setItem('selectedYear', selectedYear);
});
function updateChart(selectedYear) { // Kondisi Pertama: Setelah halaman dimuat
var selectedYearIndex = chartData.years.indexOf(selectedYear); // Coba baca tahun yang disimpan di local storage
var selectedYear = localStorage.getItem('selectedYear');
if (selectedYear) {
yearFilter.value = selectedYear;
updateChart(selectedYear);
} else {
// Jika tidak ada tahun yang disimpan, pilih tahun saat ini
selectedYear = new Date().getFullYear();
yearFilter.value = selectedYear;
updateChart(selectedYear);
}
});
</script>
// Mengambil data berdasarkan tahun yang dipilih <!-- script generate report -->
var updatedExitData = chartData.exitData[selectedYearIndex]; <script>
var updatedEnterData = chartData.enterData[selectedYearIndex]; function downloadReport(routeName) {
var exportUrl = '{{ url('dashboard') }}/' + routeName;
// Memperbarui chart hanya dengan data tahun yang dipilih var link = document.createElement('a');
myChart.data.labels = chartData.monthNames; link.href = exportUrl;
myChart.data.datasets[0].data = updatedExitData; link.download = 'nama_file_report.xlsx'; // Ganti dengan nama file yang diinginkan
myChart.data.datasets[1].data = updatedEnterData; link.target = '_blank';
myChart.update(); link.click();
} }
myChart = new Chart(ctx, { document.getElementById('generateReportBtn').addEventListener('click', function() {
type: 'bar', downloadReport('Pettern_Lot_Peti/export');
data: { downloadReport('StokOpname/export');
labels: chartData.monthNames, // Menggunakan nama bulan sebagai label
datasets: [{
label: 'Peminjaman',
data: chartData.exitData[
0], // Menggunakan data tahun saat ini sebagai awalan
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 1
}, {
label: 'Pengembalian',
data: chartData.enterData[
0], // Menggunakan data tahun saat ini sebagai awalan
backgroundColor: 'rgba(255, 159, 64, 0.2)',
borderColor: 'rgba(255, 159, 64, 1)',
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
var yearFilter = document.getElementById('yearFilter');
yearFilter.addEventListener('change', function() {
var selectedYear = yearFilter.value;
updateChart(selectedYear);
// Simpan tahun yang dipilih ke local storage
localStorage.setItem('selectedYear', selectedYear);
}); });
</script>
// Kondisi Pertama: Setelah halaman dimuat @endpush
// Coba baca tahun yang disimpan di local storage @elseif(auth()->user()->role_id == 2)
var selectedYear = localStorage.getItem('selectedYear'); @include('pages.user.dashboard.index')
if (selectedYear) { @endif
yearFilter.value = selectedYear;
updateChart(selectedYear);
} else {
// Jika tidak ada tahun yang disimpan, pilih tahun saat ini
selectedYear = new Date().getFullYear();
yearFilter.value = selectedYear;
updateChart(selectedYear);
}
});
</script>
@endpush
@endsection @endsection

8
resources/views/layouts/navbar.blade.php

@ -46,15 +46,15 @@
</div> </div>
<div> <div>
<div class="small text-gray-500"> <div class="small text-gray-500">
{{ \Carbon\Carbon::parse($data_notification->exit_at)->format('F j, Y') }}</div> {{ \Carbon\Carbon::parse($data_notification->est_pengembalian)->format('F j, Y') }}
</div>
<span class="font-weight-bold">Peti dengan kode <span class="font-weight-bold">Peti dengan kode
{{ $data_notification->peti->fix_lot }} berhasil di pinjam</span> {{ $data_notification->peti->fix_lot }} Sudah waktunya pengembalian</span>
</div> </div>
</a> </a>
@endforeach @endforeach
<a class="dropdown-item text-center small text-gray-500" <a class="dropdown-item text-center small text-gray-500"
href="{{ route('dashboard.navbarList.notification') }}">Show All href="{{ route('dashboard.navbarList.notification') }}">Show All Notifikasi</a>
Alerts</a>
</div> </div>
</li> </li>

19
resources/views/layouts/navbar_list.blade.php

@ -1,4 +1,21 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<p>Halaman Notification</p> <div class="row">
@foreach ($notifikasi as $data_notifikasi)
<div class="col-lg-6">
<div class="card shadow mb-4">
<div class="card-header py-3">
<a href="{{ route('dashboard.pengembalian.edit', $data_notifikasi->id) }}">
<h6 class="m-0 font-weight-bold text-primary">Kode Peti {{ $data_notifikasi->peti->fix_lot }}
</h6>
</a>
</div>
<div class="card-body">
Kode Peti dengan dengan kode "{{ $data_notifikasi->peti->fix_lot }}" sudah waktunya dikembalikan
pada tanggal {{ \Carbon\Carbon::parse($data_notifikasi->est_pengembalian)->format('F j, Y') }}
</div>
</div>
</div>
@endforeach
</div>
@endsection @endsection

118
resources/views/pages/layouts/sidebar_user.blade.php

@ -1,34 +1,74 @@
<!-- Sidebar - Brand --> <!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard.home.user') }}"> <a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard.home.admin') }}">
<div class="sidebar-brand-icon rotate-n-15"> <div class="sidebar-brand-icon">
<i class="fas fa-laugh-wink"></i> {{-- <i class="fas fa-laugh-wink"></i> --}}
<img src="{{ asset('assets/img/logo_istw.png') }}" alt="Tachometer Icon" width="70" height="70"
class="mb-2 mt-2">
</div> </div>
<div class="sidebar-brand-text mx-3">SIOPAS</div> <div class="sidebar-brand-text mx-2 mr-3">SIOPAS</div>
</a> </a>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider my-0"> <hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard --> <!-- Nav Item - Dashboard -->
<li class="nav-item {{ $active == 'menu-user' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-admin' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.user') }}"> <a class="nav-link" href="{{ route('dashboard.home.admin') }}">
<i class="fas fa-fw fa-tachometer-alt"></i> <i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a> <span>Dashboard</span></a>
</li> </li>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider"> <hr class="sidebar-divider">
<li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}"> @php
<a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}"> $isTransaksiActive = in_array($active, ['menu-user', 'menu-role']);
<i class="fas fa-fw fa-upload"></i> @endphp
<span>Peminjaman</span>
<!-- Transaction -->
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsetransaktion"
aria-expanded="{{ $isTransaksiActive ? 'true' : 'false' }}" aria-controls="collapsetransaktion">
<i class="fas fa-fw fa-exchange-alt"></i>
<span>Transaksi</span>
</a> </a>
<div id="collapsetransaktion" class="collapse" aria-labelledby="headingTransaktion" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}"
href="{{ route('dashboard.peminjaman.index') }}">Peminjaman</a>
<a class="collapse-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}"
href="{{ route('dashboard.pengembalian.index') }}">Pengembalian</a>
<a class="collapse-item {{ $active == 'menu-transfer' ? 'active' : '' }}"
href="{{ route('dashboard.transfer.index') }}">Transfer</a>
</div>
</div>
</li> </li>
<li class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.pengembalian.index') }}"> <li class="nav-item {{ $active == 'menu-disposal' ? 'active' : '' }}">
<i class="fas fa-fw fa-download"></i> <a class="nav-link" href="{{ route('dashboard.disposal.index') }}">
<span>Pengembalian</span> <i class="fas fa-fw fa-trash"></i>
<span>Disposal</span>
</a>
</li>
<!-- Histories -->
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsehistory"
aria-expanded="{{ $isTransaksiActive ? 'true' : 'false' }}" aria-controls="collapsehistory">
<i class="fas fa-history"></i>
<span>History</span>
</a> </a>
<div id="collapsehistory" class="collapse" aria-labelledby="headingHistory" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'history-peminjaman' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPeminjaman') }}">Peminjaman</a>
<a class="collapse-item {{ $active == 'history-pengembalian' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPengembalian') }}">Pengembalian</a>
<a class="collapse-item {{ $active == 'history-transfer' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyTransfer') }}">Transfer</a>
</div>
</div>
</li> </li>
<!-- Divider --> <!-- Divider -->
@ -38,6 +78,32 @@
<div class="sidebar-heading"> <div class="sidebar-heading">
Master Data Master Data
</div> </div>
@php
$isUserActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
{{-- <li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo"
aria-expanded="{{ $isUserActive ? 'true' : 'false' }}" aria-controls="collapseTwo">
<i class="fas fa-fw fa-users"></i>
<span>Manajemen User</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-user' ? 'active' : '' }}"
href="{{ route('dashboard.user.index') }}">User</a>
<a class="collapse-item {{ $active == 'menu-role' ? 'active' : '' }}"
href="{{ route('dashboard.role.index') }}">Role</a>
</div>
</div>
</li> --}}
<li class="nav-item {{ $active == 'menu-customer' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.customer.index') }}">
<i class="fas fa-fw fa-user"></i>
<span>Customer</span>
</a>
</li>
@php @php
$isPetiActive = in_array($active, ['menu-user', 'menu-role']); $isPetiActive = in_array($active, ['menu-user', 'menu-role']);
@endphp @endphp
@ -45,13 +111,16 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsepeti" <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsepeti"
aria-expanded="{{ $isPetiActive ? 'true' : 'false' }}" aria-controls="collapsepeti"> aria-expanded="{{ $isPetiActive ? 'true' : 'false' }}" aria-controls="collapsepeti">
<i class="fas fa-fw fa-user"></i> <i class="fas fa-fw fa-box"></i>
<span>Manajemen Peti</span> <span>Manajemen Peti</span>
</a> </a>
<div id="collapsepeti" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar"> <div id="collapsepeti" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded"> <div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-typepeti' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'menu-typepeti' ? 'active' : '' }}"
href="{{ route('dashboard.typepeti.index') }}">Tipe Peti</a> href="{{ route('dashboard.typepeti.index') }}">Tipe Peti</a>
<a class="collapse-item {{ $active == 'menu-kondisipeti' ? 'active' : '' }}"
href="{{ route('dashboard.kondisipeti.index') }}">Kondisi
Peti</a>
<a class="collapse-item {{ $active == 'menu-peti' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'menu-peti' ? 'active' : '' }}"
href="{{ route('dashboard.peti.index') }}">Peti</a> href="{{ route('dashboard.peti.index') }}">Peti</a>
</div> </div>
@ -59,7 +128,24 @@
</li> </li>
<li class="nav-item {{ $active == 'menu-warehouse' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-warehouse' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.warehouse.index') }}"> <a class="nav-link" href="{{ route('dashboard.warehouse.index') }}">
<i class="fas fa-fw fa-table"></i> <i class="fas fa-fw fa-warehouse"></i>
<span>Warehouse</span> <span>Warehouse</span>
</a> </a>
</li> </li>
{{-- <li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsereport"
aria-expanded="{{ $isUserActive ? 'true' : 'false' }}" aria-controls="collapseTwo">
<i class="fas fa-fw fa-file-alt"></i>
<span>Report</span>
</a>
<div id="collapsereport" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-Pettern_Lot_Peti' ? 'active' : '' }}"
href="{{ route('dashboard.Pettern_Lot_Peti.index') }}">PATTERN LOT
PETI</a>
<a class="collapse-item {{ $active == 'menu-Stok_Opname' ? 'active' : '' }}"
href="{{ route('dashboard.StokOpname.index') }}">Stok Opname</a>
</div>
</div>
</li> --}}

24
resources/views/pages/user/Master_Data/Customer/index.blade.php

@ -4,11 +4,6 @@
<div class="col-6"> <div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Customer</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Customer</h5>
</div> </div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.customer.create') }}" class="btn btn-success btn-icon-split">
<span class="text">+ Tambah data</span>
</a>
</div>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -21,7 +16,6 @@
<th>Kode Customer</th> <th>Kode Customer</th>
<th>No. Telepon</th> <th>No. Telepon</th>
<th>Alamat</th> <th>Alamat</th>
<th class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -35,24 +29,6 @@
<td>{{ $data_customer->code_customer }}</td> <td>{{ $data_customer->code_customer }}</td>
<td>{{ $data_customer->no_tlp }}</td> <td>{{ $data_customer->no_tlp }}</td>
<td>{{ $data_customer->address }}</td> <td>{{ $data_customer->address }}</td>
<td class="text-center">
<a href="{{ route('dashboard.customer.show', [$data_customer->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.customer.edit', [$data_customer->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.customer.destroy', $data_customer->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p> <p>Data Kosong</p>

36
resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php

@ -1,14 +1,9 @@
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-9">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5>
</div> </div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Peti</span>
</a>
</div>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -17,6 +12,7 @@
<thead> <thead>
<tr> <tr>
<th class="text-center" style="width: 10px">No</th> <th class="text-center" style="width: 10px">No</th>
<th>Fix Lot</th>
<th>User</th> <th>User</th>
<th>Customer</th> <th>Customer</th>
<th>WH</th> <th>WH</th>
@ -24,10 +20,9 @@
<th>Tipe Peti</th> <th>Tipe Peti</th>
<th>Ukuran Peti</th> <th>Ukuran Peti</th>
<th>Lot No</th> <th>Lot No</th>
<th>Status Peti</th> <th>Kondisi Peti</th>
<th>Packing No</th> <th>Packing No</th>
<th>Fix Lot</th> <th>Status</th>
<th class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -37,6 +32,7 @@
@forelse ($peti as $data_peti) @forelse ($peti as $data_peti)
<tr> <tr>
<td class="text-center">{{ $nopeti++ }}</td> <td class="text-center">{{ $nopeti++ }}</td>
<td>{{ $data_peti->fix_lot }}</td>
<td>{{ $data_peti->created_by }}</td> <td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td> <td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td> <td>{{ $data_peti->warehouse->name }}</td>
@ -44,27 +40,9 @@
<td>{{ $data_peti->tipe_peti->type }}</td> <td>{{ $data_peti->tipe_peti->type }}</td>
<td>{{ $data_peti->tipe_peti->size_peti }}</td> <td>{{ $data_peti->tipe_peti->size_peti }}</td>
<td>{{ $data_peti->customer->lot_no }}</td> <td>{{ $data_peti->customer->lot_no }}</td>
<td>{{ $data_peti->status_disposal }}</td> <td>{{ $data_peti->kondisipeti->nama_kondisi }}</td>
<td class="text-right">{{ $data_peti->packing_no }}</td> <td class="text-right">{{ $data_peti->packing_no }}</td>
<td>{{ $data_peti->fix_lot }}</td> <td>{{ $data_peti->status }}</td>
<td class="text-center">
<a href="{{ route('dashboard.peti.show', [$data_peti->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.peti.edit', [$data_peti->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peti.destroy', $data_peti->id) }}" method="POST"
style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p> <p>Data Kosong</p>

62
resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php

@ -1,62 +0,0 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Tipe Peti</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.typepeti.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Tipe Peti</span>
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 20px">No</th>
<th>Tipe Peti</th>
<th>Ukuran Peti</th>
<th>Deskripsi Peti</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$notype = 1;
@endphp
@forelse ($typepeti as $data_typepeti)
<tr>
<td class="text-center">{{ $notype++ }}</td>
<td>{{ $data_typepeti->type }}</td>
<td>{{ $data_typepeti->size_peti }}</td>
<td>{{ $data_typepeti->description }}</td>
<td class="text-center">
<a href="{{ route('dashboard.typepeti.show', [$data_typepeti->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.typepeti.edit', [$data_typepeti->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.typepeti.destroy', $data_typepeti->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

20
resources/views/pages/user/Master_Data/Role/index.blade.php → resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php

@ -2,7 +2,7 @@
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Role</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Kondisi Peti</h5>
</div> </div>
</div> </div>
</div> </div>
@ -11,22 +11,24 @@
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th class="text-center" style="width: 50px;">No</th> <th class="text-center" style="width: 20px">No</th>
<th>Nama Role</th> <th>Kondisi Peti</th>
<th>Deskripsi</th> <th>Deskripsi</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@php @php
$norole = 1; $nokondisi = 1;
@endphp @endphp
@foreach ($role as $data_role) @forelse ($kondisiPeti as $data_kondisiPeti)
<tr> <tr>
<td class="text-center">{{ $norole++ }}</td> <td class="text-center">{{ $nokondisi++ }}</td>
<td>{{ $data_role->name }}</td> <td>{{ $data_kondisiPeti->nama_kondisi }}</td>
<td>{{ $data_role->description }}</td> <td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td>
</tr> </tr>
@endforeach @empty
<p>Data Kosong</p>
@endforelse
</tbody> </tbody>
</table> </table>
</div> </div>

38
resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php

@ -0,0 +1,38 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Tipe Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 20px">No</th>
<th>Tipe Peti</th>
<th>Ukuran Peti</th>
<th>Deskripsi Peti</th>
</tr>
</thead>
<tbody>
@php
$notype = 1;
@endphp
@forelse ($typepeti as $data_typepeti)
<tr>
<td class="text-center">{{ $notype++ }}</td>
<td>{{ $data_typepeti->type }}</td>
<td>{{ $data_typepeti->size_peti }}</td>
<td>{{ $data_typepeti->description }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

59
resources/views/pages/user/Master_Data/User/index.blade.php

@ -1,59 +0,0 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
<tbody>
@php
$noUser = 1;
@endphp
@forelse ($user as $data)
<tr>
<td class="text-center">{{ $noUser++ }}</td>
<td>{{ $data->fullname }}</td>
<td>{{ $data->email }}</td>
<td>{{ isset($data->no_hp) ? $data->no_hp : '-' }}</td>
<td>{{ isset($data->address) ? $data->address : '-' }}</td>
<td>{{ $data->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.user.show', [$data->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

4
resources/views/pages/user/Master_Data/Warehouse/index.blade.php

@ -4,6 +4,8 @@
<div class="col-6"> <div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Gudang</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Gudang</h5>
</div> </div>
<div class="col-6 text-right">
</div>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -15,6 +17,7 @@
<th>Nama Gudang</th> <th>Nama Gudang</th>
<th>Deskripsi</th> <th>Deskripsi</th>
<th>Alamat</th> <th>Alamat</th>
{{-- <th class="text-center">Action</th> --}}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -32,6 +35,5 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>

65
resources/views/pages/user/Peminjaman/index.blade.php

@ -1,65 +0,0 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peminjaman</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.peminjaman.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Peminjaman</span>
</a>
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th>
<th>Asal Gudang</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data_peminjaman)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

88
resources/views/pages/user/Pengembalian/index.blade.php

@ -1,88 +0,0 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Data Pengembalian</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Kode Peti</th>
<th>Tgl Peinjaman</th>
<th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th>
<th>Asal WH Peminjaman</th>
<th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th>
<th>Tujuan WH Pengembalian</th>
<th>Kondisi Peti</th>
<th>Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
{{-- @foreach ($peminjaman as $data)
@endforeach --}}
@forelse ($peminjaman as $data)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->customer->code_customer }} -
{{ $data->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td>
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td>
<td>{{ $data->exit_pic }}</td>
<td>{{ $data->warehouse->name }}</td>
<td>
@if ($data->enter_at)
{{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_pic)
{{ $data->enter_pic }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse === null)
Not Return
@else
Return
@endif
</td>
<td class="text-center">
<a href="{{ route('dashboard.pengembalian.edit', [$data->id]) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

42
resources/views/pages/user/dashboard/disposal/index.blade.php

@ -0,0 +1,42 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Disposal</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>Tanggal Disposal</th>
<th>Alasan Disposal</th>
<th>Status Peti</th>
</tr>
</thead>
<tbody>
@php
$nodisposal = 1;
@endphp
@forelse ($disposal as $data_disposal)
<tr>
<td>{{ $nodisposal++ }}</td>
<td>{{ $data_disposal->peti->fix_lot }}</td>
<td>{{ $data_disposal->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td>
<td>{{ $data_disposal->description }}</td>
<td>{{ $data_disposal->status_disposal }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

288
resources/views/pages/user/dashboard/index.blade.php

@ -0,0 +1,288 @@
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
{{-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> --}}
</div>
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeti }}
</div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1" style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Pending Requests Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1" style="font-size: 13px;">
<strong>Reminder Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $reminder }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Area Bar Chart -->
<div class="col-xl-7 col-lg-7">
<div class="card shadow mb-4" style="max-height: 600px;">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian</h6>
</div>
@php
$chartData = app('App\Http\Controllers\HomeController')->generateChartData();
@endphp
<div class="card-body" style="height: 80%;"> <!-- Sesuaikan persentase tinggi konten yang diinginkan -->
<label for="yearFilter">Pilih Tahun:</label>
<select id="yearFilter" class="form-control">
@foreach ($chartData['years'] as $year)
@if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="ChartAssetStatus" style="width: 100px; height: 68px;"></canvas>
</div>
</div>
</div>
<!-- Area Pie Chart -->
<div class="col-xl-5 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Peti</h6>
</div>
@php
$chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie();
@endphp
<div class="card-body">
<label for="yearFilterPie">Pilih Tahun:</label>
<select id="yearFilterPie" class="form-control">
@foreach ($chartDataPie['years'] as $year)
@if (count($chartDataPie['enterData']) > 0 && $chartDataPie['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="myPieChartsiopas"></canvas>
</div>
</div>
</div>
</div>
@push('script')
<!-- script pie chart -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Function to update the pie chart based on selected year
function updatePieChart(selectedYear) {
// Call the controller function to get data for the selected year
var chartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
var yearIndex = chartDataPie.years.indexOf(selectedYear);
// Update the pie chart data
myPieChart.data.datasets[0].data = chartDataPie.enterData[yearIndex];
myPieChart.update();
// Save selected year to local storage
localStorage.setItem('selectedYearPie', selectedYear);
}
// Initial chart data
var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
// Get the canvas element for the pie chart
var ctxPie = document.getElementById("myPieChartsiopas").getContext('2d');
// Create the initial pie chart instance
var myPieChart = new Chart(ctxPie, {
type: 'pie',
data: {
labels: initialChartDataPie.monthNames,
datasets: [{
data: initialChartDataPie.enterData[0],
backgroundColor: ["#4e73df", "#1cc88a", "#36b9cc", "#ff6384", "#ff9f40", "#9966ff",
"#cc65fe",
"#ffcc29", "#a4e56d", "#ff3d00", "#9c9c9c", "#0d47a1"
],
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right',
maxHeight: 200,
},
tooltip: {
callbacks: {
label: function(context) {
var label = context.label || '';
if (label) {
label += ' : ';
}
label += Math.round(context.parsed * 1) + ' Peti';
return label;
}
}
}
}
},
});
// Event listener for year filter change
document.getElementById('yearFilterPie').addEventListener('change', function() {
var selectedYear = this.value;
updatePieChart(selectedYear);
});
// On page load, try to retrieve the selected year from local storage
document.addEventListener('DOMContentLoaded', function() {
var selectedYear = localStorage.getItem('selectedYearPie');
if (selectedYear) {
// If a year is found, set the dropdown value and update the chart
document.getElementById('yearFilterPie').value = selectedYear;
updatePieChart(selectedYear);
}
});
</script>
<!-- script bar chart -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var ctx = document.getElementById('ChartAssetStatus').getContext('2d');
var myChart;
var chartData = @json($chartData);
function updateChart(selectedYear) {
var selectedYearIndex = chartData.years.indexOf(selectedYear);
// Mengambil data berdasarkan tahun yang dipilih
var updatedExitData = chartData.exitData[selectedYearIndex];
var updatedEnterData = chartData.enterData[selectedYearIndex];
// Memperbarui chart hanya dengan data tahun yang dipilih
myChart.data.labels = chartData.monthNames;
myChart.data.datasets[0].data = updatedExitData;
myChart.data.datasets[1].data = updatedEnterData;
myChart.update();
}
myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: chartData.monthNames, // Menggunakan nama bulan sebagai label
datasets: [{
label: 'Peminjaman',
data: chartData.exitData[
0], // Menggunakan data tahun saat ini sebagai awalan
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 1
}, {
label: 'Pengembalian',
data: chartData.enterData[
0], // Menggunakan data tahun saat ini sebagai awalan
backgroundColor: 'rgba(255, 159, 64, 0.2)',
borderColor: 'rgba(255, 159, 64, 1)',
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
var yearFilter = document.getElementById('yearFilter');
yearFilter.addEventListener('change', function() {
var selectedYear = yearFilter.value;
updateChart(selectedYear);
// Simpan tahun yang dipilih ke local storage
localStorage.setItem('selectedYear', selectedYear);
});
// Kondisi Pertama: Setelah halaman dimuat
// Coba baca tahun yang disimpan di local storage
var selectedYear = localStorage.getItem('selectedYear');
if (selectedYear) {
yearFilter.value = selectedYear;
updateChart(selectedYear);
} else {
// Jika tidak ada tahun yang disimpan, pilih tahun saat ini
selectedYear = new Date().getFullYear();
yearFilter.value = selectedYear;
updateChart(selectedYear);
}
});
</script>
@endpush

194
resources/views/pages/user/index.blade.php

@ -1,194 +0,0 @@
@extends('layouts.main')
@section('content')
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
</div>
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahAsset }}
</div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1" style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Pending Requests Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1" style="font-size: 13px;">
<strong>Reminder Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $reminder }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-8 col-lg-7">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
@php
$chartData = app('App\Http\Controllers\HomeController')->generateChartData();
@endphp
<div class="card-body">
<canvas id="ChartAssetStatus" style="max-height: 500px;"></canvas> <!-- Atur tinggi chart -->
</div>
</div>
</div>
<!-- Pie Chart -->
<div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Barang</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChart"></canvas>
</div>
<div class="mt-4 text-center small">
<span class="mr-2">
<i class="fas fa-circle text-primary"></i> Direct
</span>
<span class="mr-2">
<i class="fas fa-circle text-success"></i> Social
</span>
<span class="mr-2">
<i class="fas fa-circle text-info"></i> Referral
</span>
</div>
</div>
</div>
</div>
</div>
@push('script')
<script>
document.addEventListener('DOMContentLoaded', function() {
var ctx = document.getElementById('ChartAssetStatus').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: {!! json_encode($chartData['monthNames']) !!},
datasets: [{
label: 'Peminjaman',
data: {!! json_encode($chartData['exitData']) !!},
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 1
}, {
label: 'Pengembalian',
data: {!! json_encode($chartData['enterData']) !!},
backgroundColor: 'rgba(255, 159, 64, 0.2)',
borderColor: 'rgba(255, 159, 64, 1)',
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
});
</script>
@endpush
@endsection

3
routes/web.php

@ -205,9 +205,8 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
//halaman Report Stok //halaman Report Stok
Route::controller(StokOpNameController::class)->group(function () { Route::controller(StokOpNameController::class)->group(function () {
Route::get('StokOpname', 'index')->name('StokOpname.index');
// Route::get('StokOpname/{id}', 'show')->name('StokOpname.show');
Route::get('StokOpname/export', 'export')->name('StokOpname.export'); Route::get('StokOpname/export', 'export')->name('StokOpname.export');
Route::get('StokOpname', 'index')->name('StokOpname.index');
}); });
}); });

Loading…
Cancel
Save