Merge branch 'wkParticipo' of https://gitea.cwsvjudo.dedyn.io/marko/cwsvJudo into wkParticipo
This commit is contained in:
@@ -7,8 +7,8 @@ return (is_numeric($str) && $str > 0 && $str == round($str));
|
||||
function getPdoDbConnection($hostname, $dbName, $user, $password){
|
||||
try{
|
||||
$dbConnection = new PDO(
|
||||
'mysql:host='.$hostname.';dbname='.$dbName,
|
||||
$user,
|
||||
'mysql:host='.$hostname.';dbname='.$dbName,
|
||||
$user,
|
||||
$password
|
||||
);
|
||||
}
|
||||
@@ -23,8 +23,8 @@ global $cwsvJudoConfig;
|
||||
// Datenbankverbindung bereit stellen
|
||||
try{
|
||||
$db_connection = new PDO(
|
||||
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"]
|
||||
);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ if (is_array($somePossibleEmptyStuff) || $somePossibleEmptyStuff instanceof Trav
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Eine als String gegebene Liste kommagetrennter key=value Paare in
|
||||
/// Eine als String gegebene Liste kommagetrennter key=value Paare in
|
||||
/// ein assoziatives Array überführen
|
||||
function getKeyValueArray($aKeyValueStringList){
|
||||
$retKeyValueArray = array();
|
||||
@@ -87,7 +87,7 @@ if( empty($optionsArray['outCharset']) ) $optionsArray['outCharset'] = "UTF-8";
|
||||
);
|
||||
$pdoStatementForQuerryingZitat->execute();
|
||||
$retZitat = $pdoStatementForQuerryingZitat->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
// Zeichensatzkonvertierung
|
||||
foreach($retZitat as &$entry){
|
||||
array_walk(
|
||||
@@ -127,8 +127,8 @@ if( !file_exists($aJsonFileName) ) return null;
|
||||
if( !(is_array( $someLinkNames ) || is_object( $someLinkNames )) ) return null;
|
||||
|
||||
return arrayKeyFilter(
|
||||
json_decode(
|
||||
file_get_contents($aJsonFileName),
|
||||
json_decode(
|
||||
file_get_contents($aJsonFileName),
|
||||
true
|
||||
),
|
||||
$someLinkNames
|
||||
@@ -162,14 +162,14 @@ function toAscii($str, $replace=array(), $delimiter='-') {
|
||||
return $clean;
|
||||
}
|
||||
|
||||
/// Wrapper function for a query to the
|
||||
/// $aDbConnection connection to a db
|
||||
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.
|
||||
/// @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 );
|
||||
@@ -187,7 +187,7 @@ if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
||||
print "Error!: " . $db_error->getMessage() . "<br/>";
|
||||
return null;
|
||||
}
|
||||
//var_dump($ret);
|
||||
|
||||
// Zeichensatzkonvertierung
|
||||
if( is_array($ret) ){
|
||||
foreach($ret as &$entry){
|
||||
|
||||
@@ -18,6 +18,31 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
if ($mysqlConn->connect_error) {
|
||||
$sqlMessage['error'] .= 'Datenbankverbindung fehlgeschlagen: ' . $mysqlConn->connect_error;
|
||||
}
|
||||
// var_dump($_SESSION);
|
||||
|
||||
/// Stellt den cssCode mit den Variablendefinitionen bereit
|
||||
/*
|
||||
function colorThemeCss($colorArray = array('backgroundColor'=>"#FFAE00", 'highlightColor'=>"#FF8100", 'buttonColor'=>"#291670")){
|
||||
//$colorTypes = ["backgroundColor", "highlightColor", "buttonColor"];
|
||||
$defaultColors =['backgroundColor'=> "#FFAE00", 'highlightColor'=>"#FF8100", 'buttonColor'=>"#291670"];
|
||||
|
||||
//echo("DBG: colorArray:"); var_dump($colorArray);
|
||||
|
||||
// Inputdatenvalidierung
|
||||
foreach($defaultColors as $key=>$value){
|
||||
if( !preg_match("/^#(?:[0-9a-fA-F]{3}){1,2}$/", $colorArray[$key]) ){
|
||||
$colorArray[$key] = $defaultColors[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$ret = ":root{";
|
||||
|
||||
foreach($colorArray as $key=>$value){
|
||||
$ret .= "--".$key.": ".$value."; ";
|
||||
}
|
||||
$ret .= "}";
|
||||
return $ret;
|
||||
}*/
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user