unknown 1 year ago
parent
commit
6f2dee6c76
  1. 25
      app/Http/Controllers/Auth/AuthenticatedSessionController.php
  2. 28
      app/Http/Controllers/Auth/RedirectAuthController.php
  3. 36
      app/Http/Controllers/CustomerController.php
  4. 14
      app/Http/Controllers/HomeController.php
  5. 12
      app/Http/Controllers/M_userController.php
  6. 150
      app/Http/Controllers/PetiController.php
  7. 24
      app/Http/Controllers/RoleController.php
  8. 20
      app/Http/Controllers/TypePetiController.php
  9. 19
      app/Http/Controllers/WarehouseController.php
  10. 52
      app/Http/Requests/ValidasiCreateCustomer.php
  11. 60
      app/Http/Requests/ValidasiCreatePeti.php
  12. 40
      app/Http/Requests/ValidasiCreateRole.php
  13. 44
      app/Http/Requests/ValidasiCreateType_Peti.php
  14. 78
      app/Http/Requests/ValidasiCreateUser.php
  15. 45
      app/Http/Requests/ValidasiCreateWarehouse.php
  16. 52
      app/Http/Requests/ValidasiUpdateCustomer.php
  17. 59
      app/Http/Requests/ValidasiUpdatePeti.php
  18. 40
      app/Http/Requests/ValidasiUpdateRole.php
  19. 44
      app/Http/Requests/ValidasiUpdateType_Peti.php
  20. 78
      app/Http/Requests/ValidasiUpdateUser.php
  21. 45
      app/Http/Requests/ValidasiUpdateWarehouse.php
  22. 6
      app/Models/Customer.php
  23. 2
      database/migrations/2023_10_23_073314_create_m_warehouses_table.php
  24. 6
      database/migrations/2023_10_23_075239_create_m_roles_table.php
  25. 22
      database/migrations/2023_10_23_075245_create_users_table.php
  26. 14
      database/migrations/2023_10_28_080457_create_customers_table.php
  27. 8
      database/migrations/2023_10_28_083930_create_type_petis_table.php
  28. 28
      database/seeders/Customer.php
  29. 6
      database/seeders/RoleSeeder.php
  30. 8
      database/seeders/Type_Peti.php
  31. 26
      database/seeders/UserSeeder.php
  32. 26
      resources/views/auth/login.blade.php
  33. 84
      resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php
  34. 231
      resources/views/dashboard/Master_Data/Asset/index.blade.php
  35. 65
      resources/views/dashboard/Master_Data/Asset/show.blade.php
  36. 35
      resources/views/dashboard/Master_Data/Customer/create.blade.php
  37. 37
      resources/views/dashboard/Master_Data/Customer/edit.blade.php
  38. 121
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  39. 29
      resources/views/dashboard/Master_Data/Customer/show.blade.php
  40. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php
  41. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php
  42. 148
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  43. 1
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php
  44. 13
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php
  45. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php
  46. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php
  47. 117
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  48. 7
      resources/views/dashboard/Master_Data/Role/index.blade.php
  49. 2
      resources/views/dashboard/Master_Data/User/create.blade.php
  50. 2
      resources/views/dashboard/Master_Data/User/edit.blade.php
  51. 147
      resources/views/dashboard/Master_Data/User/index.blade.php
  52. 18
      resources/views/dashboard/Master_Data/Warehouse/index.blade.php
  53. 126
      resources/views/dashboard/Peminjaman/index.blade.php
  54. 9
      resources/views/dashboard/Pengembalian/index.blade.php
  55. 1
      resources/views/dashboard/index.blade.php
  56. 1
      resources/views/dashboard/peminjaman.blade.php
  57. 26
      resources/views/layouts/components/alert-prompt.blade.php
  58. 4
      resources/views/layouts/main.blade.php
  59. 175
      resources/views/layouts/sidebar.blade.php
  60. 91
      resources/views/pages/layouts/sidebar_user.blade.php
  61. 64
      resources/views/pages/user/Master_Data/Customer/index.blade.php
  62. 76
      resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php
  63. 62
      resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  64. 34
      resources/views/pages/user/Master_Data/Role/index.blade.php
  65. 59
      resources/views/pages/user/Master_Data/User/index.blade.php
  66. 37
      resources/views/pages/user/Master_Data/Warehouse/index.blade.php
  67. 65
      resources/views/pages/user/Peminjaman/index.blade.php
  68. 88
      resources/views/pages/user/Pengembalian/index.blade.php
  69. 194
      resources/views/pages/user/index.blade.php
  70. 12
      routes/web.php

25
app/Http/Controllers/Auth/AuthenticatedSessionController.php

@ -23,14 +23,29 @@ class AuthenticatedSessionController extends Controller
/** /**
* Handle an incoming authentication request. * Handle an incoming authentication request.
*/ */
public function store(LoginRequest $request): RedirectResponse public function store(Request $request)
{ {
$request->authenticate(); $request->validate([
'email' => 'required|email',
'password' => 'required',
]);
if (!Auth::attempt($request->only('email', 'password'), $request->input('remember'))) {
return back()
->withInput($request->only('email'))
->withErrors(['email' => 'Kombinasi email dan password tidak valid.']);
}
return redirect(RouteServiceProvider::HOME);
}
// public function store(LoginRequest $request): RedirectResponse
// {
// $request->authenticate();
$request->session()->regenerate(); // $request->session()->regenerate();
return redirect()->intended(RouteServiceProvider::HOME); // return redirect()->intended(RouteServiceProvider::HOME);
} // }
/** /**
* Destroy an authenticated session. * Destroy an authenticated session.

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

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

36
app/Http/Controllers/CustomerController.php

@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreateCustomer;
use App\Http\Requests\ValidasiUpdateCustomer;
use App\Models\Customer; use App\Models\Customer;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -34,26 +36,13 @@ class CustomerController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreateCustomer $request)
{ {
// dd('oke');
$request->validate([
'name' => 'required',
'code_customer' => 'required',
'lot_no' => 'required',
'nip' => '',
'no_hp' => 'required',
'tgl_lahir' => '',
'jenis_kelamin' => '',
'agama' => '',
'address' => 'required',
]);
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by $validatedData['created_by'] = $currentUser->id; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by $validatedData['updated_by'] = $currentUser->id; // Menggunakan nama pengguna sebagai updated_by
Customer::create($validatedData); Customer::create($validatedData);
return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil ditambahkan'); return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil ditambahkan');
} catch (\Throwable $th) { } catch (\Throwable $th) {
@ -88,21 +77,8 @@ class CustomerController extends Controller
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id) public function update(ValidasiUpdateCustomer $request, $id)
{ {
// dd($request->all());
$request->validate([
'name' => 'required',
'code_customer' => 'required',
'lot_no' => 'required',
'nip' => 'required',
'no_hp' => 'required',
'tgl_lahir' => 'required',
'jenis_kelamin' => 'required',
'agama' => 'required',
'address' => 'required',
]);
// dd($request);
try { try {
$customer = Customer::findOrFail($id); $customer = Customer::findOrFail($id);
$customerData = $request->all(); $customerData = $request->all();

14
app/Http/Controllers/HomeController.php

@ -15,11 +15,23 @@ class HomeController extends Controller
'jumlahAsset' => \App\Models\m_asset::count(), 'jumlahAsset' => \App\Models\m_asset::count(),
'jumlahPeminjaman' => \App\Models\asset_status::count(), 'jumlahPeminjaman' => \App\Models\asset_status::count(),
'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
'active' => 'menu-dashboard', 'active' => 'menu-admin',
]; ];
return view('dashboard.index', $data); return view('dashboard.index', $data);
} }
public function indexUser()
{
$data = [
'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(),
'jumlahAsset' => \App\Models\m_asset::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);
}
public function generateChartData() public function generateChartData()
{ {

12
app/Http/Controllers/M_userController.php

@ -7,6 +7,7 @@ use App\Models\m_role;
use App\Models\m_warehouse; use App\Models\m_warehouse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use App\Http\Requests\ValidasiCreateUser;
class M_userController extends Controller class M_userController extends Controller
{ {
@ -40,17 +41,8 @@ class M_userController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreateUser $request)
{ {
$request->validate([
'username' => 'required',
'fullname' => 'required',
'email' => 'required|email',
'divisi' => 'required',
'role_id' => 'required',
'warehouse_id' => 'required',
'password' => 'required',
]);
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();

150
app/Http/Controllers/PetiController.php

@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreatePeti;
use App\Http\Requests\ValidasiUpdatePeti;
use Dompdf\Dompdf; use Dompdf\Dompdf;
use Dompdf\Options; use Dompdf\Options;
use App\Models\Peti; use App\Models\Peti;
@ -44,21 +46,8 @@ class PetiController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreatePeti $request)
{ {
// dd($request->all());
$request->validate([
'tipe_peti_id' => 'required',
'warna' => 'required',
'customer_id' => 'required',
'warehouse_id' => 'required',
'jumlah' => 'required|numeric|min:1',
'date_pembuatan' => 'required',
'status_disposal' => 'nullable',
'packing_no' => 'nullable',
'fix_lot' => 'nullable',
]);
// dd($request);
try { try {
$currenttype = Auth::user(); $currenttype = Auth::user();
@ -160,17 +149,8 @@ class PetiController extends Controller
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id) public function update(ValidasiUpdatePeti $request, $id)
{ {
$request->validate([
'tipe_peti_id' => 'required',
'warna' => 'required',
'customer_id' => 'required',
'warehouse_id' => 'required',
'status_disposal' => 'nullable',
'date_pembuatan' => 'required',
]);
try { try {
$currentuser = Auth::user(); $currentuser = Auth::user();
$typepeti = Peti::findOrFail($id); $typepeti = Peti::findOrFail($id);
@ -219,58 +199,74 @@ class PetiController extends Controller
public function cetakPdf($id) public function cetakPdf($id)
{ {
$peti = Peti::find($id); try {
$peti = Peti::find($id);
// Generate QR Code
$qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate( // Generate QR Code
'Nama Customer : ' . $qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate(
$peti->customer->name . 'Nama Customer : ' .
"\n" . $peti->customer->name .
'Code Customer : ' . "\n" .
$peti->customer->code_customer . 'Code Customer : ' .
"\n" . $peti->customer->code_customer .
'ID Peti : ' . "\n" .
$peti->tipe_peti->id . 'ID Peti : ' .
"\n" . $peti->tipe_peti->id .
'Type Peti : ' . "\n" .
$peti->tipe_peti->type . 'Type Peti : ' .
"\n" . $peti->tipe_peti->type .
'ID Warehouse : ' . "\n" .
$peti->warehouse->id . 'ID Warehouse : ' .
"\n" . $peti->warehouse->id .
'Warehouse : ' . "\n" .
$peti->warehouse->name . 'Warehouse : ' .
"\n" . $peti->warehouse->name .
'Ukuran Peti : ' . "\n" .
$peti->tipe_peti->size_peti . 'Ukuran Peti : ' .
"\n" . $peti->tipe_peti->size_peti .
'Lot Number : ' . "\n" .
$peti->customer->lot_no . 'Lot Number : ' .
"\n" . $peti->customer->lot_no .
'Paking Number : ' . "\n" .
$peti->packing_no . 'Paking Number : ' .
"\n" . $peti->packing_no .
'Status Peti : ' . "\n" .
$peti->status_disposal 'Fix Lot : ' .
)); $peti->fix_lot .
// Inisialisasi Dompdf 'Status Peti : ' .
$options = new Options(); $peti->status_disposal
$options->set('isHtml5ParserEnabled', true); ));
$options->set('isPhpEnabled', true);
$dompdf = new Dompdf($options); // Inisialisasi Dompdf
$options = new Options();
// Load HTML dari view $options->set('isHtml5ParserEnabled', true);
$html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render(); $options->set('isRemoteEnabled', true);
$options->set('defaultFont', 'Arial');
// Load HTML ke Dompdf $dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
// Load HTML dari view
// Render PDF (portrait A4) $html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render();
$dompdf->setPaper('A4', 'horizontal'); $dompdf->loadHtml($html);
$dompdf->render();
// Render PDF (portrait A4)
// Menggunakan stream untuk menghasilkan dan mengunduh PDF $dompdf->setPaper('A4', 'portrait');
return $dompdf->stream('Label_Peti.pdf'); $dompdf->render();
$output = $dompdf->output();
// Download file PDF dengan nama yang sesuai
return response()->stream(
function () use ($output) {
echo $output;
},
200,
[
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="label_Peti.pdf"',
]
);
} catch (\Exception $e) {
return redirect()->back()->with('error', 'Terjadi kesalahan saat mencetak PDF.');
}
} }
} }

24
app/Http/Controllers/RoleController.php

@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use App\Models\m_role; use App\Models\m_role;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use App\Http\Requests\ValidasiCreateRole;
use App\Http\Requests\ValidasiUpdateRole;
class RoleController extends Controller class RoleController extends Controller
{ {
@ -31,12 +33,8 @@ class RoleController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreateRole $request)
{ {
$request->validate([
'name' => 'required',
'description' => 'required',
]);
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
@ -71,9 +69,21 @@ class RoleController extends Controller
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id) public function update(ValidasiUpdateRole $request, $id)
{ {
dd('oke'); try {
$currentUser = Auth::user();
$role = m_role::findOrFail($id); // Cari peran berdasarkan ID
$validatedData = $request->except('_token');
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by
$role->update($validatedData); // Update data peran
return redirect()->back()->with('success', 'Data role Berhasil Diperbarui.');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data role Gagal Diperbarui.');
}
} }
/** /**

20
app/Http/Controllers/TypePetiController.php

@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreateType_Peti;
use App\Http\Requests\ValidasiUpdateType_Peti;
use App\Models\Type_peti; use App\Models\Type_peti;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -34,15 +36,8 @@ class TypePetiController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreateType_Peti $request)
{ {
// dd($request->all());
$request->validate([
'type' => 'required',
'size_peti' => 'required',
'description' => 'required',
]);
// dd($request);
try { try {
$currenttype = Auth::user(); $currenttype = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
@ -84,15 +79,8 @@ class TypePetiController extends Controller
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id) public function update(ValidasiUpdateType_Peti $request, $id)
{ {
// dd($request->all());
$request->validate([
'type' => 'required',
'size_peti' => 'required',
'description' => 'required',
]);
// dd($request);
try { try {
$typepeti = Type_peti::findOrFail($id); $typepeti = Type_peti::findOrFail($id);
$typepetiData = $request->all(); $typepetiData = $request->all();

19
app/Http/Controllers/WarehouseController.php

@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreateWarehouse;
use App\Http\Requests\ValidasiUpdateWarehouse;
use App\Models\m_warehouse; use App\Models\m_warehouse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -30,13 +32,9 @@ class WarehouseController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store(Request $request) public function store(ValidasiCreateWarehouse $request)
{ {
$request->validate([
'name' => 'required',
'description' => 'required',
'address' => 'required',
]);
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
@ -71,15 +69,8 @@ class WarehouseController extends Controller
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id) public function update(ValidasiUpdateWarehouse $request, $id)
{ {
// dd('oke');
$request->validate([
'name' => 'required',
'description' => 'required',
'address' => 'required',
]);
// dd($request);
try { try {
$warehouse = m_warehouse::findOrFail($id); $warehouse = m_warehouse::findOrFail($id);
$warehouse->update($request->all()); $warehouse->update($request->all());

52
app/Http/Requests/ValidasiCreateCustomer.php

@ -0,0 +1,52 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateCustomer extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:50',
'code_customer' => 'required|string|max:15|unique:customers,code_customer',
'lot_no' => 'required|string|max:50',
'no_tlp' => 'required|numeric',
'address' => 'required|string',
];
}
public function messages()
{
return [
'name.required' => 'Kolom name wajib diisi.',
'name.string' => 'Kolom name harus berupa teks.',
'name.max' => 'Kolom name tidak boleh lebih dari :max karakter.',
'code_customer.required' => 'Kolom code_customer wajib diisi.',
'code_customer.string' => 'Kolom code_customer harus berupa teks.',
'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.',
'code_customer.unique' => 'Kolom code_customer sudah ada.',
'lot_no.required' => 'Kolom lot_no wajib diisi.',
'lot_no.string' => 'Kolom lot_no harus berupa teks.',
'no_tlp.required' => 'Kolom no_tlp wajib diisi.',
'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.',
'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.',
'address.required' => 'Kolom address wajib diisi.',
'address.string' => 'Kolom address harus berupa teks.',
];
}
}

60
app/Http/Requests/ValidasiCreatePeti.php

@ -0,0 +1,60 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreatePeti extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'tipe_peti_id' => 'required|exists:type_petis,id',
'warna' => 'required|string|max:50',
'customer_id' => 'required|exists:customers,id',
'warehouse_id' => 'required|exists:m_warehouses,id',
'jumlah' => 'required|numeric|min:1',
'date_pembuatan' => 'required|date',
'status_disposal' => 'nullable|string',
'packing_no' => 'nullable|integer',
'fix_lot' => 'nullable|string|max:100',
];
}
public function messages()
{
return [
'tipe_peti_id.required' => 'Tipe Peti harus diisi',
'tipe_peti_id.exists' => 'Tipe Peti tidak ditemukan',
'warna.required' => 'Warna harus diisi',
'warna.string' => 'Warna harus berupa string',
'warna.max' => 'Warna maksimal 50 karakter',
'customer_id.required' => 'Customer harus diisi',
'customer_id.exists' => 'Customer tidak ditemukan',
'warehouse_id.required' => 'Warehouse harus diisi',
'warehouse_id.exists' => 'Warehouse tidak ditemukan',
'jumlah.required' => 'Jumlah harus diisi',
'jumlah.numeric' => 'Jumlah harus berupa angka',
'jumlah.min' => 'Jumlah minimal 1',
'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi',
'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal',
'status_disposal.string' => 'Status Disposal harus berupa string',
'packing_no.integer' => 'Packing No harus berupa angka',
'fix_lot.string' => 'Fix Lot harus berupa string',
'fix_lot.max' => 'Fix Lot maksimal 100 karakter',
];
}
}

40
app/Http/Requests/ValidasiCreateRole.php

@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateRole extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:50',
'description' => 'required|string',
];
}
public function messages()
{
return [
'name.required' => 'Nama Role harus diisi',
'name.string' => 'Nama Role harus berupa string',
'name.max' => 'Nama Role maksimal 50 karakter',
'description.required' => 'Deskripsi harus diisi',
'description.string' => 'Deskripsi harus berupa string',
];
}
}

44
app/Http/Requests/ValidasiCreateType_Peti.php

@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateType_Peti extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'type' => 'required|string|max:20',
'size_peti' => 'required|string|max:25',
'description' => 'required|string',
];
}
public function messages()
{
return [
'type.required' => 'Type Peti tidak boleh kosong',
'type.string' => 'Type Peti harus berupa string',
'type.max' => 'Type Peti maksimal 20 karakter',
'size_peti.required' => 'Size Peti tidak boleh kosong',
'size_peti.string' => 'Size Peti harus berupa string',
'size_peti.max' => 'Size Peti maksimal 25 karakter',
'description.required' => 'Deskripsi tidak boleh kosong',
'description.string' => 'Deskripsi harus berupa string',
];
}
}

78
app/Http/Requests/ValidasiCreateUser.php

@ -0,0 +1,78 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateUser extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'username' => 'required|string|max:32',
'fullname' => 'required|string|max:32',
'nip' => 'nullable|numeric|max:20',
'email' => 'required|email|string|max:45',
'no_hp' => 'nullable|numeric|max:15',
'divisi' => 'nullable|string|max:50',
'foto' => 'nullable|string|max:255',
'role_id' => 'required|exists:m_roles,id',
'warehouse_id' => 'nullable|exists:m_warehouses,id',
'address' => 'nullable|string',
'email_verified_at' => 'nullable|date',
'password' => 'required|string|min:6|max:16',
'created_by' => 'nullable|string|max:32',
'updated_by' => 'nullable|string|max:32',
];
}
public function messages()
{
return [
'username.required' => 'Kolom username wajib diisi.',
'username.string' => 'Kolom username harus berupa teks.',
'username.max' => 'Kolom username tidak boleh lebih dari :max karakter.',
'fullname.required' => 'Kolom fullname wajib diisi.',
'fullname.string' => 'Kolom fullname harus berupa teks.',
'fullname.max' => 'Kolom fullname tidak boleh lebih dari :max karakter.',
'nip.numeric' => 'Kolom NIP harus berisi angka.',
'nip.max' => 'Kolom NIP tidak boleh lebih dari :max karakter.',
'email.required' => 'Kolom email wajib diisi.',
'email.email' => 'Format email tidak valid.',
'email.string' => 'Kolom email harus berupa teks.',
'email.max' => 'Kolom email tidak boleh lebih dari :max karakter.',
'no_hp.numeric' => 'Kolom no_hp harus berisi angka.',
'no_hp.max' => 'Kolom no_hp tidak boleh lebih dari :max karakter.',
'divisi.string' => 'Kolom divisi harus berupa teks.',
'divisi.max' => 'Kolom divisi tidak boleh lebih dari :max karakter.',
'foto.string' => 'Kolom foto harus berupa teks.',
'foto.max' => 'Kolom foto tidak boleh lebih dari :max karakter.',
'role_id.required' => 'Kolom role_id wajib diisi.',
'role_id.exists' => 'Role yang dipilih tidak valid.',
'warehouse_id.exists' => 'Warehouse yang dipilih tidak valid.',
'address.string' => 'Kolom address harus berupa teks.',
'email_verified_at.date' => 'Format tanggal email_verified_at tidak valid.',
'password.required' => 'Kolom password wajib diisi.',
'password.string' => 'Kolom password harus berupa teks.',
'password.min' => 'Kolom password minimal harus :min karakter.',
'password.max' => 'Kolom password tidak boleh lebih dari :max karakter.',
'created_by.string' => 'Kolom created_by harus berupa teks.',
'created_by.max' => 'Kolom created_by tidak boleh lebih dari :max karakter.',
'updated_by.string' => 'Kolom updated_by harus berupa teks.',
'updated_by.max' => 'Kolom updated_by tidak boleh lebih dari :max karakter.',
];
}
}

45
app/Http/Requests/ValidasiCreateWarehouse.php

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateWarehouse extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:32',
'description' => 'required|string|max:255',
'address' => 'required|string|max:255',
];
}
public function messages()
{
return [
'name.required' => 'Kolom nama wajib diisi.',
'name.string' => 'Kolom nama harus berupa teks.',
'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.',
'description.required' => 'Kolom deskripsi wajib diisi.',
'description.string' => 'Kolom deskripsi harus berupa teks.',
'description.max' => 'Kolom deskripsi tidak boleh lebih dari :max karakter.',
'address.required' => 'Kolom alamat wajib diisi.',
'address.string' => 'Kolom alamat harus berupa teks.',
'address.max' => 'Kolom alamat tidak boleh lebih dari :max karakter.',
];
}
}

52
app/Http/Requests/ValidasiUpdateCustomer.php

@ -0,0 +1,52 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateCustomer extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:50',
'code_customer' => 'required|string|max:15|unique:customers,code_customer',
'lot_no' => 'required|string|max:50',
'no_tlp' => 'required|numeric',
'address' => 'required|string',
];
}
public function messages()
{
return [
'name.required' => 'Kolom name wajib diisi.',
'name.string' => 'Kolom name harus berupa teks.',
'name.max' => 'Kolom name tidak boleh lebih dari :max karakter.',
'code_customer.required' => 'Kolom code_customer wajib diisi.',
'code_customer.string' => 'Kolom code_customer harus berupa teks.',
'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.',
'code_customer.unique' => 'Kolom code_customer sudah ada.',
'lot_no.required' => 'Kolom lot_no wajib diisi.',
'lot_no.string' => 'Kolom lot_no harus berupa teks.',
'no_tlp.required' => 'Kolom no_tlp wajib diisi.',
'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.',
'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.',
'address.required' => 'Kolom address wajib diisi.',
'address.string' => 'Kolom address harus berupa teks.',
];
}
}

59
app/Http/Requests/ValidasiUpdatePeti.php

@ -0,0 +1,59 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdatePeti extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'tipe_peti_id' => 'required|exists:type_petis,id',
'warna' => 'required|string|max:50',
'customer_id' => 'required|exists:customers,id',
'warehouse_id' => 'required|exists:m_warehouses,id',
'date_pembuatan' => 'required|date',
'status_disposal' => 'nullable|string',
'packing_no' => 'nullable|integer',
'fix_lot' => 'nullable|string|max:100',
];
}
public function messages()
{
return [
'tipe_peti_id.required' => 'Tipe Peti harus diisi',
'tipe_peti_id.exists' => 'Tipe Peti tidak ditemukan',
'warna.required' => 'Warna harus diisi',
'warna.string' => 'Warna harus berupa string',
'warna.max' => 'Warna maksimal 50 karakter',
'customer_id.required' => 'Customer harus diisi',
'customer_id.exists' => 'Customer tidak ditemukan',
'warehouse_id.required' => 'Warehouse harus diisi',
'warehouse_id.exists' => 'Warehouse tidak ditemukan',
'jumlah.required' => 'Jumlah harus diisi',
'jumlah.numeric' => 'Jumlah harus berupa angka',
'jumlah.min' => 'Jumlah minimal 1',
'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi',
'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal',
'status_disposal.string' => 'Status Disposal harus berupa string',
'packing_no.integer' => 'Packing No harus berupa angka',
'fix_lot.string' => 'Fix Lot harus berupa string',
'fix_lot.max' => 'Fix Lot maksimal 100 karakter',
];
}
}

40
app/Http/Requests/ValidasiUpdateRole.php

@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateRole extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:50',
'description' => 'required|string',
];
}
public function messages()
{
return [
'name.required' => 'Nama Role harus diisi',
'name.string' => 'Nama Role harus berupa string',
'name.max' => 'Nama Role maksimal 50 karakter',
'description.required' => 'Deskripsi harus diisi',
'description.string' => 'Deskripsi harus berupa string',
];
}
}

44
app/Http/Requests/ValidasiUpdateType_Peti.php

@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateType_Peti extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'type' => 'required|string|max:20',
'size_peti' => 'required|string|max:25',
'description' => 'required|string',
];
}
public function messages()
{
return [
'type.required' => 'Type Peti tidak boleh kosong',
'type.string' => 'Type Peti harus berupa string',
'type.max' => 'Type Peti maksimal 20 karakter',
'size_peti.required' => 'Size Peti tidak boleh kosong',
'size_peti.string' => 'Size Peti harus berupa string',
'size_peti.max' => 'Size Peti maksimal 25 karakter',
'description.required' => 'Deskripsi tidak boleh kosong',
'description.string' => 'Deskripsi harus berupa string',
];
}
}

78
app/Http/Requests/ValidasiUpdateUser.php

@ -0,0 +1,78 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateUser extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'username' => 'required|string|max:32',
'fullname' => 'required|string|max:32',
'nip' => 'nullable|numeric|max:20',
'email' => 'required|email|string|max:45',
'no_hp' => 'nullable|numeric|max:15',
'divisi' => 'nullable|string|max:50',
'foto' => 'nullable|string|max:255',
'role_id' => 'required|exists:m_roles,id',
'warehouse_id' => 'nullable|exists:m_warehouses,id',
'address' => 'nullable|string',
'email_verified_at' => 'nullable|date',
'password' => 'required|string|min:6|max:16',
'created_by' => 'nullable|string|max:32',
'updated_by' => 'nullable|string|max:32',
];
}
public function messages()
{
return [
'username.required' => 'Kolom username wajib diisi.',
'username.string' => 'Kolom username harus berupa teks.',
'username.max' => 'Kolom username tidak boleh lebih dari :max karakter.',
'fullname.required' => 'Kolom fullname wajib diisi.',
'fullname.string' => 'Kolom fullname harus berupa teks.',
'fullname.max' => 'Kolom fullname tidak boleh lebih dari :max karakter.',
'nip.numeric' => 'Kolom NIP harus berisi angka.',
'nip.max' => 'Kolom NIP tidak boleh lebih dari :max karakter.',
'email.required' => 'Kolom email wajib diisi.',
'email.email' => 'Format email tidak valid.',
'email.string' => 'Kolom email harus berupa teks.',
'email.max' => 'Kolom email tidak boleh lebih dari :max karakter.',
'no_hp.numeric' => 'Kolom no_hp harus berisi angka.',
'no_hp.max' => 'Kolom no_hp tidak boleh lebih dari :max karakter.',
'divisi.string' => 'Kolom divisi harus berupa teks.',
'divisi.max' => 'Kolom divisi tidak boleh lebih dari :max karakter.',
'foto.string' => 'Kolom foto harus berupa teks.',
'foto.max' => 'Kolom foto tidak boleh lebih dari :max karakter.',
'role_id.required' => 'Kolom role_id wajib diisi.',
'role_id.exists' => 'Role yang dipilih tidak valid.',
'warehouse_id.exists' => 'Warehouse yang dipilih tidak valid.',
'address.string' => 'Kolom address harus berupa teks.',
'email_verified_at.date' => 'Format tanggal email_verified_at tidak valid.',
'password.required' => 'Kolom password wajib diisi.',
'password.string' => 'Kolom password harus berupa teks.',
'password.min' => 'Kolom password minimal harus :min karakter.',
'password.max' => 'Kolom password tidak boleh lebih dari :max karakter.',
'created_by.string' => 'Kolom created_by harus berupa teks.',
'created_by.max' => 'Kolom created_by tidak boleh lebih dari :max karakter.',
'updated_by.string' => 'Kolom updated_by harus berupa teks.',
'updated_by.max' => 'Kolom updated_by tidak boleh lebih dari :max karakter.',
];
}
}

45
app/Http/Requests/ValidasiUpdateWarehouse.php

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateWarehouse extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|string|max:32',
'description' => 'required|string|max:255',
'address' => 'required|string|max:255',
];
}
public function messages()
{
return [
'name.required' => 'Kolom nama wajib diisi.',
'name.string' => 'Kolom nama harus berupa teks.',
'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.',
'description.required' => 'Kolom deskripsi wajib diisi.',
'description.string' => 'Kolom deskripsi harus berupa teks.',
'description.max' => 'Kolom deskripsi tidak boleh lebih dari :max karakter.',
'address.required' => 'Kolom alamat wajib diisi.',
'address.string' => 'Kolom alamat harus berupa teks.',
'address.max' => 'Kolom alamat tidak boleh lebih dari :max karakter.',
];
}
}

6
app/Models/Customer.php

@ -15,11 +15,7 @@ class Customer extends Model
'name', 'name',
'code_customer', 'code_customer',
'lot_no', 'lot_no',
'nip', 'no_tlp',
'no_hp',
'tgl_lahir',
'jenis_kelamin',
'agama',
'address', 'address',
'created_by', 'created_by',
'updated_by', 'updated_by',

2
database/migrations/2023_10_23_073314_create_m_warehouses_table.php

@ -13,7 +13,7 @@ return new class extends Migration
{ {
Schema::create('m_warehouses', function (Blueprint $table) { Schema::create('m_warehouses', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name', 200)->nullable(); $table->string('name', 32)->nullable();
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->text('address')->nullable(); $table->text('address')->nullable();
$table->timestamps(); $table->timestamps();

6
database/migrations/2023_10_23_075239_create_m_roles_table.php

@ -13,12 +13,12 @@ return new class extends Migration
{ {
Schema::create('m_roles', function (Blueprint $table) { Schema::create('m_roles', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name', 200)->nullable(); $table->string('name', 50)->nullable();
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->string('created_by', 200)->nullable(); $table->string('created_by', 50)->nullable();
$table->string('updated_by', 200)->nullable(); $table->string('updated_by', 50)->nullable();
}); });
} }

22
database/migrations/2023_10_23_075245_create_users_table.php

@ -14,28 +14,28 @@ return new class extends Migration
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('username', 50)->nullable();
$table->string('fullname', 255)->nullable(); $table->string('username', 32)->nullable();
$table->string('fullname', 50)->nullable();
$table->string('nip', 20)->nullable(); $table->string('nip', 20)->nullable();
$table->string('email', 255)->nullable(); $table->string('email', 45)->nullable();
$table->string('no_hp', 20)->nullable(); $table->string('no_hp', 15)->nullable();
$table->string('divisi', 255)->nullable(); $table->string('divisi', 100)->nullable();
$table->date('tgl_lahir')->nullable(); $table->date('tgl_lahir')->nullable();
$table->string('jenis_kelamin', 30)->nullable();
$table->string('agama', 30)->nullable();
$table->string('foto', 255)->nullable(); $table->string('foto', 255)->nullable();
// $table->bigInteger('role_id')->unsigned()->nullable(); $table->string('jenis_kelamin', 20)->nullable();
// $table->foreign('role_id')->references('id')->on('m_roles')->onDelete('set null'); $table->string('agama', 15)->nullable();
$table->foreignId('role_id')->constrained('m_roles')->onDelete('cascade'); $table->foreignId('role_id')->constrained('m_roles')->onDelete('cascade');
$table->bigInteger('warehouse_id')->unsigned()->nullable(); $table->bigInteger('warehouse_id')->unsigned()->nullable();
$table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null'); $table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null');
$table->text('address')->nullable(); $table->text('address')->nullable();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password', 255)->nullable(); $table->string('password', 255)->nullable();
$table->string('created_by', 50)->nullable();
$table->string('updated_by', 50)->nullable();
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
$table->softDeletes(); $table->softDeletes();
}); });
} }

14
database/migrations/2023_10_28_080457_create_customers_table.php

@ -13,19 +13,15 @@ return new class extends Migration
{ {
Schema::create('customers', function (Blueprint $table) { Schema::create('customers', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name', 200); $table->string('name', 50);
$table->string('code_customer', 50); $table->string('code_customer', 15);
$table->string('lot_no', 50); $table->string('lot_no', 50);
$table->string('nip', 20)->nullable(); $table->string('no_tlp', 20)->nullable();
$table->string('no_hp', 20)->nullable();
$table->date('tgl_lahir')->nullable();
$table->string('jenis_kelamin', 30)->nullable();
$table->string('agama', 30)->nullable();
$table->text('address')->nullable(); $table->text('address')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->string('created_by', 200)->nullable(); $table->string('created_by', 50)->nullable();
$table->string('updated_by', 200)->nullable(); $table->string('updated_by', 50)->nullable();
}); });
} }

8
database/migrations/2023_10_28_083930_create_type_petis_table.php

@ -13,13 +13,13 @@ return new class extends Migration
{ {
Schema::create('type_petis', function (Blueprint $table) { Schema::create('type_petis', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('type'); $table->string('type', 20);
$table->string('size_peti'); $table->string('size_peti', 25);
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->string('created_by', 200)->nullable(); $table->string('created_by', 50)->nullable();
$table->string('updated_by', 200)->nullable(); $table->string('updated_by', 50)->nullable();
}); });
} }

28
database/seeders/Customer.php

@ -14,28 +14,20 @@ class Customer extends Seeder
public function run(): void public function run(): void
{ {
DB::table('customers')->insert([ DB::table('customers')->insert([
'name' => 'Gunawan', 'name' => 'DHARMA',
'code_customer' => 'G', 'code_customer' => 'DPM',
'lot_no' => 'CWT', 'lot_no' => 'JKT23',
'nip' => '1234567890987654', 'no_tlp' => '02122344',
'no_hp' => '085159079010', 'address' => 'Jalan Raya Ciwatu',
// 'tgl_lahir' => '19-06-2001',
'jenis_kelamin' => 'Laki-Laki',
'agama' => 'Islam',
'address' => 'CIwatu',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);
DB::table('customers')->insert([ DB::table('customers')->insert([
'name' => 'Andra Ryandra', 'name' => 'ADHI CHANDRA',
'code_customer' => 'AR', 'code_customer' => 'ACJ',
'lot_no' => 'KA', 'lot_no' => 'JKT23',
'nip' => '1234567890987', 'no_tlp' => '02198765',
'no_hp' => '085159079011', 'address' => 'Jalan Raya Gelarmendala',
// 'tgl_lahir' => '19-06-2001',
'jenis_kelamin' => 'Laki-Laki',
'agama' => 'Islam',
'address' => 'CIwatu',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);

6
database/seeders/RoleSeeder.php

@ -16,15 +16,15 @@ class RoleSeeder extends Seeder
// Role Admin // Role Admin
m_role::create([ m_role::create([
'name' => 'Admin', 'name' => 'Admin',
'description' => 'Peran admin sistem', 'description' => 'admin sistem',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);
// Role User // Role User
m_role::create([ m_role::create([
'name' => 'User', 'name' => 'Operator',
'description' => 'Peran pengguna biasa', 'description' => 'Operator sistem',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);

8
database/seeders/Type_Peti.php

@ -15,16 +15,16 @@ class Type_Peti extends Seeder
public function run(): void public function run(): void
{ {
DB::table('type_petis')->insert([ DB::table('type_petis')->insert([
'type' => 'BS', 'type' => 'Bagus',
'size_peti' => '2 X 2 X 2 X 2', 'size_peti' => '2 X 2 X 2 X 2',
'description' => 'Detail BS', 'description' => 'Detail Barang Bagus',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);
DB::table('type_petis')->insert([ DB::table('type_petis')->insert([
'type' => 'BCA', 'type' => 'Standar',
'size_peti' => '3 X 3 X 3 X 3', 'size_peti' => '3 X 3 X 3 X 3',
'description' => 'Detail BCA', 'description' => 'Detail Barang Standar',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);

26
database/seeders/UserSeeder.php

@ -15,10 +15,10 @@ class UserSeeder extends Seeder
{ {
User::create([ User::create([
'username' => 'admin', 'username' => 'admin',
'fullname' => 'Admin User', 'fullname' => 'Admin System',
'nip' => '12345', 'nip' => '1234567890123456',
'email' => 'admin@gmail.com', 'email' => 'admin@gmail.com',
'no_hp' => '1234567890', 'no_hp' => '085159079010',
'divisi' => 'Admin Division', 'divisi' => 'Admin Division',
'tgl_lahir' => '1990-01-01', 'tgl_lahir' => '1990-01-01',
'jenis_kelamin' => 'Laki-laki', 'jenis_kelamin' => 'Laki-laki',
@ -26,7 +26,7 @@ class UserSeeder extends Seeder
'foto' => '', // Ganti dengan nama berkas foto jika diperlukan 'foto' => '', // Ganti dengan nama berkas foto jika diperlukan
'role_id' => 1, // Ganti dengan ID peran yang sesuai 'role_id' => 1, // Ganti dengan ID peran yang sesuai
'warehouse_id' => 1, // Ganti dengan ID gudang yang sesuai 'warehouse_id' => 1, // Ganti dengan ID gudang yang sesuai
'address' => 'Alamat Admin', 'address' => 'Jalan Ciwatu',
'email_verified_at' => now(), 'email_verified_at' => now(),
'password' => bcrypt('admin'), 'password' => bcrypt('admin'),
'created_by' => 'Seeder', 'created_by' => 'Seeder',
@ -35,21 +35,21 @@ class UserSeeder extends Seeder
// User lainnya // User lainnya
User::create([ User::create([
'username' => 'user1', 'username' => 'Operator',
'fullname' => 'User Satu', 'fullname' => 'Operator System',
'nip' => '54321', 'nip' => '6543210987654321',
'email' => 'user1@gmail.com', 'email' => 'operator@gmail.com',
'no_hp' => '9876543210', 'no_hp' => '087779767603',
'divisi' => 'Divisi Satu', 'divisi' => 'Operator Gudang',
'tgl_lahir' => '1985-05-15', 'tgl_lahir' => '1985-05-15',
'jenis_kelamin' => 'Perempuan', 'jenis_kelamin' => 'Perempuan',
'agama' => 'Kristen', 'agama' => 'Islam',
'foto' => '', // Ganti dengan nama berkas foto jika diperlukan 'foto' => '', // Ganti dengan nama berkas foto jika diperlukan
'role_id' => 2, // Ganti dengan ID peran yang sesuai 'role_id' => 2, // Ganti dengan ID peran yang sesuai
'warehouse_id' => 2, // Ganti dengan ID gudang yang sesuai 'warehouse_id' => 2, // Ganti dengan ID gudang yang sesuai
'address' => 'Alamat User Satu', 'address' => 'Jalan Gelarmendala',
'email_verified_at' => now(), 'email_verified_at' => now(),
'password' => bcrypt('user1'), 'password' => bcrypt('operator'),
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);

26
resources/views/auth/login.blade.php

@ -40,7 +40,7 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="p-5"> <div class="p-5">
<div class="text-center"> <div class="text-center">
<h1 class="h4 text-gray-900 mb-4">Welcome Back!</h1> <h1 class="h4 text-gray-900 mb-4">Selamat Datang!</h1>
</div> </div>
<form class="user" method="POST" action="{{ route('login') }}"> <form class="user" method="POST" action="{{ route('login') }}">
@csrf @csrf
@ -49,16 +49,22 @@
aria-describedby="emailHelp" name="email" value="{{ old('email') }}" aria-describedby="emailHelp" name="email" value="{{ old('email') }}"
required autofocus autocomplete="username" required autofocus autocomplete="username"
placeholder="Masukan Email anda"> placeholder="Masukan Email anda">
@if ($errors->has('email'))
<div class="alert alert-danger rounded mt-1">
{{ $errors->first('email') }}
</div>
@endif
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" class="form-control form-control-user" id="password" <input type="password" class="form-control form-control-user" id="password"
name="password" required autocomplete="current-password" name="password" required autocomplete="current-password"
placeholder="Masukan password anda"> placeholder="Masukan password anda">
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="custom-control custom-checkbox small"> <div class="custom-control custom-checkbox small">
<input id="remember_me" type="checkbox" name="remember" <input id="remember_me" type="checkbox" name="remember"
class="custom-control-input"> class="custom-control-input">
<label for="remember_me" class="custom-control-label"> <label for="remember_me" class="custom-control-label">
<span>Remember Me</span> <span>Remember Me</span>
</label> </label>
@ -69,21 +75,7 @@
Login Login
</button> </button>
<hr> <hr>
<!-- <a href="#" class="btn btn-google btn-user btn-block">
<i class="fab fa-google fa-fw"></i> Login with Google
</a>
<a href="#" class="btn btn-facebook btn-user btn-block">
<i class="fab fa-facebook-f fa-fw"></i> Login with Facebook
</a> -->
</form> </form>
<!-- <hr> -->
<!-- <div class="text-center">
@if (Route::has('password.request'))
<a class="small" href="{{ route('password.request') }}">Forgot your
password?</a>
@endif
</div> -->
<div class="text-center"> <div class="text-center">
<label class="small">Copy Rigth SIOPAS</label> <label class="small">Copy Rigth SIOPAS</label>
</div> </div>

84
resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php

@ -1,84 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<style>
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td,
#customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even) {
background-color: #f2f2f2;
}
#customers tr:hover {
background-color: #ddd;
}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4aa2dd;
color: white;
}
</style>
</head>
<body>
{{-- <h1>Laporan Keuangan</h1> --}}
<h1 class="text-gray-800">Tabel Asset</h1>
<div class="mb-3">
<p>Our Item Tables are enhanced with the help of the DataTables plugin. This is a powerful tool that allows you
to explore return data in a more interactive and efficient way</p>
</div>
<table id="customers">
<thead>
<tr>
<th>No. Seri</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Gudang</th>
<th>Tanggal</th>
<th>QR</th>
</tr>
</thead>
<tbody>
@forelse ($asset as $data)
<tr>
<td>{{ $data->seri }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->warehouse->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->date)->format('d-m-Y') }}</td>
<td>{{ $data->qr_count }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
<tfoot>
<tr>
<th>No. Seri</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Gudang</th>
<th>Tanggal</th>
<th>QR</th>
</tr>
</tfoot>
</table>
</body>
</html>

231
resources/views/dashboard/Master_Data/Asset/index.blade.php

@ -1,231 +0,0 @@
@extends('layouts.main')
@section('title', 'Setting Platform')
@section('content')
<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 Asset</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 data</span>
</a>
<a href="{{ route('dashboard.assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak PDF</span>
</a>
<a href="{{ route('dashboard.assetexport.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak Exel</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>No. Seri</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Gudang</th>
<th>Tanggal</th>
<th>Jumlah QR Print</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($asset as $data)
<tr>
<td>{{ $data->seri }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->warehouse->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->date)->format('d-m-Y') }}</td>
<td class="text-center">
{!! QrCode::size(80)->generate(route('dashboard.asset.show', $data->id)) !!}
</td>
<td class="text-center">
<a href="{{ route('dashboard.asset.show', $data->id) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="#" data-toggle="modal" data-target="#editDataModal{{ $data->id }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.asset.destroy', $data->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>
<!-- Modal Tambah Asset-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Tambah Data</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('dashboard.asset.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="name" class="col-form-label">Nama Asset:</label>
<input class="form-control" name="name" type="text" id="name"
value="{{ old('name') }}" placeholder="Masukan Nama Asset" required>
<label for="description" class="col-form-label">Deskripsi Asset:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Asset" required>{{ old('description') }}</textarea>
<label for="warehouse_id" class="col-form-label">Gudang:</label>
<select class="form-control" name="warehouse_id" type="text" id="warehouse_id">
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
<label for="date" class="col-form-label">Tanggal:</label>
<input class="form-control" name="date" type="date" id="date"
value="{{ old('date') }}" placeholder="Masukan Tanggal Asset" required>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Modal Edit Asset-->
@foreach ($asset as $data)
<div class="modal fade" id="editDataModal{{ $data['id'] }}" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Edit Data Asset</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('dashboard.asset.update', $data->id) }}" method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label for="name" class="col-form-label">Nama Asset:</label>
<input class="form-control" name="name" type="text" id="name"
value="{{ $data->name }}" placeholder="Masukan Nama Asset" required>
<label for="description" class="col-form-label">Deskripsi Asset:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Asset" required>{{ $data->description }}</textarea>
<label for="date" class="col-form-label">Tanggal:</label>
<input class="form-control" name="date" type="date" id="date"
value="{{ \Carbon\Carbon::parse($data->date)->format('Y-m-d') }}"
placeholder="Masukan Tanggal Asset" required>
<label for="warehouse_id" class="col-form-label">Gudang:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id">
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}"
@if ($data_warehouse->id == $data->warehouse_id) selected
@else @endif>
{{ $data_warehouse->name }}</option>
@endforeach
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endforeach
<!-- Modal Print QR Asset-->
{{-- @foreach ($asset as $data)
<div class="modal fade" id="printQRModal{{ $data['id'] }}" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Print QR Asset</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('dashboard.asset.update', $data->id) }}" method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label for="name" class="col-form-label">Nama Asset:</label>
<input class="form-control" name="name" type="text" id="name"
value="{{ $data->name }}" placeholder="Masukan Nama Asset" required>
<label for="description" class="col-form-label">Deskripsi Asset:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Asset" required>{{ $data->description }}</textarea>
<label for="qr_count" class="col-form-label">QR_Count:</label>
<input class="form-control" name="qr_count" type="text" id="qr_count"
value="{{ $data->qr_count }}" placeholder="Masukan Kode QR"
onkeypress="return event.charCode >= 48 && event.charCode <= 57" required>
<label for="date" class="col-form-label">Tanggal:</label>
<input class="form-control" name="date" type="date" id="date"
value="{{ \Carbon\Carbon::parse($data->date)->format('Y-m-d') }}"
placeholder="Masukan Tanggal Asset" required>
<label for="warehouse_id" class="col-form-label">Gudang:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id">
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}"
@if ($data_warehouse->id == $data->warehouse_id) selected
@else @endif>
{{ $data_warehouse->name }}</option>
@endforeach
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endforeach --}}
@endsection

65
resources/views/dashboard/Master_Data/Asset/show.blade.php

@ -1,65 +0,0 @@
@extends('layouts.main')
@section('title', 'Setting Platform')
@section('content')
<div class="container-fluid">
<div class="card">
<div class="card-body">
<h1 class="h3 mb-1 text-gray-800 mb-3">Detail Asset</h1>
<hr class="border">
<div class="form-group">
<label for="name" class="col-form-label">Nama Asset:</label>
<input class="form-control" name="name" type="text" id="name" value="{{ $asset->name }}"
placeholder="Masukan Nama Asset" required readonly>
<label for="description" class="col-form-label">Deskripsi Asset:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Asset" required
readonly>{{ $asset->description }}</textarea>
<label for="qr_count" class="col-form-label">QR:</label>
<div>
{!! QrCode::size(75)->generate(
'Name: ' .
$asset->name .
"\n" .
'ID Asset: ' .
$asset->id .
"\n" .
'Description: ' .
$asset->description .
"\n" .
'QR Code: ' .
$asset->qr_count .
"\n" .
'Date: ' .
\Carbon\Carbon::parse($asset->date)->format('d-m-Y') .
"\n" .
'Name WH: ' .
$asset->warehouse->name .
"\n" .
'ID WH: ' .
$asset->warehouse_id,
) !!}
</div>
<label for="date" class="col-form-label">Tanggal:</label>
<input class="form-control" name="date" type="date" id="date"
value="{{ \Carbon\Carbon::parse($asset->date)->format('Y-m-d') }}"
placeholder="Masukan Tanggal Asset" required readonly>
<label for="warehouse_id" class="col-form-label">Gudang:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id" disabled>
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}"
@if ($data_warehouse->id == $asset->warehouse_id) selected
@else @endif>
{{ $data_warehouse->name }}</option>
@endforeach
</select>
</div>
<a href="{{ route('dashboard.asset.index') }}" class="btn btn-primary ">Kembali</a>
</div>
</div>
</div>
@endsection

35
resources/views/dashboard/Master_Data/Customer/create.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
@ -24,36 +26,9 @@
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ old('lot_no') }}" <input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ old('lot_no') }}"
placeholder="Masukan lot number" required> placeholder="Masukan lot number" required>
<label for="nip" class="col-form-label">NIP Customer:</label> <label for="no_tlp" class="col-form-label">Nomor Telepon Customer:</label>
<input class="form-control" name="nip" type="text" id="nip" value="{{ old('nip') }}" <input class="form-control" name="no_tlp" type="text" id="no_tlp" value="{{ old('no_tlp') }}"
placeholder="Masukan NIP customer" required> placeholder="Masukan Nomor Telepon customer" required>
<label for="no_hp" class="col-form-label">No. HP Customer:</label>
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ old('no_hp') }}"
placeholder="Masukan Nomor Handphone customer" required>
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label>
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir"
value="{{ old('tgl_lahir') }}" required>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label>
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required>
<option disabled selected>Pilih Jenis Kelamin Customer</option>
<option value="Laki-Laki">Laki-Laki</option>
<option value="Perempuan">Perempuan</option>
</select>
<label for="agama" class="col-form-label">Agama Customer:</label>
<select class="form-control" name="agama" id="agama" required>
<option disabled selected>Pilih Agama Customer</option>
<option value="Islam">Islam</option>
<option value="Kristen">Kristen</option>
<option value="Katolik">Katolik</option>
<option value="Hindu">Hindu</option>
<option value="Buddha">Buddha</option>
<option value="Konghucu">Konghucu</option>
<option value="Lainnya">Lainnya</option>
</select>
<label for="address" class="col-form-label">Alamat Customer:</label> <label for="address" class="col-form-label">Alamat Customer:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea> <textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea>

37
resources/views/dashboard/Master_Data/Customer/edit.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
@ -26,38 +28,9 @@
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" <input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}"
placeholder="Masukan lot number" required> placeholder="Masukan lot number" required>
<label for="nip" class="col-form-label">NIP Customer:</label> <label for="no_tlp" class="col-form-label">No. Telepon Customer:</label>
<input class="form-control" name="nip" type="text" id="nip" value="{{ $customer->nip }}" <input class="form-control" name="no_tlp" type="text" id="no_tlp" value="{{ $customer->no_tlp }}"
placeholder="Masukan NIP customer" required> placeholder="Masukan nomor telepon customer" required>
<label for="no_hp" class="col-form-label">No. HP Customer:</label>
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ $customer->no_hp }}"
placeholder="Masukan Nomor Handphone customer" required>
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label>
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir"
value="{{ $customer->tgl_lahir }}" required>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label>
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required>
<option disabled>Pilih Jenis Kelamin Customer</option>
<option value="Laki-Laki" {{ $customer->jenis_kelamin === 'Laki-Laki' ? 'selected' : '' }}>Laki-Laki
</option>
<option value="Perempuan" {{ $customer->jenis_kelamin === 'Perempuan' ? 'selected' : '' }}>Perempuan
</option>
</select>
<label for="agama" class="col-form-label">Agama Customer:</label>
<select class="form-control" name="agama" id="agama" required>
<option disabled selected>Pilih Agama Customer</option>
<option value="Islam" {{ $customer->agama === 'Islam' ? 'selected' : '' }}>Islam</option>
<option value="Kristen" {{ $customer->agama === 'Kristen' ? 'selected' : '' }}>Kristen</option>
<option value="Katolik" {{ $customer->agama === 'Katolik' ? 'selected' : '' }}>Katolik</option>
<option value="Hindu" {{ $customer->agama === 'Hindu' ? 'selected' : '' }}>Hindu</option>
<option value="Buddha" {{ $customer->agama === 'Buddha' ? 'selected' : '' }}>Buddha</option>
<option value="Konghucu" {{ $customer->agama === 'Konghucu' ? 'selected' : '' }}>Konghucu</option>
<option value="Lainnya" {{ $customer->agama === 'Lainnya' ? 'selected' : '' }}>Lainnya</option>
</select>
<label for="address" class="col-form-label">Alamat Customer:</label> <label for="address" class="col-form-label">Alamat Customer:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea> <textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea>

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

@ -1,67 +1,72 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<div class="card shadow mb-4"> @include('layouts.components.alert-prompt')
<div class="card-header py-3"> @if (auth()->user()->role_id == 1)
<div class="row"> <div class="card shadow mb-4">
<div class="col-6"> <div class="card-header py-3">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5> <div class="row">
</div> <div class="col-6">
<div class="col-6 text-right"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Customer</h5>
<a href="{{ route('dashboard.customer.create') }}" class="btn btn-success btn-icon-split"> </div>
<span class="text">+ Tambah data</span> <div class="col-6 text-right">
</a> <a href="{{ route('dashboard.customer.create') }}" class="btn btn-success btn-icon-split">
<span class="text">+ Tambah data</span>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center">No</th>
<th>Nama</th>
<th>Kode Customer</th>
<th>No. HP</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nocustomer = 1;
@endphp
@forelse ($customer as $data_customer)
<tr> <tr>
<td class="text-center">{{ $nocustomer++ }}</td> <th class="text-center">No</th>
<td>{{ $data_customer->name }}</td> <th>Nama</th>
<td>{{ $data_customer->code_customer }}</td> <th>Kode Customer</th>
<td>{{ $data_customer->no_hp }}</td> <th>No. Telepon</th>
<td>{{ $data_customer->address }}</td> <th>Alamat</th>
<td class="text-center"> <th class="text-center">Action</th>
<a href="{{ route('dashboard.customer.show', [$data_customer->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.customer.edit', [$data_customer->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.customer.destroy', $data_customer->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @php
</tbody> $nocustomer = 1;
</table> @endphp
@forelse ($customer as $data_customer)
<tr>
<td class="text-center">{{ $nocustomer++ }}</td>
<td>{{ $data_customer->name }}</td>
<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>
@endforelse
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> @else
@include('pages.user.Master_Data.Customer.index')
@endif
@endsection @endsection

29
resources/views/dashboard/Master_Data/Customer/show.blade.php

@ -11,39 +11,20 @@
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Nama Customer:</label> <label for="name" class="col-form-label">Nama Customer:</label>
<input class="form-control" name="name" type="text" id="name" value="{{ $customer->name }}" <input class="form-control" value="{{ $customer->name }}" readonly>
readonly>
<label for="code_customer" class="col-form-label">Kode Customer:</label> <label for="code_customer" class="col-form-label">Kode Customer:</label>
<input class="form-control" name="code_customer" type="text" id="code_customer" <input class="form-control" value="{{ $customer->code_customer }}" readonly>
value="{{ $customer->code_customer }}" readonly>
<label for="lot_no" class="col-form-label">Lot Number:</label> <label for="lot_no" class="col-form-label">Lot Number:</label>
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" <input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}"
readonly> readonly>
<label for="nip" class="col-form-label">NIP Customer:</label> <label for="no_tlp" class="col-form-label">No. Telepon Customer:</label>
<input class="form-control" name="nip" type="text" id="nip" value="{{ $customer->nip }}" <input class="form-control" value="{{ $customer->no_tlp }}" readonly>
readonly>
<label for="no_hp" class="col-form-label">No. HP Customer:</label>
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ $customer->no_hp }}"
readonly>
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label>
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir"
value="{{ $customer->tgl_lahir }}" readonly>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label>
<input class="form-control" name="jenis_kelamin" type="text" id="jenis_kelamin"
value="{{ $customer->jenis_kelamin }}" readonly>
<label for="agama" class="col-form-label">Agama Customer:</label>
<input class="form-control" name="agama" type="text" id="agama" value="{{ $customer->agama }}"
readonly>
<label for="address" class="col-form-label">Alamat Customer:</label> <label for="address" class="col-form-label">Alamat Customer:</label>
<textarea class="form-control" name="address" id="address" readonly>{{ $customer->address }}</textarea> <textarea class="form-control" readonly>{{ $customer->address }}</textarea>
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a>

2
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

2
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

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

@ -10,83 +10,85 @@
} }
</style> </style>
<div class="card shadow mb-4"> @include('layouts.components.alert-prompt')
<div class="card-header py-3"> @if (auth()->user()->role_id == 1)
<div class="row"> <div class="card shadow mb-4">
<div class="col-6"> <div class="card-header py-3">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5> <div class="row">
</div> <div class="col-6">
<div class="col-6 text-right"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5>
<a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split"> </div>
<span class="text">Tambah Peti</span> <div class="col-6 text-right">
</a> <a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Peti</span>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center" style="width: 10px">No</th>
<th>User</th>
<th>Customer</th>
<th>WH</th>
<th>Kode Customer</th>
<th>Tipe Peti</th>
<th>Ukuran Peti</th>
<th>Lot No</th>
<th>Status Peti</th>
<th>Packing No</th>
<th>QR Code</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nopeti = 1;
@endphp
@forelse ($peti as $data_peti)
<tr> <tr>
<td class="text-center">{{ $nopeti++ }}</td> <th class="text-center" style="width: 10px">No</th>
<td>{{ $data_peti->created_by }}</td> <th>User</th>
<td>{{ $data_peti->customer->name }}</td> <th>Customer</th>
<td>{{ $data_peti->warehouse->name }}</td> <th>WH</th>
<td>{{ $data_peti->customer->code_customer }}</td> <th>Kode Customer</th>
<td>{{ $data_peti->tipe_peti->type }}</td> <th>Tipe Peti</th>
<td>{{ $data_peti->tipe_peti->size_peti }}</td> <th>Ukuran Peti</th>
<td>{{ $data_peti->customer->lot_no }}</td> <th>Lot No</th>
<td>{{ $data_peti->status_disposal }}</td> <th>Status Peti</th>
<td class="text-right">{{ $data_peti->packing_no }}</td> <th>Packing No</th>
<td>{{ $data_peti->fix_lot }}</td> <th>Fix Lot</th>
{{-- <td class="text-center"> <th class="text-center">Action</th>
{!! QrCode::size(80)->generate(route('dashboard.peti.show', $data_peti->id)) !!}
</td> --}}
<td class="text-center">
<a href="{{ route('dashboard.peti.show', [$data_peti->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.peti.edit', [$data_peti->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peti.destroy', $data_peti->id) }}" method="POST"
style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @php
</tbody> $nopeti = 1;
</table> @endphp
@forelse ($peti as $data_peti)
<tr>
<td class="text-center">{{ $nopeti++ }}</td>
<td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td>
<td>{{ $data_peti->customer->code_customer }}</td>
<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 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>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> @else
@include('pages.user.Master_Data.Manajemen_Peti.Peti.index')
@endif
@endsection @endsection

1
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php

@ -66,6 +66,7 @@
<td>1</td> <td>1</td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>

13
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php

@ -64,13 +64,16 @@
'Paking Number : ' . 'Paking Number : ' .
$peti->packing_no . $peti->packing_no .
"\n" . "\n" .
'Fix Lot : ' .
$peti->fix_lot .
"\n" .
'Status Peti : ' . 'Status Peti : ' .
$peti->status_disposal, $peti->status_disposal,
) !!} ) !!}
</div> </div>
<div class="d-flex justify-content-center mt-2 mb-3"> <div class="d-flex justify-content-center mt-2 mb-3">
<a href="{{ route('dashboard.peticetakpdf.cetakpdf', $peti->id) }}" class="btn btn-info">Cetak <a href="{{ route('dashboard.peticetakpdf.cetakpdf', $peti->id) }}" class="btn btn-info"
Label</a> target="_blank">Cetak Label</a>
</div> </div>
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
@ -79,4 +82,10 @@
</div> </div>
</div> </div>
</div> </div>
<script>
function bukaPdfDiTabBaru() {
window.open("{{ route('dashboard.peticetakpdf.cetakpdf', $peti->id) }}", "_blank");
}
</script>
@endsection @endsection

2
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

2
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php

@ -1,5 +1,7 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

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

@ -1,65 +1,70 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<div class="card shadow mb-4"> @include('layouts.components.alert-prompt')
<div class="card-header py-3"> @if (auth()->user()->role_id == 1)
<div class="row"> <div class="card shadow mb-4">
<div class="col-6"> <div class="card-header py-3">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Tipe Peti</h5> <div class="row">
</div> <div class="col-6">
<div class="col-6 text-right"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Tipe Peti</h5>
<a href="{{ route('dashboard.typepeti.create') }}" class="btn btn-success btn-icon-split"> </div>
<span class="text">Tambah Tipe Peti</span> <div class="col-6 text-right">
</a> <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> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center" style="width: 20px">No</th>
<th>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> <tr>
<td class="text-center">{{ $notype++ }}</td> <th class="text-center" style="width: 20px">No</th>
<td>{{ $data_typepeti->type }}</td> <th>Tipe Peti</th>
<td>{{ $data_typepeti->size_peti }}</td> <th>Ukuran Peti</th>
<td>{{ $data_typepeti->description }}</td> <th>Deskripsi Peti</th>
<td class="text-center"> <th class="text-center">Action</th>
<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> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @php
</tbody> $notype = 1;
</table> @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>
</div> </div>
</div> @else
@include('pages.user.Master_Data.Manajemen_Peti.Type_peti.index')
@endif
@endsection @endsection

7
resources/views/dashboard/Master_Data/Role/index.blade.php

@ -1,7 +1,8 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Role') @section('title', 'Role')
@section('content') @section('content')
<div class="container-fluid"> @include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
@ -59,7 +60,9 @@
</div> </div>
</div> </div>
</div> </div>
</div> @else
@include('pages.user.Master_Data.Role.index')
@endif
<!-- Edit Data Modal--> <!-- Edit Data Modal-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" <div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"

2
resources/views/dashboard/Master_Data/User/create.blade.php

@ -1,6 +1,8 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Tambah User') @section('title', 'Tambah User')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

2
resources/views/dashboard/Master_Data/User/edit.blade.php

@ -1,6 +1,8 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Update Data User') @section('title', 'Update Data User')
@section('content') @section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">

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

@ -1,80 +1,85 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<div class="card shadow mb-4"> @include('layouts.components.alert-prompt')
<div class="card-header py-3"> @if (auth()->user()->role_id == 1)
<div class="row"> <div class="card shadow mb-4">
<div class="col-6"> <div class="card-header py-3">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5> <div class="row">
</div> <div class="col-6">
<div class="col-6 text-right"> <h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
<a href="{{ route('dashboard.user.create') }}" class="btn btn-success btn-icon-split"> </div>
<span class="text">+ Tambah data</span> <div class="col-6 text-right">
</a> <a href="{{ route('dashboard.user.create') }}" class="btn btn-success btn-icon-split">
<span class="text">+ Tambah data</span>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th>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> <tr>
<td class="text-center">{{ $noUser++ }}</td> <th>No</th>
<td>{{ $data->fullname }}</td> <th>Nama</th>
<td>{{ $data->email }}</td> <th>Email</th>
<td>{{ isset($data->no_hp) ? $data->no_hp : '-' }}</td> <th>No. HP</th>
<td>{{ isset($data->address) ? $data->address : '-' }}</td> <th>Alamat</th>
<td>{{ $data->warehouse->name }}</td> <th>Ditugaskan</th>
<td class="text-center"> <th class="text-center">Action</th>
<a href="{{ route('dashboard.user.show', [$data->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('dashboard.user.edit', [$data->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.user.destroy', $data->id) }}" method="POST"
style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr> </tr>
@empty </thead>
<p>Data Kosong</p> <tfoot>
@endforelse <tr>
</tbody> <th>No</th>
</table> <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>
<a href="{{ route('dashboard.user.edit', [$data->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.user.destroy', $data->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>
</div> </div>
</div> @else
@include('pages.user.Master_Data.User.index')
@endif
@endsection @endsection

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

@ -1,17 +1,19 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Warehouse') @section('title', 'Warehouse')
@section('content') @section('content')
<div class="container-fluid">
@include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Warehouse</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Gudang</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
data-target="#tambahDataModal"> data-target="#tambahDataModal">
<span class="text">Tambah Data Warehouse</span> <span class="text">Tambah Data Gudang</span>
</a> </a>
</a> </a>
</div> </div>
@ -23,7 +25,7 @@
<thead> <thead>
<tr> <tr>
<th class="text-center" style="width: 50px;">No.</th> <th class="text-center" style="width: 50px;">No.</th>
<th>Nama Warehouse</th> <th>Nama Gudang</th>
<th>Deskripsi</th> <th>Deskripsi</th>
<th>Alamat</th> <th>Alamat</th>
<th class="text-center">Action</th> <th class="text-center">Action</th>
@ -63,7 +65,9 @@
</div> </div>
</div> </div>
</div> @else
@include('pages.user.Master_Data.Warehouse.index')
@endif
<!-- Modal Tambah--> <!-- Modal Tambah-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" <div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
@ -71,7 +75,7 @@
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Tambah Data Warehouse</h5> <h5 class="modal-title" id="exampleModalLabel">Tambah Data Gudang</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
@ -107,7 +111,7 @@
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Edit Data Asset</h5> <h5 class="modal-title" id="exampleModalLabel">Edit Data Gudang</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>

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

@ -1,67 +1,68 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Peminjaman')
@section('content') @section('content')
<div class="card shadow mb-4"> @if (auth()->user()->role_id == 1)
<div class="card-header py-3"> <div class="card shadow mb-4">
<div class="row"> <div class="card-header py-3">
<div class="col-6"> <div class="row">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peminjaman</h5> <div class="col-6">
</div> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Peminjaman</h5>
<div class="col-6 text-right"> </div>
<a href="{{ route('dashboard.peminjaman.create') }}" class="btn btn-success btn-icon-split"> <div class="col-6 text-right">
<span class="text">Tambah Peminjaman</span> <a href="{{ route('dashboard.peminjaman.create') }}" class="btn btn-success btn-icon-split">
</a> <span class="text">Tambah Peminjaman</span>
</a> </a>
</a>
</div>
</div> </div>
</div> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <thead>
<thead>
<tr>
<th class="text-center">No</th>
<th>Kode Peti</th>
<th>Nama Customer</th>
<th>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> <tr>
<td class="text-center">{{ $no_peminjaman++ }}</td> <th class="text-center">No</th>
<td>{{ $data_peminjaman->peti->customer->code_customer }} - <th>Kode Peti</th>
{{ $data_peminjaman->peti->tipe_peti->type }}</td> <th>Nama Customer</th>
<td>{{ $data_peminjaman->peti->customer->name }}</td> <th>Tgl Peminjaman</th>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td> <th>PJ Peminjaman</th>
<td>{{ $data_peminjaman->exit_pic }}</td> <th>Asal Gudang</th>
<td>{{ $data_peminjaman->warehouse->name }}</td> <th class="text-center">Action</th>
<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> </tr>
@empty </thead>
<p>Data Kosong</p> <tbody>
@endforelse @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
{{--
@foreach ($peminjaman as $data) @foreach ($peminjaman as $data)
<tr> <tr>
<td class="text-center">{{ $no_peminjaman++ }}</td> <td class="text-center">{{ $no_peminjaman++ }}</td>
@ -72,9 +73,12 @@
</tr> </tr>
@endforeach --}} @endforeach --}}
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> @else
@include('pages.user.Peminjaman.index')
@endif
@endsection @endsection

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

@ -9,7 +9,7 @@
white-space: nowrap; white-space: nowrap;
} }
</style> </style>
<div class="container-fluid"> @if (auth()->user()->role_id == 1)
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Data Pengembalian</h6> <h6 class="m-0 font-weight-bold text-primary">Data Pengembalian</h6>
@ -39,7 +39,7 @@
@endphp @endphp
{{-- @foreach ($peminjaman as $data) {{-- @foreach ($peminjaman as $data)
@endforeach --}} @endforeach --}}
@forelse ($peminjaman as $data) @forelse ($peminjaman as $data)
<tr> <tr>
<td>{{ $no_peminjaman++ }}</td> <td>{{ $no_peminjaman++ }}</td>
@ -98,6 +98,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> @else
<!-- /.container-fluid --> @include('pages.user.Pengembalian.index')
@endif
@endsection @endsection

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

@ -1,5 +1,4 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Dashboard')
@section('content') @section('content')
<div class="container-fluid"> <div class="container-fluid">
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="d-sm-flex align-items-center justify-content-between mb-4">

1
resources/views/dashboard/peminjaman.blade.php

@ -1 +0,0 @@
{{--

26
resources/views/layouts/components/alert-prompt.blade.php

@ -0,0 +1,26 @@
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@if (Session::has('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>{{ Session::get('success') }}</strong>
</div>
@endif
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
setTimeout(function() {
$(".alert.alert-danger, .alert.alert-success").fadeOut(500, function() {
$(this).remove();
});
}, 5000); // 5 detik
});
</script>

4
resources/views/layouts/main.blade.php

@ -28,7 +28,7 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- allert update data foto --> <!-- allert update data foto -->
@if (session()->has('success')) {{-- @if (session()->has('success'))
<div id="success-alert" class="alert alert-success floating-alert"> <div id="success-alert" class="alert alert-success floating-alert">
{{ session()->get('success') }} {{ session()->get('success') }}
</div> </div>
@ -36,7 +36,7 @@
<div id="error-alert" class="alert alert-danger floating-alert"> <div id="error-alert" class="alert alert-danger floating-alert">
X {{ session()->get('error') }} X {{ session()->get('error') }}
</div> </div>
@endif @endif --}}
<!-- Main Bar --> <!-- Main Bar -->
@yield('content') @yield('content')

175
resources/views/layouts/sidebar.blade.php

@ -1,101 +1,102 @@
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"> <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand --> @if (auth()->user()->role_id == 1)
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/dashboard') }}"> <!-- Sidebar - Brand -->
<div class="sidebar-brand-icon rotate-n-15"> <a class="sidebar-brand d-flex align-items-center justify-content-center"
<i class="fas fa-laugh-wink"></i> href="{{ route('dashboard.home.admin') }}">
</div> <div class="sidebar-brand-icon rotate-n-15">
<div class="sidebar-brand-text mx-3">SIOPAS</div> <i class="fas fa-laugh-wink"></i>
</a> </div>
<div class="sidebar-brand-text mx-3">SIOPAS</div>
</a>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider my-0"> <hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard --> <!-- Nav Item - Dashboard -->
<li class="nav-item {{ $active == 'menu-dashboard' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-admin' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.admin') }}"> <a class="nav-link" href="{{ route('dashboard.home.admin') }}">
<i class="fas fa-fw fa-tachometer-alt"></i> <i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a> <span>Dashboard</span></a>
</li> </li>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider"> <hr class="sidebar-divider">
<li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}"> <a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}">
<i class="fas fa-fw fa-upload"></i> <i class="fas fa-fw fa-upload"></i>
<span>Peminjaman</span> <span>Peminjaman</span>
</a> </a>
</li> </li>
<li class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.pengembalian.index') }}"> <a class="nav-link" href="{{ route('dashboard.pengembalian.index') }}">
<i class="fas fa-fw fa-download"></i> <i class="fas fa-fw fa-download"></i>
<span>Pengembalian</span> <span>Pengembalian</span>
</a> </a>
</li> </li>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider"> <hr class="sidebar-divider">
<!-- Heading --> <!-- Heading -->
<div class="sidebar-heading"> <div class="sidebar-heading">
Master Data Master Data
</div> </div>
@php
$isUserActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
<li class="nav-item"> @php
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo" $isUserActive = in_array($active, ['menu-user', 'menu-role']);
aria-expanded="{{ $isUserActive ? 'true' : 'false' }}" aria-controls="collapseTwo"> @endphp
<i class="fas fa-fw fa-user"></i>
<span>Manajemen User</span> <li class="nav-item">
</a> <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo"
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar"> aria-expanded="{{ $isUserActive ? 'true' : 'false' }}" aria-controls="collapseTwo">
<div class="bg-white py-2 collapse-inner rounded"> <i class="fas fa-fw fa-user"></i>
<a class="collapse-item {{ $active == 'menu-user' ? 'active' : '' }}" <span>Manajemen User</span>
href="{{ route('dashboard.user.index') }}">User</a> </a>
<a class="collapse-item {{ $active == 'menu-role' ? 'active' : '' }}" <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
href="{{ route('dashboard.role.index') }}">Role</a> <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> </div>
</div> </li>
</li> <li class="nav-item {{ $active == 'menu-customer' ? 'active' : '' }}">
<li class="nav-item {{ $active == 'menu-customer' ? 'active' : '' }}"> <a class="nav-link" href="{{ route('dashboard.customer.index') }}">
<a class="nav-link" href="{{ route('dashboard.customer.index') }}"> <i class="fas fa-fw fa-users"></i>
<i class="fas fa-fw fa-users"></i> <span>Customer</span>
<span>Customer</span> </a>
</a> </li>
</li> @php
@php $isPetiActive = in_array($active, ['menu-user', 'menu-role']);
$isPetiActive = in_array($active, ['menu-user', 'menu-role']); @endphp
@endphp
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsepeti" <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsepeti"
aria-expanded="{{ $isPetiActive ? 'true' : 'false' }}" aria-controls="collapsepeti"> aria-expanded="{{ $isPetiActive ? 'true' : 'false' }}" aria-controls="collapsepeti">
<i class="fas fa-fw fa-user"></i> <i class="fas fa-fw fa-user"></i>
<span>Manajemen Peti</span> <span>Manajemen Peti</span>
</a> </a>
<div id="collapsepeti" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar"> <div id="collapsepeti" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded"> <div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'menu-typepeti' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'menu-typepeti' ? 'active' : '' }}"
href="{{ route('dashboard.typepeti.index') }}">Tipe Peti</a> href="{{ route('dashboard.typepeti.index') }}">Tipe Peti</a>
<a class="collapse-item {{ $active == 'menu-peti' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'menu-peti' ? 'active' : '' }}"
href="{{ route('dashboard.peti.index') }}">Peti</a> href="{{ route('dashboard.peti.index') }}">Peti</a>
</div>
</div> </div>
</div> </li>
</li> <li class="nav-item {{ $active == 'menu-warehouse' ? 'active' : '' }}">
{{-- <li class="nav-item {{ $active == 'menu-asset' ? 'active' : '' }}"> <a class="nav-link" href="{{ route('dashboard.warehouse.index') }}">
<a class="nav-link" href="{{ route('dashboard.asset.index') }}"> <i class="fas fa-fw fa-table"></i>
<i class="fas fa-fw fa-chart-area"></i> <span>Warehouse</span>
<span>Asset</span> </a>
</a> </li>
</li> --}} @else
<li class="nav-item {{ $active == 'menu-warehouse' ? 'active' : '' }}"> @include('pages.layouts.sidebar_user')
<a class="nav-link" href="{{ route('dashboard.warehouse.index') }}"> @endif
<i class="fas fa-fw fa-table"></i>
<span>Warehouse</span>
</a>
</li>
<!-- Divider --> <!-- Divider -->
<hr class="sidebar-divider d-none d-md-block"> <hr class="sidebar-divider d-none d-md-block">

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

@ -0,0 +1,91 @@
<!-- 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>
</div>
<div class="sidebar-brand-text mx-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') }}">
<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>
</a>
</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>
</a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<!-- Heading -->
<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-user"></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-users"></i>
<span>Customer</span>
</a>
</li>
@php
$isPetiActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
<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>
<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-peti' ? 'active' : '' }}"
href="{{ route('dashboard.peti.index') }}">Peti</a>
</div>
</div>
</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>
<span>Warehouse</span>
</a>
</li>

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

@ -0,0 +1,64 @@
<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 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">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center">No</th>
<th>Nama</th>
<th>Kode Customer</th>
<th>No. Telepon</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nocustomer = 1;
@endphp
@forelse ($customer as $data_customer)
<tr>
<td class="text-center">{{ $nocustomer++ }}</td>
<td>{{ $data_customer->name }}</td>
<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>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

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

@ -0,0 +1,76 @@
<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 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">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 10px">No</th>
<th>User</th>
<th>Customer</th>
<th>WH</th>
<th>Kode Customer</th>
<th>Tipe Peti</th>
<th>Ukuran Peti</th>
<th>Lot No</th>
<th>Status Peti</th>
<th>Packing No</th>
<th>Fix Lot</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nopeti = 1;
@endphp
@forelse ($peti as $data_peti)
<tr>
<td class="text-center">{{ $nopeti++ }}</td>
<td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td>
<td>{{ $data_peti->customer->code_customer }}</td>
<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 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>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>

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

@ -0,0 +1,62 @@
<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>

34
resources/views/pages/user/Master_Data/Role/index.blade.php

@ -0,0 +1,34 @@
<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 Role</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: 50px;">No</th>
<th>Nama Role</th>
<th>Deskripsi</th>
</tr>
</thead>
<tbody>
@php
$norole = 1;
@endphp
@foreach ($role as $data_role)
<tr>
<td class="text-center">{{ $norole++ }}</td>
<td>{{ $data_role->name }}</td>
<td>{{ $data_role->description }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

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

@ -0,0 +1,59 @@
<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>

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

@ -0,0 +1,37 @@
<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 Gudang</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: 50px;">No.</th>
<th>Nama Gudang</th>
<th>Deskripsi</th>
<th>Alamat</th>
</tr>
</thead>
<tbody>
@php
$nowarehouses = 1;
@endphp
@foreach ($warehouses as $data)
<tr>
<td class="text-center" style="width: 50px;">{{ $nowarehouses++ }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->address }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

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

@ -0,0 +1,65 @@
<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

@ -0,0 +1,88 @@
<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>

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

@ -0,0 +1,194 @@
@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

12
routes/web.php

@ -42,6 +42,7 @@ Route::middleware('auth')->group(function () {
Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(function () { Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(function () {
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home.admin'); Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home.admin');
Route::get('/homeuser', [App\Http\Controllers\HomeController::class, 'indexUser'])->name('home.user');
//Halaman Warehouse //Halaman Warehouse
Route::controller(WarehouseController::class)->group(function () { Route::controller(WarehouseController::class)->group(function () {
@ -59,17 +60,6 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::delete('role/delete/{id}', 'destroy')->name('role.destroy'); Route::delete('role/delete/{id}', 'destroy')->name('role.destroy');
}); });
//Halaman Asset
// Route::controller(M_assetController::class)->group(function () {
// Route::get('asset', 'index')->name('asset.index');
// Route::post('asset/store', 'store')->name('asset.store');
// Route::get('asset/{id}', 'show')->name('asset.show');
// Route::put('asset/{id}', 'update')->name('asset.update');
// Route::delete('asset/delete/{id}', 'destroy')->name('asset.destroy');
// Route::get('/assetcetak_pdf', [M_assetController::class, 'cetakpdf'])->name('assetcetakpdf.cetakpdf');
// Route::get('/assetexport', [M_assetController::class, 'export'])->name('assetexport.export');
// });
//Halaman User //Halaman User
Route::controller(M_userController::class)->group(function () { Route::controller(M_userController::class)->group(function () {
Route::get('user', 'index')->name('user.index'); Route::get('user', 'index')->name('user.index');

Loading…
Cancel
Save