<?php
/**
 * VENDOR ORDER CANCELLATION EMAIL TEMPLATE
 * File: templates/email/order-cancellation-vendor.php
 */

// Email content
ob_start();
?>

<div class="alert alert-danger">
    <strong>Order Cancelled</strong><br>
    An order for your item has been cancelled.
</div>

<div class="order-summary">
    <h4>Cancellation Details</h4>
    <p><strong>Order Number:</strong> #<?= $order_number ?></p>
    <p><strong>Item:</strong> <?= htmlspecialchars($item_title) ?></p>
    <p><strong>Customer:</strong> <?= htmlspecialchars($customer_name) ?></p>
    <p><strong>Cancelled By:</strong> <?= htmlspecialchars($cancelled_by) ?> (<?= $cancelled_by_type ?>)</p>
    <p><strong>Reason:</strong> <?= htmlspecialchars($reason) ?></p>
</div>

<div class="alert alert-info">
    <strong>What This Means:</strong>
    <ul style="margin: 10px 0 0 20px;">
        <li>The customer has been penalised accordingly and received a refund</li>
        <li>Cancellation penalty has been credited into your wallet</li>
        <li>Your item is now available for other bookings</li>
        <li>No payment will be processed for this order</li>
        <li>You can continue accepting new orders</li>
    </ul>
</div>

<div class="alert alert-warning">
    <strong>Action Required:</strong>
    <ul style="margin: 10px 0 0 20px;">
        <li>If the item was already prepared, you can return it to inventory</li>
        <li>If you had arranged pickup/delivery, please cancel those arrangements</li>
        <li>Review the cancellation reason to improve your service</li>
        <li>Contact support if you have concerns about this cancellation</li>
    </ul>
</div>

<p>We're sorry this booking didn't work out. Keep providing great service and you'll get more bookings!</p>

<?php
$content = ob_get_clean();

// Prepare email data
$email_data = [
    'title' => 'Order Cancelled - #' . $order_number,
    'greeting' => "Hello {$vendor_name}!",
    'content' => $content,
    'action_url' => APP_URL . '/vendor/orders.php',
    'action_text' => 'View Orders',
    'secondary_action_url' => APP_URL . '/vendor/items.php',
    'secondary_action_text' => 'Manage Items',
    'footer_note' => 'Need help? Contact our vendor support team.',
    'signature' => "Best regards,<br>The " . APP_NAME . " Team<br>support@rentidium.com"
];

// Include layout
include 'layout.php';
?>