<?php
// admin/delete_stk.php - Delete a record from mpesa_stk_queue by ID
require_once '../src/Database.php';
require_once '../src/Auth.php';

$auth = new Auth();
$auth->requireLogin();

$db = new Database();
$conn = $db->getConnection();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $conn->exec('DELETE FROM mpesa_stk_queue');
    header('Location: update_paybills.php?deleted=all');
    exit;
}
// fallback
header('Location: update_paybills.php');
exit;
