Revisi Bu Bitari PERTAMA rentang nilai k dan hapus CRUD Kecamatan klaster
This commit is contained in:
parent
c3165955c1
commit
33cff2186a
|
@ -13,7 +13,7 @@ class KmeansController extends Controller
|
|||
public function KMeansCuras()
|
||||
{
|
||||
$data = Curas::select('id', 'kecamatan_id', 'klaster_id', 'jumlah_curas')
|
||||
->orderBy('kecamatan_id', 'asc')->get();
|
||||
->orderBy('jumlah_curas', 'asc')->get();
|
||||
|
||||
// Hitung min dan max untuk normalisasi
|
||||
$min = $data->min('jumlah_curas');
|
||||
|
@ -123,12 +123,11 @@ public function KMeansCuras()
|
|||
return redirect('/dashboard/TampilHitungCuras');
|
||||
}
|
||||
|
||||
|
||||
public function KMeansCuranmor()
|
||||
{
|
||||
// Ambil data awal
|
||||
$data = Curanmor::select('id', 'kecamatan_id', 'klaster_id', 'jumlah_curanmor')
|
||||
->orderBy('kecamatan_id', 'asc')->get();
|
||||
->orderBy('jumlah_curanmor', 'asc')->get();
|
||||
|
||||
// Hitung min dan max untuk normalisasi Min-Max
|
||||
$min = $data->min('jumlah_curanmor');
|
||||
|
|
|
@ -37,7 +37,7 @@ public function runKmeans()
|
|||
$hasilKMeansCuranmor = $serviceKmeansCuranmor->hitungKMeansCuranmor();
|
||||
file_put_contents(storage_path('app/public/hasil_kmeans_curanmor.json'), json_encode($hasilKMeansCuranmor));
|
||||
|
||||
return redirect('/dashboard/curanmor');
|
||||
return redirect('/dashboard');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,21 +16,27 @@ public function hitungKMeansCuras()
|
|||
$k = Klaster::count('id');
|
||||
$maxIterasi = 100;
|
||||
|
||||
// Hitung min dan max untuk normalisasi
|
||||
$minValue = $data->min('jumlah_curas');
|
||||
$maxValue = $data->max('jumlah_curas');
|
||||
|
||||
// Normalisasi data dan simpan hasilnya ke dalam array baru
|
||||
$normalizedData = $data->map(function ($item) use ($minValue, $maxValue) {
|
||||
$normalized = ($item->jumlah_curas - $minValue) / ($maxValue - $minValue);
|
||||
$item->normalized_curas = round($normalized, 2); // 2 angka di belakang koma
|
||||
return $item;
|
||||
});
|
||||
|
||||
// Inisialisasi centroid dengan nilai acak dari rentang normalisasi [0, 1]
|
||||
$generated = collect();
|
||||
while ($generated->count() < $k) {
|
||||
$random = mt_rand($minValue, $maxValue);
|
||||
$random = round(mt_rand(0, 100) / 100, 2); // Random 0.00–1.00
|
||||
if (!$generated->contains($random)) {
|
||||
$generated->push($random);
|
||||
}
|
||||
}
|
||||
|
||||
$centroids = $generated->map(function ($value) {
|
||||
return ['C' => $value];
|
||||
});
|
||||
|
||||
$centroids = $generated->map(fn($value) => ['C' => $value]);
|
||||
$centroidAwal = $centroids->toArray();
|
||||
|
||||
$iterasi = [];
|
||||
|
@ -40,22 +46,27 @@ public function hitungKMeansCuras()
|
|||
$clustered = [];
|
||||
$currentAssignment = [];
|
||||
|
||||
foreach ($data as $item) {
|
||||
foreach ($normalizedData as $item) {
|
||||
$jarak = [];
|
||||
|
||||
foreach ($centroids as $idx => $centroid) {
|
||||
$dist = abs($item->jumlah_curas - $centroid['C']);
|
||||
$jarak["C" . ($idx + 1)] = $dist;
|
||||
$dist = abs($item->normalized_curas - $centroid['C']);
|
||||
$jarak["C" . ($idx + 1)] = round($dist, 2); // Format 2 angka koma
|
||||
}
|
||||
|
||||
$iterasi[$i][] = array_merge(['kecamatan_id' => $item->kecamatan_id], $jarak);
|
||||
|
||||
$minIndex = array_keys($jarak, min($jarak))[0];
|
||||
$clusterNumber = (int) str_replace("C", "", $minIndex);
|
||||
|
||||
$clustered[$clusterNumber][] = $item;
|
||||
$item->temp_klaster = $clusterNumber;
|
||||
$currentAssignment[$item->id] = $clusterNumber;
|
||||
|
||||
// Tambahkan nilai normalisasi ke dalam iterasi
|
||||
$iterasi[$i][] = array_merge(
|
||||
['kecamatan_id' => $item->kecamatan_id],
|
||||
['normal' => round($item->normalized_curas, 2)],
|
||||
$jarak
|
||||
);
|
||||
}
|
||||
|
||||
if ($currentAssignment === $prevAssignment) {
|
||||
|
@ -64,9 +75,10 @@ public function hitungKMeansCuras()
|
|||
|
||||
$prevAssignment = $currentAssignment;
|
||||
|
||||
// Update centroid berdasarkan rata-rata
|
||||
// Update centroid
|
||||
foreach ($clustered as $key => $group) {
|
||||
$avg = collect($group)->avg('jumlah_curas');
|
||||
$avg = collect($group)->avg('normalized_curas');
|
||||
$avg = round($avg, 2); // Format 2 angka koma
|
||||
$centroids = $centroids->map(function ($item, $index) use ($key, $avg) {
|
||||
return $index === ($key - 1)
|
||||
? ['C' => $avg]
|
||||
|
@ -77,16 +89,14 @@ public function hitungKMeansCuras()
|
|||
|
||||
// Final mapping centroid ke klaster_id
|
||||
$finalCentroids = $centroids->map(function ($item, $index) {
|
||||
return ['index' => $index + 1, 'C' => $item['C']];
|
||||
return ['index' => $index + 1, 'C' => round($item['C'], 2)];
|
||||
})->sortBy('C')->values();
|
||||
|
||||
$availableKlasterIDs = Klaster::orderBy('id', 'asc')->pluck('id')->values();
|
||||
|
||||
foreach ($finalCentroids as $i => $centroid) {
|
||||
$centroidToKlaster[$centroid['index']] = $availableKlasterIDs[$i];
|
||||
}
|
||||
|
||||
|
||||
// Update ke database
|
||||
foreach ($data as $item) {
|
||||
Curas::where('id', $item->id)->update([
|
||||
|
@ -96,21 +106,24 @@ public function hitungKMeansCuras()
|
|||
|
||||
// Format centroid awal
|
||||
$centroidAwalFormatted = collect($centroidAwal)->values()->map(function ($item, $index) {
|
||||
return ['C' . ($index + 1) => $item['C']];
|
||||
return ['C' . ($index + 1) => round($item['C'], 2)];
|
||||
});
|
||||
|
||||
// Format centroid akhir
|
||||
$centroidAkhirFormatted = $centroids->values()->map(function ($item, $index) {
|
||||
return ['C' . ($index + 1) => $item['C']];
|
||||
return ['C' . ($index + 1) => round($item['C'], 2)];
|
||||
});
|
||||
|
||||
// Simpan hasil ke file JSON (opsional)
|
||||
return [
|
||||
'centroid_awal' => $centroidAwalFormatted,
|
||||
'centroid_akhir' => $centroidAkhirFormatted,
|
||||
'iterasi' => $iterasi
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function hitungKMeansCuranmor()
|
||||
{
|
||||
$data = Curanmor::select('id', 'kecamatan_id', 'klaster_id', 'jumlah_curanmor')->orderBy('jumlah_curanmor', 'asc')->get();
|
||||
|
@ -118,22 +131,28 @@ public function hitungKMeansCuranmor()
|
|||
$k = Klaster::count('id');
|
||||
$maxIterasi = 100;
|
||||
|
||||
// Ambil centroid awal yang unik
|
||||
// Hitung min dan max untuk normalisasi
|
||||
$minValue = $data->min('jumlah_curanmor');
|
||||
$maxValue = $data->max('jumlah_curanmor');
|
||||
|
||||
$generated = collect();
|
||||
while ($generated->count() < $k) {
|
||||
$random = mt_rand($minValue, $maxValue);
|
||||
if (!$generated->contains($random)) {
|
||||
$generated->push($random);
|
||||
}
|
||||
}
|
||||
|
||||
$centroids = $generated->map(function ($value) {
|
||||
return ['C' => $value];
|
||||
// Normalisasi data dan simpan hasilnya ke dalam property baru
|
||||
$normalizedData = $data->map(function ($item) use ($minValue, $maxValue) {
|
||||
$normalized = ($maxValue - $minValue) == 0 ? 0 : ($item->jumlah_curanmor - $minValue) / ($maxValue - $minValue);
|
||||
$item->normalized_curanmor = round($normalized, 2);
|
||||
return $item;
|
||||
});
|
||||
|
||||
// Generate centroid awal unik dari data ter-normalisasi
|
||||
$generated = collect();
|
||||
while ($generated->count() < $k) {
|
||||
$rand = mt_rand(0, 100) / 100; // antara 0 dan 1 dengan 2 desimal
|
||||
$rand = round($rand, 2);
|
||||
if (!$generated->contains($rand)) {
|
||||
$generated->push($rand);
|
||||
}
|
||||
}
|
||||
|
||||
$centroids = $generated->map(fn($val) => ['C' => $val]);
|
||||
$centroidAwal = $centroids->toArray();
|
||||
|
||||
$iterasi = [];
|
||||
|
@ -143,15 +162,20 @@ public function hitungKMeansCuranmor()
|
|||
$clustered = [];
|
||||
$currentAssignment = [];
|
||||
|
||||
foreach ($data as $item) {
|
||||
foreach ($normalizedData as $item) {
|
||||
$jarak = [];
|
||||
|
||||
foreach ($centroids as $idx => $centroid) {
|
||||
$dist = abs($item->jumlah_curanmor - $centroid['C']);
|
||||
$jarak["C" . ($idx + 1)] = $dist;
|
||||
$dist = abs($item->normalized_curanmor - $centroid['C']);
|
||||
$jarak["C" . ($idx + 1)] = round($dist, 2);
|
||||
}
|
||||
|
||||
$iterasi[$i][] = array_merge(['kecamatan_id' => $item->kecamatan_id], $jarak);
|
||||
// Tambahkan data ke iterasi, termasuk nilai normalisasi
|
||||
$iterasi[$i][] = array_merge(
|
||||
['kecamatan_id' => $item->kecamatan_id],
|
||||
['normal' => $item->normalized_curanmor], // tampilkan nilai normalisasi
|
||||
$jarak
|
||||
);
|
||||
|
||||
$minIndex = array_keys($jarak, min($jarak))[0];
|
||||
$clusterNumber = (int) str_replace("C", "", $minIndex);
|
||||
|
@ -167,9 +191,10 @@ public function hitungKMeansCuranmor()
|
|||
|
||||
$prevAssignment = $currentAssignment;
|
||||
|
||||
// Update centroid berdasarkan rata-rata
|
||||
// Update centroid berdasarkan rata-rata normalisasi
|
||||
foreach ($clustered as $key => $group) {
|
||||
$avg = collect($group)->avg('jumlah_curanmor');
|
||||
$avg = collect($group)->avg('normalized_curanmor');
|
||||
$avg = round($avg, 2);
|
||||
$centroids = $centroids->map(function ($item, $index) use ($key, $avg) {
|
||||
return $index === ($key - 1)
|
||||
? ['C' => $avg]
|
||||
|
@ -180,20 +205,17 @@ public function hitungKMeansCuranmor()
|
|||
|
||||
// Final mapping centroid ke klaster_id
|
||||
$finalCentroids = $centroids->map(function ($item, $index) {
|
||||
return ['index' => $index + 1, 'C' => $item['C']];
|
||||
return ['index' => $index + 1, 'C' => round($item['C'], 2)];
|
||||
})->sortBy('C')->values();
|
||||
|
||||
$availableKlasterIDs = Klaster::orderBy('id', 'asc')->pluck('id')->values();
|
||||
$centroidToKlaster = [];
|
||||
|
||||
foreach ($finalCentroids as $i => $centroid) {
|
||||
$centroidToKlaster[$centroid['index']] = $availableKlasterIDs[$i];
|
||||
}
|
||||
|
||||
|
||||
// Update ke database
|
||||
|
||||
|
||||
|
||||
// Update database
|
||||
foreach ($data as $item) {
|
||||
Curanmor::where('id', $item->id)->update([
|
||||
'klaster_id' => $centroidToKlaster[$item->temp_klaster],
|
||||
|
@ -202,12 +224,12 @@ public function hitungKMeansCuranmor()
|
|||
|
||||
// Format centroid awal
|
||||
$centroidAwalFormatted = collect($centroidAwal)->values()->map(function ($item, $index) {
|
||||
return ['C' . ($index + 1) => $item['C']];
|
||||
return ['C' . ($index + 1) => round($item['C'], 2)];
|
||||
});
|
||||
|
||||
// Format centroid akhir
|
||||
$centroidAkhirFormatted = $centroids->values()->map(function ($item, $index) {
|
||||
return ['C' . ($index + 1) => $item['C']];
|
||||
return ['C' . ($index + 1) => round($item['C'], 2)];
|
||||
});
|
||||
|
||||
return [
|
||||
|
@ -217,92 +239,93 @@ public function hitungKMeansCuranmor()
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
public function SSEElbowCuranmor()
|
||||
{
|
||||
$data = Curanmor::select('id', 'jumlah_curanmor')->get();
|
||||
$maxK = 10;
|
||||
$maxK = 15;
|
||||
$maxIterasi = 100;
|
||||
$elbowData = [];
|
||||
|
||||
$min = $data->min('jumlah_curanmor');
|
||||
$max = $data->max('jumlah_curanmor');
|
||||
|
||||
// Loop untuk setiap nilai k dari 2 hingga maxK
|
||||
// Normalisasi jumlah_curanmor
|
||||
$normalizedData = $data->map(function ($item) use ($min, $max) {
|
||||
$item->normalized = ($max - $min) == 0 ? 0 : round(($item->jumlah_curanmor - $min) / ($max - $min), 2);
|
||||
return $item;
|
||||
});
|
||||
|
||||
for ($k = 2; $k <= $maxK; $k++) {
|
||||
$usedValues = [];
|
||||
$centroids = collect();
|
||||
|
||||
// Inisialisasi centroid secara acak dari nilai 0 sampai 1 dengan 2 desimal
|
||||
while ($centroids->count() < $k) {
|
||||
$randVal = mt_rand($min, $max);
|
||||
$randVal = round(mt_rand(0, 10000) / 10000, 2); // 2 angka desimal
|
||||
if (!in_array($randVal, $usedValues)) {
|
||||
$centroids->push(['jumlah_curanmor' => $randVal]);
|
||||
$centroids->push(['normalized' => $randVal]);
|
||||
$usedValues[] = $randVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$prevAssignment = [];
|
||||
|
||||
for ($iter = 0; $iter < $maxIterasi; $iter++) {
|
||||
$clustered = [];
|
||||
$currentAssignment = [];
|
||||
|
||||
foreach ($data as $item) {
|
||||
foreach ($normalizedData as $item) {
|
||||
$jarak = [];
|
||||
|
||||
// Hitung jarak antara data dan setiap centroid
|
||||
foreach ($centroids as $idx => $centroid) {
|
||||
$dist = abs($item->jumlah_curanmor - $centroid['jumlah_curanmor']);
|
||||
$dist = abs($item->normalized - $centroid['normalized']);
|
||||
$jarak[$idx] = $dist;
|
||||
}
|
||||
|
||||
// Tentukan cluster dengan jarak terdekat
|
||||
$minIndex = array_keys($jarak, min($jarak))[0];
|
||||
$clustered[$minIndex][] = $item;
|
||||
$currentAssignment[$item->id] = $minIndex;
|
||||
}
|
||||
|
||||
// Jika tidak ada perubahan cluster, break
|
||||
if ($currentAssignment === $prevAssignment) {
|
||||
break;
|
||||
}
|
||||
|
||||
$prevAssignment = $currentAssignment;
|
||||
|
||||
// Update centroid dengan rata-rata cluster
|
||||
foreach ($clustered as $key => $group) {
|
||||
$avg = collect($group)->avg('jumlah_curanmor');
|
||||
$avg = round(collect($group)->avg('normalized'), 2); // 2 angka desimal
|
||||
$centroids = $centroids->map(function ($centroid, $idx) use ($key, $avg) {
|
||||
return $idx == $key
|
||||
? ['jumlah_curanmor' => $avg]
|
||||
? ['normalized' => $avg]
|
||||
: $centroid;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Hitung SSE (Sum of Squared Errors)
|
||||
// Hitung SSE
|
||||
$sse = 0;
|
||||
foreach ($clustered as $key => $group) {
|
||||
$centroidVal = $centroids[$key]['jumlah_curanmor'];
|
||||
$centroidVal = $centroids[$key]['normalized'];
|
||||
foreach ($group as $item) {
|
||||
$sse += pow($item->jumlah_curanmor - $centroidVal, 2);
|
||||
$sse += pow($item->normalized - $centroidVal, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// Simpan SSE untuk nilai k
|
||||
$elbowData[] = [
|
||||
'k' => $k,
|
||||
'sse' => round($sse, 4)
|
||||
'sse' => round($sse, 2) // 2 angka desimal
|
||||
];
|
||||
}
|
||||
|
||||
// Simpan hasil SSE untuk setiap k ke file JSON
|
||||
file_put_contents(
|
||||
storage_path('app/public/sse_elbow_curanmor.json'),
|
||||
json_encode($elbowData, JSON_PRETTY_PRINT)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function SSEElbowCuras()
|
||||
{
|
||||
$data = Curas::select('id', 'jumlah_curas')->get();
|
||||
|
@ -313,82 +336,84 @@ public function SSEElbowCuras()
|
|||
$min = $data->min('jumlah_curas');
|
||||
$max = $data->max('jumlah_curas');
|
||||
|
||||
// Loop untuk setiap nilai k dari 2 hingga maxK
|
||||
// Normalisasi nilai jumlah_curas
|
||||
$normalizedData = $data->map(function ($item) use ($min, $max) {
|
||||
$item->normalized = ($max - $min) == 0 ? 0 : round(($item->jumlah_curas - $min) / ($max - $min), 2);
|
||||
return $item;
|
||||
});
|
||||
|
||||
for ($k = 2; $k <= $maxK; $k++) {
|
||||
$usedValues = [];
|
||||
$centroids = collect();
|
||||
|
||||
// Inisialisasi centroid secara acak dari nilai 0 sampai 1 dengan 2 desimal
|
||||
while ($centroids->count() < $k) {
|
||||
$randVal = mt_rand($min, $max);
|
||||
$randVal = round(mt_rand(0, 10000) / 10000, 2); // 0.00 - 1.00
|
||||
if (!in_array($randVal, $usedValues)) {
|
||||
$centroids->push(['jumlah_curas' => $randVal]);
|
||||
$centroids->push(['normalized' => $randVal]);
|
||||
$usedValues[] = $randVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$prevAssignment = [];
|
||||
|
||||
for ($iter = 0; $iter < $maxIterasi; $iter++) {
|
||||
$clustered = [];
|
||||
$currentAssignment = [];
|
||||
|
||||
foreach ($data as $item) {
|
||||
foreach ($normalizedData as $item) {
|
||||
$jarak = [];
|
||||
|
||||
// Hitung jarak antara data dan setiap centroid
|
||||
// Hitung jarak absolut (Manhattan Distance)
|
||||
foreach ($centroids as $idx => $centroid) {
|
||||
$dist = abs($item->jumlah_curas - $centroid['jumlah_curas']);
|
||||
$dist = abs($item->normalized - $centroid['normalized']);
|
||||
$jarak[$idx] = $dist;
|
||||
}
|
||||
|
||||
// Tentukan cluster dengan jarak terdekat
|
||||
$minIndex = array_keys($jarak, min($jarak))[0];
|
||||
$clustered[$minIndex][] = $item;
|
||||
$currentAssignment[$item->id] = $minIndex;
|
||||
}
|
||||
|
||||
// Jika tidak ada perubahan cluster, break
|
||||
if ($currentAssignment === $prevAssignment) {
|
||||
break;
|
||||
}
|
||||
|
||||
$prevAssignment = $currentAssignment;
|
||||
|
||||
// Update centroid dengan rata-rata cluster
|
||||
// Update centroid
|
||||
foreach ($clustered as $key => $group) {
|
||||
$avg = collect($group)->avg('jumlah_curas');
|
||||
$avg = round(collect($group)->avg('normalized'), 2);
|
||||
$centroids = $centroids->map(function ($centroid, $idx) use ($key, $avg) {
|
||||
return $idx == $key
|
||||
? ['jumlah_curas' => $avg]
|
||||
? ['normalized' => $avg]
|
||||
: $centroid;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Hitung SSE (Sum of Squared Errors)
|
||||
// Hitung SSE
|
||||
$sse = 0;
|
||||
foreach ($clustered as $key => $group) {
|
||||
$centroidVal = $centroids[$key]['jumlah_curas'];
|
||||
$centroidVal = $centroids[$key]['normalized'];
|
||||
foreach ($group as $item) {
|
||||
$sse += pow($item->jumlah_curas - $centroidVal, 2);
|
||||
$sse += pow($item->normalized - $centroidVal, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// Simpan SSE untuk nilai k
|
||||
$elbowData[] = [
|
||||
'k' => $k,
|
||||
'sse' => round($sse, 4)
|
||||
'sse' => round($sse, 2) // dibulatkan ke 2 desimal
|
||||
];
|
||||
}
|
||||
|
||||
// Simpan hasil SSE untuk setiap k ke file JSON
|
||||
file_put_contents(
|
||||
storage_path('app/public/sse_elbow_curas.json'),
|
||||
json_encode($elbowData, JSON_PRETTY_PRINT)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function hitungDBSCANManual()
|
||||
{
|
||||
$eps = 1.5; // Jarak maksimum antar titik
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
Kabupaten Probolinggo. </p>
|
||||
</div>
|
||||
|
||||
<a href="/dashboard/kecamatan/create" class="btn btn-primary add-list"><i class="las la-plus mr-3"></i>Tambah Kecamatan</a>
|
||||
{{-- <a href="/dashboard/kecamatan/create" class="btn btn-primary add-list"><i class="las la-plus mr-3"></i>Tambah Kecamatan</a> --}}
|
||||
</div>
|
||||
@if (session()->has('succes'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
|
@ -36,7 +36,7 @@
|
|||
</th>
|
||||
<th>No</th>
|
||||
<th class="text-center">Nama Kecamatan</th>
|
||||
<th>Action</th>
|
||||
{{-- <th>Action</th> --}}
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach ( $kecamatans as $kecamatan )
|
||||
|
@ -50,7 +50,7 @@
|
|||
</td>
|
||||
<td>{{ $kecamatan -> id }}</td>
|
||||
<td>{{ $kecamatan -> nama_kecamatan }}</td>
|
||||
<td class="text-center">
|
||||
{{-- <td class="text-center">
|
||||
<div class="d-flex align-items-center list-action">
|
||||
<a class="badge bg-success mr-2" data-toggle="tooltip" data-placement="top" title=""
|
||||
href="/dashboard/kecamatan/{{ $kecamatan ->id}}/edit"><i class="ri-pencil-line mr-0"></i></a>
|
||||
|
@ -61,7 +61,7 @@
|
|||
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</td> --}}
|
||||
</tr>
|
||||
</tbody>
|
||||
@endforeach
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<p class="mb-0">Berikut merupakan data Klaster atau Kategori yang dijadikan sebagai acuan pemetaan.<br>
|
||||
Ingat dalam pengisian data klaster, kategori aman atau rendah dimulai dari id 1</p>
|
||||
</div>
|
||||
<a href="/dashboard/klaster/create" class="btn btn-primary add-list"><i class="las la-plus mr-3"></i>Tambah Klaster</a>
|
||||
</div>
|
||||
</div>
|
||||
@if (session()->has('succes'))
|
||||
|
@ -36,7 +35,7 @@
|
|||
<th>id</th>
|
||||
<th>Nama Klaster</th>
|
||||
<th>Warna</th>
|
||||
<th>Action</th>
|
||||
{{-- <th>Action</th> --}}
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach ( $klasters as $klaster )
|
||||
|
@ -51,7 +50,7 @@
|
|||
<td>{{ $klaster -> id }}</td>
|
||||
<td>{{ $klaster -> nama_klaster }}</td>
|
||||
<td style="background-color: {{ $klaster->warna }}" >{{ $klaster -> warna }}</td>
|
||||
<td>
|
||||
{{-- <td>
|
||||
<div class="d-flex align-items-center list-action">
|
||||
<a class="badge bg-success mr-2" data-toggle="tooltip" data-placement="top" title=""
|
||||
href="/dashboard/klaster/{{ $klaster->id }}/edit"><i class="ri-pencil-line mr-0"></i></a>
|
||||
|
@ -62,7 +61,7 @@
|
|||
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</td> --}}
|
||||
</tr>
|
||||
</tbody>
|
||||
@endforeach
|
||||
|
|
|
@ -56,7 +56,21 @@
|
|||
<span class="ml-4">Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class=" {{ Request::is('dashboard/kecamatan')||Request::is('dashboard/kecamatan/create') ? 'active' : '' }}">
|
||||
<li class="{{ Request::is('dashboard/kecamatan') ? 'active' : '' }}">
|
||||
<a href="/dashboard/kecamatan" class="svg-icon">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M5.875 12.5729C5.30847 11.2498 5 9.84107 5 8.51463C5 4.9167 8.13401 2 12 2C15.866 2 19 4.9167 19 8.51463C19 12.0844 16.7658 16.2499 13.2801 17.7396C12.4675 18.0868 11.5325 18.0868 10.7199 17.7396C9.60664 17.2638 8.62102 16.5151 7.79508 15.6" stroke="#676e8a" stroke-width="1.9200000000000004" stroke-linecap="round"></path> <path d="M14 9C14 10.1046 13.1046 11 12 11C10.8954 11 10 10.1046 10 9C10 7.89543 10.8954 7 12 7C13.1046 7 14 7.89543 14 9Z" stroke="#676e8a" stroke-width="1.9200000000000004"></path> <path d="M20.9605 15.5C21.6259 16.1025 22 16.7816 22 17.5C22 18.4251 21.3797 19.285 20.3161 20M3.03947 15.5C2.37412 16.1025 2 16.7816 2 17.5C2 19.9853 6.47715 22 12 22C13.6529 22 15.2122 21.8195 16.5858 21.5" stroke="#676e8a" stroke-width="1.9200000000000004" stroke-linecap="round"></path> </g></svg>
|
||||
<span class="ml-4">Kecamatan</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/klaster') ? 'active' : '' }}">
|
||||
<a href="/dashboard/klaster" class="svg-icon">
|
||||
<svg class="svg-icon" id="p-dash4" width="20" height="20" xmlns="http://www.w3.org/ 2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path>
|
||||
</svg>
|
||||
<span class="ml-4">Klaster</span>
|
||||
</a>
|
||||
</li>
|
||||
{{-- <li class=" {{ Request::is('dashboard/kecamatan')||Request::is('dashboard/kecamatan/create') ? 'active' : '' }}">
|
||||
<a href="#product" class="collapsed" data-toggle="collapse" aria-expanded="false">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M5.875 12.5729C5.30847 11.2498 5 9.84107 5 8.51463C5 4.9167 8.13401 2 12 2C15.866 2 19 4.9167 19 8.51463C19 12.0844 16.7658 16.2499 13.2801 17.7396C12.4675 18.0868 11.5325 18.0868 10.7199 17.7396C9.60664 17.2638 8.62102 16.5151 7.79508 15.6" stroke="#676e8a" stroke-width="1.9200000000000004" stroke-linecap="round"></path> <path d="M14 9C14 10.1046 13.1046 11 12 11C10.8954 11 10 10.1046 10 9C10 7.89543 10.8954 7 12 7C13.1046 7 14 7.89543 14 9Z" stroke="#676e8a" stroke-width="1.9200000000000004"></path> <path d="M20.9605 15.5C21.6259 16.1025 22 16.7816 22 17.5C22 18.4251 21.3797 19.285 20.3161 20M3.03947 15.5C2.37412 16.1025 2 16.7816 2 17.5C2 19.9853 6.47715 22 12 22C13.6529 22 15.2122 21.8195 16.5858 21.5" stroke="#676e8a" stroke-width="1.9200000000000004" stroke-linecap="round"></path> </g></svg>
|
||||
<span class="ml-4">Kecamatan</span>
|
||||
|
@ -99,7 +113,7 @@
|
|||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</li> --}}
|
||||
<li class=" {{ Request::is('dashboard/curas')||Request::is('dashboard/curas/create') ||Request::is('dashboard/curanmor/create') ||Request::is('dashboard/curanmor/create') ||Request::is('dashboard/detail-curas') ||Request::is('dashboard/detail-curanmor') ? 'active' : '' }}">
|
||||
<a href="#people" class="collapsed" data-toggle="collapse" aria-expanded="false">
|
||||
<svg class="svg-icon" id="p-dash8" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
|
|
Loading…
Reference in New Issue