batch 1 update style & dahsboard for rec.nurinda.co.id

This commit is contained in:
dirga committed 2026-10-14 13:52:12 +07:00
1 parent 9107ffb158
commit f39aa60384
18485 files changed
+843 -2881869

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<?php
ini_set('session.use_strict_mode','1');
session_set_cookie_params(['httponly'=>true,'secure'=>!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!=='off','samesite'=>'Lax','path'=>'/']);
session_start();
header('Cache-Control: no-store');
header('X-Content-Type-Options: nosniff');
header("Content-Security-Policy: default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:; connect-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'self'");
date_default_timezone_set('Asia/Jakarta');
if(empty($_SESSION['candidate_csrf'])) $_SESSION['candidate_csrf']=bin2hex(random_bytes(32));
function ce($v) { return htmlspecialchars(str_replace("\0",'',(string)$v),ENT_QUOTES|ENT_SUBSTITUTE,'UTF-8'); }
function cgo($url) { header('Location: '.$url); exit; }
function cdb() { static $db; if(!$db) { mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); require __DIR__.'/conn.php'; $db=$conn; $db->set_charset('utf8mb4'); } return $db; }
function cq($sql,$types='',$params=[]) { $s=cdb()->prepare($sql); if($types) $s->bind_param($types,...$params); $s->execute(); return $s; }
function candidate() {
if(empty($_SESSION['candidate_id'])) cgo('index.php');
$p=cq('SELECT * FROM in_daper WHERE id=?','i',[(int)$_SESSION['candidate_id']])->get_result()->fetch_assoc();
if(!$p) { unset($_SESSION['candidate_id']); cgo('index.php'); } return $p;
}
function ctoken() { echo '<input type="hidden" name="csrf" value="'.ce($_SESSION['candidate_csrf']).'">'; }
function cverify() { if(!hash_equals($_SESSION['candidate_csrf'],(string)($_POST['csrf']??''))) { http_response_code(403); exit('Formulir kedaluwarsa. Muat ulang halaman.'); } }
const CPHASES=[1=>['Matematika','15 soal','20 menit',1200,[1=>15]],2=>['Sinonim & Antonim','20 soal','5 menit',300,[2=>10,3=>10]],3=>['Padanan kata','10 soal','5 menit',300,[4=>10]],4=>['Kepribadian','20 soal','5 menit',300,[5=>20]]];
function cstart($title,$p=null) {
?><!doctype html><html lang="id"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title><?=ce($title)?> · Nurinda Recruitment</title><link rel="stylesheet" href="dashboard/assets/admin.css"><link rel="stylesheet" href="assets/recruitment.css"><script src="assets/recruitment.js" defer></script></head><body class="candidate-body">
<?php if($p): ?><header class="candidate-header"><a class="brand" href="home.php"><img class="brand-logo" src="dashboard/assets/nurinda-logo.png" alt="Logo Nurinda"><span>NURINDA<small>Recruitment experience</small></span></a><div class="candidate-user"><span><?=ce($p['nama'])?></span><form action="logout.php" method="post"><?php ctoken(); ?><button class="button secondary compact">Keluar ↗</button></form></div></header><main class="candidate-content"><?php else: ?><main class="auth-main"><?php endif; ?>
<?php foreach(['error','success'] as $flash): if(!empty($_SESSION[$flash])): ?><div class="notice <?=$flash==='error'?'error':''?>" role="status"><?=ce(strip_tags($_SESSION[$flash]))?></div><?php unset($_SESSION[$flash]); endif; endforeach;
}
function cend() { echo '</main><footer class="candidate-footer">© '.date('Y').' PT Nurinda · Human Capital</footer></body></html>'; }
require_once __DIR__ . "/exam-service.php";