Merge pull request #29 from arieeefajar/fix/master-rule
Fix/master rule
This commit is contained in:
commit
fd3c9de0fd
|
@ -11,7 +11,7 @@ class IndicatorController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$indicators = Indicator::all();
|
||||
$indicators = Indicator::select('id', 'name')->orderBy('created_at', 'desc')->get();
|
||||
return view('master-data.indikator.index', compact('indicators'));
|
||||
}
|
||||
|
||||
|
@ -21,15 +21,10 @@ public function store(Request $request)
|
|||
"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()) {
|
||||
|
@ -39,7 +34,6 @@ public function store(Request $request)
|
|||
|
||||
$indicator = new Indicator();
|
||||
$indicator->name = $request->name;
|
||||
$indicator->description = $request->description;
|
||||
|
||||
try {
|
||||
$indicator->save();
|
||||
|
@ -57,15 +51,10 @@ public function update(Request $request, $id)
|
|||
"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()) {
|
||||
|
@ -75,7 +64,6 @@ public function update(Request $request, $id)
|
|||
|
||||
$indicator = Indicator::find($id);
|
||||
$indicator->name = $request->name;
|
||||
$indicator->description = $request->description;
|
||||
|
||||
try {
|
||||
$indicator->save();
|
||||
|
|
|
@ -12,7 +12,7 @@ class RuleController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$rules = Rule::with('indicator')->orderBy('created_at', 'desc')->get();
|
||||
$rules = Indicator::with('rules')->get();
|
||||
$indicators = Indicator::select('id', 'name')->get();
|
||||
return view('master-data.aturan.index', compact('rules', 'indicators'));
|
||||
}
|
||||
|
@ -23,21 +23,20 @@ public function store(Request $request)
|
|||
'indicator.required' => 'Harap pilih indikator',
|
||||
'indicator.exists' => 'Indikator tidak ditemukan',
|
||||
|
||||
'ideal_min.required' => 'Nilai minimum wajib diisi',
|
||||
'ideal_min.numeric' => 'Nilai minimum harus berupa angka',
|
||||
'parameter_type.required' => 'Jenis parameter wajib diisi',
|
||||
'parameter_type.string' => 'Jenis parameter harus berupa teks',
|
||||
'parameter_type.max' => 'Jenis parameter maksimal 25 karakter',
|
||||
|
||||
'ideal_max.required' => 'Nilai maksimum wajib diisi',
|
||||
'ideal_max.numeric' => 'Nilai maksimum harus berupa angka',
|
||||
|
||||
'mb.required' => 'Nilai MB wajib diisi',
|
||||
'mb.numeric' => 'Nilai MB harus berupa angka',
|
||||
'description.required' => 'Deskripsi wajib diisi',
|
||||
'description.string' => 'Deskripsi harus berupa teks',
|
||||
'description.max' => 'Deskripsi maksimal 40 karakter',
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'indicator' => 'required|exists:indicators,id',
|
||||
'ideal_min' => 'required|numeric',
|
||||
'ideal_max' => 'required|numeric',
|
||||
'mb' => 'required|numeric',
|
||||
'parameter_type' => 'required|string|max:25',
|
||||
'description' => 'required|string|max:40',
|
||||
'cf' => 'required|numeric|min:-8|max:1',
|
||||
], $customMessage);
|
||||
|
||||
if ($validator->fails()) {
|
||||
|
@ -46,11 +45,10 @@ public function store(Request $request)
|
|||
}
|
||||
|
||||
$rule = new Rule();
|
||||
|
||||
$rule->indicator_id = $request->indicator;
|
||||
$rule->ideal_min = $request->ideal_min;
|
||||
$rule->ideal_max = $request->ideal_max;
|
||||
$rule->mb = $request->mb;
|
||||
$rule->parameter_type = $request->parameter_type;
|
||||
$rule->description = $request->description;
|
||||
$rule->cf = $request->cf;
|
||||
|
||||
try {
|
||||
$rule->save();
|
||||
|
@ -64,25 +62,25 @@ public function store(Request $request)
|
|||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// dd($request->all());
|
||||
$customMessage = [
|
||||
'indicator.required' => 'Harap pilih indikator',
|
||||
'indicator.exists' => 'Indikator tidak ditemukan',
|
||||
'parameter_type.required' => 'Jenis parameter wajib diisi',
|
||||
'parameter_type.string' => 'Jenis parameter harus berupa teks',
|
||||
'parameter_type.max' => 'Jenis parameter maksimal 25 karakter',
|
||||
|
||||
'ideal_min.required' => 'Nilai minimum wajib diisi',
|
||||
'ideal_min.numeric' => 'Nilai minimum harus berupa angka',
|
||||
'description.required' => 'Deskripsi wajib diisi',
|
||||
'description.string' => 'Deskripsi harus berupa teks',
|
||||
'description.max' => 'Deskripsi maksimal 40 karakter',
|
||||
|
||||
'ideal_max.required' => 'Nilai maksimum wajib diisi',
|
||||
'ideal_max.numeric' => 'Nilai maksimum harus berupa angka',
|
||||
|
||||
'mb.required' => 'Nilai MB wajib diisi',
|
||||
'mb.numeric' => 'Nilai MB harus berupa angka',
|
||||
'cf.required' => 'Nilai CF wajib diisi',
|
||||
'cf.numeric' => 'Nilai CF harus berupa angka',
|
||||
'cf.max' => 'Nilai CF maksimal 1',
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'indicator' => 'required|exists:indicators,id',
|
||||
'ideal_min' => 'required|numeric',
|
||||
'ideal_max' => 'required|numeric',
|
||||
'mb' => 'required|numeric',
|
||||
'parameter_type' => 'required|string|max:25',
|
||||
'description' => 'required|string|max:40',
|
||||
'cf' => 'required|numeric|max:1',
|
||||
], $customMessage);
|
||||
|
||||
if ($validator->fails()) {
|
||||
|
@ -91,9 +89,9 @@ public function update(Request $request, $id)
|
|||
}
|
||||
|
||||
$rule = Rule::find($id);
|
||||
$rule->ideal_min = $request->ideal_min;
|
||||
$rule->ideal_max = $request->ideal_max;
|
||||
$rule->mb = $request->mb;
|
||||
$rule->parameter_type = $request->parameter_type;
|
||||
$rule->description = $request->description;
|
||||
$rule->cf = $request->cf;
|
||||
|
||||
try {
|
||||
$rule->save();
|
||||
|
|
|
@ -11,4 +11,10 @@ class Indicator extends Model
|
|||
|
||||
protected $table = 'indicators';
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return $this->hasMany(Rule::class, 'indicator_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ public function up(): void
|
|||
Schema::create('indicators', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@ public function up(): void
|
|||
Schema::create('rule', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('indicator_id');
|
||||
$table->float('ideal_min');
|
||||
$table->float('ideal_max');
|
||||
$table->float('mb');
|
||||
$table->string('parameter_type');
|
||||
$table->string('description');
|
||||
$table->float('cf');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ class IndicatorSeeder extends Seeder
|
|||
public function run(): void
|
||||
{
|
||||
$indicator = [
|
||||
['name' => 'pH Tanah', 'description' => 'Indicator 1 Description'],
|
||||
['name' => 'Ketinggian Tempat', 'description' => 'Indicator 2 Description'],
|
||||
['name' => 'Ketersediaan Air', 'description' => 'Indicator 3 Description'],
|
||||
['name' => 'Curah Hujan', 'description' => 'Indicator 4 Description'],
|
||||
['name' => 'Isolasi', 'description' => 'Indicator 5 Description']
|
||||
['name' => 'pH Tanah'],
|
||||
['name' => 'Ketinggian Tempat'],
|
||||
['name' => 'Ketersediaan Air'],
|
||||
['name' => 'Curah Hujan'],
|
||||
['name' => 'Isolasi Jarak']
|
||||
];
|
||||
|
||||
foreach ($indicator as $item) {
|
||||
|
|
|
@ -14,11 +14,31 @@ class RuleSeeder extends Seeder
|
|||
public function run(): void
|
||||
{
|
||||
$rules = [
|
||||
['indicator_id' => 1, 'ideal_min' => 5.5, 'ideal_max' => 7, 'mb' => 0.9],
|
||||
['indicator_id' => 2, 'ideal_min' => 0, 'ideal_max' => 1500, 'mb' => 0.8],
|
||||
['indicator_id' => 3, 'ideal_min' => 70, 'ideal_max' => 100, 'mb' => 0.7],
|
||||
['indicator_id' => 4, 'ideal_min' => 1000, 'ideal_max' => 2000, 'mb' => 0.9],
|
||||
['indicator_id' => 5, 'ideal_min' => 0, 'ideal_max' => 100, 'mb' => 0.8],
|
||||
// pH Tanah
|
||||
['indicator_id' => 1, 'parameter_type' => "Asam", 'description' => "Tingkat keasaman pH tanah kurang dari 6", 'cf' => -0.6],
|
||||
['indicator_id' => 1, 'parameter_type' => "Ideal", 'description' => "Tingkat keasaman pH tanah antara 6.0 - 7.0", 'cf' => 0.8],
|
||||
['indicator_id' => 1, 'parameter_type' => "Basa", 'description' => "Tingkat keasaman pH tanah lebih dari 7.0", 'cf' => -0.8],
|
||||
|
||||
// Ketinggian Tempat
|
||||
['indicator_id' => 2, 'parameter_type' => "Rendah", 'description' => "Lahan berada di dataran rendah (<200 mdpl)", 'cf' => -0.6],
|
||||
['indicator_id' => 2, 'parameter_type' => "Sedang", 'description' => "Lahan berada di ketinggian sedang (250 - 600 mdpl)", 'cf' => 0.8],
|
||||
['indicator_id' => 2, 'parameter_type' => "Tinggi", 'description' => "Lahan berada di dataran tinggi (>600 mdpl)", 'cf' => -0.4],
|
||||
|
||||
// Ketersediaan Air
|
||||
['indicator_id' => 3, 'parameter_type' => "Berlimpah", 'description' => "Irigasi teknis, air selalu tersedia sepanjang tahun", 'cf' => 1.0],
|
||||
['indicator_id' => 3, 'parameter_type' => "Cukup", 'description' => "Sumber air stabil, tetapi tidak selalu tersedia", 'cf' => 0.6],
|
||||
['indicator_id' => 3, 'parameter_type' => "Terbatas", 'description' => "Kadang-kadang mengalami kekeringan", 'cf' => -0.6],
|
||||
|
||||
// Curah Hujan
|
||||
['indicator_id' => 4, 'parameter_type' => "Rendah", 'description' => "Curah hujan kurang dari 1000 mm/tahun", 'cf' => -0.6],
|
||||
['indicator_id' => 4, 'parameter_type' => "Sedang", 'description' => "Curah hujan antara 1000 - 1500 mm/tahun", 'cf' => 0.6],
|
||||
['indicator_id' => 4, 'parameter_type' => "Tinggi", 'description' => "Curah hujan antara 1500 - 2000 mm/tahun", 'cf' => 0.8],
|
||||
['indicator_id' => 4, 'parameter_type' => "Sangat Tinggi", 'description' => "Curah hujan lebih dari 2000 mm/tahun", 'cf' => -0.4],
|
||||
|
||||
// Isolasi (Jarak Antar Lahan)
|
||||
['indicator_id' => 5, 'parameter_type' => "Telalu Dekat", 'description' => "Jarak antar lahan sangat dekat < 250 meter", 'cf' => -0.8],
|
||||
['indicator_id' => 5, 'parameter_type' => "Aman", 'description' => "Jarak antar lahan cukup jauh 250 - 400 meter", 'cf' => 0.8],
|
||||
['indicator_id' => 5, 'parameter_type' => "Jauh", 'description' => "Jarak antar lahan jauh > 400 meter", 'cf' => 1.0],
|
||||
];
|
||||
|
||||
foreach ($rules as $rule) {
|
||||
|
|
|
@ -1,57 +1,13 @@
|
|||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const inputs = document.querySelectorAll(
|
||||
"#idealmin-field, #idealmax-field",
|
||||
"#mb-field"
|
||||
);
|
||||
|
||||
const inputEdit = document.querySelectorAll(
|
||||
"#idealmin-edit-field, #idealmax-edit-field",
|
||||
"#mb-edit-field"
|
||||
);
|
||||
var indicatorField = document.getElementById("indicator-field");
|
||||
var indicatorVal = new Choices(indicatorField);
|
||||
var indicatorEditField = document.getElementById("indicator-edit-field");
|
||||
var indicatorEditVal = new Choices(indicatorEditField);
|
||||
|
||||
inputs.forEach((input) => {
|
||||
input.addEventListener("input", function () {
|
||||
this.value = this.value.replace(/[^0-9.]/g, "");
|
||||
this.value = this.value.replace(/^(\.)/, "");
|
||||
if ((this.value.match(/\./g) || []).length > 1) {
|
||||
this.value = this.value.substring(
|
||||
0,
|
||||
this.value.lastIndexOf(".")
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
inputEdit.forEach((input) => {
|
||||
input.addEventListener("input", function () {
|
||||
this.value = this.value.replace(/[^0-9.]/g, "");
|
||||
this.value = this.value.replace(/^(\.)/, "");
|
||||
if ((this.value.match(/\./g) || []).length > 1) {
|
||||
this.value = this.value.substring(
|
||||
0,
|
||||
this.value.lastIndexOf(".")
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function updateData(rule) {
|
||||
var form = document.getElementById("edit-form");
|
||||
// var indicatorName = form.querySelector('input[id="indicatorname-field"]');
|
||||
var idealMin = form.querySelector('input[id="idealmin-edit-field"]');
|
||||
var idealMax = form.querySelector('input[id="idealmax-edit-field"]');
|
||||
var mb = form.querySelector('input[id="mb-edit-field"]');
|
||||
|
||||
// indicatorName.value = rule.indicator.name;
|
||||
idealMin.value = rule.ideal_max;
|
||||
idealMax.value = rule.ideal_min;
|
||||
mb.value = rule.mb;
|
||||
var indicatorType = form.querySelector("#indicator-type-edit-field");
|
||||
var description = form.querySelector("#description-edit-field");
|
||||
var cf = form.querySelector("#cf-edit-field");
|
||||
form.action = "/data-aturan/" + rule.id;
|
||||
|
||||
indicatorType.value = rule.parameter_type;
|
||||
description.value = rule.description;
|
||||
cf.value = rule.cf;
|
||||
}
|
||||
|
||||
function deleteData(id) {
|
||||
|
@ -59,16 +15,53 @@ function deleteData(id) {
|
|||
form.action = "/data-aturan/" + id;
|
||||
}
|
||||
|
||||
function validateCfInput(input) {
|
||||
input.value = input.value.replace(",", ".");
|
||||
|
||||
input.value = input.value.replace(/[^0-9.\-]/g, "");
|
||||
|
||||
if (input.value.includes("-") && !input.value.startsWith("-")) {
|
||||
input.value = input.value.replace("-", "");
|
||||
}
|
||||
|
||||
input.value = input.value.replace(/-+/g, "-");
|
||||
|
||||
if (input.value === "-") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.value.startsWith(".")) {
|
||||
input.value = "0" + input.value;
|
||||
}
|
||||
|
||||
if (input.value.startsWith("-.")) {
|
||||
input.value = "-0.";
|
||||
}
|
||||
|
||||
// **PERBAIKAN**: Hilangkan nol berlebih di depan angka, kecuali nol sebelum titik
|
||||
input.value = input.value.replace(/^(-?)0+(\d)/, "$1$2");
|
||||
|
||||
// **BATASI INPUT**: Hanya satu titik desimal, dan maksimal 1 angka setelah titik
|
||||
let match = input.value.match(/^-?\d*(\.\d{0,1})?/);
|
||||
if (match) {
|
||||
input.value = match[0];
|
||||
}
|
||||
|
||||
let numValue = parseFloat(input.value);
|
||||
|
||||
// **Batasi nilai antara -1.0 dan 1.0**
|
||||
if (!isNaN(numValue)) {
|
||||
if (numValue > 1) {
|
||||
input.value = "1.0";
|
||||
} else if (numValue < -1) {
|
||||
input.value = "-1.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var perPage = 10,
|
||||
options = {
|
||||
valueNames: [
|
||||
"id",
|
||||
"indicator_name",
|
||||
"range_min",
|
||||
"range_max",
|
||||
"mb",
|
||||
"status",
|
||||
],
|
||||
valueNames: ["id", "parameter_type", "description", "status"],
|
||||
page: perPage,
|
||||
pagination: !0,
|
||||
plugins: [ListPagination({ left: 2, right: 2 })],
|
||||
|
|
|
@ -20,10 +20,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
function updateData(indicator) {
|
||||
var form = document.getElementById("edit-form");
|
||||
var indicatorName = form.querySelector('input[name="name"]');
|
||||
var description = form.querySelector('textarea[name="description"]');
|
||||
|
||||
indicatorName.value = indicator.name;
|
||||
description.value = indicator.description;
|
||||
form.action = "/data-indikator/" + indicator.id;
|
||||
}
|
||||
|
||||
|
@ -50,7 +48,7 @@ checkAll &&
|
|||
});
|
||||
var perPage = 8,
|
||||
options = {
|
||||
valueNames: ["id", "indicator_name", "status"],
|
||||
valueNames: ["id", "status"],
|
||||
page: perPage,
|
||||
pagination: !0,
|
||||
plugins: [ListPagination({ left: 2, right: 2 })],
|
||||
|
|
|
@ -22,7 +22,102 @@
|
|||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row g-4 mb-3">
|
||||
<div class="col-sm-auto">
|
||||
<div>
|
||||
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal" id="create-btn"
|
||||
data-bs-target="#addModal">
|
||||
<i class="ri-add-line align-bottom me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($rules as $rule)
|
||||
<div class="row">
|
||||
<div class="col lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Indikator {{ $rule->name }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div id="customerList">
|
||||
<div class="row g-4 mb-3">
|
||||
<div class="col-sm-auto">
|
||||
<div class="d-flex justify-content-sm-end">
|
||||
<div class="search-box ms-2">
|
||||
<input type="text" class="form-control search"
|
||||
placeholder="Search..." />
|
||||
<i class="ri-search-line search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive table-card mt-3 mb-1">
|
||||
<table class="table align-middle table-nowrap" id="indicatorTable">
|
||||
<thead class="table-light">
|
||||
<tr class="text-center">
|
||||
<th class="sort" data-sort="no">No</th>
|
||||
<th class="sort" data-sort="indicator_type">Jenis Parameter</th>
|
||||
<th class="sort" data-sort="description">Deskirpsi</th>
|
||||
<th class="sort" data-status="status">
|
||||
CF(e)
|
||||
</th>
|
||||
<th class="sort" data-sort="action">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list form-check-all">
|
||||
@foreach ($rule->rules as $item)
|
||||
<tr class="text-center">
|
||||
<td class="no">{{ $loop->iteration }}</td>
|
||||
<td class="id" style="display: none">
|
||||
<a href="javascript:void(0);"
|
||||
class="fw-medium link-primary">#VZ2101</a>
|
||||
</td>
|
||||
<td class="parameter_type">{{ $item->parameter_type }}</td>
|
||||
<td class="description">{{ $item->description }}</td>
|
||||
<td class="status">{{ $item->cf }}</td>
|
||||
<td>
|
||||
<div class="d-flex gap-2 justify-content-center">
|
||||
<div class="edit">
|
||||
<button class="btn btn-sm btn-warning edit-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#showModal"
|
||||
onclick="updateData({{ $item }})">Edit</button>
|
||||
</div>
|
||||
<div class="remove">
|
||||
<button class="btn btn-sm btn-danger remove-item-btn"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#deleteRecordModal"
|
||||
onclick="deleteData({{ $item->id }})">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="noresult" style="display: none">
|
||||
<div class="text-center">
|
||||
<lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop"
|
||||
colors="primary:#25a0e2,secondary:#00bd9d"
|
||||
style="width: 75px; height: 75px">
|
||||
</lord-icon>
|
||||
<h5 class="mt-2">Maaf! Data Tidak Ditemukan</h5>
|
||||
<p class="text-muted mb-0">Silahkan gunakan kata kunci lain</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
{{-- <div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
@ -34,14 +129,6 @@
|
|||
<div id="customerList">
|
||||
<div class="row g-4 mb-3">
|
||||
<div class="col-sm-auto">
|
||||
<div>
|
||||
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal"
|
||||
id="create-btn" data-bs-target="#addModal">
|
||||
<i class="ri-add-line align-bottom me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="d-flex justify-content-sm-end">
|
||||
<div class="search-box ms-2">
|
||||
<input type="text" class="form-control search" placeholder="Search..." />
|
||||
|
@ -61,10 +148,10 @@
|
|||
<th class="sort" data-sort="indicator_name">
|
||||
Indikator
|
||||
</th>
|
||||
<th class="sort" data-sort="range_min">Ideal Min</th>
|
||||
<th class="sort" data-sort="range_max">Ideal Max</th>
|
||||
<th class="sort" data-sort="parameter_type">Jenis Indikator</th>
|
||||
<th class="sort" data-sort="description">Deskripsi</th>
|
||||
<th class="sort" data-sort="status">
|
||||
Meansure Belief
|
||||
CF(e)
|
||||
</th>
|
||||
<th class="sort" data-sort="action">Action</th>
|
||||
</tr>
|
||||
|
@ -77,18 +164,34 @@
|
|||
<a href="javascript:void(0);"
|
||||
class="fw-medium link-primary">#VZ2101</a>
|
||||
</td>
|
||||
<td class="indicator_name">{{ $rule->indicator->name }}</td>
|
||||
<td class="range_min">{{ $rule->ideal_min }}</td>
|
||||
<td class="range_max">{{ $rule->ideal_max }}</td>
|
||||
<td class="indicator_name">{{ $rule->name }}</td>
|
||||
<td class="parameter_type">
|
||||
<ul class="list-unstyled mb-0">
|
||||
@foreach ($rule->rules as $item)
|
||||
<li class="mb-2">{{ $item->parameter_type }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
<td class="description">
|
||||
<ul class="list-unstyled mb-0">
|
||||
@foreach ($rule->rules as $item)
|
||||
<li class="mb-2">{{ $item->description }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
<td class="status">
|
||||
<span>{{ $rule->mb }}</span>
|
||||
<ul class="list-unstyled mb-0">
|
||||
@foreach ($rule->rules as $item)
|
||||
<li class="mb-2"><span>{{ $item->cf }}</span></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex gap-2 justify-content-center">
|
||||
<div class="edit">
|
||||
<button class="btn btn-sm btn-warning edit-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#showModal"
|
||||
onclick="updateData({{ $rule }})">
|
||||
onclick="updateData({{ $item }})">
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
@ -136,7 +239,7 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
</div> --}}
|
||||
<!-- end row -->
|
||||
|
||||
{{-- add modal --}}
|
||||
|
@ -172,29 +275,29 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
</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"
|
||||
placeholder="Masukan Nilai Ideal Min" required />
|
||||
<label for="indicator-type-field" class="form-label">Jenis Indikator</label>
|
||||
<input type="text" id="indicator-type-field" class="form-control"
|
||||
name="parameter_type" placeholder="Masukan jenis indikator" required />
|
||||
<div class="invalid-feedback">
|
||||
Masukan Nilai Ideal Min
|
||||
Masukan Jenis Indikator
|
||||
</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"
|
||||
placeholder="Masukan Nilai Ideal Max" required />
|
||||
<label for="description-field" class="form-label">Deskripsi</label>
|
||||
<textarea class="form-control" name="description" id="description-field" rows="5"
|
||||
placeholder="Masukan Deskripsi" required></textarea>
|
||||
<div class="invalid-feedback">
|
||||
Masukan Nilai Ideal Max
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="mb-field" class="form-label">Meansure Belief</label>
|
||||
<input type="text" id="mb-field" class="form-control" name="mb"
|
||||
placeholder="Masukan Meansure Belief" required />
|
||||
<label for="cf-field" class="form-label">CF(e)</label>
|
||||
<input type="text" id="cf-field" class="form-control" name="cf"
|
||||
placeholder="Masukan nilai CF pakar" required oninput="validateCfInput(this)" />
|
||||
<div class="invalid-feedback">
|
||||
Masukan Meansure Belief
|
||||
Masukan Nilai CF
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -234,42 +337,29 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="indicatorname-field" class="form-label">Indikator</label>
|
||||
<select name="indicator" id="indicator-edit-field" class="form-control">
|
||||
<option value="" selected disabled>Pilih Indikator</option>
|
||||
@foreach ($indicators as $indicator)
|
||||
<option value="{{ $indicator->id }}">{{ $indicator->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<label for="indicator-type-edit-field" class="form-label">Jenis Indikator</label>
|
||||
<input type="text" id="indicator-type-edit-field" class="form-control"
|
||||
name="parameter_type" placeholder="Masukan jenis parameter" required />
|
||||
<div class="invalid-feedback">
|
||||
Pilih Indikator
|
||||
Masukan jenis parameter
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="idealmin-field" class="form-label">Ideal Min</label>
|
||||
<input type="text" id="idealmin-edit-field" class="form-control" name="ideal_min"
|
||||
placeholder="Masukan Nilai Ideal Min" required />
|
||||
<label for="description-edit-field" class="form-label">Deskirpsi</label>
|
||||
<textarea class="form-control" name="description" id="description-edit-field" rows="5"
|
||||
placeholder="Masukan Deskripsi" required></textarea>
|
||||
<div class="invalid-feedback">
|
||||
Masukan Nilai Ideal Min
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="idealmax-edit-field" class="form-label">Ideal Max</label>
|
||||
<input type="text" id="idealmax-edit-field" class="form-control" name="ideal_max"
|
||||
placeholder="Masukan Nilai Ideal Max" required />
|
||||
<div class="invalid-feedback">
|
||||
Masukan Nilai Ideal Max
|
||||
Masukan Deskirpsi
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="mb-edit-field" class="form-label">Meansure Belief</label>
|
||||
<input type="text" id="mb-edit-field" class="form-control" name="mb"
|
||||
placeholder="Masukan Nilai Meansure Belief" required />
|
||||
<label for="cf-edit-field" class="form-label">CF(e)</label>
|
||||
<input type="text" id="cf-edit-field" class="form-control" name="cf"
|
||||
placeholder="Masukan Nilai CF(e)" required oninput="validateCfInput(this)" />
|
||||
<div class="invalid-feedback">
|
||||
Masukan Meansure Belief
|
||||
Masukan CF(e)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
<th class="sort" data-sort="indicator_name">
|
||||
Name
|
||||
</th>
|
||||
<th class="sort" data-sort="description">Description</th>
|
||||
<th class="sort" data-sort="action">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -73,9 +72,8 @@
|
|||
<a href="javascript:void(0);"
|
||||
class="fw-medium link-primary">#VZ2101</a>
|
||||
</td>
|
||||
<td class="indicator_name">{{ $indicator->name }}</td>
|
||||
<td class="status">
|
||||
<span>{{ $indicator->description }}</span>
|
||||
<span>{{ $indicator->name }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex gap-2 justify-content-center">
|
||||
|
@ -151,7 +149,7 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
readonly />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div>
|
||||
<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
|
||||
|
@ -160,15 +158,6 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
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">
|
||||
|
@ -205,7 +194,7 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
readonly />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div>
|
||||
<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
|
||||
|
@ -214,15 +203,6 @@ class="fw-medium link-primary">#VZ2101</a>
|
|||
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">
|
||||
|
|
Loading…
Reference in New Issue