Browse Source

Update Master Kondisi Peti

master
Gunawan19621 1 year ago
parent
commit
c6094a1f52
  1. 85
      app/Http/Controllers/TransferController.php
  2. 3
      app/Http/Requests/ValidasiCreatePeti.php
  3. 3
      app/Http/Requests/ValidasiUpdatePeti.php
  4. 35
      app/Models/Transfer.php
  5. 2
      app/Models/asset_status.php
  6. 1
      database/migrations/2023_11_06_085238_create_petis_table.php
  7. 33
      database/migrations/2023_11_08_132316_create_transfers_table.php
  8. 6
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php
  9. 2
      resources/views/dashboard/Peminjaman/create.blade.php
  10. 97
      resources/views/dashboard/Transfer/create.blade.php
  11. 5
      resources/views/dashboard/Transfer/edit.blade.php
  12. 83
      resources/views/dashboard/Transfer/index.blade.php
  13. 5
      resources/views/dashboard/Transfer/show.blade.php
  14. 256
      resources/views/dashboard/index.blade.php
  15. 12
      resources/views/layouts/sidebar.blade.php
  16. 13
      routes/web.php

85
app/Http/Controllers/TransferController.php

@ -0,0 +1,85 @@
<?php
namespace App\Http\Controllers;
use App\Models\m_warehouse;
use App\Models\Peti;
use App\Models\Transfer;
use Illuminate\Http\Request;
class TransferController extends Controller
{
public function index()
{
$data = [
'peminjaman' => Transfer::all(),
'active' => 'menu-transfer',
];
return view('dashboard.Transfer.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data = [
'peti' => Peti::get(),
// 'warehouse' => Peti::with('warehouse_id')->get(),
'warehouse' => m_warehouse::get(),
'active' => 'menu-transfer',
];
return view('dashboard.Transfer.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store($request)
{
}
/**
* Display the specified resource.
*/
public function show($id)
{
$data = [
'active' => 'menu-transfer',
];
return view('dashboard.Transfer.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data = [
'active' => 'menu-transfer',
];
return view('dashboard.Transfer.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update($request, $id)
{
//
}
/**
* 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');
// }
}
}

3
app/Http/Requests/ValidasiCreatePeti.php

@ -28,7 +28,7 @@ class ValidasiCreatePeti extends FormRequest
'warehouse_id' => 'required|exists:m_warehouses,id',
'jumlah' => 'required|numeric|min:1',
'date_pembuatan' => 'required|date',
'status_disposal' => 'nullable|string',
'kondisipeti_id' => 'nullable',
'packing_no' => 'nullable|integer',
'fix_lot' => 'nullable|string|max:100',
];
@ -51,7 +51,6 @@ class ValidasiCreatePeti extends FormRequest
'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',

3
app/Http/Requests/ValidasiUpdatePeti.php

@ -27,7 +27,7 @@ class ValidasiUpdatePeti extends FormRequest
'customer_id' => 'required|exists:customers,id',
'warehouse_id' => 'required|exists:m_warehouses,id',
'date_pembuatan' => 'required|date',
'status_disposal' => 'nullable|string',
'kondisipeti_id' => 'nullable',
'packing_no' => 'nullable|integer',
'fix_lot' => 'nullable|string|max:100',
];
@ -50,7 +50,6 @@ class ValidasiUpdatePeti extends FormRequest
'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',

35
app/Models/Transfer.php

@ -0,0 +1,35 @@
<?php
namespace App\Models;
use App\Models\Peti;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Transfer extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'petis';
protected $fillable = [
'peti_id',
'tanggal',
'created_by',
'updated_by',
];
public function peti()
{
return $this->belongsTo(Peti::class, 'peti_id')->select(
'id',
'tipe_peti_id',
'customer_id',
'warehouse_id',
'date_pembuatan',
'kondisipeti_id',
'fix_lot',
'updated_by',
);
}
}

2
app/Models/asset_status.php

@ -44,7 +44,7 @@ class asset_status extends Model
public function peti()
{
return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'status_disposal');
return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'kondisipeti_id');
}
public function tipe_peti()

1
database/migrations/2023_11_06_085238_create_petis_table.php

@ -26,7 +26,6 @@ return new class extends Migration
$table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null');
$table->unsignedBigInteger('kondisipeti_id')->nullable();
$table->foreign('kondisipeti_id')->references('id')->on('kondisi_petis')->onDelete('set null');
// $table->string('status_disposal')->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();

33
database/migrations/2023_11_08_132316_create_transfers_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('transfers', function (Blueprint $table) {
$table->id();
$table->bigInteger('peti_id')->unsigned()->nullable();
$table->foreign('peti_id')->references('id')->on('petis')->onDelete('set null');
$table->date('tanggal')->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('transfers');
}
};

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

@ -64,12 +64,6 @@
@else @endif>
{{ $data_kondisiPeti->nama_kondisi }}</option>
@endforeach
{{-- <option value="Baru" {{ old('status_disposal') == 'Baru' ? 'selected' : '' }}>Baru</option>
<option value="Bekas" {{ old('status_disposal') == 'Bekas' ? 'selected' : '' }}>Bekas</option>
<option value="Recycle" {{ old('status_disposal') == 'Recycle' ? 'selected' : '' }}>Recycle
</option>
<option value="Lainnya" {{ old('status_disposal') == 'Lainnya' ? 'selected' : '' }}>Lainnya
</option> --}}
</select>
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti: <span

2
resources/views/dashboard/Peminjaman/create.blade.php

@ -85,7 +85,7 @@
});
</script>
<!-- otomatis asal gudang dan asal gudang berdasarkan detail peti -->
<!-- otomatis asal gudang dan Customer berdasarkan detail peti -->
<script>
// Mendapatkan elemen select detail peti
const petiSelect = document.getElementById('peti_id');

97
resources/views/dashboard/Transfer/create.blade.php

@ -0,0 +1,97 @@
@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">Transfer Peti</h5>
</div>
</div>
</div>
<div class="card-body">
<form action="{{ route('dashboard.transfer.store') }}" method="POST" enctype="multipart/form-data"
id="transferForm">
@csrf
<div class="form-group">
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span
class="text-danger">*</span></label>
<select class="form-control" name="peti_id" type="text" id="peti_id" required>
<option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti)
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"
data-customer-name="{{ $data_peti->customer->name }}">
{{ $data_peti->fix_lot }}
</option>
@endforeach
</select>
<label for="tanggal" class="col-form-label">Tanggal Transfer: <span
class="text-danger">*</span></label>
<input class="form-control" name="tanggal" type="date" id="tanggal" value="{{ old('tanggal') }}"
required>
<label for="name" class="col-form-label">Customer: <span class="text-danger">*</span></label>
<input class="form-control" name="name" type="text" id="name"
placeholder="Nama Customer akan otomatis terpilih ketika memilih detail peti.">
<label for="exit_warehouse" class="col-form-label">Asal Gudang: <span
class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required>
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
<label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span
class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="" required>
<option disabled selected>Pilih Tujuan Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
</div>
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.transfer.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div>
</form>
</div>
</div>
<!-- auto disable form pada saat sudah di simpan-->
<script>
document.getElementById('transferForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
<!-- otomatis asal gudang dan Customer berdasarkan detail peti -->
<script>
// Mendapatkan elemen select detail peti
const petiSelect = document.getElementById('peti_id');
// Mendapatkan elemen select asal gudang
const exitWarehouseSelect = document.getElementById('exit_warehouse');
// Mendapatkan elemen input Customer
const nameInput = document.getElementById('name');
// Menambahkan event listener ke select detail peti
petiSelect.addEventListener('change', function() {
// Mendapatkan data-warehouse-id dari option yang dipilih
const selectedOption = this.options[this.selectedIndex];
const warehouseId = selectedOption.getAttribute('data-warehouse-id');
// Mendapatkan data-customer-name dari option yang dipilih
const customerName = selectedOption.getAttribute('data-customer-name');
// Memilih asal gudang berdasarkan data-warehouse-id
exitWarehouseSelect.value = warehouseId;
// Mengisi input Customer dengan nama pelanggan
nameInput.value = customerName;
});
</script>
@endsection

5
resources/views/dashboard/Transfer/edit.blade.php

@ -0,0 +1,5 @@
@extends('layouts.main')
@section('content')
@include('layouts.components.alert-prompt')
<p>Halaman edit transfer</p>
@endsection

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

@ -0,0 +1,83 @@
@extends('layouts.main')
@section('content')
<style>
.table th {
white-space: nowrap;
}
.table td {
white-space: nowrap;
}
</style>
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Transfer</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('dashboard.transfer.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Transfer Peti</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>Kode</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)
@if ($data_peminjaman->enter_warehouse == null)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}"
title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endif
@empty
<p>Data Kosong</p>
@endforelse --}}
</tbody>
</table>
</div>
</div>
</div>
@endsection

5
resources/views/dashboard/Transfer/show.blade.php

@ -0,0 +1,5 @@
@extends('layouts.main')
@section('content')
@include('layouts.components.alert-prompt')
<p>Halaman show transfer</p>
@endsection

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

@ -1,177 +1,157 @@
@extends('layouts.main')
@section('content')
<div class="container-fluid">
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</div>
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1"
style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeti }}
</div>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</div>
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeti }}
</div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1"
style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
<!-- 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>
<!-- 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>
<!-- 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>
@php
$chartData = app('App\Http\Controllers\HomeController')->generateChartData();
@endphp
{{-- <div class="card-body">
<label for="yearFilter">Pilih Tahun:</label>
<select id="yearFilter" class="form-control">
@foreach ($chartData['years'] as $year)
@if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="ChartAssetStatus" style="max-height: 500px;"></canvas> <!-- Atur tinggi chart -->
</div> --}}
<div class="card-body">
<label for="yearFilter">Pilih Tahun:</label>
<select id="yearFilter" class="form-control">
@foreach ($chartData['years'] as $year)
@if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="ChartAssetStatus" style="max-height: 500px;"></canvas>
</div>
<!-- Area Bar Chart -->
<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>
@php
$chartData = app('App\Http\Controllers\HomeController')->generateChartData();
@endphp
<div class="card-body">
<label for="yearFilter">Pilih Tahun:</label>
<select id="yearFilter" class="form-control">
@foreach ($chartData['years'] as $year)
@if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index])
<option value="{{ $year }}">{{ $year }}</option>
@endif
@endforeach
</select>
<canvas id="ChartAssetStatus" style="max-height: 500px;"></canvas>
</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>
<!-- Area 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 Peti</h6>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChartsiopas"></canvas>
</div>
</div>
</div>
</div>
</div>
@push('script')
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Data untuk grafik pie (gantilah data sesuai kebutuhan Anda)
var data = {
labels: ["Gunawan", "Social", "Referral"],
datasets: [{
data: [30, 40, 30], // Misalnya, data penggunaan Anda
backgroundColor: ["#4e73df", "#1cc88a", "#36b9cc"], // Warna untuk setiap bagian grafik
}]
};
// Mengambil elemen canvas untuk grafik pie
var ctx = document.getElementById("myPieChartsiopas").getContext('2d');
// Membuat instance grafik pie
var myPieChart = new Chart(ctx, {
type: 'pie',
data: data,
});
</script>
<!-- script bar chart -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var ctx = document.getElementById('ChartAssetStatus').getContext('2d');

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

@ -36,6 +36,18 @@
<span>Pengembalian</span>
</a>
</li>
<li class="nav-item {{ $active == 'menu-transfer' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.transfer.index') }}">
<i class="fas fa-fw fa-exchange-alt"></i>
<span>Transfer</span>
</a>
</li>
<li class="nav-item {{ $active == 'menu-disposal' ? 'active' : '' }}">
<a class="nav-link" href="#">
<i class="fas fa-fw fa-trash"></i>
<span>Disposal</span>
</a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">

13
routes/web.php

@ -7,6 +7,7 @@ use App\Http\Controllers\M_userController;
use App\Http\Controllers\M_assetController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\CustomerController;
use App\Http\Controllers\TransferController;
use App\Http\Controllers\TypePetiController;
use App\Http\Controllers\WarehouseController;
use App\Http\Controllers\PeminjamanController;
@ -67,6 +68,18 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::delete('pengembalian/delete/{id}', 'destroy')->name('pengembalian.destroy');
});
//Halaman Transfer
Route::controller(TransferController::class)->group(function () {
Route::get('transfer', 'index')->name('transfer.index');
Route::get('transfer/create', 'create')->name('transfer.create');
Route::post('transfer/store', 'store')->name('transfer.store');
Route::get('transfer/{id}', 'show')->name('transfer.show');
Route::get('transfer/{id}/edit', 'edit')->name('transfer.edit');
Route::put('transfer/{id}', 'update')->name('transfer.update');
Route::delete('transfer/delete/{id}', 'destroy')->name('transfer.destroy');
});
//Halaman User
Route::controller(M_userController::class)->group(function () {
Route::get('user', 'index')->name('user.index');

Loading…
Cancel
Save