";
}
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{
// Wenn keine userId übergeben wird, biete alle Kinder an
// Wenn die Art des Startes nicht mit angegeben ist, auch nachfragen
if( !isset($_POST['f']['userId']) || !isset($_POST['f']['type'])){
$kinderDaten = getUsersKidsData($mysqlConn, $_SESSION['user']['userId']);
//print_r($kinderDaten);
foreach($kinderDaten as $kind){
$meldungsBox .= "
Meldung
";
$meldungsBox .= "
Für Starter: ".mb_convert_encoding($kind['name'], 'UTF-8', 'ISO-8859-1').", ".mb_convert_encoding($kind['vorname'], 'UTF-8', 'ISO-8859-1')."
";
$meldungsBox .= "
";
}
}
else{
// @todo hier müsste das Auslösen der Meldung
$userData = getUserData($mysqlConn, $_SESSION['user']['userId']);
$starterData = getUserData($mysqlConn, $_POST['f']['userId']);
// $wkData = getWkData($mysqlConn, $eventData['wkId']);
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 = createStarterForEvent($mysqlConn, $_POST['f']['eventId'], $_POST['f']['userId'], $_POST['f']['type']);
if( isset($message['success']) ){
$notificationMail['to'] = $userData['eMail'];
$notificationMail['subject'] = "=?UTF-8?B?".base64_encode("Meldebestätigung")."?=";
$notificationMail['message'] = mb_convert_encoding($starterData['name'], 'UTF-8', 'ISO-8859-1') . ", " . mb_convert_encoding($starterData['vorname'], 'UTF-8', 'ISO-8859-1') . " zum Wettkampf " . mb_convert_encoding($wkEventData['Veranstaltung'], 'UTF-8', 'ISO-8859-1') . " 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!