|
22 | 22 | } |
23 | 23 | $municipalesDefaultRound = $municipales_ministry_default_round ?? 't1'; |
24 | 24 | $showMunicipalesRoundToggle = !empty($municipales_ministry_show_round_toggle); |
| 25 | + $hasSecondRoundPartialResults = |
| 26 | + !empty($municipalesRounds['t2']) && |
| 27 | + !empty($municipalesRounds['t2']['results']) && |
| 28 | + isset($municipalesRounds['t2']['infos']['pct_saisis']) && |
| 29 | + (float) $municipalesRounds['t2']['infos']['pct_saisis'] < 100.0; |
25 | 30 | $hasSecondRoundOfficialResults = |
26 | 31 | !empty($municipalesRounds['t2']) && |
27 | 32 | (($municipalesRounds['t2']['display_mode'] ?? '') === 'results') && |
| 33 | + isset($municipalesRounds['t2']['infos']['pct_saisis']) && |
| 34 | + (float) $municipalesRounds['t2']['infos']['pct_saisis'] === 100.0 && |
28 | 35 | !empty($municipalesRounds['t2']['results']); |
29 | 36 | $hasSecondRound = isset($municipalesRounds['t2']); |
30 | 37 | $listSituations = isset($municipales_list_situations) && is_array($municipales_list_situations) |
|
93 | 100 | } |
94 | 101 | } |
95 | 102 | ?> |
96 | | - <?php if ($hasSecondRound && !$hasSecondRoundOfficialResults): ?> |
| 103 | + <?php if ($hasSecondRound && !$hasSecondRoundOfficialResults && !$hasSecondRoundPartialResults): ?> |
97 | 104 | <div class="alert alert-primary mt-4"> |
98 | 105 | Les résultats seront disponibles dès que possible pour la ville de <?= $ville['commune_nom'] ?> à partir de 20h. |
99 | 106 | </div> |
100 | 107 | <?php endif; ?> |
101 | 108 | <?php if ($hasMunicipalesRoundData): ?> |
102 | 109 | <?php |
103 | 110 | $summaryRound = $municipalesRounds['t1'] ?? reset($municipalesRounds); |
104 | | - if (!empty($municipalesRounds['t2']) && ($municipalesRounds['t2']['display_mode'] ?? '') === 'results' && !empty($municipalesRounds['t2']['results'])) { |
| 111 | + if (!empty($municipalesRounds['t2']) && !empty($municipalesRounds['t2']['results']) && isset($municipalesRounds['t2']['infos']['pct_saisis']) && (float) $municipalesRounds['t2']['infos']['pct_saisis'] < 100.0) { |
| 112 | + $summaryRound = $municipalesRounds['t2']; |
| 113 | + } |
| 114 | + if ( |
| 115 | + !empty($municipalesRounds['t2']) && |
| 116 | + ($municipalesRounds['t2']['display_mode'] ?? '') === 'results' && |
| 117 | + isset($municipalesRounds['t2']['infos']['pct_saisis']) && |
| 118 | + (float) $municipalesRounds['t2']['infos']['pct_saisis'] === 100.0 && |
| 119 | + !empty($municipalesRounds['t2']['results']) |
| 120 | + ) { |
105 | 121 | $summaryRound = $municipalesRounds['t2']; |
106 | 122 | } |
107 | 123 | $summaryRoundKey = $summaryRound['key'] ?? ''; |
|
150 | 166 | La liste dirigée par <b><?= trim(($winningCandidate['prenom'] ?? '') . ' ' . ($winningCandidate['nom'] ?? '')) ?></b> a remporté les élections municipales 2026 <?= $ville_infos['nom_a'] ?> avec <u><?= number_format($winningCandidate['voix_pct'], 2, ',', ' ') ?>%</u> des voix. |
151 | 167 | </div> |
152 | 168 | </div> |
| 169 | + <?php elseif ($summaryRoundKey === 't2' && isset($summaryInfos['pct_saisis']) && (float) $summaryInfos['pct_saisis'] < 100.0): ?> |
| 170 | + <div class="card border-primary mt-4"> |
| 171 | + <div class="card-body py-3"> |
| 172 | + Dépouillement en cours (<?= number_format((float) $summaryInfos['pct_saisis'], 0, ',', ' ') ?>%). |
| 173 | + </div> |
| 174 | + </div> |
153 | 175 | <?php elseif ($summaryRoundKey === 't1'): ?> |
154 | 176 | <div class="card border-primary my-4"> |
155 | 177 | <div class="card-body py-3"> |
@@ -236,6 +258,18 @@ class="previous-election-round-btn municipales-round-btn <?= (($round['key'] ?? |
236 | 258 | $roundResults = $round['results'] ?? array(); |
237 | 259 | $roundInfos = $round['infos'] ?? array(); |
238 | 260 | $roundListes = $round['listes'] ?? array(); |
| 261 | + $roundIsPartialCount = |
| 262 | + $roundKey === 't2' && |
| 263 | + !empty($roundResults) && |
| 264 | + isset($roundInfos['pct_saisis']) && |
| 265 | + (float) $roundInfos['pct_saisis'] < 100.0; |
| 266 | + |
| 267 | + if ( |
| 268 | + $roundKey === 't2' && |
| 269 | + !isset($roundInfos['pct_saisis']) |
| 270 | + ) { |
| 271 | + $roundDisplayMode = 'listes'; |
| 272 | + } |
239 | 273 | ?> |
240 | 274 | <div |
241 | 275 | class="municipales-round-content" |
@@ -316,26 +350,28 @@ class="municipales-round-content" |
316 | 350 | </div> |
317 | 351 | </div> |
318 | 352 |
|
319 | | - <div class="col-4 order-2 col-lg-2 order-lg-3 px-0 text-right mb-1 mb-md-0"> |
320 | | - <div class="font-weight-bold"> |
321 | | - <?= number_format($candidate['voix_pct'] ?? 0, 2, ',', ' ') ?>% |
| 353 | + <?php if (!$roundIsPartialCount): ?> |
| 354 | + <div class="col-4 order-2 col-lg-2 order-lg-3 px-0 text-right mb-1 mb-md-0"> |
| 355 | + <div class="font-weight-bold"> |
| 356 | + <?= number_format($candidate['voix_pct'] ?? 0, 2, ',', ' ') ?>% |
| 357 | + </div> |
| 358 | + <small class="text-muted"> |
| 359 | + <?= formatNumber($candidate['voix'] ?? 0) ?> vote<?= ($candidate['voix'] ?? 0) > 1 ? 's' : '' ?> |
| 360 | + </small> |
322 | 361 | </div> |
323 | | - <small class="text-muted"> |
324 | | - <?= formatNumber($candidate['voix'] ?? 0) ?> vote<?= ($candidate['voix'] ?? 0) > 1 ? 's' : '' ?> |
325 | | - </small> |
326 | | - </div> |
327 | 362 |
|
328 | | - <div class="col-12 order-3 col-lg-4 px-0 order-lg-2 ml-lg-0 px-lg-5 align-self-lg-center"> |
329 | | - <div class="progress" style="height: 8px; background-color: #e9ecef"> |
330 | | - <div |
331 | | - class="progress-bar bg-primary" |
332 | | - role="progressbar" |
333 | | - style="width: <?= number_format($score_pct, 2, '.', '') ?>%;" |
334 | | - aria-valuenow="<?= number_format($score_pct, 2, '.', '') ?>" |
335 | | - aria-valuemin="0" |
336 | | - aria-valuemax="100"></div> |
| 363 | + <div class="col-12 order-3 col-lg-4 px-0 order-lg-2 ml-lg-0 px-lg-5 align-self-lg-center"> |
| 364 | + <div class="progress" style="height: 8px; background-color: #e9ecef"> |
| 365 | + <div |
| 366 | + class="progress-bar bg-primary" |
| 367 | + role="progressbar" |
| 368 | + style="width: <?= number_format($score_pct, 2, '.', '') ?>%;" |
| 369 | + aria-valuenow="<?= number_format($score_pct, 2, '.', '') ?>" |
| 370 | + aria-valuemin="0" |
| 371 | + aria-valuemax="100"></div> |
| 372 | + </div> |
337 | 373 | </div> |
338 | | - </div> |
| 374 | + <?php endif; ?> |
339 | 375 | </div> |
340 | 376 | <?php endforeach; ?> |
341 | 377 | <?php elseif ($roundDisplayMode === 'listes' && !empty($roundListes)): ?> |
|
0 commit comments