3 * 1024 * 1024) { $errors[] = 'Ukuran foto maksimal 3MB.'; } else { $finfo = new finfo(FILEINFO_MIME_TYPE); $mime = $finfo->file($file['tmp_name']); $allowed = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/webp' => 'webp']; if (!isset($allowed[$mime])) { $errors[] = 'Format foto harus JPG, PNG, atau WEBP.'; } else { $uploadDir = __DIR__ . '/assets/uploads'; if (!is_dir($uploadDir)) { mkdir($uploadDir, 0775, true); } $filename = uniqid('profile_', true) . '.' . $allowed[$mime]; $destination = $uploadDir . '/' . $filename; if (!move_uploaded_file($file['tmp_name'], $destination)) { $errors[] = 'Gagal menyimpan foto.'; } else { $photoPath = 'assets/uploads/' . $filename; } } } } if ($errors) { flash_set('danger', implode(' ', $errors)); header('Location: /#daftar'); exit; } $regCode = generate_reg_code(); insert_registration([ 'reg_code' => $regCode, 'name' => $name, 'education' => $education, 'major' => $major, 'photo_path' => $photoPath, ]); $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; $now = date('Y-m-d H:i:s'); ?> Pendaftaran Berhasil
Pendaftaran berhasil! Simpan nomor pendaftaran Anda.

Nomor Pendaftaran

Foto pendaftar

Nama:

Pendidikan:

Jurusan:

Waktu daftar: UTC

Jika Anda membutuhkan perubahan data, silakan hubungi admin internal.