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

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

@ -11,12 +11,13 @@ class RedirectAuthController extends Controller
public function redirectAuth()
{
if (Auth::check()) {
if (Auth::user()->role_id == 1) {
// Admin
return redirect()->route('dashboard.home.admin');
} else {
return redirect()->route('dashboard.home.user');
}
return redirect()->route('dashboard.home.admin');
// if (Auth::user()->role_id == 1) {
// // Admin
// return redirect()->route('dashboard.home.admin');
// } else {
// return redirect()->route('dashboard.home.user');
// }
} else {
// Tidak ada akun atau kesalahan login
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()
{
$data = [
'disposal' => Disposal::where('status_disposal', 'INAKTIF')->orderBy('created_at', 'desc')->get(),
// 'disposal' => Disposal::orderBy('created_at', 'desc')->get(),
'disposal' => Disposal::where('status_disposal', 'INAKTIF')
->orderBy('created_at', 'desc')
->get(),
'active' => 'menu-disposal',
];
return view('dashboard.Disposal.index', $data);
}
/**
* Show the form for creating a new resource.
*/

6
app/Http/Controllers/HistoryController.php

@ -14,7 +14,7 @@ class HistoryController extends Controller
$data = [
// '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(),
'active' => 'history-peminjaman',
];
@ -25,7 +25,7 @@ class HistoryController extends Controller
public function historyPengembalian()
{
$data = [
'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(),
'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-pengembalian',
];
return view('dashboard.History.Pengembalian.index', $data);
@ -34,7 +34,7 @@ class HistoryController extends Controller
public function historyTransfer()
{
$data = [
'transfer' => Transfer::orderBy('created_at', 'desc')->get(),
'transfer' => Transfer::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-transfer',
];
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
{
//halaman Admin
public function index()
{
$data = [
@ -20,29 +20,34 @@ class HomeController extends Controller
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()
{
$notification = \App\Models\asset_status::whereNull('enter_at')
->whereDate('est_pengembalian', \Carbon\Carbon::today())
->get();
$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(),
'notifikasi' => $notification,
'active' => 'menu-admin',
];
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
public function generateChartData()

6
app/Http/Controllers/PeminjamanController.php

@ -39,18 +39,12 @@ class PeminjamanController extends Controller
$subquery->where('status', '!=', 0);
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
// $petiTransfer = Peti::where('id', $PetiId)
// ->leftJoin('category', 'product.category', '=', 'category.id')
// ->select('product.id','category.name')->first();
$data = [
// 'peti' => Peti::all(),
'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(),
'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(),
'existingPeti' => asset_status::pluck('peti_id')->toArray(),
'active' => 'menu-peminjaman',

3
app/Http/Controllers/PetternLotPetiController.php

@ -13,8 +13,7 @@ class PetternLotPetiController extends Controller
public function index()
{
$data = [
// 'warehouses' => m_warehouse::orderBy('created_at', 'desc')->get(),
'peti' => Peti::get(),
'peti' => Peti::withTrashed()->get(),
'active' => 'menu-Pettern_Lot_Peti'
];
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()
{
// 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'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get();
// 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'))
->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id')
->get();
// 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'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id')
->get();
// 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'))
->groupBy('customer_id', 'tipe_peti_id')
->get();
@ -52,25 +52,31 @@ class StokOpNameController extends Controller
public function export()
{
//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'))
->groupBy('customer_id', 'tipe_peti_id')
->get();
// 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'))
->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id')
->get();
// 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'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id')
->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()
{
$data = [
'peminjaman' => asset_status::all(),
'peminjaman' => asset_status::withTrashed()->all(),
'active' => 'menu-transaksi',
];
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
{
return [
'peti_id' => 'required',
'customer_id' => 'nullable',
'warehouse_id' => 'nullable',
'peti_id' => 'required|integer',
'customer_id' => 'required|integer',
'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date',
'description' => 'nullable|string',
'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiCreateDisposal extends FormRequest
public function messages(): array
{
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.',
'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
{
return [
'peti_id' => 'required',
'customer_id' => 'nullable',
'warehouse_id' => 'nullable',
'peti_id' => 'required|integer',
'customer_id' => 'required|integer',
'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date',
'description' => 'nullable|string',
'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiUpdateDisposal extends FormRequest
public function messages(): array
{
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.',
'description.string' => 'Deskripsi harus berupa teks.',
];

5
app/Models/Disposal.php

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

26
app/Models/Peti.php

@ -31,29 +31,43 @@ class Peti extends Model
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()
{
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()
{
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()
{
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()
{
return $this->hasOne(Transfer::class, 'peti_id');
return $this->hasOne(Transfer::class, 'peti_id')->withTrashed();
}
// proses pengambilan data
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',
'fix_lot',
'updated_by',
);
)->withTrashed();
}
public function customer()
{
return $this->belongsTo(Customer::class, 'name_customer')->select(
'name',
'code_customer',
);
)->withTrashed();
}
public function sourceWarehouse()
{
return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select(
'name',
'address',
);
)->withTrashed();
}
public function destinationWarehouse()
{
return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select(
'name',
'address',
);
)->withTrashed();
}
}

5
app/Models/User.php

@ -8,11 +8,12 @@ use Laravel\Sanctum\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements JWTSubject
{
use HasApiTokens, HasFactory, Notifiable;
use HasApiTokens, HasFactory, Notifiable, SoftDeletes;
/**
* The attributes that are mass assignable.
@ -40,7 +41,7 @@ class User extends Authenticatable implements JWTSubject
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\Type_peti;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class asset_status extends Model
{
use HasFactory;
use HasFactory, SoftDeletes;
protected $table = 'asset_statuses';
protected $fillable = [
@ -34,41 +35,52 @@ class asset_status extends Model
public function asset()
{
return $this->belongsTo(m_asset::class, 'asset_id');
return $this->belongsTo(m_asset::class, 'asset_id')->withTrashed();
}
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()
{
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()
{
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()
{
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()
{
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()
{
return $this->belongsTo(Customer::class, 'customer_id');
return $this->belongsTo(Customer::class, 'customer_id')->withTrashed();
}
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('jenis_kelamin', 20)->nullable();
$table->string('agama', 15)->nullable();
$table->foreignId('role_id')->nullable()->constrained('m_roles')->onDelete('set null');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null');
$table->foreignId('role_id')->nullable()->constrained('m_roles');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->text('address')->nullable();
$table->timestamp('email_verified_at')->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) {
$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('fix_lot', 100);
$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->date('date_pembuatan', 100)->nullable();
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null');
$table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis')->onDelete('set null');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis');
$table->string('status', 50)->default('AKTIF');
$table->timestamps();
$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('name_customer')->nullable()->constrained('customers');
$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->timestamps();
$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->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->constrained('petis');
$table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null');
$table->foreignId('customer_id')->constrained('customers');
$table->foreignId('warehouse_id')->constrained('m_warehouses');
$table->date('date_disposal');
$table->text('description')->nullable();
$table->string('status_disposal', 50);

100
database/seeders/PetiSeeder.php

@ -15,24 +15,106 @@ class PetiSeeder extends Seeder
public function run()
{
// Generate 5 dummy data
for ($i = 0; $i < 5; $i++) {
DB::table('petis')->insert([
// for ($i = 0; $i < 5; $i++) {
// 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'),
'warna' => 'Dummy Warna ' . ($i + 1),
'fix_lot' => 'Dummy Fix Lot ' . ($i + 1),
'packing_no' => rand(1, 100),
'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot 1',
'packing_no' => 1,
'customer_id' => $this->getRandomId('customers'),
'jumlah' => rand(1, 10),
'jumlah' => 1,
'date_pembuatan' => now(),
'warehouse_id' => $this->getRandomId('m_warehouses'),
'warehouse_id' => 1,
'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 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>
@include('layouts.components.alert-prompt')
<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 class="col-6 text-right">
<a href="{{ route('dashboard.disposal.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Disposal Peti</span>
</a>
</a>
@if (auth()->user()->role_id == 1)
<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 class="col-6 text-right">
<a href="{{ route('dashboard.disposal.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Disposal Peti</span>
</a>
</a>
</div>
</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>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nodisposal = 1;
@endphp
@forelse ($disposal as $data_disposal)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<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>
<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>
<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>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</thead>
<tbody>
@php
$nodisposal = 1;
@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>
@elseif (auth()->user()->role_id == 2)
@include('pages.user.dashboard.disposal.index')
@endif
@endsection

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

@ -9,53 +9,48 @@
white-space: nowrap;
}
</style>
@if (auth()->user()->role_id == 1)
<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">Histori Peminjaman</h5>
</div>
<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">Histori Peminjaman</h5>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
</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>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>
<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>
<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>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@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>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
@else
@include('pages.user.Peminjaman.index')
@endif
</div>
@endsection

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

@ -9,100 +9,95 @@
white-space: nowrap;
}
</style>
@if (auth()->user()->role_id == 1)
<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 Pengembalian</h5>
</div>
<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 Pengembalian</h5>
</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>Kode Peti</th>
<th>Customer</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>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
<td>{{ $data->peti->customer->name }}</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>
@if ($data->exit_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</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->warehouseEnter->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti->nama_kondisi }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse === null)
Not Return
@else
Return
@endif
</td>
</tr>
@endif
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>Kode Peti</th>
<th>Customer</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>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
<td>{{ $data->peti->customer->name }}</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>
@if ($data->exit_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</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->warehouseEnter->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti->nama_kondisi }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse === null)
Not Return
@else
Return
@endif
</td>
</tr>
@endif
@empty
@endforelse
</tbody>
</table>
</div>
</div>
@else
@include('pages.user.Pengembalian.index')
@endif
</div>
@endsection

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

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

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

@ -1,64 +1,68 @@
@extends('layouts.main')
@section('content')
@include('layouts.components.alert-prompt')
<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 Kondisi Peti</h5>
</div>
<div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal">
<span class="text">Tambah Kondisi Peti</span>
</a>
@if (auth()->user()->role_id == 1)
<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 Kondisi Peti</h5>
</div>
<div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
data-target="#tambahDataModal">
<span class="text">Tambah Kondisi Peti</span>
</a>
</div>
</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>Kondisi Peti</th>
<th>Deskripsi</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nokondisi = 1;
@endphp
@forelse ($kondisiPeti as $data_kondisiPeti)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<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>
<th class="text-center" style="width: 20px">No</th>
<th>Kondisi Peti</th>
<th>Deskripsi</th>
<th class="text-center">Action</th>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</thead>
<tbody>
@php
$nokondisi = 1;
@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>
@elseif (auth()->user()->role_id == 2)
@include('pages.user.master_data.manajemen_peti.kondisi_peti.index')
@endif
<!-- Tambah Data Modal-->
<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>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
@ -100,7 +99,7 @@
</div>
</div>
</div>
@else
@elseif (auth()->user()->role_id == 2)
@include('pages.user.Master_Data.Manajemen_Peti.Peti.index')
@endif

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

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

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

@ -86,7 +86,6 @@
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</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>
</div>
<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"
target="_blank">
<span class="text">Cetak Exel</span>
@ -42,6 +39,7 @@
<th>LOT NO</th>
<th>PACKING NO</th>
<th>FIX LOT</th>
<th>STATUS</th>
</tr>
</thead>
<tbody>
@ -63,9 +61,9 @@
<a
href="{{ route('dashboard.Pettern_Lot_Peti.show', $data_peti->id) }}">{{ $data_peti->fix_lot }}</a>
</td>
<td>{{ $data_peti->status }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>

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

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

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

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

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

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

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

@ -11,82 +11,76 @@
</style>
@include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1)
<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>
</div>
<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>
<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>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 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>
@else
@include('pages.user.Peminjaman.index')
@endif
<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>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

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

@ -10,107 +10,101 @@
white-space: nowrap;
}
</style>
@if (auth()->user()->role_id == 1)
<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 Pengembalian</h5>
</div>
<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 Pengembalian</h5>
</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>Kode Peti</th>
<th>Customer</th>
<th>Tgl Peinjaman</th>
<th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th>
<th>WH Peminjam</th>
<th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th>
<th>WH Pengembalian</th>
<th>Kondisi Peti</th>
<th>Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
<td>{{ $data->peti->customer->name }}</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>
@if ($data->exit_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</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->warehouseEnter->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti->nama_kondisi }}
@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>
@endif
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>Kode Peti</th>
<th>Customer</th>
<th>Tgl Peinjaman</th>
<th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th>
<th>WH Peminjam</th>
<th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th>
<th>WH Pengembalian</th>
<th>Kondisi Peti</th>
<th>Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
<td>{{ $data->peti->customer->name }}</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>
@if ($data->exit_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</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->warehouseEnter->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti->nama_kondisi }}
@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>
@endif
@empty
@endforelse
</tbody>
</table>
</div>
</div>
@else
@include('pages.user.Pengembalian.index')
@endif
</div>
@endsection

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

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

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

@ -44,7 +44,8 @@
@foreach ($transfer as $data_transfer)
<tr>
<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>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td>
<td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td>

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

@ -1,376 +1,318 @@
@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>
<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>
@if (auth()->user()->role_id == 1)
<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="#" id="generateReportBtn" 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="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeti }}
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</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>
<!-- 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 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>
<!-- 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 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>
<!-- 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 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>
<!-- 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>
<canvas id="ChartAssetStatus" style="width: 100px; height: 68px;"></canvas>
</div>
</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
<!-- 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>
<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>
<canvas id="myPieChartsiopas"></canvas>
</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')
<!-- 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);
@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();
// 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);
}
// Save selected year to local storage
localStorage.setItem('selectedYearPie', selectedYear);
}
// Initial chart data
var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
// 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');
// 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 += ' : ';
// 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;
}
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
document.getElementById('yearFilterPie').addEventListener('change', function() {
var selectedYear = this.value;
updatePieChart(selectedYear);
});
<!-- script bar chart -->
<script>
document.addEventListener('DOMContentLoaded', function() {
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
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 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);
function updateChart(selectedYear) {
var selectedYearIndex = chartData.years.indexOf(selectedYear);
// Update the pie chart data
myPieChart.data.datasets[0].data = chartDataPie.enterData[yearIndex];
myPieChart.update();
}
// Mengambil data berdasarkan tahun yang dipilih
var updatedExitData = chartData.exitData[selectedYearIndex];
var updatedEnterData = chartData.enterData[selectedYearIndex];
// Initial chart data
var initialChartDataPie = {!! json_encode(app('App\Http\Controllers\HomeController')->generateChartDataPie()) !!};
// 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;
// Get the canvas element for the pie chart
var ctxPie = document.getElementById("myPieChartsiopas").getContext('2d');
myChart.update();
}
// 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,
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
}]
},
tooltip: {
callbacks: {
label: function(context) {
var label = context.label || '';
if (label) {
label += ' : ';
}
label += Math.round(context.parsed * 1) + ' Peti';
return label;
options: {
scales: {
y: {
beginAtZero: true
}
}
}
}
},
});
// Event listener for year filter change
document.getElementById('yearFilterPie').addEventListener('change', function() {
var selectedYear = this.value;
updatePieChart(selectedYear);
});
</script> --}}
});
<!-- script bar chart -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var ctx = document.getElementById('ChartAssetStatus').getContext('2d');
var myChart;
var chartData = @json($chartData);
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);
});
function updateChart(selectedYear) {
var selectedYearIndex = chartData.years.indexOf(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>
// Mengambil data berdasarkan tahun yang dipilih
var updatedExitData = chartData.exitData[selectedYearIndex];
var updatedEnterData = chartData.enterData[selectedYearIndex];
<!-- script generate report -->
<script>
function downloadReport(routeName) {
var exportUrl = '{{ url('dashboard') }}/' + routeName;
// 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;
var link = document.createElement('a');
link.href = exportUrl;
link.download = 'nama_file_report.xlsx'; // Ganti dengan nama file yang diinginkan
link.target = '_blank';
myChart.update();
link.click();
}
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);
document.getElementById('generateReportBtn').addEventListener('click', function() {
downloadReport('Pettern_Lot_Peti/export');
downloadReport('StokOpname/export');
});
// 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
</script>
@endpush
@elseif(auth()->user()->role_id == 2)
@include('pages.user.dashboard.index')
@endif
@endsection

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

@ -46,15 +46,15 @@
</div>
<div>
<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
{{ $data_notification->peti->fix_lot }} berhasil di pinjam</span>
{{ $data_notification->peti->fix_lot }} Sudah waktunya pengembalian</span>
</div>
</a>
@endforeach
<a class="dropdown-item text-center small text-gray-500"
href="{{ route('dashboard.navbarList.notification') }}">Show All
Alerts</a>
href="{{ route('dashboard.navbarList.notification') }}">Show All Notifikasi</a>
</div>
</li>

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

@ -1,4 +1,21 @@
@extends('layouts.main')
@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

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

@ -1,34 +1,74 @@
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard.home.user') }}">
<div class="sidebar-brand-icon rotate-n-15">
<i class="fas fa-laugh-wink"></i>
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard.home.admin') }}">
<div class="sidebar-brand-icon">
{{-- <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 class="sidebar-brand-text mx-3">SIOPAS</div>
<div class="sidebar-brand-text mx-2 mr-3">SIOPAS</div>
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ $active == 'menu-user' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.user') }}">
<li class="nav-item {{ $active == 'menu-admin' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.admin') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}">
<i class="fas fa-fw fa-upload"></i>
<span>Peminjaman</span>
@php
$isTransaksiActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
<!-- 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>
<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 class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.pengembalian.index') }}">
<i class="fas fa-fw fa-download"></i>
<span>Pengembalian</span>
<li class="nav-item {{ $active == 'menu-disposal' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.disposal.index') }}">
<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>
<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>
<!-- Divider -->
@ -38,6 +78,32 @@
<div class="sidebar-heading">
Master Data
</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
$isPetiActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
@ -45,13 +111,16 @@
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#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>
</a>
<div id="collapsepeti" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-typepeti' ? 'active' : '' }}"
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' : '' }}"
href="{{ route('dashboard.peti.index') }}">Peti</a>
</div>
@ -59,7 +128,24 @@
</li>
<li class="nav-item {{ $active == 'menu-warehouse' ? 'active' : '' }}">
<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>
</a>
</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">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Customer</h5>
</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 class="card-body">
@ -21,7 +16,6 @@
<th>Kode Customer</th>
<th>No. Telepon</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -35,24 +29,6 @@
<td>{{ $data_customer->code_customer }}</td>
<td>{{ $data_customer->no_tlp }}</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>
@empty
<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-header py-3">
<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>
</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 class="card-body">
@ -17,6 +12,7 @@
<thead>
<tr>
<th class="text-center" style="width: 10px">No</th>
<th>Fix Lot</th>
<th>User</th>
<th>Customer</th>
<th>WH</th>
@ -24,10 +20,9 @@
<th>Tipe Peti</th>
<th>Ukuran Peti</th>
<th>Lot No</th>
<th>Status Peti</th>
<th>Kondisi Peti</th>
<th>Packing No</th>
<th>Fix Lot</th>
<th class="text-center">Action</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@ -37,6 +32,7 @@
@forelse ($peti as $data_peti)
<tr>
<td class="text-center">{{ $nopeti++ }}</td>
<td>{{ $data_peti->fix_lot }}</td>
<td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td>
@ -44,27 +40,9 @@
<td>{{ $data_peti->tipe_peti->type }}</td>
<td>{{ $data_peti->tipe_peti->size_peti }}</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>{{ $data_peti->fix_lot }}</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>
<td>{{ $data_peti->status }}</td>
</tr>
@empty
<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="row">
<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>
@ -11,22 +11,24 @@
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 50px;">No</th>
<th>Nama Role</th>
<th class="text-center" style="width: 20px">No</th>
<th>Kondisi Peti</th>
<th>Deskripsi</th>
</tr>
</thead>
<tbody>
@php
$norole = 1;
$nokondisi = 1;
@endphp
@foreach ($role as $data_role)
@forelse ($kondisiPeti as $data_kondisiPeti)
<tr>
<td class="text-center">{{ $norole++ }}</td>
<td>{{ $data_role->name }}</td>
<td>{{ $data_role->description }}</td>
<td class="text-center">{{ $nokondisi++ }}</td>
<td>{{ $data_kondisiPeti->nama_kondisi }}</td>
<td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td>
</tr>
@endforeach
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Gudang</h5>
</div>
<div class="col-6 text-right">
</div>
</div>
</div>
<div class="card-body">
@ -15,6 +17,7 @@
<th>Nama Gudang</th>
<th>Deskripsi</th>
<th>Alamat</th>
{{-- <th class="text-center">Action</th> --}}
</tr>
</thead>
<tbody>
@ -32,6 +35,5 @@
</tbody>
</table>
</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
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', 'index')->name('StokOpname.index');
});
});

Loading…
Cancel
Save