<div class="container-fluid">
  <!--  Row 1 -->

  <div class="row">

    <div class="col-lg-12 d-flex align-items-stretch">
      <div class="card w-100">
        <div class="card-body p-4">

            <h2><?= htmlspecialchars($ad['title']) ?></h2>
            <p><strong>Priority:</strong> 
                <?php
                if ($ad['occurance'] == '1') echo 'Low';
                elseif ($ad['occurance'] == '2') echo 'Medium';
                else echo 'High';
                ?>
            </p>
            <p><strong>Target Audience:</strong> <?= htmlspecialchars($ad['target']) ?></p>
            <p><strong>Watch Credit:</strong> <?= htmlspecialchars($ad['watch_credit']) ?></p>
            <p><strong>Running Dates:</strong> <?= htmlspecialchars($ad['date_from']) ?> to <?= htmlspecialchars($ad['date_to']) ?></p>
            <p><strong>URL:</strong> <a href="<?= htmlspecialchars($ad['url']) ?>" target="_blank"><?= htmlspecialchars($ad['url']) ?></a></p>

            <img src="<?= $ad['thumbnail'] ?>" alt="Thumbnail" style="max-width:200px;">
            <br>
            <br>
            <?php if ($ad['type'] == 1): ?>
                <img src="<?= $ad['file'] ?>" alt="Ad Image" style="max-width:400px;">
            <?php else: ?>
                <video controls style="max-width:400px;">
                    <source src="<?= $ad['file'] ?>" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            <?php endif; ?>

            <br><br>
            <a href="<?= site_url('/admin/ads/edit?id=' . $ad['id']) ?>" class="btn btn-primary btn-sm">Edit</a>
            <a href="<?= site_url('/admin/ads/delete?id=' . $ad['id']) ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</a>
            <a href="<?= site_url('/admin/ads') ?>" class="btn btn-secondary btn-sm">Back to list</a>
        </div>

        </div>
        </div>
        </div>
        </div>
        
