Merge /media/sdb1/gitRepositories/judo into shiai
This commit is contained in:
@@ -114,6 +114,10 @@ body{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.valignMiddle{
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
/* Bilder in voller Breite */
|
||||
.bigPicture{
|
||||
width: 100%;
|
||||
|
||||
@@ -45,10 +45,10 @@ ampTest: $(ampFiles)
|
||||
|
||||
build/css/cwsvJudo.css: $(cssFiles)
|
||||
mkdir -p $(dir $@)
|
||||
# cat $(cssFiles) > $@
|
||||
cat $^ > $@
|
||||
# cat $(cssFiles) | cleancss -o $@
|
||||
# cat $^ | ./node_modules/.bin/csso -o $@
|
||||
cat $^ | csso -o $@
|
||||
# cat $^ | csso -o $@
|
||||
|
||||
build/%.php: src/md/%.md build/yaml/%.yaml pandocTemplate/cwsvJudo.html5.pandocTemplate
|
||||
mkdir -p build
|
||||
|
||||
@@ -4,6 +4,20 @@ function is_positive_integer($str){
|
||||
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,
|
||||
$password
|
||||
);
|
||||
}
|
||||
catch(PDOException $dbError){
|
||||
echo( "Error whilst getting a dbConnection!: " . $dbError->getMessage() );
|
||||
}
|
||||
return $dbConnection;
|
||||
}
|
||||
|
||||
function getCwsvJudoDbConn(){
|
||||
global $cwsvJudoConfig;
|
||||
// Datenbankverbindung bereit stellen
|
||||
|
||||
@@ -11,7 +11,11 @@ function echoWkTitle(){
|
||||
}
|
||||
/// Einen Wettkampfnamen per ID abfragen
|
||||
function getWkName( $wkId, $alternative="Judo-Wettkampf" ){
|
||||
if( !is_positive_integer($wkId) ) return $alternative;
|
||||
|
||||
if( !is_positive_integer($wkId) ) return $alternative;
|
||||
|
||||
if( empty($optionsArray['dbCharset']) ) $optionsArray['dbCharset'] = "ISO-8859-1";
|
||||
if( empty($optionsArray['outCharset']) ) $optionsArray['outCharset'] = "UTF-8";
|
||||
|
||||
// Datenbankverbindung bereit stellen
|
||||
global $cwsvJudoConfig;
|
||||
@@ -35,7 +39,7 @@ function getWkName( $wkId, $alternative="Judo-Wettkampf" ){
|
||||
$pdoStatementForQuerryingWkById->execute();
|
||||
$ret = $pdoStatementForQuerryingWkById->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
return $ret[0]['Veranstaltung'];
|
||||
return iconv($optionsArray['dbCharset'], $optionsArray['outCharset'], $ret[0]['Veranstaltung']);
|
||||
}
|
||||
catch(PDOException $db_error){
|
||||
// $siteData['errors'][] = "Error!: " . $db_error->getMessage();
|
||||
@@ -191,9 +195,11 @@ $htmlWkTableString = "";
|
||||
str_replace("randori", "­randori", $wk['Veranstaltung']);
|
||||
$wk['Veranstaltung'] =
|
||||
str_replace("spiele", "­spiele", $wk['Veranstaltung']);
|
||||
$wk['Veranstaltung'] =
|
||||
str_replace("mannschaft", "mann­schaft", $wk['Veranstaltung']);
|
||||
|
||||
$htmlWkTableString .=
|
||||
"<tr>".
|
||||
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."\"><tr>".
|
||||
"<script type=\"application/ld+json\">".$wkJsonSd."</script>".
|
||||
"<td data-title=\"Datum\" class=\"noWrap\">".
|
||||
"<time class=\"kalenderDatum\" datetime=".$wk['Datum'].">".
|
||||
@@ -215,7 +221,7 @@ $htmlWkTableString = "";
|
||||
"<td data-title=\"iCal\">".
|
||||
"<a title=\"Termin für ".$wk['Veranstaltung']." in Kalender übernehmen\" href=\"/ressourcen/phpLib/calendar.php?wkID=".$wk['lfdeNr']."\">iCal</a>".
|
||||
"</td>".
|
||||
"</tr>\n";
|
||||
"</tr></a>\n";
|
||||
}
|
||||
$htmlWkTableString .=
|
||||
"</tbody>".
|
||||
@@ -244,6 +250,8 @@ function nicerAkList($akArray){
|
||||
$ret = join(' und ', $both);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/// Wettkampfdaten als json-formatierte strukturierte Event-Daten
|
||||
function wkArray2jsonSdEvent($wk){
|
||||
return
|
||||
@@ -297,6 +305,23 @@ function wkTableHtml(){
|
||||
"<div class=\"wkInfoBox\">".
|
||||
"<script type=\"application/ld+json\">".wkArray2jsonSdEvent($wk)."</script>".
|
||||
"<h2>".$wk['Veranstaltung']."</h2>".
|
||||
wkBoxMediaGalleryHtml($wkGals);
|
||||
/*
|
||||
if( !empty($wkGals) ){
|
||||
foreach($wkGals as $wkGal){
|
||||
// Für den Fall einer ampSeite müssen die imgTags angepasst werden
|
||||
if( strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false ){
|
||||
$siteData['mainContent'] .=
|
||||
"<li><a style=\"position:relative;display:block;\" href=\"".$wkGal['url']."\">".( !empty($wkGal['teaserBildUrl'])?("<amp-img layout=\"responsive\" width=\"200\" height=\"133\" class=\"valignMiddle\" src=\"".$wkGal['teaserBildUrl']."\" ></amp-img>"):"").("<div style=\"color:white;position:absolute;left:0;top:42%;\">".$wkGal['typ']."galerie</div>")."</a></li>";
|
||||
}
|
||||
else{
|
||||
$siteData['mainContent'] .=
|
||||
"<li><a style=\"position:relative;display:block;\" href=\"".$wkGal['url']."\">".( !empty($wkGal['teaserBildUrl'])?("<img class=\"valignMiddle\" src=\"".$wkGal['teaserBildUrl']."\" />"):"").("<div style=\"color:white;position:absolute;left:0;top:42%;\">".$wkGal['typ']."galerie</div>")."</a></li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
$siteData['mainContent'] .=
|
||||
"<h3>Veranstaltungsdaten</h3>".
|
||||
"<ul>".
|
||||
"<li>Datum: <time datetime=".$wk['Datum'].">".strftime("%a, %d. %B %Y", strtotime($wk['Datum']))."</time></li>".
|
||||
@@ -308,12 +333,6 @@ function wkTableHtml(){
|
||||
"<li><a href =\"".$wk['Ausschreibung']."\"><div>Link zur Ausschreibung</div></a></li>".
|
||||
"<li><a href =\"".$wk['Routenplaner'] ."\"><div>Link zum Routenplaner</div></a></li>".
|
||||
"<li><a href =\"/ressourcen/phpLib/calendar.php?wkID=".$wk['lfdeNr']."\"><div>Termin in Kalender übernehmen</div></a></li>";
|
||||
if( !empty($wkGals) ){
|
||||
foreach($wkGals as $wkGal){
|
||||
$siteData['mainContent'] .=
|
||||
"<li><a href=\"".$wkGal['url']."\">".$wkGal['typ']."galerie</a></li>";
|
||||
}
|
||||
}
|
||||
$siteData['mainContent'] .=
|
||||
"</ul>".
|
||||
"</nav>".
|
||||
@@ -461,4 +480,41 @@ $wkInfoBoxHtml = "";
|
||||
return $wkInfoBoxHtml;
|
||||
}
|
||||
|
||||
|
||||
function wkBoxMediaGalleryHtml($wkGals){
|
||||
if(empty($wkGals)) return "";
|
||||
$retHtml = "";
|
||||
|
||||
|
||||
$retHtml .= "<div class=\"wkBoxMediaGallery\">";
|
||||
|
||||
foreach($wkGals as $wkGal){
|
||||
$retHtml.=
|
||||
"<a class=\"textoverlayedImage\" href=\"".$wkGal['url']."\">";
|
||||
|
||||
if(strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false)
|
||||
$retHtml .= "<amp-img layout=\"responsive\" ";
|
||||
else
|
||||
$retHtml .= "<img class=\"valignMiddle\" ";
|
||||
|
||||
$retHtml .=
|
||||
"width=\"200\" height=\"133\" class=\"valignMiddle\" src=\"".
|
||||
$wkGal['teaserBildUrl']."\"";
|
||||
|
||||
if(strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false)
|
||||
$retHtml .= "></amp-img>";
|
||||
else
|
||||
$retHtml .= "/>";
|
||||
|
||||
$retHtml .=
|
||||
"<div><p>".$wkGal['typ']."galerie</p></div>";
|
||||
|
||||
$retHtml .= "</a>";
|
||||
}
|
||||
|
||||
$retHtml .= "</div>"; // Ende wkBoxMediaGallery
|
||||
|
||||
return $retHtml;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -58,7 +58,7 @@ return $retVal;
|
||||
<!--https://github.com/aFarkas/lazysizes-->
|
||||
<script src="/ressourcen/jsLib/lazysizes.min.js" async=""></script>
|
||||
<style>
|
||||
.no-js img.lazyload {
|
||||
img.lazyload {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -128,10 +128,11 @@ return $retVal;
|
||||
flex: auto;
|
||||
width: 100%;
|
||||
padding: 1vw 0;
|
||||
flex-grow: unset;
|
||||
}
|
||||
.galImgList div img{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
height: auto;
|
||||
}
|
||||
.galImgList div video{
|
||||
width: 100%;
|
||||
@@ -162,7 +163,9 @@ return $retVal;
|
||||
foreach( $vidList as $vidKey => $vidEntry ){
|
||||
echo( "<div>" );
|
||||
echo "<img class=\"lazyload\" ".
|
||||
"src=\"".$vidEntry['posterSrc']."\"".
|
||||
// Wir haben unsere eigen noscript-Alternative (die kein img mehr
|
||||
// ist!), deshalb brauchen wir diesen empfohlenen Fallback nicht!
|
||||
// "src=\"".$vidEntry['posterSrc']."\"".
|
||||
// "srcset=\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"".
|
||||
"id=\"Video".( $vidKey )."\" ".
|
||||
"data-src=\"".( $vidEntry['posterSrc'] )."\" ".
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
include Makefile.cfg
|
||||
|
||||
ftpServer = ftpupload.net
|
||||
ftpUser = unaux_22935783
|
||||
ftpPassword = eeloor0D
|
||||
|
||||
ftpPathBase = /htdocs/videoalben/videoalben.2018
|
||||
|
||||
vidGalIndexPhp = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryTemplates/indexHier.php
|
||||
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
||||
.PHONY: ftpUpload
|
||||
ftpUpload:
|
||||
lftp -e 'set net:limit-rate 25600; mkdir -f $(ftpPathBase)/$(VID_GAL_DIR); mkdir -f $(ftpPathBase)/$(VID_GAL_DIR)/thumbnails; mkdir -f $(ftpPathBase)/$(VID_GAL_DIR)/webm; put $(vidGalIndexPhp) -o $(ftpPathBase)/$(VID_GAL_DIR)/index.php; put videos/config.inc.php -o $(ftpPathBase)/$(VID_GAL_DIR)/config.inc.php; mirror -R --ignore-time videos/thumbnails $(ftpPathBase)/$(VID_GAL_DIR)/thumbnails; mirror -R --ignore-time videos/webm $(ftpPathBase)/$(VID_GAL_DIR)/webm;quit' -u $(ftpUser),$(ftpPassword) ftp://$(ftpServer)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
font-family: 'Orbitron-Medium', sans-serif;
|
||||
/* line-height: 1.6;*/
|
||||
margin: .5em 0;
|
||||
padding: 0;
|
||||
border: 1px solid #a2a2a2;
|
||||
@@ -45,20 +45,16 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* =================================
|
||||
Media Queries
|
||||
==================================== */
|
||||
|
||||
|
||||
/*
|
||||
* Media Queries
|
||||
*/
|
||||
|
||||
|
||||
@media (min-width: 640px) {
|
||||
#mainNav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
/* align-items: flex-end;*/
|
||||
}
|
||||
#mainNav > a{
|
||||
padding: .5em .5em;
|
||||
|
||||
@@ -794,3 +794,44 @@
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mit Text overlay-tes Bild
|
||||
*/
|
||||
|
||||
.textoverlayedImage{
|
||||
position: relative;
|
||||
display: table;
|
||||
}
|
||||
.textoverlayedImage > img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.textoverlayedImage > div {
|
||||
z-index: 99;
|
||||
width: 70%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
.textoverlayedImage > div > p{
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-weight: lighter;
|
||||
line-height: 2;
|
||||
padding: 0 10%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Die Galerie der Galerien in der wkInfoBox
|
||||
*/
|
||||
.wkBoxMediaGallery{
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.wkBoxMediaGallery > *{
|
||||
flex-basis:50%;
|
||||
}
|
||||
|
||||
@@ -38,13 +38,17 @@ html{
|
||||
/*
|
||||
* Body
|
||||
*/
|
||||
|
||||
body{
|
||||
background: #FFAE00;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* Container für eine einzelne News */
|
||||
/*
|
||||
* Container für eine einzelne News
|
||||
*/
|
||||
|
||||
.newsBox{
|
||||
border: solid 1px #000000;
|
||||
padding: 1vmin;
|
||||
@@ -113,6 +117,9 @@ body{
|
||||
.fullWidth{
|
||||
width:100%;
|
||||
}
|
||||
.valignMiddle{
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
/* Bilder in voller Breite */
|
||||
.bigPicture{
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
include_once("config.inc.php");
|
||||
|
||||
$wkName = empty($wkName) ? "<fehlender Wettkampfname>" : $wkName;
|
||||
|
||||
include_once( $_SERVER['DOCUMENT_ROOT']."/ressourcen/phpLib/videoGallery/videoGallery.tmpl.php" );
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include_once("config.inc.php");
|
||||
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
require_once($basePath."/config/phpcount.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>In Arbeit</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<?php PHPCount::AddHit($wkName." - Videoalbum (Vorschau)");?>
|
||||
</head>
|
||||
<body>
|
||||
<p>Die Videos des Wettkampfes <?php echo($wkName);?> sind momentan noch in Vorbereitung. Einfach später noch mal probieren.</p>
|
||||
<img style="width:100%;" src="/ressourcen/graphiken/misc/staffeleiM%e4nnlein.jpg" />
|
||||
<p>Wer ganz ungeduldig ist, kann ja schon mal <a href="./indexHier.php">kiebitzen</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +1,18 @@
|
||||
<?php
|
||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
|
||||
require_once('../local/wkParticipoConf.php.inc');
|
||||
require_once('../auth.php');
|
||||
require_once('../local/db.php.inc');
|
||||
require_once('../lib/wkParticipoLib.inc.php');
|
||||
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
// require_once($basePath."/config/phpcount.config.php");
|
||||
require_once($basePath."/config/cwsvJudo.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
|
||||
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
|
||||
|
||||
$pdoDbConn = getCwsvJudoDbConn();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
@@ -5,6 +5,10 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once('./local/db.php.inc');
|
||||
require_once('./lib/wkParticipoLib.inc.php');
|
||||
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
require_once($basePath."/config/phpcount.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
|
||||
|
||||
$sqlMessage = array();
|
||||
|
||||
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
||||
@@ -27,6 +31,8 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="wkParticipo.css">
|
||||
<link rel="stylesheet" href="http://cwsvjudo.bplaced.net/ressourcen/css/cwsvJudoNavBar.css">
|
||||
|
||||
<?php PHPCount::AddHit("Wettkampfplaner (".htmlspecialchars($_SESSION['user']['username']).")");?>
|
||||
</head>
|
||||
<body>
|
||||
<?php echo $login_status; ?>
|
||||
@@ -189,7 +195,6 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
<hr />
|
||||
|
||||
<h2 id="wettkaempfen">Anstehende Wettkämpfe</h2>
|
||||
Nicht wundern, dass hier eventuell etwas doppelt steht! Ich experimentiere gerade.
|
||||
<?php
|
||||
$wkEvents = getCommingWkEvents($mysqli, array('outCharset'=>"UTF-8") );
|
||||
|
||||
@@ -210,7 +215,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
$wkEvent,
|
||||
getStarterForEvent($mysqlConn, $wkEvent['id']),
|
||||
getFahrtenForEvent($mysqlConn, $wkEvent['id'])
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -225,6 +230,24 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
<p>
|
||||
Es gibt zwei verschiedene Fristen. Zum einen die Frist vom Veranstalter, bis wann ihm alle Starter gemeldet sein müssen und zum anderen eine Frist bis wann man einen Starter für einen geplanten Wettkampf bei uns im Planer einschreiben kann. Logischerweise muss vor der Meldung bekannt sein, wer gemeldet werden kann. Deshalb ist die Einschreibefrist des Wettkampfplaners vor der Meldefrist des Veranstalters. Üblicherweise wird mit Meldeschluss die Meldung an den Veranstalter geschickt. Aber nicht immer, z. B. wenn die Teilnehmerzahl beschränkt ist. Sollte mal die Einschreibefrist verstrichen sein und man möchte trotzdem noch jemanden einschreiben, kann dies in den meisten Fällen noch erfolgen indem man mit dem Übungsleiter Rücksprache hält bevor dieser die Meldung an den Veranstalter abschickt.
|
||||
</p>
|
||||
|
||||
<h3>Altersklassen</h3>
|
||||
<p>
|
||||
<p>
|
||||
Im Judo werden die Kämpfer gemäß ihrem Alter, der Masse und (meistens auch) nach ihrem Geschlecht in Gruppen eingeteilt um miteinander zu kämpfen. Weder die Einteilung in <emph>Alters-</emph> noch die in <emph>Gewichtsklassen</emph> ist dabei einheitlich. Da die Wettkämpfe immer jeweils nur für bestimmte Altersklassen und manchmal auch nur für entweder männlich oder weiblich veranstaltet werden, sollte immer auf der Ausschreibung nachgesehen werden, wie der Veranstalter die Altersklassen definiert.
|
||||
</p>
|
||||
<p>
|
||||
Bezeichnet werden die Altersklassen im Judo meistens mit Ux, wobei x eine Zahl ist. Ux steht für unter x Jahre. Man ist unter x Jahre, wenn man im laufenden Kalenderjahr nicht mehr x Jahre alt wird. Eine Altersklasse geht normalerweise über zwei (teilweise auch drei) Jahrgänge. Zur U11 z.B. würden normalerweise all diejenigen gehören, die im laufenden Jahr 10 oder 9 (bei drei Jahrgängen auch 8) Jahre alt werden. Es gibt aber auch Wettkämpfe in denen die Altersklassen mehr Jahrgänge umfassen.
|
||||
</p>
|
||||
<p>Im Zweifelsfall kann man mich auch jederzeit fragen.</p>
|
||||
<p>
|
||||
Für offizielle, vom Verband ausgerichtete Wettkämpfe gibt es festgelegte Alters- und Gewichtsklassen:
|
||||
<ul>
|
||||
<li><a href='http://cwsvjudo.bplaced.net/JudoWiki/AkGk/Jvs2018'>Alters- und Gewichtsklassen des Judoverbandes Sachsen</a></li>
|
||||
<li><a href='http://cwsvjudo.bplaced.net/JudoWiki/AkGk/Djb2018'>Alters- und Gewichtsklassen im Deutschen Judo Bundes</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<h2 id="menue">Menü</h2>
|
||||
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
ini_set('display_errors',1);
|
||||
|
||||
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
|
||||
require_once($basePath."/config/cwsvJudo.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
function array2htmlTableString($anArray){
|
||||
$ret = "";
|
||||
if( !is_array($anArray) )
|
||||
return "";
|
||||
$ret .= "<table>";
|
||||
foreach($anArray as $row){
|
||||
if( !is_array($anArray) )
|
||||
continue;
|
||||
$ret .= "<tr>";
|
||||
foreach( $row as $entry )
|
||||
$ret .= "<td>".$entry."</td>";
|
||||
$ret .= "</tr>";
|
||||
}
|
||||
$ret .= "</table>";
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function giveUserAnUserAttribute($aDbConnection, $anUserId, $anAttributeId){
|
||||
echo("Entering giveUserAnUserAttribute!");
|
||||
try{
|
||||
dbQuery(
|
||||
$aDbConnection,
|
||||
"INSERT INTO `wkParticipo_user<=>userAttributes` (userId, attributeId) VALUES (:userId, :attributeId);",
|
||||
array(
|
||||
':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
|
||||
':attributeId'=>array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT)
|
||||
)
|
||||
);
|
||||
}
|
||||
catch(PDOException $db_error){
|
||||
print "Error!: " . $db_error->getMessage() . "<br/>";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#exit();
|
||||
|
||||
var_dump($_GET);
|
||||
|
||||
$actions = ["giveUserAnUserAttribute"];
|
||||
|
||||
|
||||
$dbConn = getCwsvJudoDbConn();
|
||||
$dbConn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
|
||||
|
||||
if(isset($_GET['action'])){
|
||||
switch($_GET['action']){
|
||||
case "giveUserAnUserAttribute":
|
||||
//echo("Doing giveUserAnUserAttribute!");
|
||||
try{
|
||||
giveUserAnUserAttribute($dbConn, intval($_GET['userIdToGetAttribute']), intval($_GET['attributeIdToGet']));
|
||||
}
|
||||
catch(Exception $e){
|
||||
print("UPS: ".$e->getMessage());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo("Ungültige Aktion erwünscht!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$users =
|
||||
dbQuery(
|
||||
$dbConn,
|
||||
"SELECT * FROM cwsvjudo.wkParticipo_Users;"
|
||||
);
|
||||
|
||||
$userAttributes =
|
||||
dbQuery(
|
||||
$dbConn,
|
||||
"SELECT * FROM cwsvjudo.wkParticipo_userAttributes;"
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<label>Action:
|
||||
<select name="action">
|
||||
<option disabled selected value> -- Aktion auswählen -- </option>
|
||||
<?php
|
||||
foreach($actions as $action)
|
||||
echo("<option>".$action."</option>");
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<label>User:
|
||||
<select name="userIdToGetAttribute">
|
||||
<option disabled selected value> -- User auswählen -- </option>
|
||||
<?php
|
||||
foreach($users as $user)
|
||||
echo("<option value=\"".$user['id']."\">".$user['loginName']."</option>");
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<label>Attribut:
|
||||
<select name="attributeIdToGet">
|
||||
<option disabled selected value> -- Attribut auswählen -- </option>
|
||||
<?php
|
||||
foreach($userAttributes as $userAttribute)
|
||||
echo("<option value=\"".$userAttribute['id']."\">".$userAttribute['name']."</option>");
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<button type="submit">Eingaben absenden</button>
|
||||
</form>
|
||||
<h1>Attribute</h1>
|
||||
<?php echo(array2htmlTableString($userAttributes));?>
|
||||
<?php
|
||||
foreach($userAttributes as $userAttribute){
|
||||
$attributedUsers =
|
||||
dbQuery(
|
||||
$dbConn,
|
||||
"SELECT * FROM wkParticipo_Users, `wkParticipo_user<=>userAttributes` WHERE wkParticipo_Users.id = `wkParticipo_user<=>userAttributes`.userId AND `wkParticipo_user<=>userAttributes`.attributeId=:attributeId;",
|
||||
array(":attributeId"=>array('value'=>$userAttribute['id'], 'data_type'=>PDO::PARAM_INT))
|
||||
);
|
||||
echo( "<h2>".$userAttribute['name']."</h2>".array2htmlTableString($attributedUsers) );
|
||||
}
|
||||
?>
|
||||
|
||||
<h1>User</h1>
|
||||
<?php echo(array2htmlTableString($users));?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1201,6 +1201,7 @@ return $url;
|
||||
function htmlWkEvent($aWkEvent, $starters, $fahrten){
|
||||
//var_dump($aWkEvent, $starters, $fahrten);
|
||||
|
||||
|
||||
$retHtml = "";
|
||||
|
||||
if( empty($aWkEvent['Datum']) )
|
||||
@@ -1209,6 +1210,10 @@ $retHtml = "";
|
||||
foreach($fahrten as $fahrt)
|
||||
$anzPlätze += $fahrt['plaetze'];
|
||||
|
||||
$anzahlKaempfer = array_count_values(array_column($starters, 'type'))['1'];
|
||||
$anzahlZuschauer = array_count_values(array_column($starters, 'type'))['2'];
|
||||
|
||||
|
||||
$heuteDateTime = DateTimeImmutable::createFromFormat("Y-m-d", date("Y-m-d"));
|
||||
$einschreibeDateTime = DateTimeImmutable::createFromFormat("Y-m-d", $aWkEvent['meldefrist']);
|
||||
|
||||
@@ -1235,10 +1240,17 @@ $retHtml = "";
|
||||
"</div>"
|
||||
)."</dd>".
|
||||
(!empty($_SESSION['login'])?
|
||||
"<dt>angemeldete Starter</dt><dd>".(
|
||||
empty($starters)?
|
||||
"Noch hat sich niemand für diesen Wettkampf gemeldet!":
|
||||
count($starters)
|
||||
"<dt>eingeschriebene Starter</dt><dd>".(
|
||||
( $anzahlKaempfer == 0 )?
|
||||
"Noch hat sich niemand für diesen Wettkampf eingeschrieben!":
|
||||
$anzahlKaempfer
|
||||
)."</dd>"
|
||||
:"").
|
||||
(!empty($_SESSION['login'])?
|
||||
"<dt>eingeschriebene Zuschauer</dt><dd>".(
|
||||
( $anzahlZuschauer == 0 )?
|
||||
"Noch will sich niemand diesen Wettkampf anschauen!":
|
||||
$anzahlZuschauer
|
||||
)."</dd>"
|
||||
:"").
|
||||
(empty($_SESSION['login'])?
|
||||
@@ -1257,7 +1269,7 @@ $retHtml = "";
|
||||
).
|
||||
"</form></dd>"
|
||||
).
|
||||
"<dt" . ( ($anzPlätze<count($starters)) ? " style=\"color: red\"" : "" ) . ">Anzahl Mitfahrgelegenheiten</dt><dd>" . $anzPlätze . "</dd>".
|
||||
"<dt" . ( ($anzPlätze<($anzKaempfer+$anzZuschauer)) ? " style=\"color: red\"" : "" ) . ">Anzahl Mitfahrgelegenheiten</dt><dd>" . $anzPlätze . "</dd>".
|
||||
(empty($_SESSION['login'])?
|
||||
"<dd>Das Anbieten von Mitfahrgelegenheiten ist nur eingeloggt möglich!</dd>"
|
||||
:"<dd><form action=\"./addFahrt.php\" method=\"post\">".
|
||||
|
||||
Reference in New Issue
Block a user