"; } else{ $mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name); if ($mysqlConn->connect_error) { $message['error'] .= "Datenbankverbindung fehlgeschlagen: ".$mysqlConn->connect_error."
$wkEventData['meldefrist']){ $message['error'] .= "Die Meldefrist ist bereits abgelaufen!
"; } else{ if( !isset($_POST['f']['userId']) ){ $query = sprintf( "SELECT kinder FROM wkParticipo_Users WHERE id='%s';", $mysqlConn->real_escape_string($_SESSION['user']['userId']) ); $kinderResults = $mysqlConn->query($query); if(!$kinderResults){ $message['warning'] .= "Fehler bei Abfrage der Kinder!
"; } $kinderResult = $kinderResults->fetch_array(); $kinderIds = explode(',', $kinderResult['kinder']); foreach($kinderIds as $kindId){ $query = sprintf("SELECT name, vorname FROM wkParticipo_Users WHERE id='%s';", $mysqlConn->real_escape_string($kindId) ); $kinderDaten = $mysqlConn->query($query); if(!$kinderDaten){ $message['warning'] .= "Fehler bei Abfrage der Kinder!
"; } if($mysqlConn->affected_rows != 1) $message['warning'] .= "Nicht eindeutige userId!
"; $kindDaten = $kinderDaten->fetch_array(); $meldungsBox = "
Meldung". "". "
". "". ""; if( getUsersMeldeStatus($mysqlConn, $_POST['f']['eventId'], $kindId) ){ $meldungsBox .= "
Bereits gemeldet
"; } else{ if( date("Y-m-d") > $wkEventData['meldefrist']){ $meldungsBox .= "
Die Meldefrist ist bereits abgelaufen!
"; } else{ $meldungsBox .= ""; } } $meldungsBox .="
"; } } else{ $userData = getUserData($mysqlConn, $_SESSION['user']['userId']); $starterData = getUserData($mysqlConn, $_POST['f']['userId']); if( !in_array( $_POST['f']['userId'], explode(',', getUserData($mysqlConn, $_SESSION['user']['userId'])['kinder']) ) ){ $message['error'] .= "Es fehlt die Berechtigung diesen Starter zu melden!
"; } else{ $message = addStarterToEvent($mysqlConn, $_POST['f']['userId'], $_POST['f']['eventId']); if( isset($message['success']) ){ $notificationMail['to'] = $userData['eMail']; $notificationMail['subject'] = "=?UTF-8?B?".base64_encode("Meldebestätigung")."?="; $notificationMail['message'] = $starterData['name'] . ", " . $starterData['vorname'] . " zum Wettkampf " . $wkData['Veranstaltung'] . " gemeldet. Diese Mail wurde automatisch vom Wettkampfplaner bei der Meldung versandt."; $notificationMail['headers'] = "From: noreply.wettkampflaner@cwsvjudo.bplaced.net\r\n". "Reply-To: cwsvjudo@arcor.de\r\n". "X-Mailer: PHP/".phpversion()."\r\n". "Content-Type: text/plain; charset=UTF-8"; if(!empty($notificationMail['to'])){ mail ( $notificationMail['to'] , $notificationMail['subject'] , $notificationMail['message'], $notificationMail['headers'] ); } $notificationMail['to'] = $wkParticipoConf['adminEmail']; if(!empty($notificationMail['to'])){ mail ( $notificationMail['to'] , $notificationMail['subject'] , $notificationMail['message'], $notificationMail['headers'] ); } } } } } } $mysqlConn->close(); } } ?> Wettkampfplaner - Meldung
zum Wettkampf gemeldet!