<?php
// Filename: booking/admin/bulk_process.php
include '../../config.php';
requireAdmin();

if(isset($_POST['bulk_approve']) && !empty($_POST['booking_ids'])) {
    $ids = $_POST['booking_ids'];
    $placeholders = str_repeat('?,', count($ids) - 1) . '?';
    
    $stmt = $pdo->prepare("UPDATE bookings SET status = 'approved' WHERE id IN ($placeholders)");
    $stmt->execute($ids);
    
    header("Location: manage.php?status=pending&msg=bulk_success");
    exit;
}

header("Location: manage.php");