Browse Source

update pagenation serch

master
Gunawan19621 11 months ago
parent
commit
8a72094a2d
  1. 32
      app/Http/Controllers/PetiController.php
  2. 2
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  3. 1
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  4. 34
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php
  5. 1
      resources/views/dashboard/Master_Data/Warehouse/index.blade.php
  6. 4
      resources/views/layouts/sidebar.blade.php
  7. 4
      resources/views/pages/layouts/sidebar_user.blade.php
  8. 3
      resources/views/pages/user/Master_Data/Customer/index.blade.php
  9. 27
      resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php
  10. 6
      resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php
  11. 1
      resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php
  12. 1
      resources/views/pages/user/Master_Data/Warehouse/index.blade.php
  13. 1
      resources/views/pages/user/dashboard/disposal/index.blade.php

32
app/Http/Controllers/PetiController.php

@ -34,25 +34,35 @@ class PetiController extends Controller
$search = $request->input('search') ?? ''; $search = $request->input('search') ?? '';
if ($search) { if ($search) {
$query->where(function ($q) use ($search) { $query->where(function ($q) use ($search) {
$q->where('fix_lot', 'like', "%$search%") $q->where('fix_lot', 'like', "%$search%") // mencari fix lot
->orWhere('created_by', 'like', "%$search%") // ->orWhere('created_by', 'like', "%$search%")
->orWhereHas('customer', function ($customerQuery) use ($search) { ->orWhereHas('customer', function ($customerQuery) use ($search) {
$customerQuery->where('name', 'like', "%$search%") $customerQuery->where('name', 'like', "%$search%") //mencari nama customer
->orWhere('code_customer', 'like', "%$search%") ->orWhere('code_customer', 'like', "%$search%") //mencari kode customer
->orWhere('lot_no', 'like', "%$search%"); ->orWhere('lot_no', 'like', "%$search%"); //mencari lot no
}) })
->orWhereHas('warehouse', function ($warehouseQuery) use ($search) { ->orWhereHas('warehouse', function ($warehouseQuery) use ($search) {
$warehouseQuery->where('name', 'like', "%$search%"); $warehouseQuery->where('name', 'like', "%$search%"); //mencari nama gudang
}) })
->orWhereHas('tipe_peti', function ($tipePetiQuery) use ($search) { ->orWhereHas('tipe_peti', function ($tipePetiQuery) use ($search) {
$tipePetiQuery->where('type', 'like', "%$search%") $tipePetiQuery->where('type', 'like', "%$search%") //mencari type
->orWhere('size_peti', 'like', "%$search%"); ->orWhere('size_peti', 'like', "%$search%"); //mencari ukuran peti
}) })
->orWhereHas('kondisipeti', function ($kondisiPetiQuery) use ($search) { ->orWhereHas('kondisipeti', function ($kondisiPetiQuery) use ($search) {
$kondisiPetiQuery->where('nama_kondisi', 'like', "%$search%"); $kondisiPetiQuery->where('nama_kondisi', 'like', "%$search%"); //mencari nama kondisi
}) })
->orWhere('packing_no', 'like', "%$search%") ->orWhere(function ($statusQuery) use ($search) {
->orWhere('status', 'like', "%$search%"); if (strtolower($search) === 'ada') {
$statusQuery->where('status_isi', 1);
} elseif (strtolower($search) === 'tidak ada') {
$statusQuery->where('status_isi', 0);
} else {
$statusQuery->where('status_isi', 'like', "%$search%");
}
}) //mencari status isi ADA atau TIDAK ADA
->orWhere('warna', 'like', "%$search%")
->orWhere('packing_no', 'like', "%$search%"); //mencari packing no
// ->orWhere('status', 'like', "%$search%");
}); });
} }

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

@ -18,8 +18,6 @@
href="#">Import Data Customer</a> href="#">Import Data Customer</a>
<a class="dropdown-item" href="{{ route('dashboard.ReportCustomer.export') }}" <a class="dropdown-item" href="{{ route('dashboard.ReportCustomer.export') }}"
target="_blank">Export Data Customer</a> target="_blank">Export Data Customer</a>
{{-- <div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a> --}}
</div> </div>
</li> </li>
</ul> </ul>

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

@ -12,7 +12,6 @@
@include('layouts.components.alert-prompt') @include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1) @if (auth()->user()->role_id == 1)
<!-- cara data table buatan sendiri -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<nav class="navbar navbar-expand navbar-light bg-light mb-4 py-3" style="border-bottom: 1px solid #ddd;"> <nav class="navbar navbar-expand navbar-light bg-light mb-4 py-3" style="border-bottom: 1px solid #ddd;">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Peti</h5>

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

@ -8,10 +8,6 @@
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
h1 {
text-align: center;
}
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
@ -25,22 +21,44 @@
th, th,
td { td {
padding: 8px;
text-align: center; text-align: center;
} }
th { th {
background-color: #f2f2f2; background-color: #f2f2f2;
} }
/* Lanskap */
@page {
size: 15cm 8cm;
/* Perubahan lebar dan tinggi sesuai lanskap */
margin: 0;
}
body {
margin: 0.5cm;
}
/* Atur ukuran gambar logo */
.logo {
width: 100px;
height: 100px;
}
/* Atur ukuran gambar QR Code */
.qrcode {
width: 150px;
height: 150px;
}
</style> </style>
</head> </head>
<body> <body>
<table style="width:100%" class="table table-bordered"> <table style="width:100%; margin-top: 10px;" class="table table-bordered">
<tr> <tr>
<td rowspan="2"> <td rowspan="2">
<img src="data:image/jpeg;base64,<?= base64_encode(file_get_contents('assets/img/istw_black&white.jpg')) ?>" <img src="data:image/jpeg;base64,<?= base64_encode(file_get_contents('assets/img/istw_black&white.jpg')) ?>"
alt="Logo ISTW" width="100" height="100"> alt="Logo ISTW" class="logo">
</td> </td>
<td>PETI NUMBER</td> <td>PETI NUMBER</td>
<td>BARCODE</td> <td>BARCODE</td>
@ -50,7 +68,7 @@
{{ $peti->fix_lot }} {{ $peti->fix_lot }}
</td> </td>
<td rowspan="4"> <td rowspan="4">
<img src="data:image/svg+xml;base64,{{ $qrcode }}" alt="QR Code" /> <img src="data:image/svg+xml;base64,{{ $qrcode }}" alt="QR Code" class="qrcode">
</td> </td>
</tr> </tr>
<tr> <tr>

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

@ -68,7 +68,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
@elseif(auth()->user()->role_id == 2) @elseif(auth()->user()->role_id == 2)

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

@ -67,9 +67,9 @@
aria-labelledby="headingHistory" data-parent="#accordionSidebar"> aria-labelledby="headingHistory" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded"> <div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'history-peminjaman' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-peminjaman' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPeminjaman') }}">Peminjaman</a> href="{{ route('dashboard.history.historyPeminjaman') }}">Peti Out</a>
<a class="collapse-item {{ $active == 'history-pengembalian' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-pengembalian' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPengembalian') }}">Pengembalian</a> href="{{ route('dashboard.history.historyPengembalian') }}">Peti In</a>
<a class="collapse-item {{ $active == 'history-transfer' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-transfer' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyTransfer') }}">Transfer</a> href="{{ route('dashboard.history.historyTransfer') }}">Transfer</a>
</div> </div>

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

@ -65,9 +65,9 @@
aria-labelledby="headingHistory" data-parent="#accordionSidebar"> aria-labelledby="headingHistory" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded"> <div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ $active == 'history-peminjaman' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-peminjaman' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPeminjaman') }}">Peminjaman</a> href="{{ route('dashboard.history.historyPeminjaman') }}">Peti Out</a>
<a class="collapse-item {{ $active == 'history-pengembalian' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-pengembalian' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyPengembalian') }}">Pengembalian</a> href="{{ route('dashboard.history.historyPengembalian') }}">Peti In</a>
<a class="collapse-item {{ $active == 'history-transfer' ? 'active' : '' }}" <a class="collapse-item {{ $active == 'history-transfer' ? 'active' : '' }}"
href="{{ route('dashboard.history.historyTransfer') }}">Transfer</a> href="{{ route('dashboard.history.historyTransfer') }}">Transfer</a>
</div> </div>

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

@ -12,7 +12,7 @@
<thead> <thead>
<tr> <tr>
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Nama</th> <th>Nama Customer</th>
<th>Kode Customer</th> <th>Kode Customer</th>
<th>No. Telepon</th> <th>No. Telepon</th>
<th>Alamat</th> <th>Alamat</th>
@ -31,7 +31,6 @@
<td>{{ $data_customer->address }}</td> <td>{{ $data_customer->address }}</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -37,34 +37,45 @@
<thead> <thead>
<tr> <tr>
<th class="text-center" style="width: 10px">No</th> <th class="text-center" style="width: 10px">No</th>
<th><input type="checkbox" class="checkbox " id="selectAll"></th>
<th>Fix Lot</th> <th>Fix Lot</th>
<th>User</th>
<th>Customer</th> <th>Customer</th>
<th>GD</th>
<th>Kode Customer</th> <th>Kode Customer</th>
<th>Tipe Peti</th> <th>Tipe Peti</th>
<th>Ukuran Peti</th> <th>Ukuran Peti</th>
<th>Lot No</th> <th>Lot No</th>
<th>Kondisi Peti</th>
<th>Packing No</th> <th>Packing No</th>
<th>Status</th> <th>GD</th>
<th>Kondisi Peti</th>
<th>Isi Peti</th>
<th>Warna Peti</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@forelse ($peti as $data_peti) @forelse ($peti as $data_peti)
<tr> <tr>
<td>{{ $i++ }}</td> <td>{{ $i++ }}</td>
<td><input type="checkbox" class="checkbox" value="{{ $data_peti->id }}">
</td>
<td>{{ $data_peti->fix_lot }}</td> <td>{{ $data_peti->fix_lot }}</td>
<td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td> <td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td>
<td>{{ $data_peti->customer->code_customer }}</td> <td>{{ $data_peti->customer->code_customer }}</td>
<td>{{ $data_peti->tipe_peti->type }}</td> <td>{{ $data_peti->tipe_peti->type }}</td>
<td>{{ $data_peti->tipe_peti->size_peti }}</td> <td>{{ $data_peti->tipe_peti->size_peti }}</td>
<td>{{ $data_peti->customer->lot_no }}</td> <td>{{ $data_peti->customer->lot_no }}</td>
<td>{{ $data_peti->kondisipeti->nama_kondisi }}</td>
<td class="text-right">{{ $data_peti->packing_no }}</td> <td class="text-right">{{ $data_peti->packing_no }}</td>
<td>{{ $data_peti->status }}</td> <td>{{ $data_peti->warehouse->name }}</td>
<td>{{ $data_peti->kondisipeti->nama_kondisi }}</td>
<td>
@if ($data_peti->status_isi == 1)
ADA
@elseif($data_peti->status_isi == 0)
TIDAK ADA
@else
TIDAK ADA
@endif
</td>
<td>{{ $data_peti->warna }}</td>
</tr> </tr>
@empty @empty
<tr> <tr>

6
resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php

@ -20,15 +20,13 @@
@php @php
$nokondisi = 1; $nokondisi = 1;
@endphp @endphp
@forelse ($kondisiPeti as $data_kondisiPeti) @foreach ($kondisiPeti as $data_kondisiPeti)
<tr> <tr>
<td class="text-center">{{ $nokondisi++ }}</td> <td class="text-center">{{ $nokondisi++ }}</td>
<td>{{ $data_kondisiPeti->nama_kondisi }}</td> <td>{{ $data_kondisiPeti->nama_kondisi }}</td>
<td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td> <td>{{ $data_kondisiPeti->deskripsi_kondisi }}</td>
</tr> </tr>
@empty @endforeach
<p>Data Kosong</p>
@endforelse
</tbody> </tbody>
</table> </table>
</div> </div>

1
resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php

@ -29,7 +29,6 @@
<td>{{ $data_typepeti->description }}</td> <td>{{ $data_typepeti->description }}</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -17,7 +17,6 @@
<th>Nama Gudang</th> <th>Nama Gudang</th>
<th>Deskripsi</th> <th>Deskripsi</th>
<th>Alamat</th> <th>Alamat</th>
{{-- <th class="text-center">Action</th> --}}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

1
resources/views/pages/user/dashboard/disposal/index.blade.php

@ -34,6 +34,7 @@
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save