cms-frontend/resources/views/pages/home page/photo-slider.blade.php

80 lines
2.5 KiB
PHP

@extends('layouts.app')
@section('page_title', 'Photo Slider')
@section('content')
@php
$sliders = [
[
'id' => 1,
'title' => 'Homepage Banner',
'type' => 'Banner',
'startDate' => '2025-04-10',
'endDate' => '2025-04-20'
],
[
'id' => 2,
'title' => 'Product Carousel',
'type' => 'Carousel',
'startDate' => '2025-04-15',
'endDate' => '2025-04-25'
],
[
'id' => 3,
'title' => 'Seasonal Promo',
'type' => 'Banner',
'startDate' => '2025-04-20',
'endDate' => '2025-05-01'
],
[
'id' => 4,
'title' => 'Flash Sale Slider',
'type' => 'Slider',
'startDate' => '2025-04-22',
'endDate' => '2025-04-24'
],
[
'id' => 5,
'title' => 'New Arrivals',
'type' => 'Carousel',
'startDate' => '2025-04-25',
'endDate' => '2025-05-05'
],
[
'id' => 6,
'title' => 'Event Highlight',
'type' => 'Banner',
'startDate' => '2025-04-30',
'endDate' => '2025-05-10'
]
];
@endphp
@include('components.table-component', [
'pageTitle' => 'Photo Slider',
'data' => $sliders,
'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]
],
'actions' => ['edit', 'view', 'delete'],
'showAddButton' => true,
'addButtonUrl' => '/add-photo-slider',
'showCheckboxes' => true,
'showBatchDelete' => true,
'showEditModal' => true,
'showViewModal' => true
])
<script>
const storedSliders = JSON.parse(sessionStorage.getItem('sliders') || '[]');
if (storedSliders.length > 0) {
const tableConfig = window.tableConfig || {};
tableConfig.data = [...tableConfig.data, ...storedSliders];
window.renderTable();
window.renderPagination();
}
</script>
@endsection