Browse Source

update validasi dan hak akses

master
Gunawan19621 1 year ago
parent
commit
a8681f1406
  1. 2
      app/Http/Controllers/Auth/RedirectAuthController.php
  2. 12
      app/Http/Controllers/CustomerController.php
  3. 14
      app/Http/Controllers/HomeController.php
  4. 150
      app/Http/Controllers/PetiController.php
  5. 24
      app/Http/Controllers/RoleController.php
  6. 20
      app/Http/Controllers/TypePetiController.php
  7. 3
      app/Http/Requests/ValidasiCreateCustomer.php
  8. 60
      app/Http/Requests/ValidasiCreatePeti.php
  9. 40
      app/Http/Requests/ValidasiCreateRole.php
  10. 44
      app/Http/Requests/ValidasiCreateType_Peti.php
  11. 52
      app/Http/Requests/ValidasiUpdateCustomer.php
  12. 59
      app/Http/Requests/ValidasiUpdatePeti.php
  13. 40
      app/Http/Requests/ValidasiUpdateRole.php
  14. 44
      app/Http/Requests/ValidasiUpdateType_Peti.php
  15. 78
      app/Http/Requests/ValidasiUpdateUser.php
  16. 6
      database/migrations/2023_10_23_075239_create_m_roles_table.php
  17. 8
      database/migrations/2023_10_28_083930_create_type_petis_table.php
  18. 8
      database/seeders/Type_Peti.php
  19. 22
      resources/views/auth/login.blade.php
  20. 84
      resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php
  21. 231
      resources/views/dashboard/Master_Data/Asset/index.blade.php
  22. 65
      resources/views/dashboard/Master_Data/Asset/show.blade.php
  23. 1
      resources/views/dashboard/Master_Data/Customer/create.blade.php
  24. 2
      resources/views/dashboard/Master_Data/Customer/edit.blade.php
  25. 120
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  26. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php
  27. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php
  28. 148
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  29. 1
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php
  30. 13
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php
  31. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php
  32. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php
  33. 117
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  34. 7
      resources/views/dashboard/Master_Data/Role/index.blade.php
  35. 7
      resources/views/dashboard/Master_Data/User/create.blade.php
  36. 2
      resources/views/dashboard/Master_Data/User/edit.blade.php
  37. 146
      resources/views/dashboard/Master_Data/User/index.blade.php
  38. 117
      resources/views/dashboard/Master_Data/Warehouse/index.blade.php
  39. 126
      resources/views/dashboard/Peminjaman/index.blade.php
  40. 9
      resources/views/dashboard/Pengembalian/index.blade.php
  41. 1
      resources/views/dashboard/index.blade.php
  42. 1
      resources/views/dashboard/peminjaman.blade.php
  43. 175
      resources/views/layouts/sidebar.blade.php
  44. 91
      resources/views/pages/layouts/sidebar_user.blade.php
  45. 64
      resources/views/pages/user/Master_Data/Customer/index.blade.php
  46. 76
      resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php
  47. 62
      resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  48. 34
      resources/views/pages/user/Master_Data/Role/index.blade.php
  49. 59
      resources/views/pages/user/Master_Data/User/index.blade.php
  50. 37
      resources/views/pages/user/Master_Data/Warehouse/index.blade.php
  51. 65
      resources/views/pages/user/Peminjaman/index.blade.php
  52. 88
      resources/views/pages/user/Pengembalian/index.blade.php
  53. 194
      resources/views/pages/user/index.blade.php
  54. 12
      routes/web.php

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

@ -15,7 +15,7 @@ class RedirectAuthController extends Controller
// Admin
return redirect()->route('dashboard.home.admin');
} else {
return redirect()->route('dashboard.home.admin');
return redirect()->route('dashboard.home.user');
// User (role_id selain 1)
// return redirect()->route('dashboard.home.user');
}

12
app/Http/Controllers/CustomerController.php

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreateCustomer;
use App\Http\Requests\ValidasiUpdateCustomer;
use App\Models\Customer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@ -76,17 +77,8 @@ class CustomerController extends Controller
/**
* 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',
'no_tlp' => 'required',
'address' => 'required',
]);
// dd($request);
try {
$customer = Customer::findOrFail($id);
$customerData = $request->all();

14
app/Http/Controllers/HomeController.php

@ -15,11 +15,23 @@ class HomeController extends Controller
'jumlahAsset' => \App\Models\m_asset::count(),
'jumlahPeminjaman' => \App\Models\asset_status::count(),
'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
'active' => 'menu-dashboard',
'active' => 'menu-admin',
];
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()
{

150
app/Http/Controllers/PetiController.php

@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use App\Http\Requests\ValidasiCreatePeti;
use App\Http\Requests\ValidasiUpdatePeti;
use Dompdf\Dompdf;
use Dompdf\Options;
use App\Models\Peti;
@ -44,21 +46,8 @@ class PetiController extends Controller
/**
* 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 {
$currenttype = Auth::user();
@ -160,17 +149,8 @@ class PetiController extends Controller
/**
* 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 {
$currentuser = Auth::user();
$typepeti = Peti::findOrFail($id);
@ -219,58 +199,74 @@ class PetiController extends Controller
public function cetakPdf($id)
{
$peti = Peti::find($id);
// Generate QR Code
$qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate(
'Nama Customer : ' .
$peti->customer->name .
"\n" .
'Code Customer : ' .
$peti->customer->code_customer .
"\n" .
'ID Peti : ' .
$peti->tipe_peti->id .
"\n" .
'Type Peti : ' .
$peti->tipe_peti->type .
"\n" .
'ID Warehouse : ' .
$peti->warehouse->id .
"\n" .
'Warehouse : ' .
$peti->warehouse->name .
"\n" .
'Ukuran Peti : ' .
$peti->tipe_peti->size_peti .
"\n" .
'Lot Number : ' .
$peti->customer->lot_no .
"\n" .
'Paking Number : ' .
$peti->packing_no .
"\n" .
'Status Peti : ' .
$peti->status_disposal
));
// Inisialisasi Dompdf
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isPhpEnabled', true);
$dompdf = new Dompdf($options);
// Load HTML dari view
$html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render();
// Load HTML ke Dompdf
$dompdf->loadHtml($html);
// Render PDF (portrait A4)
$dompdf->setPaper('A4', 'horizontal');
$dompdf->render();
// Menggunakan stream untuk menghasilkan dan mengunduh PDF
return $dompdf->stream('Label_Peti.pdf');
try {
$peti = Peti::find($id);
// Generate QR Code
$qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate(
'Nama Customer : ' .
$peti->customer->name .
"\n" .
'Code Customer : ' .
$peti->customer->code_customer .
"\n" .
'ID Peti : ' .
$peti->tipe_peti->id .
"\n" .
'Type Peti : ' .
$peti->tipe_peti->type .
"\n" .
'ID Warehouse : ' .
$peti->warehouse->id .
"\n" .
'Warehouse : ' .
$peti->warehouse->name .
"\n" .
'Ukuran Peti : ' .
$peti->tipe_peti->size_peti .
"\n" .
'Lot Number : ' .
$peti->customer->lot_no .
"\n" .
'Paking Number : ' .
$peti->packing_no .
"\n" .
'Fix Lot : ' .
$peti->fix_lot .
'Status Peti : ' .
$peti->status_disposal
));
// Inisialisasi Dompdf
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$options->set('defaultFont', 'Arial');
$dompdf = new Dompdf($options);
// Load HTML dari view
$html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render();
$dompdf->loadHtml($html);
// Render PDF (portrait A4)
$dompdf->setPaper('A4', 'portrait');
$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 Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests\ValidasiCreateRole;
use App\Http\Requests\ValidasiUpdateRole;
class RoleController extends Controller
{
@ -31,12 +33,8 @@ class RoleController extends Controller
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
public function store(ValidasiCreateRole $request)
{
$request->validate([
'name' => 'required',
'description' => 'required',
]);
try {
$currentUser = Auth::user();
$validatedData = $request->except('_token');
@ -71,9 +69,21 @@ class RoleController extends Controller
/**
* 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;
use App\Http\Requests\ValidasiCreateType_Peti;
use App\Http\Requests\ValidasiUpdateType_Peti;
use App\Models\Type_peti;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@ -34,15 +36,8 @@ class TypePetiController extends Controller
/**
* 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 {
$currenttype = Auth::user();
$validatedData = $request->except('_token');
@ -84,15 +79,8 @@ class TypePetiController extends Controller
/**
* 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 {
$typepeti = Type_peti::findOrFail($id);
$typepetiData = $request->all();

3
app/Http/Requests/ValidasiCreateCustomer.php

@ -25,7 +25,7 @@ class ValidasiCreateCustomer extends FormRequest
'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|max:20',
'no_tlp' => 'required|numeric',
'address' => 'required|string',
];
}
@ -42,7 +42,6 @@ class ValidasiCreateCustomer extends FormRequest
'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.',
'lot_no.max' => 'Kolom lot_no tidak boleh lebih dari :max karakter.',
'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.',

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',
];
}
}

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.',
];
}
}

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) {
$table->id();
$table->string('name', 200)->nullable();
$table->string('name', 50)->nullable();
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
$table->string('created_by', 50)->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) {
$table->id();
$table->string('type');
$table->string('size_peti');
$table->string('type', 20);
$table->string('size_peti', 25);
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
$table->string('created_by', 50)->nullable();
$table->string('updated_by', 50)->nullable();
});
}

8
database/seeders/Type_Peti.php

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

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

@ -50,7 +50,7 @@
required autofocus autocomplete="username"
placeholder="Masukan Email anda">
@if ($errors->has('email'))
<div class="alert alert-danger">
<div class="alert alert-danger rounded mt-1">
{{ $errors->first('email') }}
</div>
@endif
@ -59,12 +59,8 @@
<input type="password" class="form-control form-control-user" id="password"
name="password" required autocomplete="current-password"
placeholder="Masukan password anda">
@if ($errors->has('password'))
<div class="alert alert-danger">
{{ $errors->first('password') }}
</div>
@endif
</div>
<div class="form-group">
<div class="custom-control custom-checkbox small">
<input id="remember_me" type="checkbox" name="remember"
@ -79,21 +75,7 @@
Login
</button>
<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>
<!-- <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">
<label class="small">Copy Rigth SIOPAS</label>
</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

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

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

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

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

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

@ -1,68 +1,72 @@
@extends('layouts.main')
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data 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>
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data 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>
<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)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<td class="text-center">{{ $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>
<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>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>
</div>
@else
@include('pages.user.Master_Data.Customer.index')
@endif
@endsection

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

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

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

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

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

@ -10,83 +10,85 @@
}
</style>
<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>
@include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data 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>
<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>QR Code</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nopeti = 1;
@endphp
@forelse ($peti as $data_peti)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<td class="text-center">{{ $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">
{!! 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>
<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>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>
</div>
@else
@include('pages.user.Master_Data.Manajemen_Peti.Peti.index')
@endif
@endsection

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

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

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

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

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

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

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

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

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

@ -1,65 +1,70 @@
@extends('layouts.main')
@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 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>
@include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data 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>
<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)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<td class="text-center">{{ $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>
<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>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>
</div>
@else
@include('pages.user.Master_Data.Manajemen_Peti.Type_peti.index')
@endif
@endsection

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

@ -1,7 +1,8 @@
@extends('layouts.main')
@section('title', 'Role')
@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-header py-3">
<div class="row">
@ -59,7 +60,9 @@
</div>
</div>
</div>
</div>
@else
@include('pages.user.Master_Data.Role.index')
@endif
<!-- Edit Data Modal-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"

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

@ -1,6 +1,8 @@
@extends('layouts.main')
@section('title', 'Tambah User')
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
@ -9,11 +11,6 @@
</div>
</div>
</div>
@include('layouts.components.alert-prompt')
<div class="card-body">
<form action="{{ route('dashboard.user.store') }}" method="POST" enctype="multipart/form-data">
@csrf

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

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

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

@ -1,81 +1,85 @@
@extends('layouts.main')
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.user.create') }}" class="btn btn-success btn-icon-split">
<span class="text">+ Tambah data</span>
</a>
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
</div>
<div class="col-6 text-right">
<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 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)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<td class="text-center">{{ $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>
<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>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</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>
<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>
@else
@include('pages.user.Master_Data.User.index')
@endif
@endsection

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

@ -3,66 +3,71 @@
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Warehouse</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 Warehouse</span>
</a>
</a>
@if (auth()->user()->role_id == 1)
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Gudang</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 Gudang</span>
</a>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 50px;">No.</th>
<th>Nama Warehouse</th>
<th>Deskripsi</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$nowarehouses = 1;
@endphp
@foreach ($warehouses as $data)
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<td class="text-center" style="width: 50px;">{{ $nowarehouses++ }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->address }}</td>
<td class="text-center">
<a href="#" data-toggle="modal" data-target="#editDataModal{{ $data['id'] }}">
<i class="fa fa-edit" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.warehouse.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>
<th class="text-center" style="width: 50px;">No.</th>
<th>Nama Gudang</th>
<th>Deskripsi</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
@endforeach
</tbody>
</table>
</div>
</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>
<td class="text-center">
<a href="#" data-toggle="modal"
data-target="#editDataModal{{ $data['id'] }}">
<i class="fa fa-edit" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.warehouse.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>
</div>
@else
@include('pages.user.Master_Data.Warehouse.index')
@endif
<!-- Modal Tambah-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
@ -70,7 +75,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<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">
<span aria-hidden="true">&times;</span>
</button>
@ -106,7 +111,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<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">
<span aria-hidden="true">&times;</span>
</button>

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

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

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

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

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

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

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

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

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

@ -1,101 +1,102 @@
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/dashboard') }}">
<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>
@if (auth()->user()->role_id == 1)
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center"
href="{{ route('dashboard.home.admin') }}">
<div class="sidebar-brand-icon rotate-n-15">
<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">
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ $active == 'menu-dashboard' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.admin') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a>
</li>
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ $active == 'menu-admin' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.home.admin') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<!-- 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>
<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">
<!-- Divider -->
<hr class="sidebar-divider">
<!-- Heading -->
<div class="sidebar-heading">
Master Data
</div>
@php
$isUserActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
<!-- Heading -->
<div class="sidebar-heading">
Master Data
</div>
<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>
@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>
</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>
<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>
<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>
</div>
</li>
{{-- <li class="nav-item {{ $active == 'menu-asset' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.asset.index') }}">
<i class="fas fa-fw fa-chart-area"></i>
<span>Asset</span>
</a>
</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>
</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>
@else
@include('pages.layouts.sidebar_user')
@endif
<!-- Divider -->
<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::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
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');
});
//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
Route::controller(M_userController::class)->group(function () {
Route::get('user', 'index')->name('user.index');

Loading…
Cancel
Save