44 lines
1.9 KiB
PHP
44 lines
1.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('page_title', 'Promotions')
|
|
|
|
@section('content')
|
|
<div id="promotions-table">
|
|
@if (session('success'))
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
{{ session('success') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
@endif
|
|
@if (session('error'))
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
{{ session('error') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
@endif
|
|
@include('components.promotion-component', [
|
|
'pageTitle' => 'Promotions',
|
|
'data' => $promotions ?? [],
|
|
'columns' => [
|
|
['name' => 'Title', 'key' => 'title', 'sortable' => true],
|
|
['name' => 'Type', 'key' => 'type', 'sortable' => true],
|
|
['name' => 'Start Date', 'key' => 'startDate', 'sortable' => true],
|
|
['name' => 'End Date', 'key' => 'endDate', 'sortable' => true],
|
|
['name' => 'Status', 'key' => 'status', 'sortable' => true]
|
|
],
|
|
'actions' => ['edit', 'view', 'delete'],
|
|
'showAddButton' => true,
|
|
'addButtonUrl' => route('promotions.create'),
|
|
'showCheckboxes' => true,
|
|
'showBatchDelete' => true,
|
|
'showEditModal' => false,
|
|
'showViewModal' => false,
|
|
'currentPage' => $currentPage ?? 1,
|
|
'lastPage' => $lastPage ?? 1,
|
|
'total' => $total ?? 0,
|
|
])
|
|
<div id="no-data-message" style="display: {{ empty($promotions ?? []) ? 'block' : 'none' }}; text-align: center; margin-top: 20px;">
|
|
<p>No promotions found.</p>
|
|
</div>
|
|
</div>
|
|
@endsection |