diff --git a/admin.php b/admin.php
index 22fa861..e8ccd7e 100644
--- a/admin.php
+++ b/admin.php
@@ -170,8 +170,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['
$orbital_count_val = $_POST['orbital_count_val'] !== '' ? (int)$_POST['orbital_count_val'] : null;
$terrestrial_count_op = $_POST['terrestrial_count_op'] ?: null;
$terrestrial_count_val = $_POST['terrestrial_count_val'] !== '' ? (int)$_POST['terrestrial_count_val'] : null;
- $orbital_dominance = $_POST['orbital_dominance'] ?: null;
- $terrestrial_dominance = $_POST['terrestrial_dominance'] ?: null;
+ $orbital_dominance = isset($_POST['orbital_dominance']) ? implode(',', (array)$_POST['orbital_dominance']) : null;
+ $terrestrial_dominance = isset($_POST['terrestrial_dominance']) ? implode(',', (array)$_POST['terrestrial_dominance']) : null;
$is_empty_case = isset($_POST['is_empty_case']) ? 1 : 0;
if ($id > 0) {
@@ -551,6 +551,19 @@ if ($tab === 'users') {
/* Color picker custom style */
.color-group { display: flex; gap: 5px; }
.color-picker-input { width: 45px !important; height: 34px !important; padding: 2px !important; border: 1px solid #334155 !important; background: #0f172a !important; cursor: pointer; }
+
+ /* Multi-select dropdown */
+ .ms-container { position: relative; width: 100%; }
+ .ms-display {
+ background: #0f172a; border: 1px solid #334155; color: #fff; padding: 8px; cursor: pointer; min-height: 34px; box-sizing: border-box; font-size: 12px; display: flex; align-items: center; justify-content: space-between;
+ }
+ .ms-display:after { content: '▼'; font-size: 8px; color: #8c92a3; }
+ .ms-dropdown {
+ position: absolute; top: 100%; left: 0; right: 0; background: #1a202c; border: 1px solid #334155; z-index: 1000; display: none; max-height: 200px; overflow-y: auto; padding: 5px;
+ }
+ .ms-item { padding: 5px 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 11px; }
+ .ms-item:hover { background: #2d3545; }
+ .ms-item input { width: auto !important; }
@@ -955,29 +968,35 @@ if ($tab === 'users') {
-
-
FACTION DOMINANTE :
+
+
FILTRE DOMINANCE :
+
+
+
+
@@ -1007,8 +1026,8 @@ if ($tab === 'users') {
if($r['is_empty_case']) $conds[] = "Case Vide";
if($r['orbital_count_op']) $conds[] = "Orbital Factions " . $r['orbital_count_op'] . " " . $r['orbital_count_val'];
if($r['terrestrial_count_op']) $conds[] = "Ground Factions " . $r['terrestrial_count_op'] . " " . $r['terrestrial_count_val'];
- if($r['orbital_dominance']) $conds[] = "Orbital Dom: " . $r['orbital_dominance'];
- if($r['terrestrial_dominance']) $conds[] = "Ground Dom: " . $r['terrestrial_dominance'];
+ if($r['orbital_dominance']) $conds[] = "Orbital IN (" . $r['orbital_dominance'] . ")";
+ if($r['terrestrial_dominance']) $conds[] = "Ground IN (" . $r['terrestrial_dominance'] . ")";
echo !empty($conds) ? implode(' AND ', $conds) : '
Toujours vrai';
?>
@@ -1290,7 +1309,28 @@ if ($tab === 'users') {
document.getElementById('log_id').value = 0;
document.getElementById('logForm').reset();
}
-
+
+ function toggleMS(id) {
+ const d = document.getElementById(id);
+ d.style.display = d.style.display === 'block' ? 'none' : 'block';
+ }
+ function updateMSLabel(containerId) {
+ const container = document.getElementById(containerId);
+ const checkboxes = container.querySelectorAll('input[type="checkbox"]:checked');
+ const display = container.querySelector('.ms-display');
+ if (checkboxes.length === 0) {
+ display.innerText = "Toutes / Peu importe";
+ } else {
+ const labels = Array.from(checkboxes).map(cb => cb.parentElement.innerText.trim());
+ display.innerText = labels.join(', ');
+ }
+ }
+ document.addEventListener('click', function(e) {
+ if (!e.target.closest('.ms-container')) {
+ document.querySelectorAll('.ms-dropdown').forEach(d => d.style.display = 'none');
+ }
+ });
+
Système de Lootboxes
@@ -1484,12 +1524,29 @@ function editStatus(data) {
document.getElementById('rule_orb_val').value = data.orbital_count_val !== null ? data.orbital_count_val : "";
document.getElementById('rule_terr_op').value = data.terrestrial_count_op || "";
document.getElementById('rule_terr_val').value = data.terrestrial_count_val !== null ? data.terrestrial_count_val : "";
- document.getElementById('rule_orb_dom').value = data.orbital_dominance || "";
- document.getElementById('rule_terr_dom').value = data.terrestrial_dominance || "";
+
+ // Set multi-selects
+ const orbVals = (data.orbital_dominance || "").split(",");
+ document.querySelectorAll('#ms_orb_list input').forEach(cb => {
+ cb.checked = orbVals.includes(cb.value);
+ });
+ updateMSLabel('ms_orb');
+
+ const terrVals = (data.terrestrial_dominance || "").split(",");
+ document.querySelectorAll('#ms_terr_list input').forEach(cb => {
+ cb.checked = terrVals.includes(cb.value);
+ });
+ updateMSLabel('ms_terr');
+
document.getElementById('rule_empty').checked = data.is_empty_case == 1;
window.scrollTo(0,0);
}
- function resetRuleForm() { document.getElementById('ruleForm').reset(); document.getElementById('rule_id').value = 0; }
+ function resetRuleForm() {
+ document.getElementById('ruleForm').reset();
+ document.getElementById('rule_id').value = 0;
+ updateMSLabel('ms_orb');
+ updateMSLabel('ms_terr');
+ }
function editSettlementType(data) {
document.getElementById('set_t_id').value = data.id;
@@ -1651,6 +1708,27 @@ function editStatus(data) {
if (document.getElementById('items_container').children.length === 0) addItemRow();
};
-
+
+ function toggleMS(id) {
+ const d = document.getElementById(id);
+ d.style.display = d.style.display === 'block' ? 'none' : 'block';
+ }
+ function updateMSLabel(containerId) {
+ const container = document.getElementById(containerId);
+ const checkboxes = container.querySelectorAll('input[type="checkbox"]:checked');
+ const display = container.querySelector('.ms-display');
+ if (checkboxes.length === 0) {
+ display.innerText = "Toutes / Peu importe";
+ } else {
+ const labels = Array.from(checkboxes).map(cb => cb.parentElement.innerText.trim());
+ display.innerText = labels.join(', ');
+ }
+ }
+ document.addEventListener('click', function(e) {
+ if (!e.target.closest('.ms-container')) {
+ document.querySelectorAll('.ms-dropdown').forEach(d => d.style.display = 'none');
+ }
+ });
+