Files
MoneyFlix/crm/Modules/Advertising/Views/creative-view.php
T
1sonhador 88a5659fe8 fix: Correct user permissions and UserModel query
- Fix storage permissions to use 'www' user instead of 'www-data'
- Fix UserModel getAllForAdmin query to avoid placeholders in LIMIT/OFFSET
- Import missing modules: Advertising, Dashboard, Analytics
- Update deploy script to copy files to public directory
2025-10-15 14:14:00 +01:00

131 lines
8.1 KiB
PHP

<?php
use App\Core\View;
?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<h4 class="card-title mb-0" x-text="$t('advertising.creatives.creative_details')"></h4>
<div>
<a href="/advertising/creatives/<?= $creative['creative_id'] ?>/edit" class="btn btn-primary btn-sm">
<i class="ri-pencil-fill align-bottom me-1"></i>
<span x-text="$t('advertising.creatives.edit')"></span>
</a>
<a href="/advertising/creatives" class="btn btn-secondary btn-sm">
<i class="ri-arrow-left-line align-bottom me-1"></i>
<span x-text="$t('common.back')"></span>
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<!-- Preview do Criativo -->
<div class="col-md-6">
<div class="text-center mb-4">
<h5 x-text="$t('advertising.creatives.preview')"></h5>
<?php if (strpos($creative['mime_type'], 'image/') === 0): ?>
<div class="border rounded p-3 bg-light">
<img src="<?= htmlspecialchars($creative['file_path']) ?>"
alt="<?= htmlspecialchars($creative['alt_text'] ?? $creative['creative_name']) ?>"
class="img-fluid"
style="max-width: 100%; max-height: 300px;">
</div>
<?php elseif (strpos($creative['mime_type'], 'video/') === 0): ?>
<div class="border rounded p-3 bg-light">
<video controls style="max-width: 100%; max-height: 300px;">
<source src="<?= htmlspecialchars($creative['file_path']) ?>" type="<?= htmlspecialchars($creative['mime_type']) ?>">
<span x-text="$t('common.error_loading')"></span>
</video>
</div>
<?php else: ?>
<div class="border rounded p-3 bg-light">
<i class="ri-file-line fs-1 text-muted"></i>
<p class="text-muted mt-2" x-text="$t('advertising.creatives.no_preview')"></p>
</div>
<?php endif; ?>
</div>
</div>
<!-- Detalhes do Criativo -->
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.id')"></td>
<td><?= htmlspecialchars($creative['creative_id']) ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.name')"></td>
<td><?= htmlspecialchars($creative['creative_name'] ?? 'N/A') ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.description')"></td>
<td><?= htmlspecialchars($creative['creative_description'] ?? 'N/A') ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.type')"></td>
<td>
<span class="badge bg-primary" x-text="$t('advertising.creatives.type_' + '<?= strtolower($creative['creative_type'] ?? 'banner') ?>')"></span>
</td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.dimensions')"></td>
<td><?= htmlspecialchars($creative['width'] ?? 'N/A') ?> x <?= htmlspecialchars($creative['height'] ?? 'N/A') ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.status')"></td>
<td>
<span class="badge <?= $creative['is_active'] ? 'bg-success' : 'bg-warning' ?>">
<span x-text="<?= $creative['is_active'] ? '$t(\'advertising.creatives.active\')' : '$t(\'advertising.creatives.paused\')' ?>"></span>
</span>
</td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('advertising.creatives.mime_type')"></td>
<td><?= htmlspecialchars($creative['mime_type'] ?? 'N/A') ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('common.created_at')"></td>
<td><?= htmlspecialchars($creative['created_date'] ?? 'N/A') ?></td>
</tr>
<tr>
<td class="fw-semibold" x-text="$t('common.updated_at')"></td>
<td><?= htmlspecialchars($creative['updated_date'] ?? 'N/A') ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Informações Adicionais -->
<div class="row mt-4">
<div class="col-12">
<div class="card border">
<div class="card-header">
<h5 class="card-title mb-0" x-text="$t('advertising.creatives.additional_info')"></h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<p><strong x-text="$t('advertising.creatives.file_name')"></strong>: <?= htmlspecialchars($creative['file_name'] ?? 'N/A') ?></p>
<p><strong x-text="$t('advertising.creatives.file_path')"></strong>: <code><?= htmlspecialchars($creative['file_path'] ?? 'N/A') ?></code></p>
</div>
<div class="col-md-6">
<p><strong x-text="$t('advertising.creatives.alt_text')"></strong>: <?= htmlspecialchars($creative['alt_text'] ?? 'N/A') ?></p>
<p><strong x-text="$t('advertising.creatives.format_id')"></strong>: <?= htmlspecialchars($creative['format_id'] ?? 'N/A') ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>