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){
|
function getPdoDbConnection($hostname, $dbName, $user, $password){
|
||||||
try{
|
try{
|
||||||
$dbConnection = new PDO(
|
$dbConnection = new PDO(
|
||||||
'mysql:host='.$hostname.';dbname='.$dbName,
|
'mysql:host='.$hostname.';dbname='.$dbName,
|
||||||
$user,
|
$user,
|
||||||
$password
|
$password
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -23,8 +23,8 @@ global $cwsvJudoConfig;
|
|||||||
// Datenbankverbindung bereit stellen
|
// Datenbankverbindung bereit stellen
|
||||||
try{
|
try{
|
||||||
$db_connection = new PDO(
|
$db_connection = new PDO(
|
||||||
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
|
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig["db"]["user"],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig["db"]["password"]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ if (is_array($somePossibleEmptyStuff) || $somePossibleEmptyStuff instanceof Trav
|
|||||||
return null;
|
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
|
/// ein assoziatives Array überführen
|
||||||
function getKeyValueArray($aKeyValueStringList){
|
function getKeyValueArray($aKeyValueStringList){
|
||||||
$retKeyValueArray = array();
|
$retKeyValueArray = array();
|
||||||
@@ -87,7 +87,7 @@ if( empty($optionsArray['outCharset']) ) $optionsArray['outCharset'] = "UTF-8";
|
|||||||
);
|
);
|
||||||
$pdoStatementForQuerryingZitat->execute();
|
$pdoStatementForQuerryingZitat->execute();
|
||||||
$retZitat = $pdoStatementForQuerryingZitat->fetchAll(PDO::FETCH_ASSOC);
|
$retZitat = $pdoStatementForQuerryingZitat->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
// Zeichensatzkonvertierung
|
// Zeichensatzkonvertierung
|
||||||
foreach($retZitat as &$entry){
|
foreach($retZitat as &$entry){
|
||||||
array_walk(
|
array_walk(
|
||||||
@@ -127,8 +127,8 @@ if( !file_exists($aJsonFileName) ) return null;
|
|||||||
if( !(is_array( $someLinkNames ) || is_object( $someLinkNames )) ) return null;
|
if( !(is_array( $someLinkNames ) || is_object( $someLinkNames )) ) return null;
|
||||||
|
|
||||||
return arrayKeyFilter(
|
return arrayKeyFilter(
|
||||||
json_decode(
|
json_decode(
|
||||||
file_get_contents($aJsonFileName),
|
file_get_contents($aJsonFileName),
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
$someLinkNames
|
$someLinkNames
|
||||||
@@ -162,14 +162,14 @@ function toAscii($str, $replace=array(), $delimiter='-') {
|
|||||||
return $clean;
|
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" ) ){
|
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['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1";
|
||||||
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
||||||
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
|
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
|
||||||
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
|
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
|
||||||
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
|
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
|
||||||
/// als UTF8 in latin1(?) gespeichert.
|
/// als UTF8 in latin1(?) gespeichert.
|
||||||
try{
|
try{
|
||||||
$pdoStatement = $aDbConnection->prepare( $aQueryString );
|
$pdoStatement = $aDbConnection->prepare( $aQueryString );
|
||||||
@@ -187,7 +187,7 @@ if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
|||||||
print "Error!: " . $db_error->getMessage() . "<br/>";
|
print "Error!: " . $db_error->getMessage() . "<br/>";
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//var_dump($ret);
|
|
||||||
// Zeichensatzkonvertierung
|
// Zeichensatzkonvertierung
|
||||||
if( is_array($ret) ){
|
if( is_array($ret) ){
|
||||||
foreach($ret as &$entry){
|
foreach($ret as &$entry){
|
||||||
|
|||||||
@@ -18,6 +18,31 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
if ($mysqlConn->connect_error) {
|
if ($mysqlConn->connect_error) {
|
||||||
$sqlMessage['error'] .= 'Datenbankverbindung fehlgeschlagen: ' . $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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
Reference in New Issue
Block a user