<?php
$current_lang = function_exists('current_lang') ? current_lang() : 'en';
?>

<div class="container-fluid">

<h3 class="mb-4">
<?= $current_lang==='ar' ? 'تعديل معيار التقييم' : 'Edit Review Criterion' ?>
</h3>

<form method="post" action="/easychair/admin/review-form/save">

<input type="hidden" name="id"
value="<?= (int)$criterion['id'] ?>">

<div class="mb-3">
<label class="form-label">
<?= $current_lang==='ar' ? 'العنوان' : 'Label' ?>
</label>

<input type="text"
name="label_ar"
class="form-control"
value="<?= htmlspecialchars($criterion['label_ar'] ?? '') ?>">
</div>

<div class="mb-3">
<label class="form-label">
<?= $current_lang==='ar' ? 'الوزن' : 'Weight' ?>
</label>

<input type="number"
step="0.01"
name="weight"
class="form-control"
value="<?= htmlspecialchars($criterion['weight'] ?? '1') ?>">
</div>

<div class="form-check mb-3">
<input type="checkbox"
name="is_active"
value="1"
class="form-check-input"
<?= !empty($criterion['is_active']) ? 'checked' : '' ?>>

<label class="form-check-label">
<?= $current_lang==='ar' ? 'مفعل' : 'Active' ?>
</label>
</div>

<button class="btn btn-primary">
<?= $current_lang==='ar' ? 'حفظ' : 'Save' ?>
</button>

</form>

</div>
