One Hat Cyber Team
Your IP :
104.23.243.58
Server IP :
172.67.218.182
Server :
Linux 128-201-239-36.cprapid.com 3.10.0-1160.41.1.el7.x86_64 #1 SMP Tue Aug 31 14:52:47 UTC 2021 x86_64
Server Software :
Apache
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
juscatamarca
/
www
/
asuetos-feriados
/
public
/
View File Name :
holidays_delete.php
<?php require_once __DIR__ . '/../app/auth.php'; $me = current_user(); if (!$me) { header('Location: ' . base_url() . '/login.php'); exit; } if ($me['role'] !== 'admin') { header('Location: ' . base_url() . '/index.php'); exit; } require_once __DIR__ . '/../app/config.php'; $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; if ($id <= 0) { header('Location: ' . base_url() . '/index.php'); exit; } $stmt = $pdo->prepare("SELECT * FROM holidays WHERE id = ?"); $stmt->execute([$id]); $evento = $stmt->fetch(); if (!$evento) { exit('Evento no encontrado.'); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $del = $pdo->prepare("DELETE FROM holidays WHERE id = ?"); $del->execute([$id]); header('Location: ' . base_url() . '/index.php'); exit; } ?> <!doctype html> <html lang="es"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Eliminar feriado/asueto — Asuetos & Feriados</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body class="bg-light"> <nav class="navbar navbar-expand-lg bg-white border-bottom"> <div class="container-fluid"> <a class="navbar-brand" href="<?= base_url() ?>/index.php">Asuetos & Feriados</a> <div class="ms-auto d-flex align-items-center gap-2"> <span class="text-muted me-2"><?= htmlspecialchars($me['name']) ?></span> <a class="btn btn-outline-secondary btn-sm" href="<?= base_url() ?>/logout.php">Salir</a> </div> </div> </nav> <div class="container my-4"> <h3>Eliminar feriado/asueto</h3> <div class="alert alert-warning"> ¿Seguro que querés eliminar <strong><?= htmlspecialchars($evento['title']) ?></strong> (<?= htmlspecialchars($evento['start_date']) ?><?= $evento['end_date'] ? ' al ' . htmlspecialchars($evento['end_date']) : '' ?>)? Esta acción no se puede deshacer. </div> <form method="post" class="d-flex gap-2"> <button type="submit" class="btn btn-danger">Eliminar</button> <a href="<?= base_url() ?>/index.php" class="btn btn-secondary">Cancelar</a> </form> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> </body> </html>