Hall of Fame hinzugefügt

This commit is contained in:
Jürgen Meyer
2026-03-02 19:49:22 +01:00
parent 578fb76ead
commit a856a979aa
8 changed files with 1365 additions and 73 deletions
@@ -5414,6 +5414,7 @@ function adminKategorien(): void
$kategorien[5] = array();
$kategorien[6] = array();
$kategorien[7] = array();
$kategorien[8] = array();
foreach ($rows as $row)
$kategorien[$row->typ][$row->nummer] = $row->bezeichnung;
@@ -5443,13 +5444,14 @@ function adminKategorien(): void
$kategorien[5] = array();
$kategorien[6] = array();
$kategorien[7] = array();
$kategorien[8] = array();
$anzahl = array(0,50,100,50,50,100,50,50);
$anzahl = array(0,50,100,50,50,100,50,50,100);
foreach ($rows as $row)
$kategorien[$row->typ][$row->nummer] = $row->bezeichnung;
for ($typ = 1; $typ <= 7; $typ++) {
for ($typ = 1; $typ <= 8; $typ++) {
for ($nummer = 1; $nummer <= $anzahl[$typ]; $nummer++) {
$bezeichnung = $db->escape($jInput->get('bezeichnung_' . $typ . '_' . $nummer, '', 'RAW'));
if (empty($bezeichnung)) {
@@ -7614,6 +7616,415 @@ function adminEditVerbandsorganMitglied(): void
redirectSportsManagerURL('&task=admin_verbandsorgan_mitglieder&id=' . $verbandsorgane_id);
}
function adminHalloffame(): void
{
$db = getDatabase();
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$query = "SELECT t1.*, COUNT(DISTINCT t2.jahr) AS anzahl,"
. "\n IF (COUNT(DISTINCT t2.jahr) > 0, CONCAT(min(t2.jahr), ' - ', max(t2.jahr)), " . $db->quote(Text::_('COM_SPORTSMANAGER_NO_ENTRY')) . ") AS zeitspanne"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n GROUP BY t1.halloffame_id"
. "\n ORDER BY t1.reihenfolge;";
$rows = loadObjectList($db, $query);
HTML_sportsmanager_admin::adminHalloffame($rows);
}
function adminEditHalloffame(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$id = $jInput->get('id', 0, 'INT');
$anzahl_eintraege = 0;
if ($id == 0)
$row = null;
else {
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id";
$rows = loadObjectList($db, $query);
if (count($rows) < 1) die("Wrong id!");
$row = $rows[0];
$query = "SELECT * FROM #__sportsmanager_mitglied_von_halloffame WHERE halloffame_id = $id";
$rows = loadObjectList($db, $query);
$anzahl_eintraege = count($rows);
}
$query = "SELECT *"
. "\n FROM #__sportsmanager_veranstalter"
. "\n ORDER BY veranstalterbezeichnung";
$veranstalter = loadObjectList($db, $query);
$query = "SELECT nummer, bezeichnung FROM #__sportsmanager_kategorie WHERE typ = 8 ORDER BY nummer";
$rows_kategorien = loadObjectList($db, $query);
$kategorien = array();
foreach ($rows_kategorien as $kategorie)
$kategorien[$kategorie->nummer] = $kategorie->bezeichnung;
$spielform_array = [1 => Text::_('COM_SPORTSMANAGER_TEAMS'),
2 => Text::_('COM_SPORTSMANAGER_DOUBLES'),
3 => Text::_('COM_SPORTSMANAGER_SINGLES')];
if ($anzahl_eintraege == 0)
$spielformen = $spielform_array;
else
$spielformen[$row->spielform] = $spielform_array[$row->spielform];
HTML_sportsmanager_admin::adminEditHalloffame($row,$veranstalter,$kategorien,$spielformen);
}
#[NoReturn] function adminSaveHalloffame(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff();
if ($jInput->get('cancel', false, 'BOOL')) {
redirectSportsManagerURL('&task=admin_halloffame');
}
$id = $jInput->get('id', 0, 'INT');
$halloffame = $db->escape(trim($jInput->get('halloffame', '', 'RAW')));
$veranstalter_id = $jInput->get('veranstalter_id', 0, 'INT');
$kategorie = $jInput->get('kategorie', 0, 'INT');
$spielform = $jInput->get('spielform', 0, 'INT');
$reihenfolge = $jInput->get('reihenfolge', 0, 'INT');
if (strlen($halloffame) < 3) {
redirectSportsManagerURL('&task=admin_halloffame',Text::_('COM_SPORTSMANAGER_INVALID_HALL_OF_FAME_NAME'));
}
if ($id == 0)
$query = "INSERT INTO #__sportsmanager_halloffame"
. "\n (halloffame,veranstalter_id,kategorie,spielform,reihenfolge) VALUES"
. "\n ('$halloffame'," . ($veranstalter_id != 0 ? "'$veranstalter_id'" : "NULL") . ",$kategorie,$spielform,$reihenfolge);";
else {
$query = "UPDATE #__sportsmanager_halloffame"
. "\n SET halloffame = '$halloffame',"
. "\n veranstalter_id = " . ($veranstalter_id != 0 ? "'$veranstalter_id'" : "NULL") . ","
. "\n kategorie = $kategorie,"
. "\n spielform = $spielform,"
. "\n reihenfolge = $reihenfolge"
. "\n WHERE halloffame_id = $id";
}
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
redirectSportsManagerURL('&task=admin_halloffame');
}
#[NoReturn] function adminRemoveHalloffame(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$id = $jInput->get('id', 0, 'INT');
$query = "DELETE FROM #__sportsmanager_halloffame WHERE halloffame_id = $id;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
//Alle Mitglieder löschen
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame WHERE halloffame_id = $id;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
redirectSportsManagerURL('&task=admin_halloffame');
}
function adminHalloffameMitglieder(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$id = $jInput->get('id', 0, 'INT');
$mitglieder = null;
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id";
$rows = loadObjectList($db, $query);
if (count($rows) < 1) {
abortWithError("Wrong id!");
}
$halloffame = $rows[0];
$halloffame->platz2_zeigen = 0;
$halloffame->platz3_zeigen = 0;
$query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.halloffame_id = $id"
. "\n ORDER BY t2.jahr DESC, platz ASC;";
$rows = loadObjectList($db, $query);
if (count($rows) > 0){
$mitglieder = [];
if ($halloffame->spielform == 1){
foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz;
$index_team = "teamname_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass();
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_vereinid = $row->verein_id;
$mitglieder[$row->jahr]->$index_team = $row->teamname;
if ($row->platz == 2 && !empty($row->teamname))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname))
$halloffame->platz3_zeigen = 1;
}
}
if ($halloffame->spielform == 2 || $halloffame->spielform == 3){
foreach ($rows as $row) {
$index_spieler1id = "spieler1_id_" . $row->platz;
$index_spieler1 = "spieler1_" . $row->platz;
$index_spieler2id = "spieler2_id_" . $row->platz;
$index_spieler2 = "spieler2_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass();
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id;
$mitglieder[$row->jahr]->$index_spieler1 = $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id;
$mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz3_zeigen = 1;
}
}
}
HTML_sportsmanager_admin::adminHalloffameMitglieder($mitglieder,$halloffame);
}
function adminEditHalloffameMitglied(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$halloffame_id = $jInput->get('halloffame_id', 0, 'INT');
$jahr = $jInput->get('jahr', 0, 'INT');
$mitglieder = null;
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $halloffame_id";
$rows = loadObjectList($db, $query);
if (count($rows) < 1) {
abortWithError("Wrong id!");
}
$halloffame = $rows[0];
$query = "SELECT verein_id, vereinsname As verein"
. "\n FROM #__sportsmanager_verein"
. "\n ORDER BY vereinsname";
$vereine = loadObjectList($db, $query);
$query = "SELECT spieler_id, CONCAT(nachname, ', ', vorname, ' (', spielernr, ')') AS spieler"
. "\n FROM #__sportsmanager_spieler"
. "\n ORDER BY nachname, vorname, spielernr";
$spieler = loadObjectList($db, $query);
$query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.halloffame_id = $halloffame_id"
. "\n AND t2.jahr = $jahr"
. "\n ORDER BY platz ASC;";
$rows = loadObjectList($db, $query);
if (count($rows) > 0){
if ($halloffame->spielform == 1){
$mitglieder = new stdClass();
foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz;
$index_team = "teamname_" . $row->platz;
$mitglieder->jahr = $row->jahr;
$mitglieder->$index_vereinid = $row->verein_id;
$mitglieder->$index_team = $row->teamname;
}
}
if ($halloffame->spielform == 2 || $halloffame->spielform == 3){
$mitglieder = new stdClass();
foreach ($rows as $row) {
$index_spieler1id = "spieler1_id_" . $row->platz;
$index_spieler1 = "spieler1_" . $row->platz;
$index_spieler2id = "spieler2_id_" . $row->platz;
$index_spieler2 = "spieler2_" . $row->platz;
$mitglieder->jahr = $row->jahr;
$mitglieder->$index_spieler1id = $row->spieler1_id;
$mitglieder->$index_spieler1 = $row->spieler1;
$mitglieder->$index_spieler2id = $row->spieler2_id;
$mitglieder->$index_spieler2 = $row->spieler2;
}
}
}
if ($jahr != 0){
$jahre = array((int) $jahr);
} else {
// Generate list of years in PHP instead of using WITH RECURSIVE (for MySQL < 8 compatibility)
$startYear = 1965;
$currentYear = (int) date('Y');
$jahre = array();
for ($y = $startYear; $y <= $currentYear; $y++) {
$jahre[] = $y;
}
// Load years already used for this hall of fame
$query = "SELECT jahr FROM #__sportsmanager_mitglied_von_halloffame WHERE halloffame_id = " . (int) $halloffame_id;
$db->setQuery($query);
$usedYears = $db->loadColumn();
if (!is_array($usedYears)) {
$usedYears = array();
}
$usedYears = array_map('intval', $usedYears);
// Remove already used years and sort remaining years descending
$jahre = array_values(array_diff($jahre, $usedYears));
rsort($jahre, SORT_NUMERIC);
}
HTML_sportsmanager_admin::adminEditHalloffameMitglied($mitglieder,$halloffame,$vereine,$spieler,$jahre);
}
#[NoReturn] function adminSaveHalloffameMitglied(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff();
$halloffame_id = $jInput->get('halloffame_id', 0, 'INT');
$spielform = $jInput->get('spielform', 0, 'INT');
$jahr = $jInput->get('jahr', 0, 'INT');
if ($jInput->get('cancel', false, 'BOOL'))
redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id);
if ($spielform == 1){
for ($p = 1; $p <= 3; $p++){
$verein_id[$p] = $jInput->get('verein_id_' . $p, 0, 'INT');
$teamname[$p] = $db->escape(trim($jInput->get('teamname_' . $p, '', 'RAW')));
if (empty($teamname[$p]) && !empty($verein_id[$p])){
$query = "SELECT vereinsname FROM #__sportsmanager_verein WHERE verein_id = '" . $verein_id[$p] . "';";
$verein = loadObjectList($db, $query);
$teamname[$p] = $verein[0]->vereinsname;
}
if (!empty($teamname[$p])){
$query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame"
. "\n (halloffame_id,jahr,platz,verein_id,teamname) VALUES"
. "\n ($halloffame_id,$jahr,$p," . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . ",'" . $teamname[$p] . "')"
. "\n ON DUPLICATE KEY UPDATE verein_id = " . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . ","
. "\n teamname = '" . $teamname[$p] . "';";
} else {
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
. "\n WHERE halloffame_id = $halloffame_id"
. "\n AND jahr = $jahr"
. "\n AND platz = $p";
}
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
}
if ($spielform == 2 || $spielform == 3){
for ($p = 1; $p <= 3; $p++){
$spieler1_id[$p] = $jInput->get('spieler1_id_' . $p, 0, 'INT');
$spieler2_id[$p] = $jInput->get('spieler2_id_' . $p, 0, 'INT');
$spieler1[$p] = $db->escape(trim($jInput->get('spieler1_' . $p, '', 'RAW')));
$spieler2[$p] = $db->escape(trim($jInput->get('spieler2_' . $p, '', 'RAW')));
if (!empty($spieler1_id[$p])){
$query = "SELECT CONCAT(nachname,', ', vorname) AS name"
. "\n FROM #__sportsmanager_spieler"
. "\n WHERE spieler_id = '" . $spieler1_id[$p] . "';";
$spieler = loadObjectList($db, $query);
$spieler1[$p] = $spieler[0]->name;
}
if (!empty($spieler2_id[$p])){
$query = "SELECT CONCAT(nachname,', ', vorname) AS name"
. "\n FROM #__sportsmanager_spieler"
. "\n WHERE spieler_id = '" . $spieler2_id[$p] . "';";
$spieler = loadObjectList($db, $query);
$spieler2[$p] = $spieler[0]->name;
}
if (!empty($spieler1[$p])){
$query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame"
. "\n (halloffame_id,jahr,platz,spieler1_id,spieler1,spieler2_id,spieler2) VALUES"
. "\n ($halloffame_id,$jahr,$p," . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . ",'" . $spieler1[$p] . "'," . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . ",'" . $spieler2[$p] . "')"
. "\n ON DUPLICATE KEY UPDATE"
. "\n spieler1_id = " . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . ","
. "\n spieler1 = '" . $spieler1[$p] . "',"
. "\n spieler2_id = " . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . ","
. "\n spieler2 = '" . $spieler2[$p] . "';";
} else {
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
. "\n WHERE halloffame_id = $halloffame_id"
. "\n AND jahr = $jahr"
. "\n AND platz = $p";
}
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
}
redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id);
}
#[NoReturn] function adminRemoveHalloffameMitglied(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (!benutzerZugriff("organisationen_aendern"))
keinZugriff(true);
$halloffame_id = $jInput->get('halloffame_id', 0, 'INT');
$jahr = $jInput->get('jahr', 0, 'INT');
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
. "\n WHERE halloffame_id = $halloffame_id"
. "\n AND jahr = $jahr;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id);
}
function adminRegelwerke(): void
{
$db = getDatabase();
@@ -5639,6 +5639,55 @@ function updateDatabase(): void
}
}
if ($datenbank_version < 119) {
$query = "CREATE TABLE IF NOT EXISTS `#__sportsmanager_halloffame` ("
. "\n `halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `veranstalter_id` int(11) DEFAULT NULL,"
. "\n `halloffame` varchar(64) DEFAULT NULL,"
. "\n `kategorie` int(4) DEFAULT NULL,"
. "\n `spielform` int(11) DEFAULT NULL,"
. "\n `reihenfolge` int(4) DEFAULT NULL,"
. "\n PRIMARY KEY (`halloffame_id`),"
. "\n KEY `veranstalter_id` (`veranstalter_id`)"
. "\n ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "CREATE TABLE IF NOT EXISTS `#__sportsmanager_mitglied_von_halloffame` ("
. "\n `mitglied_halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `halloffame_id` int(11) NOT NULL,"
. "\n `jahr` int(4) DEFAULT NULL,"
. "\n `platz` int(11) DEFAULT NULL,"
. "\n `verein_id` int(11) DEFAULT NULL,"
. "\n `teamname` varchar(64) DEFAULT NULL,"
. "\n `spieler1_id` int(11) DEFAULT NULL,"
. "\n `spieler1` varchar(64) DEFAULT NULL,"
. "\n `spieler2_id` int(11) DEFAULT NULL,"
. "\n `spieler2` varchar(64) DEFAULT NULL,"
. "\n PRIMARY KEY (`mitglied_halloffame_id`),"
. "\n UNIQUE KEY `halloffame_jahr_platz` (`halloffame_id`,`jahr`,`platz`),"
. "\n KEY `halloffame_id` (`halloffame_id`),"
. "\n KEY `verein_id` (`verein_id`),"
. "\n KEY `spieler1_id` (`spieler1_id`),"
. "\n KEY `spieler2_id` (`spieler2_id`)"
. "\n ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "UPDATE #__sportsmanager_einstellungen"
. "\n SET wert = '119'"
. "\n WHERE name = 'datenbank_version'";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
if ($termin_aktionen_email_setzen) {
$query = "SELECT aktion_user_id, termin_aktion_id"
. "\n FROM #__sportsmanager_termin_aktion";
@@ -398,6 +398,30 @@ if ($task == "spielerbild") {
case 'admin_verbandsorgan_mitglied_remove':
adminRemoveVerbandsorganMitglied();
break;
case 'admin_halloffame':
adminHalloffame();
break;
case 'admin_halloffame_edit':
adminEditHalloffame();
break;
case 'admin_halloffame_save':
adminSaveHalloffame();
break;
case 'admin_halloffame_remove':
adminRemoveHalloffame();
break;
case 'admin_halloffame_mitglieder':
adminHalloffameMitglieder();
break;
case 'admin_halloffame_mitglied_edit':
adminEditHalloffameMitglied();
break;
case 'admin_halloffame_mitglied_save':
adminSaveHalloffameMitglied();
break;
case 'admin_halloffame_mitglied_remove':
adminRemoveHalloffameMitglied();
break;
case 'admin_regelwerke':
adminRegelwerke();
break;
@@ -1103,6 +1127,15 @@ if ($task == "spielerbild") {
verbandsorgane();
break;
}
} else if ($content == 'hall_of_fame') {
switch ($task) {
case 'hall_of_fame_details':
halloffameDetails();
break;
default:
halloffame();
break;
}
} else if ($content == 'login') {
userAuth();
} else if ($content == 'login_refresh') {
@@ -4345,6 +4378,110 @@ function verbandsorganeDetails($uebergabe_id = 0): void
}
}
function halloffame(): void
{
$db = getDatabase();
global $params;
$query = "SELECT t1.*, COUNT(DISTINCT t2.jahr) AS anzahl,"
. "\n IF (COUNT(DISTINCT t2.jahr) > 0, CONCAT(min(t2.jahr), ' - ', max(t2.jahr)), '" . Text::_('COM_SPORTSMANAGER_NO_ENTRY') . "') AS zeitspanne"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n GROUP BY t1.halloffame_id"
. kategorieFilter("HAVING t1.kategorie IN")
. "\n ORDER BY t1.reihenfolge;";
$halloffame = loadObjectList($db, $query);
if (count($halloffame) == 1){
halloffameDetails($halloffame[0]->halloffame_id);
} else {
if (isJson()) {
echo json_encode($halloffame);
} else {
HTML_sportsmanager::halloffame($params->get('titel'), $params->get('beschreibung'), $halloffame);
}
}
}
function halloffameDetails($uebergabe_id = 0): void
{
$db = getDatabase();
$app = Factory::getContainer()->get(SiteApplication::class);
$jInput = $app->input;
global $params;
if ($uebergabe_id == 0)
$id = $jInput->get('id', 0, 'INT');
else
$id = $uebergabe_id;
$mitglieder = null;
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id";
$rows = loadObjectList($db, $query);
if (count($rows) < 1) {
abortWithError("Wrong id!");
}
$halloffame = $rows[0];
$halloffame->platz2_zeigen = 0;
$halloffame->platz3_zeigen = 0;
$query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.halloffame_id = $id"
. "\n ORDER BY t2.jahr DESC, platz ASC;";
$rows = loadObjectList($db, $query);
if (count($rows) > 0){
$mitglieder = [];
if ($halloffame->spielform == 1){
foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz;
$index_team = "teamname_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass();
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_vereinid = $row->verein_id;
$mitglieder[$row->jahr]->$index_team = $row->teamname;
if ($row->platz == 2 && !empty($row->teamname))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname))
$halloffame->platz3_zeigen = 1;
}
}
if ($halloffame->spielform == 2 || $halloffame->spielform == 3){
foreach ($rows as $row) {
$index_spieler1id = "spieler1_id_" . $row->platz;
$index_spieler1 = "spieler1_" . $row->platz;
$index_spieler2id = "spieler2_id_" . $row->platz;
$index_spieler2 = "spieler2_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass();
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id;
$mitglieder[$row->jahr]->$index_spieler1 = $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id;
$mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz3_zeigen = 1;
}
}
}
if (isJson()) {
echo json_encode($mitglieder);
} else {
HTML_sportsmanager::halloffameDetails($params->get('titel'), $params->get('beschreibung'), $mitglieder, $halloffame);
}
}
function begegnungSpielplan($teamansicht = false): void
{
$db = getDatabase();
@@ -4114,6 +4114,11 @@ static function verbandsorganeDetails($titel, $beschreibung, $verbandsorgan, $ro
<td style='width: 300px;' nowrap>
<?php echo htmlentities_utf8($row->email); ?>
</td>
<td style='width: 300px;' nowrap>
<?php echo htmlentities_utf8($row->telefon); ?>
<?PHP if ($row->telefon && $row->mobil){ echo "<br>"; }?>
<?php echo htmlentities_utf8($row->mobil); ?>
</td>
<?PHP } ?>
<td style='width: 200px;' nowrap>
<?php echo htmlentities_utf8($row->funktion); ?>
@@ -4135,6 +4140,190 @@ static function verbandsorganeDetails($titel, $beschreibung, $verbandsorgan, $ro
<?php
}
static function halloffame($titel, $beschreibung, $rows): void
{
global $params;
if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr>
<td><?php echo str_contains($beschreibung, ">") ? $beschreibung : htmlentities_utf8($beschreibung); ?></td>
</tr>
</table>
</div>
<?php
}
if (count($rows) > 0) {
?>
<table style='border-collapse: collapse;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style='text-align: left; width: 400px;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<th style='text-align: center; width: 200px;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_YEARS'); ?></strong></th>
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
?>
<tr class="sectiontableentry<?php echo $k + 1;
$k = ($k + 1) % 2; ?><?php echo $params->get('pageclass_sfx'); ?>">
<td nowrap>
<a href="<?php echo SportsManagerURL('&task=hall_of_fame_details&id=' . $row->halloffame_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($row->halloffame)); ?>
</a>
</td>
<td style='text-align: center;' nowrap>
<?php echo $row->zeitspanne; ?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): void
{
global $params;
if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr>
<td><?php echo str_contains($beschreibung, ">") ? $beschreibung : htmlentities_utf8($beschreibung); ?></td>
</tr>
</table>
</div>
<?php
}
echo "<H3>" . htmlentities_utf8($halloffame->halloffame) . "</H3>";
if ($rows != null) {
?>
<table style='border-collapse: collapse;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:center; width:100px;" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?></strong>
</th>
<?php
for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
?>
<th style="text-align:center;" colspan="2" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
</th>
<?php } ?>
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
if ($halloffame->spielform == 2) {
?>
<!-- Erste Zeile -->
<tr class="<?php echo $rowclass; ?>">
<td rowspan="2" nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
</td>
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
$spieler1_id = "spieler1_id_" . $i;
$spieler1 = "spieler1_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler1_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler1); ?>
</td>
<?php } ?>
</tr>
<!-- Zweite Zeile -->
<tr class="<?php echo $rowclass; ?>">
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
$spieler2_id = "spieler2_id_" . $i;
$spieler2 = "spieler2_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler2_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler2); ?>
</td>
<?php } ?>
</tr>
<?php
} else {
?>
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
</td>
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
if ($halloffame->spielform == 1) {
$id = "verein_id_" . $i;
$txt = "teamname_" . $i;
$type = "vereine";
} else {
$id = "spieler1_id_" . $i;
$txt = "spieler1_" . $i;
$type = "spieler";
}
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML($type, $row->$id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$txt); ?>
</td>
<?php } ?>
</tr>
<?php
}
}
?>
</table>
<?php
}
?>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
static function spieler($beschreibung, $rows, $sortierung, $statistik, $beginn, $kategorie, $filter, $veranstaltungid, $einstufungid, $veranstaltungen, $veranstalterid, $veranstalter, $einstufungen, $details_anzeigen): void
{
global $params;
@@ -208,16 +208,22 @@ class HTML_sportsmanager_admin
<a href="<?php echo SportsManagerURL('&task=admin_ranglistensysteme'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_RANKING_RATING'); ?></a>
</td>
<?php
self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
$Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
}
if (benutzerZugriff("organisationen_aendern")) {
?>
<td style="padding-right: 15px" nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></a>
</td>
<?php
$Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
}
if ((benutzerZugriff("mannschaftswettbewerb_aendern") || benutzerVeranstaltungModerator()) && einstellungswert("ordnungsstrafen_verwenden")) {
?>
<td style="padding-right: 15px" nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_ordnungsstrafen'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_DISCIPLINARY_FINES'); ?></a>
</td>
<?php
self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
}
?>
</tr>
@@ -5253,7 +5259,7 @@ class HTML_sportsmanager_admin
static function adminKategorien($kategorien): void
{
global $params;
$anzahl = array(0,50,100,50,50,100,50,50);
$anzahl = array(0,50,100,50,50,100,50,50,100);
?>
<div
@@ -5262,75 +5268,68 @@ class HTML_sportsmanager_admin
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table style="width: 100%">
<tr>
<td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto">
<table style="width: 100%">
<?php
for ($typ = 1; $typ <= 7; $typ++) {
?>
<tr>
<td></td>
<td colspan="3">
<div>
<H2>
<?php
if ($typ == 1)
echo Text::_('COM_SPORTSMANAGER_ORGANISATIONS');
else if ($typ == 2)
echo Text::_('COM_SPORTSMANAGER_TEAM_COMPETITIONS');
else if ($typ == 3)
echo Text::_('COM_SPORTSMANAGER_TOURNAMENTS');
else if ($typ == 4)
echo Text::_('COM_SPORTSMANAGER_RANKINGS');
else if ($typ == 5)
echo Text::_('COM_SPORTSMANAGER_PLAYER_STATISTICS');
else if ($typ == 6)
echo Text::_('COM_SPORTSMANAGER_INDIVIDUAL_COMPETITIONS');
else if ($typ == 7)
echo Text::_('COM_SPORTSMANAGER_ASSOCIATION_BODIES');
?>
</H2>
</div>
</td>
</tr>
<?php
for ($nummer = 1; $nummer <= $anzahl[$typ]; $nummer++) {
?>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="designation_<?php echo $typ; ?>_<?php echo $nummer; ?>"><?php echo $nummer; ?></label>
</td>
<td nowrap>
<input class="inputbox" type="text"
name="bezeichnung_<?php echo $typ; ?>_<?php echo $nummer; ?>"
id="designation_<?php echo $typ; ?>_<?php echo $nummer; ?>"
size="50" maxlength="50"
value="<?php if (isset($kategorien[$typ][$nummer])) echo htmlentities_utf8($kategorien[$typ][$nummer]); ?>"/>
</td>
</tr>
<?php
}
?>
<tr>
<td nowrap colspan="2">&nbsp;
<?php
for ($typ = 1; $typ <= 8; $typ++) {
?>
<tr>
<td></td>
<td colspan="3">
<div>
<H2>
<?php
if ($typ == 1)
echo Text::_('COM_SPORTSMANAGER_ORGANISATIONS');
else if ($typ == 2)
echo Text::_('COM_SPORTSMANAGER_TEAM_COMPETITIONS');
else if ($typ == 3)
echo Text::_('COM_SPORTSMANAGER_TOURNAMENTS');
else if ($typ == 4)
echo Text::_('COM_SPORTSMANAGER_RANKINGS');
else if ($typ == 5)
echo Text::_('COM_SPORTSMANAGER_PLAYER_STATISTICS');
else if ($typ == 6)
echo Text::_('COM_SPORTSMANAGER_INDIVIDUAL_COMPETITIONS');
else if ($typ == 7)
echo Text::_('COM_SPORTSMANAGER_ASSOCIATION_BODIES');
else if ($typ == 8)
echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME');
?>
</H2>
</div>
</td>
</tr>
<?php
for ($nummer = 1; $nummer <= $anzahl[$typ]; $nummer++) {
?>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="designation_<?php echo $typ; ?>_<?php echo $nummer; ?>"><?php echo $nummer; ?></label>
</td>
<td nowrap>
<input class="inputbox" type="text"
name="bezeichnung_<?php echo $typ; ?>_<?php echo $nummer; ?>"
id="designation_<?php echo $typ; ?>_<?php echo $nummer; ?>"
size="50" maxlength="50"
value="<?php if (isset($kategorien[$typ][$nummer])) echo htmlentities_utf8($kategorien[$typ][$nummer]); ?>"/>
</td>
</tr>
<?php
}
?>
<tr>
<td nowrap colspan="2">&nbsp;
</td>
</tr>
<?php
}
?>
</table>
</div>
</td>
</tr>
</td>
</tr>
<?php
}
?>
</table>
</div>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>"
class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" class="button"/>
<input type="hidden" name="task" value="admin_kategorien_save"/>
</form>
<?php
@@ -7929,6 +7928,449 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<?php
}
static function adminHalloffame($rows): void
{
global $params;
?>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?>
: <?php echo Text::_('COM_SPORTSMANAGER_JOOMLA_MANAGEMENT'); ?></div>
<table style="border-spacing: 10px">
<tr>
<td nowrap><a
href="<?php echo SportsManagerURL('&task=admin_uebersicht'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_BACK'); ?></a>
</td>
</tr>
<tr>
<td nowrap><a
href="<?php echo SportsManagerURL('&task=admin_halloffame_edit'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_ADD_HALL_OF_FAME'); ?></a>
</td>
</tr>
</table>
<?php
if (count($rows) > 0) {
?>
<table style='border-collapse: collapse;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style='text-align: left; width: 400px;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<th style='text-align: center; width: 200px;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_YEARS'); ?></strong></th>
<th></th>
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
?>
<tr class="sectiontableentry<?php echo $k + 1;
$k = ($k + 1) % 2; ?><?php echo $params->get('pageclass_sfx'); ?>">
<td nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_edit&id=' . $row->halloffame_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($row->halloffame)); ?>
</a>
</td>
<td style='text-align: center;' nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $row->halloffame_id); ?>">
<?php echo $row->zeitspanne; ?>
</a>
</td>
<td nowrap><small><a
href="<?php echo SportsManagerURL('&task=admin_halloffame_remove&id=' . $row->halloffame_id); ?>"
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME'); ?>');"
title="<?php echo Text::_('COM_SPORTSMANAGER_REMOVE'); ?>">X</a></small>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
}
static function adminEditHalloffame($row,$veranstalter,$kategorien,$spielformen): void
{
global $params;
?>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?>
: <?php echo($row != null ? Text::_('COM_SPORTSMANAGER_CHANGING') : Text::_('COM_SPORTSMANAGER_ADD')); ?></div>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"
enctype="multipart/form-data">
<div class="uk-overflow-auto">
<table style="width: 100%">
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="hall_of_fame"><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?>
:</label>
</td>
<td nowrap>
<input class="uk-input" type="text" name="halloffame" style="width: 500px;"
id="hall_of_fame" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->halloffame) : ''; ?>"/>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="organizer"><?php echo Text::_('COM_SPORTSMANAGER_ORGANISATION'); ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-medium" name="veranstalter_id"
id="organizer" size="1">
<?php
foreach ($veranstalter as $v)
echo "<option value=\"" . $v->veranstalter_id . "\"" . (($row != null && $v->veranstalter_id == $row->veranstalter_id) ? " selected" : "") . ">" . htmlentities_utf8($v->veranstalterbezeichnung) . "</option>\r\n";
?>
<option value="0"><?php echo Text::_('COM_SPORTSMANAGER_NONE2'); ?></option>
</select>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="category"><?php echo Text::_('COM_SPORTSMANAGER_CATEGORY'); ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-medium" style="width: 500px;" name="kategorie"
id="category" size="1">
<?php
for ($i = 1; $i <= 100; $i++) {
echo "<option value=\"" . $i . "\"" . ($row != null ? ($row->kategorie == $i ? " selected" : "") : "") . ">" . $i . (isset($kategorien[$i]) ? htmlentities_utf8(" " . $kategorien[$i]) : "") . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="type"><?php echo Text::_('COM_SPORTSMANAGER_MATCH_TYPE'); ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-medium" name="spielform"
id="type" size="1">
<?php
foreach ($spielformen as $key => $spielform)
echo "<option value=\"" . $key . "\"" . (($row != null && $key == $row->spielform) ? " selected" : "") . ">" . htmlentities_utf8($spielform) . "</option>\r\n";
?>
</select>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="order"><?php echo Text::_('COM_SPORTSMANAGER_ORDER'); ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-medium" name="reihenfolge" id="order"
size="1">
<?php
for ($i = 1; $i <= 100; $i++) {
echo "<option value=\"" . $i . "\"" . ($row != null ? ($row->reihenfolge == $i ? " selected" : "") : "") . ">" . $i . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td nowrap colspan="2">&nbsp;
</td>
</tr>
</table>
</div>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" class="button"/>
<input type="hidden" name="task" value="admin_halloffame_save"/>
<input type="hidden" name="id" value="<?php echo($row != null ? $row->halloffame_id : "0"); ?>"/>
</form>
<?php
}
static function adminHalloffameMitglieder($rows, $halloffame): void
{
global $params;
?>
<div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>">
<?php echo htmlentities_utf8($halloffame->halloffame); ?>
: <?php echo Text::_('COM_SPORTSMANAGER_JOOMLA_MANAGEMENT'); ?>
</div>
<table style="border-spacing: 10px">
<tr>
<td nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame'); ?>">
<?php echo Text::_('COM_SPORTSMANAGER_BACK'); ?>
</a>
</td>
</tr>
<tr>
<td nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_edit&halloffame_id=' . $halloffame->halloffame_id); ?>">
<?php echo Text::_('COM_SPORTSMANAGER_ADD_MEMBER'); ?>
</a>
</td>
</tr>
</table>
<?php
if ($rows != null) {
?>
<table style='border-collapse: collapse;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:center; width:100px;" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?></strong>
</th>
<?php
for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
?>
<th style="text-align:center;" colspan="2" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
</th>
<?php } ?>
<th style="width:40px;"></th>
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
if ($halloffame->spielform == 2) {
?>
<!-- Erste Zeile -->
<tr class="<?php echo $rowclass; ?>">
<td rowspan="2" nowrap style="text-align:center;">
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_edit&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>">
<?php echo $row->jahr; ?>
</a>
</td>
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
$spieler1_id = "spieler1_id_" . $i;
$spieler1 = "spieler1_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler1_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler1); ?>
</td>
<?php } ?>
<td rowspan="2" nowrap>
<small>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_remove&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>"
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR'); ?>');"
title="<?php echo Text::_('COM_SPORTSMANAGER_REMOVE'); ?>">
X
</a>
</small>
</td>
</tr>
<!-- Zweite Zeile -->
<tr class="<?php echo $rowclass; ?>">
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
$spieler2_id = "spieler2_id_" . $i;
$spieler2 = "spieler2_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler2_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler2); ?>
</td>
<?php } ?>
</tr>
<?php
} else {
?>
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center;">
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_edit&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>">
<?php echo $row->jahr; ?>
</a>
</td>
<?php for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
if ($halloffame->spielform == 1) {
$id = "verein_id_" . $i;
$txt = "teamname_" . $i;
$type = "vereine";
} else {
$id = "spieler1_id_" . $i;
$txt = "spieler1_" . $i;
$type = "spieler";
}
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML($type, $row->$id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$txt); ?>
</td>
<?php } ?>
<td nowrap>
<small>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_remove&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>"
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR'); ?>');"
title="<?php echo Text::_('COM_SPORTSMANAGER_REMOVE'); ?>">
X
</a>
</small>
</td>
</tr>
<?php
}
}
?>
</table>
<?php
}
}
static function adminEditHalloffameMitglied($row,$halloffame,$vereine,$spieler,$jahre): void
{
global $params;
?>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($halloffame->halloffame); ?>
: <?php echo($row != null ? Text::_('COM_SPORTSMANAGER_CHANGING') : Text::_('COM_SPORTSMANAGER_ADD')); ?></div>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"
enctype="multipart/form-data">
<div class="uk-overflow-auto">
<table style="width: 100%">
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="year"><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-medium" name="jahr" id="year"
size="1">
<?php
foreach ($jahre AS $jahr) {
echo "<option value=\"" . $jahr . "\"" . ($row != null ? ($row->jahr == $jahr ? " selected" : "") : "") . ">" . $jahr . "</option>";
}
?>
</select>
</td>
</tr>
<?php
for ($p = 1; $p <= 3; $p++){
if ($halloffame->spielform == 1){
$index_vereinid = "verein_id_" . $p;
$index_team = "teamname_" . $p;
?>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="verein1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-large" name="verein_id_<?php echo $p; ?>"
id="verein_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($vereine as $v)
echo "<option value=\"" . $v->verein_id . "\"" . ($row != null ? ($row->$index_vereinid == $v->verein_id ? " selected" : "") : "") . ">" . htmlentities_utf8($v->verein) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="teamname_<?php echo $p; ?>" id="verein_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_team) : ''; ?>"/>
</td>
</tr>
<?php
}
if ($halloffame->spielform == 2 || $halloffame->spielform == 3){
$index_spieler1id = "spieler1_id_" . $p;
$index_spieler1 = "spieler1_" . $p;
$index_spieler2id = "spieler2_id_" . $p;
$index_spieler2 = "spieler2_" . $p;
?>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="player1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-large" name="spieler1_id_<?php echo $p; ?>"
id="player1_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($spieler as $s)
echo "<option value=\"" . $s->spieler_id . "\"" . ($row != null ? ($row->$index_spieler1id == $s->spieler_id ? " selected" : "") : "") . ">" . htmlentities_utf8($s->spieler) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="spieler1_<?php echo $p; ?>" id="player1_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler1) : ''; ?>"/>
<?PHP if ($halloffame->spielform == 2){ ?>
<br>
<select class="uk-select uk-form-width-large" name="spieler2_id_<?php echo $p; ?>"
id="player2_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($spieler as $s)
echo "<option value=\"" . $s->spieler_id . "\"" . ($row != null ? ($row->$index_spieler2id == $s->spieler_id ? " selected" : "") : "") . ">" . htmlentities_utf8($s->spieler) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="spieler2_<?php echo $p; ?>" id="player2_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler2) : ''; ?>"/>
<?PHP } ?>
</td>
</tr>
<?php
}
}
?>
<tr>
<td nowrap colspan="2">&nbsp;</td>
</tr>
</table>
</div>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" class="button"/>
<input type="hidden" name="task" value="admin_halloffame_mitglied_save"/>
<input type="hidden" name="halloffame_id" value="<?php echo $halloffame->halloffame_id; ?>"/>
<input type="hidden" name="spielform" value="<?php echo $halloffame->spielform; ?>"/>
</form>
<?php
}
static function adminRegelwerke($rows): void
{
global $params;
@@ -1084,3 +1084,12 @@ COM_SPORTSMANAGER_ADDITIONAL_INFO="Zusatzinfo"
COM_SPORTSMANAGER_USE_HTML="Hier sollte HTML-formatierter Text verwendet werden"
COM_SPORTSMANAGER_REALLY_REMOVE_ASSOCIATION_BODY_MEMBER="M&ouml;chtest du dieses Mitglied des Verbandsorgans wirklich entfernen?"
COM_SPORTSMANAGER_HELP_EDIT_ASSOCIATION_BODY_MEMBER="Wird ein Name aus der Spielerliste ausgew&auml;hlt, werden Nachname und Vorname &uuml;bernommen.<br>Telefon, Mobil, E-Mail werden aus der Spielerliste &uuml;bernommen, wenn sie hier nicht ausgef&uuml;llt sind."
COM_SPORTSMANAGER_HALL_OF_FAME="Hall of Fame"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME="Hall of Fame hinzuf&uuml;gen"
COM_SPORTSMANAGER_INVALID_HALL_OF_FAME_NAME="Invalider Name f&uuml;r Hall of Fame"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME="Willst Du wirklich diese Hall of Fame mit allen Mitgliedern l&ouml;schen?"
COM_SPORTSMANAGER_MATCH_TYPE="Spielform"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Willst Du wirklich dieses Hall of Fame Jahr l&ouml;schen?"
COM_SPORTSMANAGER_YEARS="Jahre"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzuf&uuml;gen"
COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag"
@@ -1084,3 +1084,12 @@ COM_SPORTSMANAGER_ADDITIONAL_INFO="Additional information"
COM_SPORTSMANAGER_USE_HTML="HTML-formatted text should be used here."
COM_SPORTSMANAGER_REALLY_REMOVE_ASSOCIATION_BODY_MEMBER="Do you really want to remove this association body member?"
COM_SPORTSMANAGER_HELP_EDIT_ASSOCIATION_BODY_MEMBER="Selecting a name from the player list will fill in the first and last name.<br>Phone, mobile, and email are filled from the player list if left blank here."
COM_SPORTSMANAGER_HALL_OF_FAME="Hall of Fame"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME="Add Hall of Fame"
COM_SPORTSMANAGER_INVALID_HALL_OF_FAME_NAME="Invalid Hall of Fame name"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME="Are you sure you want to delete this Hall of Fame including all its members?"
COM_SPORTSMANAGER_MATCH_TYPE="Game Type"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Are you sure you want to delete this Hall of Fame year?"
COM_SPORTSMANAGER_YEARS="Years"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year"
COM_SPORTSMANAGER_NO_ENTRY="no entry"
+47 -1
View File
@@ -1230,11 +1230,49 @@ return new class () implements InstallerScriptInterface
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
$query = "CREATE TABLE IF NOT EXISTS `#__sportsmanager_halloffame` ("
. "\n `halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `veranstalter_id` int(11) DEFAULT NULL,"
. "\n `halloffame` varchar(64) DEFAULT NULL,"
. "\n `kategorie` int(4) DEFAULT NULL,"
. "\n `spielform` int(11) DEFAULT NULL,"
. "\n `reihenfolge` int(4) DEFAULT NULL,"
. "\n PRIMARY KEY (`halloffame_id`),"
. "\n KEY `veranstalter_id` (`veranstalter_id`)"
. "\n ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "CREATE TABLE IF NOT EXISTS `#__sportsmanager_mitglied_von_halloffame` ("
. "\n `mitglied_halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `halloffame_id` int(11) NOT NULL,"
. "\n `jahr` int(4) DEFAULT NULL,"
. "\n `platz` int(11) DEFAULT NULL,"
. "\n `verein_id` int(11) DEFAULT NULL,"
. "\n `teamname` varchar(64) DEFAULT NULL,"
. "\n `spieler1_id` int(11) DEFAULT NULL,"
. "\n `spieler1` varchar(64) DEFAULT NULL,"
. "\n `spieler2_id` int(11) DEFAULT NULL,"
. "\n `spieler2` varchar(64) DEFAULT NULL,"
. "\n PRIMARY KEY (`mitglied_halloffame_id`),"
. "\n UNIQUE KEY `halloffame_jahr_platz` (`halloffame_id`,`jahr`,`platz`),"
. "\n KEY `halloffame_id` (`halloffame_id`),"
. "\n KEY `verein_id` (`verein_id`),"
. "\n KEY `spieler1_id` (`spieler1_id`),"
. "\n KEY `spieler2_id` (`spieler2_id`)"
. "\n ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'verbands_kuerzel', wert = 'tbe.';";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '118';";
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '119';";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
@@ -1806,5 +1844,13 @@ return new class () implements InstallerScriptInterface
$query = "DROP TABLE IF EXISTS `#__sportsmanager_mitglied_von_verbandsorgan`;";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
$query = "DROP TABLE IF EXISTS `#__sportsmanager_halloffame`;";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
$query = "DROP TABLE IF EXISTS `#__sportsmanager_mitglied_von_halloffame`;";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
}
};