Update fitur show edit dan blade curanmor
This commit is contained in:
parent
0926843fc9
commit
319f3ca1ff
|
@ -56,9 +56,20 @@ public function show(Curanmor $curanmor)
|
||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*/
|
*/
|
||||||
public function edit(Curanmor $curanmor)
|
public function edit($curanmor)
|
||||||
{
|
{
|
||||||
//
|
try {
|
||||||
|
|
||||||
|
$edit = Curanmor::find($curanmor);
|
||||||
|
|
||||||
|
return view('admin.dashboardEditCuranmor', [
|
||||||
|
'curanmor' => $edit,
|
||||||
|
'kecamatans' => Kecamatan::all(),
|
||||||
|
'klasters' => Klaster::all(),
|
||||||
|
]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +83,7 @@ public function update(Request $request, Curanmor $curanmor)
|
||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*/
|
*/
|
||||||
public function destroy(Curanmor $curanmor)
|
public function destroy($curanmor)
|
||||||
{
|
{
|
||||||
try{
|
try{
|
||||||
$hapus = Curanmor::find($curanmor);
|
$hapus = Curanmor::find($curanmor);
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
<x-layoutAdmin>
|
||||||
|
<div class="content-page">
|
||||||
|
<div class="container-fluid add-form-list">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header d-flex justify-content-between">
|
||||||
|
<div class="header-title">
|
||||||
|
<h4 class="card-title">Ubah Data Kasus CURANMOR Pada Kecamatan
|
||||||
|
{{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan}}</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="/curanmor/{{ $curanmor->id }}" data-toggle="validator" method="post">
|
||||||
|
@method('put')
|
||||||
|
@csrf
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Nama Kecamatan *</label>
|
||||||
|
<select class="selectpicker form-control" data-style="py-0" id="kecamatan_id" name="kecamatan_id">
|
||||||
|
<option value="" selected disabled> Pilih Kecamatan </option>
|
||||||
|
@foreach ( $kecamatans as $kecamatan )
|
||||||
|
<option value="{{ $kecamatan->id }}"
|
||||||
|
{{ old('kecamatan_id', $curanmor->kecamatan_id) == $kecamatan->id ? 'selected' : '' }}>
|
||||||
|
{{ $kecamatan->nama_kecamatan }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Jumlah Kasus Curanmor *</label>
|
||||||
|
<input type="text" class="form-control" placeholder="Jumlah Kasus Curanmor" id="jumlah_curanmor" name="jumlah_curanmor" value="{{ old('jumlah_curanmor', $curanmor ->jumlah_curanmor )}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Klaster *</label>
|
||||||
|
<select class="selectpicker form-control" data-style="py-0" name="klaster_id" id="klaster_id">
|
||||||
|
<option value="" selected disabled>Pilih Klaster</option>
|
||||||
|
@foreach ( $klasters as $klaster )
|
||||||
|
<option value="{{ $klaster->id }}" style="background-color: {{ $klaster->warna }}" {{ old('klaster_id', $curanmor->klaster_id) == $klaster->id ? 'selected' : '' }}>{{ $klaster->nama_klaster }}</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2">Tambah Data Kasus CURANMOR</button>
|
||||||
|
<button type="reset" class="btn btn-danger">Reset</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Page end -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-layoutAdmin>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<p class="mb-0">Sales enables you to effectively control sales KPIs and monitor them in one central<br>
|
<p class="mb-0">Sales enables you to effectively control sales KPIs and monitor them in one central<br>
|
||||||
place while helping teams to reach sales goals. </p>
|
place while helping teams to reach sales goals. </p>
|
||||||
</div>
|
</div>
|
||||||
<a href="/curanmor/create" class="btn btn-primary add-list"><i class="las la-plus mr-3"></i>Tambah Data Curanmor</a>
|
<a href="/curanmor/create" class="btn btn-primary add-list"><i class="las la-plus mr-3"></i>Tambah Kasus Curanmor</a>
|
||||||
</div>
|
</div>
|
||||||
@if (session()->has('succes'))
|
@if (session()->has('succes'))
|
||||||
<div class="alert alert-success" role="alert">
|
<div class="alert alert-success" role="alert">
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
</th>
|
</th>
|
||||||
<th>id</th>
|
<th>id</th>
|
||||||
<th>Nama Kecamatan</th>
|
<th>Nama Kecamatan</th>
|
||||||
<th>Jumlah Kasus Curas</th>
|
<th>Jumlah Kasus Curanmor</th>
|
||||||
<th>Klaster</th>
|
<th>Klaster</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -50,17 +50,19 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $curanmor->id }}</td>
|
<td>{{ $curanmor->id }}</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>
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex align-items-center list-action">
|
<div class="d-flex align-items-center list-action">
|
||||||
<a class="badge badge-info mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="View"
|
|
||||||
href="#"><i class="ri-eye-line mr-0"></i></a>
|
|
||||||
<a class="badge bg-success mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit"
|
<a class="badge bg-success mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit"
|
||||||
href="#"><i class="ri-pencil-line mr-0"></i></a>
|
href="/curanmor/{{ $curanmor->id }}/edit"><i class="ri-pencil-line mr-0"></i></a>
|
||||||
<a class="badge bg-warning mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete"
|
<form action="/curanmor/{{ $curanmor->id }}" method="post" class="d-inline">
|
||||||
href="#"><i class="ri-delete-bin-line mr-0"></i></a>
|
@method('delete')
|
||||||
|
@csrf
|
||||||
|
<button type="submit" class="badge bg-warning mr-2 border-0"><i class="ri-delete-bin-line mr-0"></i></button>
|
||||||
|
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue