Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
galihap76 committed Aug 3, 2024
0 parents commit d123667
Show file tree
Hide file tree
Showing 1,886 changed files with 191,173 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ajax/updateNoAntrian.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
session_start();
header('Content-Type: application/json');

if ($_SERVER["REQUEST_METHOD"] == "POST") {
include_once '../auth/db.php';
include_once '../csrf-security/csrf.php';

$csrf_token = $_POST['csrf_token'];

if (!isset($csrf_token) || !isCSRFTokenValid($csrf_token)) {
echo json_encode(['status' => false, 'message' => 'Invalid CSRF token']);
} else {

$tz = 'Asia/Jakarta';
$dt = new DateTime("now", new DateTimeZone($tz));
$jam_panggil_sekarang = $dt->format('H:i:s');
$id = $_POST['id'];
$status_panggil = "Y";

$sql = "UPDATE tbl_antrian_obat SET jam_panggil = :jam_panggil, status_panggil = :status_panggil WHERE id = :id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":id", $id, PDO::PARAM_INT);
$stmt->bindParam(":jam_panggil", $jam_panggil_sekarang);
$stmt->bindParam(":status_panggil", $status_panggil);
$stmt->execute();

echo json_encode(['status' => true, 'message' => 'CSRF token valid']);
}
}
1 change: 1 addition & 0 deletions assets/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Options -Indexes
Binary file added assets/bel_antrian.mp3
Binary file not shown.
Loading

0 comments on commit d123667

Please sign in to comment.