<?php if ($_POST) { require_once 'pegawai.php'; $pegawai = new Pegawai(); $nip = $_POST['pegawai']; $res = $pegawai->register_pegawai($nip); if ($res) { header('Location: index.php?status=success'); } else { header('Location: register.php?status=fail'); } } if (isset($_GET['']) && $_GET['status'] == 'fail') { echo "<script>alert('Registrasi pegawai gagal')</alert>"; } ?> <!DOCTYPE html> <html> <head> <title>Update Riwayat Pekerjaan Pegawai</title> </head> <body> <h2>Update pegawai dengan nip <?php echo $_GET['nip']; ?> </h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?>