Merge /media/sdb1/gitRepositories/judo into promoInfo
Conflicts: homepage/redesign2018/markdownExperiment/wkParticipo/login.php
This commit is contained in:
@@ -269,6 +269,7 @@ function getFahrtData($anMysqlConn, $anFahrtId){
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
function getEventData($anMysqlConn, $anEventId){
|
||||
$ret = array();
|
||||
if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
@@ -276,6 +277,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
@@ -286,7 +288,8 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wettkampfkalender ".
|
||||
"ON wkParticipo_Events.wkId = wettkampfkalender.lfdeNr ".
|
||||
"WHERE wkParticipo_Events.id = '%s';",
|
||||
$anMysqlConn->real_escape_string($anEventId) );
|
||||
$results = $anMysqlConn->query($query);
|
||||
@@ -294,7 +297,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
/// @ToDo: Anzahl Ergebnise auf ==1 testen
|
||||
$ret = $results->fetch_assoc();
|
||||
return $ret;
|
||||
}
|
||||
}*/
|
||||
|
||||
/// Daten eines einzelnen wkEvents via eventId abfragen
|
||||
///
|
||||
@@ -326,7 +329,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"WHERE wkParticipo_Events.id = '%s';",
|
||||
$anMysqlConn->real_escape_string($anEventId)
|
||||
);
|
||||
@@ -347,6 +350,24 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
$someOptions
|
||||
);
|
||||
|
||||
// @todo: nur temporär: fehlende Wettkampdaten aus den Metadaten ergänzen
|
||||
if( empty($ret['wkId']) ){
|
||||
$tmpWkEvent = json_decode($ret['bemerkungen'], true);
|
||||
// var_dump($tmpWkEvent, $ret['bemerkungen']);
|
||||
if(!empty($tmpWkEvent)){
|
||||
// var_dump( $tmpWkEvent );
|
||||
// var_dump( json_decode($aWkEvent['bemerkungen'], true) );
|
||||
$ret['Datum'] = $tmpWkEvent['Datum'];
|
||||
if($tmpWkEvent['Ort'])
|
||||
$ret['Ort'] = $tmpWkEvent['Ort'];
|
||||
if($tmpWkEvent['Routenplaner'])
|
||||
$ret['Routenplaner'] = $tmpWkEvent['Routenplaner'];
|
||||
$ret['Veranstaltung'] = $tmpWkEvent['Veranstaltung'];
|
||||
$ret['Altersklassen'] = $tmpWkEvent['Altersklassen'];
|
||||
$ret['bemerkungen'] = $tmpWkEvent['bemerkungen'];
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -358,7 +379,6 @@ return $ret;
|
||||
/// selber.
|
||||
/// Der Rückgabewert sollte vor Verwendung (und zur Fehlerbeheandlung)
|
||||
/// auf NULL und/oder leeres Array getestet werden.
|
||||
///
|
||||
function getCommingWkEvents($anMysqlConn, $someOptions=array() ){
|
||||
|
||||
// wir befinden uns in der Übergangsphase:
|
||||
@@ -375,6 +395,7 @@ $ret = array();
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
@@ -386,10 +407,13 @@ $ret = array();
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ".
|
||||
"LEFT JOIN wettkampfkalender ".
|
||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"WHERE wettkampfkalender.Datum >= CURDATE() ".
|
||||
"ORDER BY wettkampfkalender.Datum;"
|
||||
// quickhack; muss noch getestet werden
|
||||
// "WHERE wettkampfkalender.Datum IS NULL OR wettkampfkalender.Datum >= CURDATE() ".
|
||||
"WHERE wkParticipo_Events.date >= CURDATE() ".
|
||||
// "ORDER BY wettkampfkalender.Datum;"
|
||||
"ORDER BY wkParticipo_Events.date;"
|
||||
);
|
||||
// echo($query);die();
|
||||
$results = $anMysqlConn->query($query);
|
||||
@@ -412,7 +436,6 @@ $ret = array();
|
||||
);
|
||||
array_push( $ret, $result);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -479,6 +502,8 @@ return $ret;
|
||||
|
||||
|
||||
/// Zukünftige Wettkämpfe abfragen
|
||||
///
|
||||
/// - Fragt in der Zukunft liegende Wettkämpfe aus dem Wettkampfkalender ab
|
||||
function getCommingWk($anMysqlConn){
|
||||
$ret = array();
|
||||
$anMysqlConn->query("USE cwsvjudo;");
|
||||
@@ -607,25 +632,29 @@ $ret = array();
|
||||
$anMysqlConn->query("USE cwsvjudo;");
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
"wkParticipo_Events.kvOptions, ".
|
||||
"wettkampfkalender.lfdeNr, ".
|
||||
"wettkampfkalender.Datum, ".
|
||||
"wettkampfkalender.Veranstaltung, ".
|
||||
"wettkampfkalender.Altersklassen, ".
|
||||
"wettkampfkalender.Ort, ".
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner, ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Starter.id, ".
|
||||
"wkParticipo_Starter.eventId, ".
|
||||
"wkParticipo_Starter.type ".
|
||||
"FROM wettkampfkalender ".
|
||||
"JOIN wkParticipo_Events ".
|
||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"JOIN wkParticipo_Starter ".
|
||||
"ON wkParticipo_Starter.eventId = wkParticipo_Events.id ".
|
||||
"WHERE wettkampfkalender.Datum >= CURDATE() AND wkParticipo_Starter.userId = '%s' ".
|
||||
"ORDER BY wettkampfkalender.Datum;",
|
||||
"FROM wkParticipo_Events ".
|
||||
"LEFT JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wkParticipo_Starter ON wkParticipo_Starter.eventId = wkParticipo_Events.id ".
|
||||
"WHERE wkParticipo_Events.date >= CURDATE() AND wkParticipo_Starter.userId = '%s' ".
|
||||
// "WHERE wkParticipo_Starter.userId = '%s' ".
|
||||
// "ORDER BY wettkampfkalender.Datum;",
|
||||
"ORDER BY wkParticipo_Events.date;",
|
||||
$anMysqlConn->real_escape_string($anUserId) );
|
||||
$results = $anMysqlConn->query($query);
|
||||
if( !$results ) die("ERR: Fehler bei Datenbankabfrage (".$query.")!\n");
|
||||
@@ -641,8 +670,22 @@ $ret = array();
|
||||
},
|
||||
$someOptions
|
||||
);
|
||||
// @todo: nur temporär: fehlende Wettkampdaten aus den Metadaten ergänzen
|
||||
if( empty($entry['wkId']) ){
|
||||
$tmpWkEvent = json_decode($entry['bemerkungen'], true);
|
||||
// var_dump($tmpWkEvent, $ret['bemerkungen']);
|
||||
if(!empty($tmpWkEvent)){
|
||||
// var_dump( $tmpWkEvent );
|
||||
// var_dump( json_decode($aWkEvent['bemerkungen'], true) );
|
||||
$entry['Datum'] = $tmpWkEvent['Datum'];
|
||||
$entry['Veranstaltung'] = $tmpWkEvent['Veranstaltung'];
|
||||
$entry['Altersklassen'] = $tmpWkEvent['Altersklassen'];
|
||||
$entry['bemerkungen'] = $tmpWkEvent['bemerkungen'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -651,23 +694,23 @@ $ret = array();
|
||||
$anMysqlConn->query("USE cwsvjudo;");
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
"wkParticipo_Events.kvOptions, ".
|
||||
"wettkampfkalender.lfdeNr, ".
|
||||
"wettkampfkalender.Datum, ".
|
||||
"wettkampfkalender.Veranstaltung, ".
|
||||
"wettkampfkalender.Altersklassen, ".
|
||||
"wettkampfkalender.Ort, ".
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner, ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Starter.id, ".
|
||||
"wkParticipo_Starter.eventId ".
|
||||
"FROM wettkampfkalender ".
|
||||
"JOIN wkParticipo_Events ".
|
||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"JOIN wkParticipo_Starter ".
|
||||
"ON wkParticipo_Starter.eventId = wkParticipo_Events.id ".
|
||||
// "WHERE wettkampfkalender.Datum >= CURDATE() AND wkParticipo_Starter.userId = '%s' ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"LEFT JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wkParticipo_Starter ON wkParticipo_Starter.eventId = wkParticipo_Events.id ".
|
||||
"WHERE wkParticipo_Starter.userId = '%s' ".
|
||||
"ORDER BY wettkampfkalender.Datum;",
|
||||
$anMysqlConn->real_escape_string($anUserId) );
|
||||
@@ -927,7 +970,7 @@ $retMessage = array();
|
||||
return $retMessage;
|
||||
}
|
||||
|
||||
$event = getEventData($anMysqlConn, $anEventId);
|
||||
$event = getWkEventData($anMysqlConn, $anEventId);
|
||||
if( empty($event) ){
|
||||
$retMessage['error'] .= "eventId ".$anEventId." nicht gefunden<br />";
|
||||
return $retMessage;
|
||||
@@ -969,7 +1012,7 @@ $retMessage = array();
|
||||
return $retMessage;
|
||||
}
|
||||
|
||||
$event = getEventData($anMysqlConn, $anEventId);
|
||||
$event = getWkEventData($anMysqlConn, $anEventId);
|
||||
if( empty($event) ){
|
||||
$retMessage['error'] .= "eventId ".$anEventId." nicht gefunden<br />";
|
||||
return $retMessage;
|
||||
@@ -1199,9 +1242,6 @@ return $url;
|
||||
|
||||
/// Erzeugen des htmlCodes der Infobox für ein wkEvent
|
||||
function htmlWkEvent($aWkEvent, $starters, $fahrten){
|
||||
//var_dump($aWkEvent, $starters, $fahrten);
|
||||
|
||||
|
||||
$retHtml = "";
|
||||
|
||||
if( empty($aWkEvent['Datum']) )
|
||||
@@ -1222,7 +1262,7 @@ $retHtml = "";
|
||||
"<time class=\"wkInfoCardDate\" datetime=\"".$aWkEvent['Datum']."\">".
|
||||
"<span class=\"wkInfoCardDateWeekday\">".strftime("%a", strtotime($aWkEvent['Datum']))."</span>".
|
||||
"<span class=\"wkInfoCardDateDay\">" .strftime("%d", strtotime($aWkEvent['Datum']))."</span>".
|
||||
"<span class=\"wkInfoCardDateMonth\">" .strftime("%b", strtotime($aWkEvent['Datum']))."</span>".
|
||||
"<span class=\"wkInfoCardDateMonth\">" .utf8_encode(strftime("%b", strtotime($aWkEvent['Datum'])))."</span>".
|
||||
"<span class=\"wkInfoCardDateYear\">" .strftime("%Y", strtotime($aWkEvent['Datum']))."</span>".
|
||||
"</time>".
|
||||
|
||||
|
||||
Reference in New Issue
Block a user