Merge pull request #8 from arieeefajar/fix/master-indicator
fix(master-indicator): create store and delete func
This commit is contained in:
commit
930f079ff0
|
@ -15,34 +15,57 @@ public function index()
|
||||||
return view('master-data.indikator.index', compact('indicators'));
|
return view('master-data.indikator.index', compact('indicators'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$customMessage = [
|
||||||
|
"name.required" => "Nama wajib diisi",
|
||||||
|
"name.max" => "Nama maksimal 25 karakter",
|
||||||
|
"name.string" => "Nama harus berupa string",
|
||||||
|
|
||||||
|
"description.required" => "Deskripsi wajib diisi",
|
||||||
|
"description.max" => "Deskripsi maksimal 50 karakter",
|
||||||
|
"description.string" => "Deskripsi harus berupa string",
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), [
|
||||||
|
'name' => 'required|string|max:25',
|
||||||
|
'description' => 'required|string|max:50',
|
||||||
|
], $customMessage);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
toast($validator->messages()->all()[0], 'error')->position('top-right')->autoclose(3000);
|
||||||
|
return redirect()->back()->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
$indicator = new Indicator();
|
||||||
|
$indicator->name = $request->name;
|
||||||
|
$indicator->description = $request->description;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$indicator->save();
|
||||||
|
toast('Data berhasil disimpan', 'success')->position('top-right')->autoclose(3000);
|
||||||
|
return redirect()->back();
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
toast('Terjadi kesalahan', 'error')->position('top')->autoclose(3000);
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
$customMessage = [
|
$customMessage = [
|
||||||
"name.required" => "Nama wajib diisi",
|
"name.required" => "Nama wajib diisi",
|
||||||
"name.max" => "Nama maksimal 255 karakter",
|
"name.max" => "Nama maksimal 25 karakter",
|
||||||
"name.string" => "Nama harus berupa string",
|
"name.string" => "Nama harus berupa string",
|
||||||
|
|
||||||
"description.required" => "Deskripsi wajib diisi",
|
"description.required" => "Deskripsi wajib diisi",
|
||||||
"description.max" => "Deskripsi maksimal 255 karakter",
|
"description.max" => "Deskripsi maksimal 50 karakter",
|
||||||
"description.string" => "Deskripsi harus berupa string",
|
"description.string" => "Deskripsi harus berupa string",
|
||||||
|
|
||||||
"ideal_min.required" => "Nilai ideal minimum wajib diisi",
|
|
||||||
"ideal_min.numeric" => "Nilai ideal minimum harus berupa angka",
|
|
||||||
|
|
||||||
"ideal_max.required" => "Nilai ideal maksimum wajib diisi",
|
|
||||||
"ideal_max.numeric" => "Nilai ideal maksimum harus berupa angka",
|
|
||||||
|
|
||||||
"unit.required" => "Unit wajib diisi",
|
|
||||||
"unit.max" => "Unit maksimal 255 karakter",
|
|
||||||
"unit.string" => "Unit harus berupa string",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), [
|
$validator = Validator::make($request->all(), [
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:25',
|
||||||
'description' => 'required|string|max:255',
|
'description' => 'required|string|max:50',
|
||||||
'ideal_min' => 'required|numeric',
|
|
||||||
'ideal_max' => 'required|numeric',
|
|
||||||
'unit' => 'required|string|max:255',
|
|
||||||
], $customMessage);
|
], $customMessage);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
|
@ -53,9 +76,6 @@ public function update(Request $request, $id)
|
||||||
$indicator = Indicator::find($id);
|
$indicator = Indicator::find($id);
|
||||||
$indicator->name = $request->name;
|
$indicator->name = $request->name;
|
||||||
$indicator->description = $request->description;
|
$indicator->description = $request->description;
|
||||||
$indicator->ideal_min = $request->ideal_min;
|
|
||||||
$indicator->ideal_max = $request->ideal_max;
|
|
||||||
$indicator->unit = $request->unit;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$indicator->save();
|
$indicator->save();
|
||||||
|
@ -66,4 +86,17 @@ public function update(Request $request, $id)
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
$indicator = Indicator::find($id);
|
||||||
|
try {
|
||||||
|
$indicator->delete();
|
||||||
|
toast('Data berhasil dihapus', 'success')->position('top-right')->autoclose(3000);
|
||||||
|
return redirect()->back();
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
toast('Terjadi kesalahan', 'error')->position('top')->autoclose(3000);
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,13 @@ class EvaluationDetail extends Model
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
// protected $fillable = [
|
|
||||||
// 'evaluation_id',
|
|
||||||
// 'indicator_id',
|
|
||||||
// 'value',
|
|
||||||
// 'cf',
|
|
||||||
// ];
|
|
||||||
|
|
||||||
public function evaluation()
|
public function evaluation()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Evalutaion::class);
|
return $this->belongsTo(Evalutaion::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function indicator()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Indicator::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,9 @@ class Evalutaion extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $table = 'evaluations';
|
protected $table = 'evaluation';
|
||||||
|
|
||||||
|
protected $guarded = [];
|
||||||
|
|
||||||
public function land()
|
public function land()
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,12 +10,5 @@ class Indicator extends Model
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $table = 'indicators';
|
protected $table = 'indicators';
|
||||||
|
protected $guarded = [];
|
||||||
protected $fillable = [
|
|
||||||
'name',
|
|
||||||
'description',
|
|
||||||
'ideal_min',
|
|
||||||
'ideal_max',
|
|
||||||
'unit',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,11 @@ class Rule extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $table = 'rules';
|
protected $table = 'rule';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'indicator_id',
|
'indicator_id',
|
||||||
'range_min',
|
|
||||||
'range_max',
|
|
||||||
'mb',
|
'mb',
|
||||||
'md',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public function indicator()
|
public function indicator()
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'enabled' => env('DEBUGBAR_ENABLED', true),
|
'enabled' => env('DEBUGBAR_ENABLED', false),
|
||||||
'hide_empty_tabs' => false, // Hide tabs until they have content
|
'hide_empty_tabs' => false, // Hide tabs until they have content
|
||||||
'except' => [
|
'except' => [
|
||||||
'telescope*',
|
'telescope*',
|
||||||
|
|
|
@ -15,9 +15,6 @@ public function up(): void
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description');
|
$table->string('description');
|
||||||
$table->float('ideal_min');
|
|
||||||
$table->float('ideal_max');
|
|
||||||
$table->string('unit');
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,17 +11,14 @@
|
||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('rules', function (Blueprint $table) {
|
Schema::create('rule', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->unsignedBigInteger('indicator_id');
|
$table->unsignedBigInteger('indicator_id');
|
||||||
$table->float('range_min');
|
|
||||||
$table->float('range_max');
|
|
||||||
$table->float('mb');
|
$table->float('mb');
|
||||||
$table->float('md');
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('rules', function (Blueprint $table) {
|
Schema::table('rule', function (Blueprint $table) {
|
||||||
$table->foreign('indicator_id')->references('id')->on('indicators')->onDelete('cascade');
|
$table->foreign('indicator_id')->references('id')->on('indicators')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -31,6 +28,6 @@ public function up(): void
|
||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('rules');
|
Schema::dropIfExists('rule');
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -11,13 +11,15 @@
|
||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('evaluations', function (Blueprint $table) {
|
Schema::create('evaluation', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->unsignedBigInteger('land_id');
|
$table->unsignedBigInteger('land_id');
|
||||||
|
$table->float('cf_value');
|
||||||
|
$table->string('conclusion');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('evaluations', function (Blueprint $table) {
|
Schema::table('evaluation', function (Blueprint $table) {
|
||||||
$table->foreign('land_id')->references('id')->on('land')->onDelete('cascade');
|
$table->foreign('land_id')->references('id')->on('land')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -27,6 +29,6 @@ public function up(): void
|
||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('evaluations');
|
Schema::dropIfExists('evaluation');
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -15,13 +15,12 @@ public function up(): void
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->unsignedBigInteger('evaluation_id');
|
$table->unsignedBigInteger('evaluation_id');
|
||||||
$table->unsignedBigInteger('indicator_id');
|
$table->unsignedBigInteger('indicator_id');
|
||||||
$table->float('value');
|
$table->float('md_value');
|
||||||
$table->float('cf');
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('evaluation_details', function (Blueprint $table) {
|
Schema::table('evaluation_details', function (Blueprint $table) {
|
||||||
$table->foreign('evaluation_id')->references('id')->on('evaluations')->onDelete('cascade');
|
$table->foreign('evaluation_id')->references('id')->on('evaluation')->onDelete('cascade');
|
||||||
$table->foreign('indicator_id')->references('id')->on('indicators')->onDelete('cascade');
|
$table->foreign('indicator_id')->references('id')->on('indicators')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -13,35 +13,16 @@ class IndicatorSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
[
|
$indicator = [
|
||||||
Indicator::create([
|
['name' => 'pH Tanah', 'description' => 'Indicator 1 Description'],
|
||||||
"name" => "pH Tanah",
|
['name' => 'Ketinggian Tempat', 'description' => 'Indicator 2 Description'],
|
||||||
"description" => "Tingkat keasaman tanah.",
|
['name' => 'Ketersediaan Air', 'description' => 'Indicator 3 Description'],
|
||||||
"ideal_min" => 5.5,
|
['name' => 'Curah Hujan', 'description' => 'Indicator 4 Description'],
|
||||||
"ideal_max" => 7.0,
|
['name' => 'Isolasi', 'description' => 'Indicator 5 Description']
|
||||||
"unit" => "pH"
|
|
||||||
]),
|
|
||||||
Indicator::create([
|
|
||||||
"name" => "Ketinggian Tempat",
|
|
||||||
"description" => "Ketinggian dari permukaan laut..",
|
|
||||||
"ideal_min" => 0,
|
|
||||||
"ideal_max" => 1000,
|
|
||||||
"unit" => "meter"
|
|
||||||
]),
|
|
||||||
Indicator::create([
|
|
||||||
"name" => "Ketersediaan Air",
|
|
||||||
"description" => "Ketersediaan air di lahan.",
|
|
||||||
"ideal_min" => 70,
|
|
||||||
"ideal_max" => 100,
|
|
||||||
"unit" => "persen"
|
|
||||||
]),
|
|
||||||
Indicator::create([
|
|
||||||
"name" => "Curah Hujan",
|
|
||||||
"description" => "Intensitas curah hujan.",
|
|
||||||
"ideal_min" => 1000,
|
|
||||||
"ideal_max" => 2000,
|
|
||||||
"unit" => "mm/tahun"
|
|
||||||
]),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
foreach ($indicator as $item) {
|
||||||
|
Indicator::create($item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,63 +13,16 @@ class RuleSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
[
|
$rules = [
|
||||||
Rule::create([
|
['indicator_id' => 1, 'mb' => 0.5],
|
||||||
'indicator_id' => 1,
|
['indicator_id' => 2, 'mb' => 0.5],
|
||||||
'range_min' => 5.5,
|
['indicator_id' => 3, 'mb' => 0.5],
|
||||||
'range_max' => 6.0,
|
['indicator_id' => 4, 'mb' => 0.5],
|
||||||
'mb' => 0.8,
|
['indicator_id' => 5, 'mb' => 0.5],
|
||||||
'md' => 0.2
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 1,
|
|
||||||
'range_min' => 6.0,
|
|
||||||
'range_max' => 7.0,
|
|
||||||
'mb' => 1.0,
|
|
||||||
'md' => 0.0
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 2,
|
|
||||||
'range_min' => 0,
|
|
||||||
'range_max' => 500,
|
|
||||||
'mb' => 0.9,
|
|
||||||
'md' => 0.1
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 2,
|
|
||||||
'range_min' => 500,
|
|
||||||
'range_max' => 1000,
|
|
||||||
'mb' => 0.8,
|
|
||||||
'md' => 0.2
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 3,
|
|
||||||
'range_min' => 70,
|
|
||||||
'range_max' => 85,
|
|
||||||
'mb' => 0.7,
|
|
||||||
'md' => 0.3
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 3,
|
|
||||||
'range_min' => 85,
|
|
||||||
'range_max' => 100,
|
|
||||||
'mb' => 1.0,
|
|
||||||
'md' => 0.0
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 4,
|
|
||||||
'range_min' => 1000,
|
|
||||||
'range_max' => 1500,
|
|
||||||
'mb' => 0.9,
|
|
||||||
'md' => 0.1
|
|
||||||
]),
|
|
||||||
Rule::create([
|
|
||||||
'indicator_id' => 4,
|
|
||||||
'range_min' => 1500,
|
|
||||||
'range_max' => 2000,
|
|
||||||
'mb' => 1.0,
|
|
||||||
'md' => 0.0
|
|
||||||
]),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
foreach ($rules as $rule) {
|
||||||
|
Rule::create($rule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,22 +18,20 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateData(indicator) {
|
function updateData(indicator) {
|
||||||
console.log(indicator);
|
|
||||||
var form = document.getElementById("edit-form");
|
var form = document.getElementById("edit-form");
|
||||||
var indicatorName = form.querySelector('input[name="name"]');
|
var indicatorName = form.querySelector('input[name="name"]');
|
||||||
var description = form.querySelector('textarea[name="description"]');
|
var description = form.querySelector('textarea[name="description"]');
|
||||||
var idealMin = form.querySelector('input[name="ideal_min"]');
|
|
||||||
var idealMax = form.querySelector('input[name="ideal_max"]');
|
|
||||||
var unit = form.querySelector('input[name="unit"]');
|
|
||||||
|
|
||||||
indicatorName.value = indicator.name;
|
indicatorName.value = indicator.name;
|
||||||
description.value = indicator.description;
|
description.value = indicator.description;
|
||||||
idealMin.value = indicator.ideal_min;
|
|
||||||
idealMax.value = indicator.ideal_max;
|
|
||||||
unit.value = indicator.unit;
|
|
||||||
form.action = "/data-indikator/" + indicator.id;
|
form.action = "/data-indikator/" + indicator.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteData(id) {
|
||||||
|
var form = document.getElementById("delete-form");
|
||||||
|
form.action = "/data-indikator/" + id;
|
||||||
|
}
|
||||||
|
|
||||||
var checkAll = document.getElementById("checkAll");
|
var checkAll = document.getElementById("checkAll");
|
||||||
checkAll &&
|
checkAll &&
|
||||||
(checkAll.onclick = function () {
|
(checkAll.onclick = function () {
|
||||||
|
@ -52,14 +50,7 @@ checkAll &&
|
||||||
});
|
});
|
||||||
var perPage = 8,
|
var perPage = 8,
|
||||||
options = {
|
options = {
|
||||||
valueNames: [
|
valueNames: ["id", "indicator_name", "status"],
|
||||||
"id",
|
|
||||||
"indicator_name",
|
|
||||||
"description",
|
|
||||||
"ideal_min",
|
|
||||||
"ideal_max",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
page: perPage,
|
page: perPage,
|
||||||
pagination: !0,
|
pagination: !0,
|
||||||
plugins: [ListPagination({ left: 2, right: 2 })],
|
plugins: [ListPagination({ left: 2, right: 2 })],
|
||||||
|
@ -180,11 +171,11 @@ refreshCallbacks(),
|
||||||
.querySelector(".modal-footer").style.display = "none"));
|
.querySelector(".modal-footer").style.display = "none"));
|
||||||
}),
|
}),
|
||||||
ischeckboxcheck(),
|
ischeckboxcheck(),
|
||||||
document
|
// document
|
||||||
.getElementById("showModal")
|
// .getElementById("showModal")
|
||||||
.addEventListener("hidden.bs.modal", function () {
|
// .addEventListener("hidden.bs.modal", function () {
|
||||||
clearFields();
|
// clearFields();
|
||||||
}),
|
// }),
|
||||||
document
|
document
|
||||||
.querySelector("#customerList")
|
.querySelector("#customerList")
|
||||||
.addEventListener("click", function () {
|
.addEventListener("click", function () {
|
||||||
|
|
|
@ -33,14 +33,14 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div id="customerList">
|
<div id="customerList">
|
||||||
<div class="row g-4 mb-3">
|
<div class="row g-4 mb-3">
|
||||||
{{-- <div class="col-sm-auto">
|
<div class="col-sm-auto">
|
||||||
<div>
|
<div>
|
||||||
<button type="button" class="btn btn-primary add-btn" data-bs-toggle="modal"
|
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal"
|
||||||
id="create-btn" data-bs-target="#showModal">
|
id="create-btn" data-bs-target="#addModal">
|
||||||
<i class="ri-add-line align-bottom me-1"></i> Tambah
|
<i class="ri-add-line align-bottom me-1"></i> Tambah
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div> --}}
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div class="d-flex justify-content-sm-end">
|
<div class="d-flex justify-content-sm-end">
|
||||||
<div class="search-box ms-2">
|
<div class="search-box ms-2">
|
||||||
|
@ -62,13 +62,6 @@
|
||||||
Name
|
Name
|
||||||
</th>
|
</th>
|
||||||
<th class="sort" data-sort="description">Description</th>
|
<th class="sort" data-sort="description">Description</th>
|
||||||
<th class="sort" data-sort="ideal_min">Ideal Min</th>
|
|
||||||
<th class="sort" data-sort="ideal_max">
|
|
||||||
Ideal Max
|
|
||||||
</th>
|
|
||||||
<th class="sort" data-sort="status">
|
|
||||||
Unit
|
|
||||||
</th>
|
|
||||||
<th class="sort" data-sort="action">Action</th>
|
<th class="sort" data-sort="action">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -81,11 +74,8 @@
|
||||||
class="fw-medium link-primary">#VZ2101</a>
|
class="fw-medium link-primary">#VZ2101</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="indicator_name">{{ $indicator->name }}</td>
|
<td class="indicator_name">{{ $indicator->name }}</td>
|
||||||
<td class="description">{{ $indicator->description }}</td>
|
|
||||||
<td class="ideal_min">{{ $indicator->ideal_min }}</td>
|
|
||||||
<td class="ideal_max">{{ $indicator->ideal_max }}</td>
|
|
||||||
<td class="status">
|
<td class="status">
|
||||||
<span>{{ $indicator->unit }}</span>
|
<span>{{ $indicator->description }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex gap-2 justify-content-center">
|
<div class="d-flex gap-2 justify-content-center">
|
||||||
|
@ -96,12 +86,14 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{-- <div class="remove">
|
<div class="remove">
|
||||||
<button class="btn btn-sm btn-success remove-item-btn"
|
<button class="btn btn-sm btn-danger remove-item-btn"
|
||||||
data-bs-toggle="modal" data-bs-target="#deleteRecordModal">
|
data-bs-toggle="modal"
|
||||||
Remove
|
data-bs-target="#deleteRecordModal"
|
||||||
|
onclick="deleteData({{ $indicator->id }})">
|
||||||
|
Hapus
|
||||||
</button>
|
</button>
|
||||||
</div> --}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -141,12 +133,65 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
{{-- edit modal --}}
|
{{-- add modal --}}
|
||||||
<div class="modal fade" id="showModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
<div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header bg-light p-3">
|
<div class="modal-header bg-light p-3">
|
||||||
<h5 class="modal-title" id="exampleModalLabel"></h5>
|
<h5 class="modal-title" id="exampleModalLabel">Tambah Indikator</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
||||||
|
id="close-modal"></button>
|
||||||
|
</div>
|
||||||
|
<form action="" class="needs-validation" method="POST" novalidate id="add-form">
|
||||||
|
@csrf
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3" id="modal-id" style="display: none">
|
||||||
|
<label for="id-field" class="form-label">ID</label>
|
||||||
|
<input type="text" id="id-field" class="form-control" placeholder="ID"
|
||||||
|
readonly />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="indicatorname-field" class="form-label">Indikator</label>
|
||||||
|
<input type="text" id="indicatorname-field" class="form-control" name="name"
|
||||||
|
value="{{ old('name') }}" placeholder="Masukan Nama Indikator" required
|
||||||
|
autocomplete="off" />
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Masukan Nama Indikator
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="description-field" class="form-label">Description</label>
|
||||||
|
<textarea name="description" id="description-field" id="description-field" rows="5" class="form-control"
|
||||||
|
placeholder="Masukan Deskripsi" required>{{ old('description') }}</textarea>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Masukan Deskripsi
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="hstack gap-2 justify-content-end">
|
||||||
|
<button type="button" class="btn btn-light" data-bs-dismiss="modal">
|
||||||
|
Tutup
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-success" id="edit-btn">
|
||||||
|
Simpan
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- edit modal --}}
|
||||||
|
<div class="modal fade" id="showModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
||||||
|
aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header bg-light p-3">
|
||||||
|
<h5 class="modal-title" id="exampleModalLabel">Update Data Indikator</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
||||||
id="close-modal"></button>
|
id="close-modal"></button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,13 +208,14 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="indicatorname-field" class="form-label">Indikator</label>
|
<label for="indicatorname-field" class="form-label">Indikator</label>
|
||||||
<input type="text" id="indicatorname-field" class="form-control" name="name"
|
<input type="text" id="indicatorname-field" class="form-control" name="name"
|
||||||
value="{{ old('name') }}" placeholder="Masukan Nama Indikator" required />
|
value="{{ old('name') }}" placeholder="Masukan Nama Indikator" required
|
||||||
|
autocomplete="off" />
|
||||||
<div class="invalid-feedback">
|
<div class="invalid-feedback">
|
||||||
Masukan Nama Indikator
|
Masukan Nama Indikator
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div>
|
||||||
<label for="description-field" class="form-label">Description</label>
|
<label for="description-field" class="form-label">Description</label>
|
||||||
<textarea name="description" id="description-field" id="description-field" rows="5" class="form-control"
|
<textarea name="description" id="description-field" id="description-field" rows="5" class="form-control"
|
||||||
placeholder="Masukan Deskripsi" required>{{ old('description') }}</textarea>
|
placeholder="Masukan Deskripsi" required>{{ old('description') }}</textarea>
|
||||||
|
@ -177,33 +223,6 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
Masukan Deskripsi
|
Masukan Deskripsi
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="idealmin-field" class="form-label">Ideal Min</label>
|
|
||||||
<input type="text" id="idealmin-field" class="form-control" name="ideal_min"
|
|
||||||
value="{{ old('ideal_min') }}" placeholder="Masukan Ideal Min." required />
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
Masukan angka ideal min
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="idealmax-field" class="form-label">Ideal Max</label>
|
|
||||||
<input type="text" id="idealmax-field" class="form-control" name="ideal_max"
|
|
||||||
value="{{ old('ideal_max') }}" placeholder="Masukan Ideal Max." required />
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
Masukan angka ideal max
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label for="status-field" class="form-label">Unit</label>
|
|
||||||
<input type="text" id="status-field" class="form-control" name="unit"
|
|
||||||
value="{{ old('unit') }}" placeholder="Masukan Unit" required>
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
Masukan Unit
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="hstack gap-2 justify-content-end">
|
<div class="hstack gap-2 justify-content-end">
|
||||||
|
@ -234,19 +253,23 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
colors="primary:#25a0e2,secondary:#00bd9d"
|
colors="primary:#25a0e2,secondary:#00bd9d"
|
||||||
style="width: 100px; height: 100px"></lord-icon>
|
style="width: 100px; height: 100px"></lord-icon>
|
||||||
<div class="mt-4 pt-2 fs-15 mx-4 mx-sm-5">
|
<div class="mt-4 pt-2 fs-15 mx-4 mx-sm-5">
|
||||||
<h4>Are you sure ?</h4>
|
<h4>Anda yakin ?</h4>
|
||||||
<p class="text-muted mx-4 mb-0">
|
<p class="text-muted mx-4 mb-0">
|
||||||
Are you sure you want to remove this record ?
|
Anda yakin mau menghapus data ini ?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex gap-2 justify-content-center mt-4 mb-2">
|
<div class="d-flex gap-2 justify-content-center mt-4 mb-2">
|
||||||
<button type="button" class="btn w-sm btn-light" data-bs-dismiss="modal">
|
<button type="button" class="btn w-sm btn-light" data-bs-dismiss="modal">
|
||||||
Close
|
Tutup
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn w-sm btn-primary" id="delete-record">
|
<form action="" method="POST" id="delete-form">
|
||||||
Yes, Delete It!
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn w-sm btn-danger" id="delete-record">
|
||||||
|
Ya, Hapus!
|
||||||
</button>
|
</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -79,9 +79,9 @@
|
||||||
|
|
||||||
Route::prefix('data-indikator')->controller(IndicatorController::class)->name('indikator.')->group(function () {
|
Route::prefix('data-indikator')->controller(IndicatorController::class)->name('indikator.')->group(function () {
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
// Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::put('/{id}', 'update')->name('update');
|
Route::put('/{id}', 'update')->name('update');
|
||||||
// Route::delete('/{id}', 'destroy')->name('destroy');
|
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('data-aturan')->controller(RuleController::class)->name('aturan.')->group(function () {
|
Route::prefix('data-aturan')->controller(RuleController::class)->name('aturan.')->group(function () {
|
||||||
|
|
Loading…
Reference in New Issue