Update Menampilkan Curas dan Curanmor dari yang terkecil

This commit is contained in:
daffarahman11 2025-03-28 00:02:28 +07:00
parent ce881b9f07
commit 3fd110097f
4 changed files with 10 additions and 7 deletions

View File

@ -15,7 +15,9 @@ class CuranmorController extends Controller
*/ */
public function index() public function index()
{ {
return view('admin.dashboardListCuranmor', ['curanmors' => Curanmor::all()]); $curanmors = Curanmor::orderBy('jumlah_curanmor', 'asc')->get();
return view('admin.dashboardListCuranmor', compact('curanmors'));
} }
/** /**

View File

@ -15,7 +15,8 @@ class CurasController extends Controller
*/ */
public function index() public function index()
{ {
return view('admin.dashboardListCuras', ['Curases' => Curas::all()]); $curases = Curas::orderBy('jumlah_curas', 'asc')->get();
return view('admin.dashboardListCuras', compact('curases'));
} }

View File

@ -33,7 +33,7 @@
<label for="checkbox1" class="mb-0"></label> <label for="checkbox1" class="mb-0"></label>
</div> </div>
</th> </th>
<th>id</th> <th>No</th>
<th>Nama Kecamatan</th> <th>Nama Kecamatan</th>
<th>Jumlah Kasus Curanmor</th> <th>Jumlah Kasus Curanmor</th>
<th>Klaster</th> <th>Klaster</th>
@ -49,7 +49,7 @@
<label for="checkbox2" class="mb-0"></label> <label for="checkbox2" class="mb-0"></label>
</div> </div>
</td> </td>
<td>{{ $curanmor->id }}</td> <td>{{ $loop->iteration }}</td>
<td>{{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan}}</td> <td>{{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan}}</td>
<td>{{ $curanmor->jumlah_curanmor }}</td> <td>{{ $curanmor->jumlah_curanmor }}</td>
<td style="background-color: {{ $curanmor->punyaKlasterCuranmor->warna }}">{{ $curanmor->punyaKlasterCuranmor->nama_klaster }}</td> <td style="background-color: {{ $curanmor->punyaKlasterCuranmor->warna }}">{{ $curanmor->punyaKlasterCuranmor->nama_klaster }}</td>

View File

@ -33,14 +33,14 @@
<label for="checkbox1" class="mb-0"></label> <label for="checkbox1" class="mb-0"></label>
</div> </div>
</th> </th>
<th>id</th> <th>No</th>
<th>Nama Kecamatan</th> <th>Nama Kecamatan</th>
<th>Jumlah Kasus Curas</th> <th>Jumlah Kasus Curas</th>
<th>Klaster</th> <th>Klaster</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
@foreach ( $Curases as $curas ) @foreach ( $curases as $curas )
<tbody class="ligth-body"> <tbody class="ligth-body">
<tr> <tr>
<td> <td>
@ -49,7 +49,7 @@
<label for="checkbox2" class="mb-0"></label> <label for="checkbox2" class="mb-0"></label>
</div> </div>
</td> </td>
<td>{{ $curas->id }}</td> <td>{{ $loop->iteration }}</td>
<td>{{ $curas->punyaKecamatanCuras->nama_kecamatan}}</td> <td>{{ $curas->punyaKecamatanCuras->nama_kecamatan}}</td>
<td>{{ $curas->jumlah_curas }}</td> <td>{{ $curas->jumlah_curas }}</td>
<td style="background-color: {{ $curas->punyaKlasterCuras->warna }}">{{ $curas -> punyaKlasterCuras -> nama_klaster }}</td> <td style="background-color: {{ $curas->punyaKlasterCuras->warna }}">{{ $curas -> punyaKlasterCuras -> nama_klaster }}</td>