31 lines
808 B
PHP
31 lines
808 B
PHP
<?php
|
|
require_once 'config/participo.php';
|
|
|
|
require_once './local/cwsvJudo.php';
|
|
|
|
require_once 'participoLib/dbConnector.php';
|
|
require_once 'participoLib/participo.php';
|
|
require_once 'participoLib/planer.php';
|
|
|
|
dbConnector::connect(
|
|
$cwsvJudoConfig['db']['host'],
|
|
$cwsvJudoConfig['db']['name'],
|
|
$cwsvJudoConfig['db']['user'],
|
|
$cwsvJudoConfig['db']['password']
|
|
);
|
|
|
|
participo::authentificate();
|
|
|
|
$eventId = $_POST['eventId'] ?? null;
|
|
$startingTypeId = $_POST['type'] ?? null;
|
|
$starterId = $_POST['userId'] ?? null;
|
|
|
|
$returnToUrl = $_POST['returnToUrl'] ?? 'participo/';
|
|
|
|
// @todo Check against deadline?
|
|
$newStarter = new Starter(null, $eventId, $startingTypeId, $starterId);
|
|
$newStarterId = $newStarter->addToDb();
|
|
|
|
header('Location: ' . urldecode($returnToUrl), true, 301);
|
|
exit(-1); // shouldn't matter
|