Erweiterungen am Wettkampkalender:

- wettkampfkalenderlose Events

- neue Funktion zur Ausführung einer DatenbankAbfrage
	modified:   markdownExperiment/phpLib/cwsvJudo/miscAssis.php
- URL der Wettkämpfe um Wetkampfname erweitert
	modified:   markdownExperiment/phpLib/cwsvJudo/wkKalender.php
- events haben jetzt ein eigenes Datum und nehmen es nicht mehr aus
dem zugeordneten Wettkampf (für die events ohne zugehörigen Eintrag im
Wettkampfkalender)
	modified:   markdownExperiment/wkParticipo/addEvent.php
	modified:   markdownExperiment/wkParticipo/admin/addEvent.php
- In der Adminansicht eines Events können jetzt auch Starter eintfernt
werden; @todo: Was noch fehlt ist die Behandlung der Fahrten!
	modified:   markdownExperiment/wkParticipo/admin/showEvent.php
- dbQuery wurde in cwsvJudoe/miscAssis eingepflegt.
	modified:   markdownExperiment/wkParticipo/lib/wkParticipo-userAttribute.php
This commit is contained in:
marko
2019-01-09 07:31:52 +01:00
parent 1823d03ef9
commit 7c9f4b8baa
6 changed files with 93 additions and 51 deletions

View File

@@ -23,7 +23,7 @@ global $cwsvJudoConfig;
// Datenbankverbindung bereit stellen
try{
$db_connection = new PDO(
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
@@ -161,4 +161,46 @@ function toAscii($str, $replace=array(), $delimiter='-') {
return $clean;
}
function dbQuery($aDbConnection, $aQueryString, $aBindArray = array(), $someOptions = array( "dbCharset" => "ISO-8859-1", "outCharset" => "UTF-8" ) ){
//echo("Doing ".$aQueryString);
var_dump($aBindArray);
if( empty($someOptions['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1";
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
/// als UTF8 in latin1(?) gespeichert.
try{
$pdoStatement = $aDbConnection->prepare( $aQueryString );
foreach( $aBindArray as $bindName => $bind ){
$pdoStatement->bindValue(
$bindName,
$bind['value'],
(isset($bind['data_type'])?$bind['data_type']:PDO::PARAM_STR)
);
}
$pdoStatement->execute();
$ret = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
return null;
}
//var_dump($ret);
// Zeichensatzkonvertierung
if( is_array($ret) ){
foreach($ret as &$entry){
array_walk(
$entry,
function (&$value, $key, $someOptions) {
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
},
$someOptions
);
}
}
return $ret;
}
?>

View File

@@ -200,7 +200,7 @@ $htmlWkTableString = "";
str_replace("mannschaft", "mann&shy;schaft", $wk['Veranstaltung']);
$htmlWkTableString .=
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."\"><tr>".
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."/".toAscii( html_entity_decode( $wk['Veranstaltung'] ))."\"><tr>".
"<script type=\"application/ld+json\">".$wkJsonSd."</script>".
"<td data-title=\"Datum\" class=\"noWrap\">".
"<time class=\"kalenderDatum\" datetime=".$wk['Datum'].">".