- Alle Dateien in ein neues Verzeichnis kopiert umbenannt: ../redesign2018/markdownExperiment/wkParticipo/addEvent.php -> addEvent.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/addFahrt.php -> addFahrt.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/addStarter.php -> addStarter.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/addStarterDev.php -> addStarterDev.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/.htaccess -> admin/.htaccess umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/addEvent.php -> admin/addEvent.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/addMitfahrer.php -> admin/addMitfahrer.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/adminAddStarter.php -> admin/adminAddStarter.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/adminFunctions.php -> admin/adminFunctions.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/adminFunctions.php.inc -> admin/adminFunctions.php.inc umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/adminUpdateStarterErgebnis.php -> admin/adminUpdateStarterErgebnis.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/config.inc.php -> admin/config.inc.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/index.php -> admin/index.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/listEvents.php -> admin/listEvents.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/listUsers.php -> admin/listUsers.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/newsLetter.php -> admin/newsLetter.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/register.php -> admin/register.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/resetPassword.php -> admin/resetPassword.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/reseteMitfahrer.php -> admin/reseteMitfahrer.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/showEvent.php -> admin/showEvent.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/showFahrt.php -> admin/showFahrt.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/showUser.php -> admin/showUser.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/admin/verteileMitfahrer.php -> admin/verteileMitfahrer.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/auth.php -> auth.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/authLogin.php -> authLogin.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/calendar.php -> calendar.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/changePassword.php -> changePassword.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/editFahrt.php -> editFahrt.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/eventKalender.php -> eventKalender.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/galImgPicker.php -> galImgPicker.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/horstWolfJudosport.php -> horstWolfJudosport.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/index.php -> index.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/infoZettel.php -> infoZettel.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/lib/wkParticipo-userAttribute.php -> lib/wkParticipo-userAttribute.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/lib/wkParticipoLib.inc.php -> lib/wkParticipoLib.inc.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/local/.htaccess -> local/.htaccess umbenannt: ../redesign2018/markdownExperiment/wkParticipo/local/db.php.inc -> local/db.php.inc umbenannt: ../redesign2018/markdownExperiment/wkParticipo/local/wkParticipoConf.php.inc -> local/wkParticipoConf.php.inc umbenannt: ../redesign2018/markdownExperiment/wkParticipo/login.php -> login.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/logout.php -> logout.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/showWkEvent.php -> showWkEvent.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/style.css -> style.css umbenannt: ../redesign2018/markdownExperiment/wkParticipo/styleDev.css -> styleDev.css umbenannt: ../redesign2018/markdownExperiment/wkParticipo/userInfo.php -> userInfo.php umbenannt: ../redesign2018/markdownExperiment/wkParticipo/wkParticipo.css -> wkParticipo.css
281 lines
10 KiB
PHP
281 lines
10 KiB
PHP
<?php
|
|
|
|
|
|
$basePath = "/users/cwsvjudo/www";
|
|
|
|
require_once($basePath."/config/cwsvJudo.config.php");
|
|
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
|
|
|
|
require_once('../local/wkParticipoConf.php.inc');
|
|
require_once('../auth.php');
|
|
require_once('../local/db.php.inc');
|
|
require_once('../lib/wkParticipoLib.inc.php');
|
|
|
|
$message = array();
|
|
$eventData = array();
|
|
|
|
if(empty($_POST)){
|
|
$message['error'] = "Fehler: leeres POST!";
|
|
}
|
|
else{
|
|
if( empty($_POST['f']['eventId']) ){
|
|
$message['error'] = "Fehler: keine eventId gefunden! <a href=\"./listEvents.php\">zur Eventübersicht</a>";
|
|
}
|
|
else{
|
|
if( (string)(int)$_POST['f']['eventId'] == $_POST['f']['eventId'] ){
|
|
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
|
if ($mysqlConn->connect_error) {
|
|
$sqlMessage['error'] .= 'Datenbankverbindung fehlgeschlagen: ' . $mysqlConn->connect_error;
|
|
}
|
|
else{
|
|
// Abfrage der Eventdaten
|
|
$eventData = getWkEventData($mysqlConn, $_POST['f']['eventId'], array('outCharset'=>"UTF-8"));
|
|
if( empty($eventData) ) $message['error'] = 'Fehler: keine Eventdaten zurückgeliefert!';
|
|
else{
|
|
// Abfrage der Starterdaten des Events
|
|
$starterData = getStarterForEvent($mysqlConn, $eventData['id']);
|
|
// Abfrage der Fahrtdaten des Events
|
|
$fahrten = getFahrtenForEvent($mysqlConn, $eventData['id']);
|
|
}
|
|
}
|
|
}
|
|
|
|
//var_dump($_POST);
|
|
if( $_POST['action'] == "deleteStarter" ){
|
|
try{
|
|
$dbConnection = new PDO(
|
|
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
|
|
$cwsvJudoConfig["db"]["user"],
|
|
$cwsvJudoConfig["db"]["password"]
|
|
);
|
|
if($_POST['action']=="deleteStarter"){
|
|
echo("DELETE FROM `wkParticipo_Starter` WHERE id=:starterId;");
|
|
$deleteStarterQuery = $dbConnection->prepare(
|
|
"DELETE FROM `wkParticipo_Starter` WHERE id=:starterId;"
|
|
);
|
|
$deleteStarterQuery->bindParam(':starterId', $_POST['starterId'], PDO::PARAM_INT);
|
|
if($deleteStarterQuery->execute());
|
|
else echo("FEHLER\n");
|
|
}
|
|
}
|
|
catch(PDOException $db_error){
|
|
die( "Error!: " . $db_error->getMessage() );
|
|
}
|
|
}
|
|
else echo("NoActionDeleteStarter\n");
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Wettkampfplanung - Administration - Eventdetails</title>
|
|
<link rel="stylesheet" href="../style.css">
|
|
</head>
|
|
<body>
|
|
<?php
|
|
echo $login_status;
|
|
?>
|
|
<a class="touchLink" href="./listEvents.php"><div>Zur Eventliste zurück</div></a>
|
|
<a class="touchLink" href="./index.php"><div>Zum Adminbereich zurück</div></a>
|
|
<?php
|
|
|
|
if( empty($eventData) ){
|
|
if( !empty($message['error']) ){
|
|
echo "<p>".$message['error']."</p>\n";
|
|
}
|
|
}
|
|
else{
|
|
?>
|
|
<h2>Eventdaten</h2>
|
|
<div class=wkBox">
|
|
<ul>
|
|
<li>EventId: <?php echo $eventData['id']?></li>
|
|
<li>wkId: <?php echo $eventData['wkId']?></li>
|
|
<li>Meldefrist: <?php echo $eventData['meldefrist']?></li>
|
|
</ul>
|
|
</div>
|
|
<?php
|
|
$wkData = array();
|
|
if( (string)(int)$eventData['wkId'] == $eventData['wkId'] ){
|
|
$wkData = getWkData($mysqli, $eventData['wkId']);
|
|
}
|
|
else echo "<li>Fehler: wkId \"".$eventData['wkId']."\" scheint kein Int zu sein!</li>";
|
|
?>
|
|
<h2>Wettkampfdaten:</h2>
|
|
<?php
|
|
if( empty($wkData) )
|
|
echo "<li>Fehler: Wettkampf mit Id ".$eventData['wkId']." nicht gefunden!</li>";
|
|
else{
|
|
?>
|
|
<ul>
|
|
<li>wkId: <?php echo $wkData['lfdeNr'] ?></li>
|
|
<li>Datum: <?php echo $wkData['Datum'] ?></li>
|
|
<li>wkName: <?php echo mb_convert_encoding($wkData['Veranstaltung'], 'UTF-8', 'ISO-8859-1');?></li>
|
|
<li>AK: <?php echo mb_convert_encoding($wkData['Altersklassen'], 'UTF-8', 'ISO-8859-1');?></li>
|
|
<li>Ort: <?php echo mb_convert_encoding($wkData['Ort'], 'UTF-8', 'ISO-8859-1');?></li>
|
|
<li><a href="<?php echo $wkData['Ausschreibung'] ?>">Ausschreibung</a></li>
|
|
<li><a href="<?php echo $wkData['Routenplaner'] ?>">Routenplaner</a></li>
|
|
<li>Galerie: <?php echo $wkData['galleryLink'] ?></li>
|
|
<li>PromoPic: <?php echo $wkData['promoPic'] ?></li>
|
|
</ul>
|
|
<form action="./verteileMitfahrer.php" method="post">
|
|
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $eventData['id'] ) ? $eventData['id'] : "");?>" />
|
|
<button type="submit">Mitfahrer verteilen</button>
|
|
</form>
|
|
<form action="./reseteMitfahrer.php" method="post">
|
|
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $eventData['id'] ) ? $eventData['id'] : "");?>" />
|
|
<button type="submit">Mitfahrer reseten</button>
|
|
</form>
|
|
<?php
|
|
}
|
|
// $starterData = array();
|
|
// if( (string)(int)$eventData['id'] == $eventData['id'] ){
|
|
// $starterData = getStarterForEvent($mysqli, $eventData['id']);
|
|
// }
|
|
// else echo "<li>Fehler: eventId \"".$eventData['id']."\" scheint kein Int zu sein!</li>";
|
|
?>
|
|
<h2>Starter:</h2>
|
|
|
|
<ul>
|
|
<?php
|
|
if( empty($starterData) )
|
|
echo "<li>Keine Starter für diesen Wettkampf</li>";
|
|
else{
|
|
?>
|
|
<?php
|
|
foreach( $startTyp as $typeKey=>$typeValue ){
|
|
echo("<h3>".$typeValue."</h3>");
|
|
|
|
foreach( $starterData as $starter ){
|
|
if($starter['type'] != $typeKey) continue;
|
|
|
|
$userData = getUserData($mysqli, $starter['userId']);
|
|
?>
|
|
<li>[<?php echo $starter['id'] ?>] -- <?php echo mb_convert_encoding($userData['name'], 'UTF-8', 'ISO-8859-1');?>, <?php echo mb_convert_encoding($userData['vorname'], 'UTF-8', 'ISO-8859-1');?>
|
|
<ul>
|
|
<li>eventId: <?php echo $starter['eventId'] ?></li>
|
|
<li>userId: <?php echo $starter['userId'] ?></li>
|
|
<li>type: <?php echo($startTyp[$starter['type']]);?></li>
|
|
<li>fahrtId: <?php echo $starter['fahrtId']; ?></li>
|
|
<li>
|
|
<form action="./showEvent.php" method="post"><input type="hidden" name="starterId" id="starterId" value="<?php echo($starter['id']);?>"><input type="hidden" name="action" id="action" value="deleteStarter"><input type="hidden" name="f[eventId]" value="<?php echo($starter['eventId']);?>" /><button type="submit">Austragen</button></form>
|
|
</li>
|
|
<li>
|
|
<?php
|
|
if(empty($starter['fahrtId'])){
|
|
//$fahrten = array();
|
|
//$fahrten = getFahrtenForEvent($mysqli, $starter['eventId']);
|
|
if(empty($fahrten)){
|
|
?>
|
|
Keine Fahrten für dieses Event gemeldet!
|
|
<?php
|
|
}
|
|
else{
|
|
foreach($fahrten as $fahrt){
|
|
?>
|
|
<form action="./addMitfahrer.php" method="post">
|
|
<input type="hidden" name="f[fahrtId]" value="<?php echo (isset( $fahrt['id'] ) ? $fahrt['id'] : ""); ?>" />
|
|
<input type="hidden" name="f[starterId]" value="<?php echo (isset( $starter['id'] ) ? $starter['id'] : ""); ?>" />
|
|
<button type="submit">Bei <?php $user = getUserData($mysqli, $fahrt['fahrerId']); echo mb_convert_encoding($user['name'], 'UTF-8', 'ISO-8859-1').", ".mb_convert_encoding($user['vorname'], 'UTF-8', 'ISO-8859-1')." (fahrtId ".$fahrt['id'].")";?> mitfahren lassen</button>
|
|
</form>
|
|
<?php
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
?>
|
|
Mitfahrt bei fahrtId "<?php echo $starter['fahrtId'];?>"
|
|
<?php
|
|
}
|
|
?>
|
|
</li>
|
|
<li>Masse: <?php echo $starter['masse'] ?></li>
|
|
<li>Platzierung: <?php echo $starter['platz'] ?></li>
|
|
</ul>
|
|
<form action="./adminUpdateStarterErgebnis.php" method="post">
|
|
<input type="hidden" name="f[starterId]" value="<?php echo (isset( $starter['id'] ) ? $starter['id'] : ""); ?>" />
|
|
<button>Ergebnis eintragen</button>
|
|
</form>
|
|
</li>
|
|
<?php
|
|
}
|
|
|
|
echo("<table>");
|
|
echo("<tr><th>Name</th><th>Vorname</th><th>Masse</th><th>Platz</th><th>starterId</th><th>fahrtId</th></tr>");
|
|
|
|
foreach( $starterData as $starter ){
|
|
if( empty($starter) ){
|
|
echo("Keine ".$typeKey." für dieses Event!");
|
|
continue;
|
|
}
|
|
|
|
if($starter['type'] != $typeKey) continue;
|
|
echo("<tr>");
|
|
$userData = getUserData($mysqli, $starter['userId']);
|
|
echo("<td>".mb_convert_encoding($userData['name'], 'UTF-8', 'ISO-8859-1')."</td>");
|
|
echo("<td>".mb_convert_encoding($userData['vorname'], 'UTF-8', 'ISO-8859-1')."</td>");
|
|
echo("<td>".$starter['masse']."</td>");
|
|
echo("<td>".$starter['platz']."</td>");
|
|
echo("<td>".$starter['id']."</td>");
|
|
echo("<td>".$starter['fahrtId']."</td>");
|
|
echo("</tr>");
|
|
}
|
|
echo("</table>");
|
|
}
|
|
}
|
|
// $fahrtenData = array();
|
|
// $fahrtenData = getFahrtenForEvent($mysqli, $eventData['id']);
|
|
?>
|
|
<h2>Fahrten:</h2>
|
|
<ul>
|
|
<?php
|
|
if( empty($fahrtenData) )
|
|
echo "<li>Keine Fahrten für dieses Event</li>";
|
|
else{
|
|
foreach( $fahrtenData as $fahrt ){
|
|
$fahrerData = getUserData($mysqli, $fahrt['fahrerId']);
|
|
?>
|
|
<li>[<?php echo $fahrt['id'] ?>] -- <?php echo mb_convert_encoding($fahrerData['name'], 'UTF-8', 'ISO-8859-1');?>, <?php echo mb_convert_encoding($fahrerData['vorname'], 'UTF-8', 'ISO-8859-1');?>
|
|
<ul>
|
|
<li>EventId: <?php echo $fahrt['eventId'] ?></li>
|
|
<li>FahrerId: <?php echo $fahrt['fahrerId'] ?></li>
|
|
<li>AnzPlätze: <?php echo $fahrt['plaetze'] ?></li>
|
|
<li>MitfahrerIds: <?php echo $fahrt['mitfahrer'] ?></li>
|
|
</ul>
|
|
</li>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</ul>
|
|
<?php
|
|
$users = array();
|
|
$users = getUsers($mysqli);
|
|
?>
|
|
<h2>Starter einschreiben:</h2>
|
|
<?php
|
|
if( empty($users) )
|
|
echo "<li>Keine User gefunden</li>";
|
|
else{
|
|
foreach( $users as $user ){
|
|
?>
|
|
<form action="./adminFunctions.php" method="post">
|
|
<input type="hidden" name="f[adminFunction]" value="createStarterForEvent" />
|
|
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $eventData['id'] ) ? $eventData['id'] : "");?>" />
|
|
<input type="hidden" name="f[userId]" value="<?php echo $user['id'];?>" />
|
|
<select name="f[type]"><option value="1" selected>als Starter</option><option value="2">als Zuschauer</option><option value="3">keine Teilnahme</option></select>
|
|
<button type="submit"><?php echo mb_convert_encoding($user['vorname'], 'UTF-8', 'ISO-8859-1')." ".mb_convert_encoding($user['name'], 'UTF-8', 'ISO-8859-1');?></button>
|
|
</form>
|
|
<hr />
|
|
<?php
|
|
}
|
|
}
|
|
$mysqli->close();
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|