- Funktion zum Erzeugen einer Datenbankverbindung ergänzt
modified: homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php - Anzahl der Teilnehmer wird jetzt getrennt in Kämpfer und Zuschauer; nicht teilnehmende, aber eingeschriebene Starter werden ignoriert modified: homepage/redesign2018/markdownExperiment/wkParticipo/admin/listUsers.php modified: homepage/redesign2018/markdownExperiment/wkParticipo/index.php modified: homepage/redesign2018/markdownExperiment/wkParticipo/lib/wkParticipoLib.inc.php
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -189,7 +193,7 @@ 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.
|
||||
<!--Nicht wundern, dass hier eventuell etwas doppelt steht! Ich experimentiere gerade.-->
|
||||
<?php
|
||||
$wkEvents = getCommingWkEvents($mysqli, array('outCharset'=>"UTF-8") );
|
||||
|
||||
@@ -210,7 +214,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
$wkEvent,
|
||||
getStarterForEvent($mysqlConn, $wkEvent['id']),
|
||||
getFahrtenForEvent($mysqlConn, $wkEvent['id'])
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
@@ -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