Browse Source

update tambahan peti

master
Gunawan19621 1 year ago
parent
commit
ea83870d5e
  1. 134
      app/Http/Controllers/CustomerController.php
  2. 182
      app/Http/Controllers/PetiController.php
  3. 123
      app/Http/Controllers/TypePetiController.php
  4. 27
      app/Models/Customer.php
  5. 40
      app/Models/Peti.php
  6. 21
      app/Models/Type_peti.php
  7. 39
      database/migrations/2023_10_28_080457_create_customers_table.php
  8. 33
      database/migrations/2023_10_28_083930_create_type_petis_table.php
  9. 42
      database/migrations/2023_10_28_085238_create_petis_table.php
  10. 43
      database/seeders/Customer.php
  11. 2
      database/seeders/DatabaseSeeder.php
  12. 32
      database/seeders/Type_Peti.php
  13. 12
      resources/views/dashboard/Master_Data/Asset/index.blade.php
  14. 68
      resources/views/dashboard/Master_Data/Customer/create.blade.php
  15. 72
      resources/views/dashboard/Master_Data/Customer/edit.blade.php
  16. 67
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  17. 53
      resources/views/dashboard/Master_Data/Customer/show.blade.php
  18. 63
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php
  19. 69
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php
  20. 92
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  21. 69
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php
  22. 33
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php
  23. 35
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php
  24. 65
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  25. 29
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/show.blade.php
  26. 2
      resources/views/dashboard/Master_Data/User/index.blade.php
  27. 9
      resources/views/layouts/main.blade.php
  28. 50
      resources/views/layouts/sidebar.blade.php
  29. 45
      routes/web.php

134
app/Http/Controllers/CustomerController.php

@ -0,0 +1,134 @@
<?php
namespace App\Http\Controllers;
use App\Models\Customer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = [
'customer' => Customer::all(),
'active' => 'menu-customer',
];
return view('dashboard.Master_Data.Customer.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data = [
'active' => 'menu-customer',
];
return view('dashboard.Master_Data.Customer.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// dd('oke');
$request->validate([
'name' => 'required',
'code_customer' => 'required',
'lot_no' => 'required',
'nip' => '',
'no_hp' => 'required',
'tgl_lahir' => '',
'jenis_kelamin' => '',
'agama' => '',
'address' => 'required',
]);
try {
$currentUser = Auth::user();
$validatedData = $request->except('_token');
$validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by
Customer::create($validatedData);
return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil ditambahkan');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data customer Gagal Ditambah.');
}
}
/**
* Display the specified resource.
*/
public function show($id)
{
$data = [
'customer' => Customer::findOrFail($id),
'active' => 'menu-customer',
];
return view('dashboard.Master_Data.Customer.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data = [
'customer' => Customer::findOrFail($id),
'active' => 'menu-customer',
];
return view('dashboard.Master_Data.Customer.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
// dd($request->all());
$request->validate([
'name' => 'required',
'code_customer' => 'required',
'lot_no' => 'required',
'nip' => 'required',
'no_hp' => 'required',
'tgl_lahir' => 'required',
'jenis_kelamin' => 'required',
'agama' => 'required',
'address' => 'required',
]);
// dd($request);
try {
$customer = Customer::findOrFail($id);
$customerData = $request->all();
// Menambahkan nama pengguna yang melakukan pembaruan
$customerData['updated_by'] = Auth::user()->fullname;
$customer->update($customerData);
return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil diperbaharui');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data customer gagal diperbaharui');
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
// dd("oke");
try {
$customer = Customer::findOrFail($id);
$customer->delete();
return redirect()->back()->with('success', 'Data customer berhasil dihapus');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data customer gagal dihapus');
}
}
}

182
app/Http/Controllers/PetiController.php

@ -0,0 +1,182 @@
<?php
namespace App\Http\Controllers;
use App\Models\Customer;
use App\Models\m_warehouse;
use App\Models\Peti;
use App\Models\Type_peti;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Mockery\Matcher\Type;
class PetiController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = [
'peti' => Peti::all(),
'active' => 'menu-peti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Peti.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data = [
'typepeti' => Type_peti::all(),
'customer' => Customer::all(),
'warehouse' => m_warehouse::all(),
'active' => 'menu-peti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Peti.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $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();
for ($i = 0; $i < $request->jumlah; $i++) {
$validatedData = $request->except('_token');
// Ambil nomor urutan otomatis untuk packing_no
$latestPackingNo = Peti::max('packing_no');
$nextPackingNo = $latestPackingNo + 1;
$validatedData['packing_no'] = $nextPackingNo;
$code_customer = Customer::where('id', $validatedData['customer_id'])->first()->code_customer;
$type = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->type;
$size_peti = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->size_peti;
$lot_no = Customer::where('id', $validatedData['customer_id'])->first()->lot_no;
$packing_no = $validatedData['packing_no'];
// Generate nilai 'fix_lot' sesuai format yang diinginkan
$fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no;
$validatedData['fix_lot'] = $fixLot;
$validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by
// Buat entri peti baru
Peti::create($validatedData);
}
return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil ditambahkan');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data peti Gagal Ditambah.');
}
}
/**
* Display the specified resource.
*/
public function show($id)
{
$data = [
'peti' => Peti::findOrFail($id),
'typepeti' => Type_peti::all(),
'customer' => Customer::all(),
'warehouse' => m_warehouse::all(),
'active' => 'menu-peti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Peti.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data = [
'peti' => Peti::findOrFail($id),
'typepeti' => Type_peti::all(),
'customer' => Customer::all(),
'warehouse' => m_warehouse::all(),
'active' => 'menu-peti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Peti.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $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);
if (!$typepeti) {
return redirect()->back()->with('error', 'Data peti tidak ditemukan.');
}
$validatedData = $request->except('_token', '_method');
$code_customer = Customer::where('id', $validatedData['customer_id'])->first()->code_customer;
$type = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->type;
$size_peti = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->size_peti;
$lot_no = Customer::where('id', $validatedData['customer_id'])->first()->lot_no;
$packing_no = $typepeti->packing_no; // Mengambil packing_no dari entitas yang sudah ada
// Generate nilai 'fix_lot' sesuai format yang diinginkan
$fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no;
$validatedData['fix_lot'] = $fixLot;
// Tambahkan perubahan yang diperlukan ke entitas Peti
$typepeti->update($validatedData);
// Menambahkan nama pengguna yang melakukan pembaruan
$typepeti->update(['updated_by' => $currentuser->fullname]);
return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil diperbaharui');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data peti gagal diperbaharui');
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$typepeti = Peti::findOrFail($id);
$typepeti->delete();
return redirect()->back()->with('success', 'Data peti berhasil dihapus');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data peti gagal dihapus');
}
}
}

123
app/Http/Controllers/TypePetiController.php

@ -0,0 +1,123 @@
<?php
namespace App\Http\Controllers;
use App\Models\Type_peti;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class TypePetiController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = [
'typepeti' => Type_peti::all(),
'active' => 'menu-typepeti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data = [
'active' => 'menu-typepeti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// dd($request->all());
$request->validate([
'type' => 'required',
'size_peti' => 'required',
'description' => 'required',
]);
// dd($request);
try {
$currenttype = Auth::user();
$validatedData = $request->except('_token');
$validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by
// dd($validatedData);
Type_peti::create($validatedData);
return redirect()->route('dashboard.typepeti.index')->with('success', 'Data Tipe Peti berhasil ditambahkan');
} catch (\Throwable $th) {
// dd($th);
return redirect()->back()->with('error', 'Data Tipe Peti Gagal Ditambah.');
}
}
/**
* Display the specified resource.
*/
public function show($id)
{
$data = [
'typepeti' => Type_peti::findOrFail($id), // Mengambil detail data yang sesuai dengan parameter $id
'active' => 'menu-typepeti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data = [
'typepeti' => Type_peti::findOrFail($id),
'active' => 'menu-typepeti',
];
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $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();
// Menambahkan nama pengguna yang melakukan pembaruan
$typepetiData['updated_by'] = Auth::user()->fullname;
$typepeti->update($typepetiData);
return redirect()->route('dashboard.typepeti.index')->with('success', 'Data typepeti berhasil diperbaharui');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data typepeti gagal diperbaharui');
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$typepeti = Type_peti::findOrFail($id);
$typepeti->delete();
return redirect()->back()->with('success', 'Data tipe peti berhasil dihapus');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data tipe peti gagal dihapus');
}
}
}

27
app/Models/Customer.php

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Customer extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'customers';
protected $fillable = [
'name',
'code_customer',
'lot_no',
'nip',
'no_hp',
'tgl_lahir',
'jenis_kelamin',
'agama',
'address',
'created_by',
'updated_by',
];
}

40
app/Models/Peti.php

@ -0,0 +1,40 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Peti extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'petis';
protected $fillable = [
'tipe_peti_id',
'warna',
'customer_id',
'warehouse_id',
'jumlah',
'date_pembuatan',
'status_disposal',
'packing_no',
'fix_lot',
'created_by',
'updated_by',
];
public function customer()
{
return $this->belongsTo(Customer::class, 'customer_id');
}
public function warehouse()
{
return $this->belongsTo(m_warehouse::class, 'warehouse_id');
}
public function tipe_peti()
{
return $this->belongsTo(Type_peti::class, 'tipe_peti_id');
}
}

21
app/Models/Type_peti.php

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Type_peti extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'type_petis';
protected $fillable = [
'type',
'size_peti',
'description',
'created_by',
'updated_by',
];
}

39
database/migrations/2023_10_28_080457_create_customers_table.php

@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('name', 200);
$table->string('code_customer', 50);
$table->string('lot_no', 50);
$table->string('nip', 20)->nullable();
$table->string('no_hp', 20)->nullable();
$table->date('tgl_lahir')->nullable();
$table->string('jenis_kelamin', 30)->nullable();
$table->string('agama', 30)->nullable();
$table->text('address')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customers');
}
};

33
database/migrations/2023_10_28_083930_create_type_petis_table.php

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('type_petis', function (Blueprint $table) {
$table->id();
$table->string('type');
$table->string('size_peti');
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('type_petis');
}
};

42
database/migrations/2023_10_28_085238_create_petis_table.php

@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('petis', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tipe_peti_id')->nullable();
$table->foreign('tipe_peti_id')->references('id')->on('type_petis')->onDelete('set null');
$table->string('warna', 50);
$table->string('fix_lot', 100);
$table->integer('packing_no');
$table->unsignedBigInteger('customer_id')->nullable();
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('set null');
$table->integer('jumlah')->nullable();
$table->date('date_pembuatan', 100)->nullable();
$table->unsignedBigInteger('warehouse_id')->nullable();
$table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null');
$table->string('status_disposal')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('petis');
}
};

43
database/seeders/Customer.php

@ -0,0 +1,43 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class Customer extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('customers')->insert([
'name' => 'Gunawan',
'code_customer' => 'G',
'lot_no' => 'CWT',
'nip' => '1234567890987654',
'no_hp' => '085159079010',
// 'tgl_lahir' => '19-06-2001',
'jenis_kelamin' => 'Laki-Laki',
'agama' => 'Islam',
'address' => 'CIwatu',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
DB::table('customers')->insert([
'name' => 'Andra Ryandra',
'code_customer' => 'AR',
'lot_no' => 'KA',
'nip' => '1234567890987',
'no_hp' => '085159079011',
// 'tgl_lahir' => '19-06-2001',
'jenis_kelamin' => 'Laki-Laki',
'agama' => 'Islam',
'address' => 'CIwatu',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
}
}

2
database/seeders/DatabaseSeeder.php

@ -24,6 +24,8 @@ class DatabaseSeeder extends Seeder
RoleSeeder::class,
WarehouseSeeder::class,
UserSeeder::class,
Type_Peti::class,
Customer::class,
]);
}
}

32
database/seeders/Type_Peti.php

@ -0,0 +1,32 @@
<?php
namespace Database\Seeders;
use App\Models\Peti;
use Illuminate\Database\Seeder;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Support\Facades\DB;
class Type_Peti extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('type_petis')->insert([
'type' => 'BS',
'size_peti' => '2 X 2 X 2 X 2',
'description' => 'Detail BS',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
DB::table('type_petis')->insert([
'type' => 'BCA',
'size_peti' => '3 X 3 X 3 X 3',
'description' => 'Detail BCA',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
}
}

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

@ -1,7 +1,6 @@
@extends('layouts.main')
@section('title', 'Setting Platform')
@section('content')
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
@ -9,12 +8,11 @@
<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">
<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">
<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"
@ -53,8 +51,7 @@
<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 }}">
<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"
@ -76,7 +73,6 @@
</div>
</div>
</div>
<!-- Modal Tambah Asset-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"

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

@ -0,0 +1,68 @@
@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">Tambah Customer</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.customer.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="name" class="col-form-label">Nama Customer:</label>
<input class="form-control" name="name" type="text" id="name" value="{{ old('name') }}"
placeholder="Masukan nama customer" required>
<label for="code_customer" class="col-form-label">Kode Customer:</label>
<input class="form-control" name="code_customer" type="text" id="code_customer"
value="{{ old('code_customer') }}" placeholder="Masukan kode customer" required>
<label for="lot_no" class="col-form-label">Lot Number:</label>
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ old('lot_no') }}"
placeholder="Masukan lot number" required>
<label for="nip" class="col-form-label">NIP Customer:</label>
<input class="form-control" name="nip" type="text" id="nip" value="{{ old('nip') }}"
placeholder="Masukan NIP customer" required>
<label for="no_hp" class="col-form-label">No. HP Customer:</label>
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ old('no_hp') }}"
placeholder="Masukan Nomor Handphone customer" required>
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label>
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir"
value="{{ old('tgl_lahir') }}" required>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label>
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required>
<option disabled selected>Pilih Jenis Kelamin Customer</option>
<option value="Laki-Laki">Laki-Laki</option>
<option value="Perempuan">Perempuan</option>
</select>
<label for="agama" class="col-form-label">Agama Customer:</label>
<select class="form-control" name="agama" id="agama" required>
<option disabled selected>Pilih Agama Customer</option>
<option value="Islam">Islam</option>
<option value="Kristen">Kristen</option>
<option value="Katolik">Katolik</option>
<option value="Hindu">Hindu</option>
<option value="Buddha">Buddha</option>
<option value="Konghucu">Konghucu</option>
<option value="Lainnya">Lainnya</option>
</select>
<label for="address" class="col-form-label">Alamat Customer:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

@ -0,0 +1,72 @@
@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">Edit Customer</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.customer.update', [$customer->id]) }}" method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label for="name" class="col-form-label">Nama Customer:</label>
<input class="form-control" name="name" type="text" id="name" value="{{ $customer->name }}"
placeholder="Masukan nama customer" required>
<label for="code_customer" class="col-form-label">Kode Customer:</label>
<input class="form-control" name="code_customer" type="text" id="code_customer"
value="{{ $customer->code_customer }}" placeholder="Masukan kode customer" required>
<label for="lot_no" class="col-form-label">Lot Number:</label>
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}"
placeholder="Masukan lot number" required>
<label for="nip" class="col-form-label">NIP Customer:</label>
<input class="form-control" name="nip" type="text" id="nip" value="{{ $customer->nip }}"
placeholder="Masukan NIP customer" required>
<label for="no_hp" class="col-form-label">No. HP Customer:</label>
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ $customer->no_hp }}"
placeholder="Masukan Nomor Handphone customer" required>
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label>
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir"
value="{{ $customer->tgl_lahir }}" required>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label>
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required>
<option disabled>Pilih Jenis Kelamin Customer</option>
<option value="Laki-Laki" {{ $customer->jenis_kelamin === 'Laki-Laki' ? 'selected' : '' }}>Laki-Laki
</option>
<option value="Perempuan" {{ $customer->jenis_kelamin === 'Perempuan' ? 'selected' : '' }}>Perempuan
</option>
</select>
<label for="agama" class="col-form-label">Agama Customer:</label>
<select class="form-control" name="agama" id="agama" required>
<option disabled selected>Pilih Agama Customer</option>
<option value="Islam" {{ $customer->agama === 'Islam' ? 'selected' : '' }}>Islam</option>
<option value="Kristen" {{ $customer->agama === 'Kristen' ? 'selected' : '' }}>Kristen</option>
<option value="Katolik" {{ $customer->agama === 'Katolik' ? 'selected' : '' }}>Katolik</option>
<option value="Hindu" {{ $customer->agama === 'Hindu' ? 'selected' : '' }}>Hindu</option>
<option value="Buddha" {{ $customer->agama === 'Buddha' ? 'selected' : '' }}>Buddha</option>
<option value="Konghucu" {{ $customer->agama === 'Konghucu' ? 'selected' : '' }}>Konghucu</option>
<option value="Lainnya" {{ $customer->agama === 'Lainnya' ? 'selected' : '' }}>Lainnya</option>
</select>
<label for="address" class="col-form-label">Alamat Customer:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

@ -0,0 +1,67 @@
@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 User</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. HP</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_hp }}</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>
@endsection

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

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

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

@ -0,0 +1,63 @@
@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">Tambah Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.peti.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label>
<select class="form-control" name="tipe_peti_id" id="tipe_peti_id" required>
<option disabled selected>Pilih Tipe Peti</option>
@foreach ($typepeti as $data_type)
<option value="{{ $data_type->id }}">{{ $data_type->type }}</option>
@endforeach
</select>
<label for="warna" class="col-form-label">Warna Peti:</label>
<input class="form-control" name="warna" type="text" id="warna" value="{{ old('warna') }}"
placeholder="Masukan Warna Peti" required>
<label for="customer_id" class="col-form-label">Customer:</label>
<select class="form-control" name="customer_id" id="customer_id" required>
<option disabled selected>Pilih Customer</option>
@foreach ($customer as $data_customer)
<option value="{{ $data_customer->id }}">{{ $data_customer->name }}</option>
@endforeach
</select>
<label for="warehouse_id" class="col-form-label">Warehouse:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id" required>
<option disabled selected>Pilih Warehouse</option>
@foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}">{{ $data_warehouse->name }}</option>
@endforeach
</select>
<label for="status_disposal" class="col-form-label">Status Peti:</label>
<input class="form-control" name="status_disposal" type="text" id="status_disposal"
value="{{ old('status_disposal') }}" placeholder="Masukan status Peti">
<label for="jumlah" class="col-form-label">Jumlah Peti:</label>
<input class="form-control" name="jumlah" type="number" id="jumlah" value="{{ old('jumlah') }}"
placeholder="Masukan jumlah Peti" required>
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label>
<input class="form-control" name="date_pembuatan" type="date" id="date_pembuatan"
value="{{ old('date_pembuatan') }}" required>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

@ -0,0 +1,69 @@
@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">Edit Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.peti.update', [$peti->id]) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label>
<select class="form-control" name="tipe_peti_id" id="tipe_peti_id">
<option disabled selected>Pilih Warehouse</option>
@foreach ($typepeti as $data_type)
<option value="{{ $data_type->id }}"
@if ($data_type->id == $peti->tipe_peti_id) selected
@else @endif>
{{ $data_type->type }}</option>
@endforeach
</select>
<label for="warna" class="col-form-label">Warna Peti:</label>
<input class="form-control" name="warna" type="text" id="warna" value="{{ $peti->warna }}"
placeholder="Masukan Warna Peti" required>
<label for="customer_id" class="col-form-label">Customer:</label>
<select class="form-control" name="customer_id" id="customer_id">
<option disabled selected>Pilih Warehouse</option>
@foreach ($customer as $data_customer)
<option value="{{ $data_customer->id }}"
@if ($data_customer->id == $peti->customer_id) selected
@else @endif>
{{ $data_customer->name }}</option>
@endforeach
</select>
<label for="warehouse_id" class="col-form-label">Warehouse:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id">
<option disabled selected>Pilih Warehouse</option>
@foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}"
@if ($data_warehouse->id == $peti->warehouse_id) selected
@else @endif>
{{ $data_warehouse->name }}</option>
@endforeach
</select>
<label for="status_disposal" class="col-form-label">Status Peti:</label>
<input class="form-control" name="status_disposal" type="text" id="status_disposal"
value="{{ $peti->status_disposal }}" placeholder="Masukan status Peti">
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label>
<input class="form-control" name="date_pembuatan" type="date" id="date_pembuatan"
value="{{ $peti->date_pembuatan }}" required>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

@ -0,0 +1,92 @@
@extends('layouts.main')
@section('content')
<style>
.table th {
white-space: nowrap;
}
.table td {
white-space: nowrap;
}
</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>
</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)
<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>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
@endsection

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

@ -0,0 +1,69 @@
@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">Tambah Tipe Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="form-group">
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label>
<input class="form-control" value="{{ $peti->tipe_peti->type }}" readonly>
<label for="warna" class="col-form-label">Warna Peti:</label>
<input class="form-control" value="{{ $peti->warna }}" readonly>
<label for="customer_id" class="col-form-label">Customer:</label>
<input class="form-control" value="{{ $peti->customer->name }}" readonly>
<label for="warehouse_id" class="col-form-label">Warehouse:</label>
<input class="form-control" value="{{ $peti->warehouse->name }}" readonly>
<label for="status_disposal" class="col-form-label">Status Peti:</label>
<input class="form-control" value="{{ $peti->status_disposal }}" readonly>
<label for="jumlah" class="col-form-label">Jumlah Peti:</label>
<input class="form-control" value="{{ $peti->jumlah }}" readonly>
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label>
<input class="form-control" value="{{ \Carbon\Carbon::parse($peti->date_pembuatan)->format('d/m/Y') }}"
readonly>
<label for="fix_lot" class="col-form-label">QR Code:</label>
<div>
{!! QrCode::size(75)->generate(
'Nama Customer : ' .
$peti->customer->name .
"\n" .
'Code Customer : ' .
$peti->customer->code_customer .
"\n" .
'Type Peti : ' .
$peti->tipe_peti->type .
"\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,
) !!}
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a>
</div>
</div>
</div>
</div>
@endsection

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

@ -0,0 +1,33 @@
@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">Tambah Tipe Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.typepeti.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="type" class="col-form-label">Tipe Peti:</label>
<input class="form-control" name="type" type="text" id="type" value="{{ old('type') }}"
placeholder="Masukan Tipe Peti" required>
<label for="size_peti" class="col-form-label">Ukuran Peti:</label>
<input class="form-control" name="size_peti" type="text" id="size_peti"
value="{{ old('size_peti') }}" placeholder="Masukan Ukuran Peti" required>
<label for="description" class="col-form-label">Deskripsi Peti:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Peti" required></textarea>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

@ -0,0 +1,35 @@
@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">Tambah Tipe Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.typepeti.update', [$typepeti->id]) }}" method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label for="type" class="col-form-label">Tipe Peti:</label>
<input class="form-control" name="type" type="text" id="type" value="{{ $typepeti->type }}"
placeholder="Masukan Tipe Peti" required>
<label for="size_peti" class="col-form-label">Ukuran Peti:</label>
<input class="form-control" name="size_peti" type="text" id="size_peti"
value="{{ $typepeti->size_peti }}" placeholder="Masukan Ukuran Peti" required>
<label for="description" class="col-form-label">Deskripsi Peti:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Peti" required>{{ $typepeti->description }}</textarea>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
@endsection

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

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

29
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/show.blade.php

@ -0,0 +1,29 @@
@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">Detail Tipe Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="form-group">
<label for="type" class="col-form-label">Tipe Peti:</label>
<input class="form-control" name="type" type="text" id="type"
value="{{ $typepeti->type }}"readonly>
<label for="size_peti" class="col-form-label">Ukuran Peti:</label>
<input class="form-control" name="size_peti" type="text" id="size_peti"
value="{{ $typepeti->size_peti }}" readonly>
<label for="description" class="col-form-label">Deskripsi Peti:</label>
<textarea class="form-control" name="description" id="description" readonly>{{ $typepeti->description }}</textarea>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a>
</div>
</div>
</div>
@endsection

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

@ -1,7 +1,5 @@
@extends('layouts.main')
@section('title', 'Manajemen User')
@section('content')
{{-- <h1>Halaman Manajement User</h1> --}}
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">

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

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<title>@yield('title')</title>
<head>
<meta charset="utf-8">
@ -93,10 +92,16 @@
<script>
$(document).ready(function() {
$('#tablebarang').DataTable({
"searching": true // Aktifkan fitur pencarian
paging: true, // Aktifkan paging
searching: true, // Aktifkan fitur pencarian
scrollX: true, // Aktifkan scroll horizontal
pageLength: 10, // Jumlah data per halaman
lengthMenu: [10, 25, 50, 100], // Pilihan jumlah data per halaman
dom: '<"top"lf<"clear">>rt<"bottom"ip<"clear">>', // Susunan elemen tabel
});
});
</script>
<!-- End pengaturan datatables -->
<!-- Batas waktu alert -->

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

@ -40,26 +40,56 @@
<div class="sidebar-heading">
Master Data
</div>
@php
$isUserActive = in_array($active, ['menu-user', 'menu-role']);
@endphp
<!-- Nav Item - Pages Collapse Menu -->
<li class="nav-item {{ $active == 'menu-role' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.role.index') }}">
<i class="fas fa-solid fa-key"></i>
<span>Role</span>
<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>
<li class="nav-item {{ $active == 'menu-user' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.user.index') }}">
@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>User</span>
<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-asset' ? 'active' : '' }}">
{{-- <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> --}}
<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>

45
routes/web.php

@ -1,22 +1,16 @@
<?php
use App\Models\m_asset;
use App\Models\asset_status;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PetiController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\M_userController;
use App\Http\Controllers\M_assetController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\ProfileController;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
use App\Http\Controllers\PengadaanController;
use App\Http\Controllers\TransaksiController;
use App\Http\Controllers\CustomerController;
use App\Http\Controllers\TypePetiController;
use App\Http\Controllers\WarehouseController;
use App\Http\Controllers\PeminjamanController;
use App\Http\Controllers\BarangMasukController;
use App\Http\Controllers\BarangKeluarController;
use App\Http\Controllers\PengembalianController;
use App\Http\Controllers\SettingPlatformController;
/*
|--------------------------------------------------------------------------
@ -107,6 +101,39 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::put('pengembalian/{id}', 'update')->name('pengembalian.update');
Route::delete('pengembalian/delete/{id}', 'destroy')->name('pengembalian.destroy');
});
//Halaman Customer
Route::controller(CustomerController::class)->group(function () {
Route::get('customer', 'index')->name('customer.index');
Route::get('customer/create', 'create')->name('customer.create');
Route::post('customer/store', 'store')->name('customer.store');
Route::get('customer/{id}', 'show')->name('customer.show');
Route::get('customer/{id}/edit', 'edit')->name('customer.edit');
Route::put('customer/{id}', 'update')->name('customer.update');
Route::delete('customer/delete/{id}', 'destroy')->name('customer.destroy');
});
//Halaman Type Peti
Route::controller(TypePetiController::class)->group(function () {
Route::get('typepeti', 'index')->name('typepeti.index');
Route::get('typepeti/create', 'create')->name('typepeti.create');
Route::post('typepeti/store', 'store')->name('typepeti.store');
Route::get('typepeti/{id}', 'show')->name('typepeti.show');
Route::get('typepeti/{id}/edit', 'edit')->name('typepeti.edit');
Route::put('typepeti/{id}', 'update')->name('typepeti.update');
Route::delete('typepeti/delete/{id}', 'destroy')->name('typepeti.destroy');
});
//Halaman Peti
Route::controller(PetiController::class)->group(function () {
Route::get('peti', 'index')->name('peti.index');
Route::get('peti/create', 'create')->name('peti.create');
Route::post('peti/store', 'store')->name('peti.store');
Route::get('peti/{id}', 'show')->name('peti.show');
Route::get('peti/{id}/edit', 'edit')->name('peti.edit');
Route::put('peti/{id}', 'update')->name('peti.update');
Route::delete('peti/delete/{id}', 'destroy')->name('peti.destroy');
});
});

Loading…
Cancel
Save