Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 0 additions & 134 deletions _terminy_rg.php

This file was deleted.

4 changes: 0 additions & 4 deletions cfg/_colors_white_blue.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@
$g_colors['table_text_header'] = '#330000';//'#CCCC33';
$g_colors['table_text_highlight'] = '#FF66FF';

$g_colors['table_row1_spare'] = '#FFF5E6'; // soft peach
$g_colors['table_row2_spare'] = '#FFF9ED'; // even lighter peach
$g_colors['table_text_spare'] = '#996600'; // warm brown/orange for contrast

$g_colors['table_cal_border'] = '#AAAA33';
$g_colors['table_cal_weekend'] = '#777700';
$g_colors['table_cal_race'] = '#AA6600';
Expand Down
61 changes: 61 additions & 0 deletions common_race.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?

require_once("cfg/race_enums.php");
require_once("cfg/_cfg.php");

function GetRaceTypeName($value)
{
Expand Down Expand Up @@ -468,4 +469,64 @@ function GetSharedTransportValue($transport,$sedadel,&$total){
else
return '';
}

function RenderCategoryCounts ( array $category_counts ) {
// Sort categories alphabetically
ksort($category_counts);

// Add collapsible section for category counts with table formatting
echo '<br><br><div id="category_details" style="display:none;">';
echo '<table cellspacing="5">';
echo '<tr><th style="text-align:left;">Kategorie</th>';

foreach ($category_counts as $category => $count) {
echo "<td>$category</td>";
}

echo '</tr><tr><th style="text-align:left;">Počet</th>';

foreach ($category_counts as $category => $count) {
echo "<td style='text-align:center;'>$count</td>";
}

echo "</tr></table></div>";

// JavaScript to expand list and scroll
echo '<script>
function toggleCategoriesAndScroll() {
var details = document.getElementById("category_details");
details.style.display = "block";

// Scroll to the category list
details.scrollIntoView({ behavior: "smooth", block: "start" });
}
</script>';
}

// get count of registered members for each race in records
function GetCountRegistered ( array $records ) {
global $g_enable_race_capacity;

$count_registered = [];

if ($g_enable_race_capacity && count($records) > 0) {
$race_ids = [];

foreach ($records as $record ) {
$race_ids[] = (int)$record['id'];
}

if (!empty($race_ids)) {
$ids_csv = implode(',', $race_ids);
$count_query = "SELECT id_zavod, COUNT(*) AS prihlaseno FROM ".TBL_ZAVXUS." WHERE id_zavod IN ($ids_csv) GROUP BY id_zavod";
$count_result = query_db($count_query);

while ($row = mysqli_fetch_assoc($count_result)) {
$count_registered[$row['id_zavod']] = $row['prihlaseno'];
}
}

}
return $count_registered;
}
?>
Loading