var/www/jonas-eriksen.dk/result/user/new.php 0000644 00000016245 15233523672 0015143 0 ustar 00 passwordResetCheck();
$log = new log($db);
if (!$admin->admin_level(0)) {
$admin->redirect('../static/401.php');
}
$stmt = $db->prepare("SELECT * FROM result_class");
$stmt->execute();
$result = $stmt->fetchAll();
if (isset($_POST['name']) && isset($_POST['memberDate'])) {
$uShooterId = $_POST['shooterId'];
$uFullname = $_POST['name'];
$uAdress = $_POST['adress'] . ", " . $_POST['areaCode'];
$uBirtday = $_POST['birthday'];
$uEmail = $_POST['email'];
$uPhone = $_POST['phonenumber'];
$uAllowPicture = $_POST['allowPicture'];
$uOwnWeapon = $_POST['ownWeapon'];
$uClass = $_POST['class'];
$uDate = $_POST['memberDate'];
$stmt = $db->prepare('SELECT * FROM result_users WHERE shooterId = :shooterId');
$stmt->execute(array(':shooterId' => $uShooterId));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($user->register($uShooterId, encrypt("123456-1234", $encryptKey), $uFullname, $uAdress, $uBirtday, $uEmail, $uAllowPicture, $uPhone, $uOwnWeapon, $uClass, $uDate)) {
$log->addLog($_SESSION['userId'], "Ny skytte oprettet", "Skytte", "/user/show.php?user=" . $user->getLatestUser());
$admin->redirect('/user/new_user.php');
}
}
include('../static/header.php');
?>