-
Notifications
You must be signed in to change notification settings - Fork 0
/
pengajuan_konfirmasi_a.php
43 lines (29 loc) · 1 KB
/
pengajuan_konfirmasi_a.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
session_start();
// jika waktu session habis (tak set 30m)
if (!isset($_SESSION['EXPIRES']) || time() >= $_SESSION['EXPIRES']) {
session_destroy();
$_SESSION = array();
}
if (!isset($_SESSION["id_pegawai"]) || $_SESSION['nama_jabatan'] != 'Admin') {
header("location:login.php");
} else {
$id_pengajuan = $_GET['id_pengajuan'];
require './dbConnection.php';
try {
$sql = 'UPDATE tb_pengajuan
SET status_pengajuan = "Diterima",
tgl_konfirmasi = CURDATE()
WHERE id_pengajuan = :id_pengajuan';
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':id_pengajuan', $id_pengajuan, PDO::PARAM_STR);
if ($stmt->execute() === FALSE) {
echo 'Could not save information to the database';
}
} catch (PDOException $e) {
echo 'Database Error '. $e->getMessage(). ' in '. $e->getFile().
': '. $e->getLine();
}
header("location:pengajuan_admin.php");
}
?>