diff --git a/app/controller/artistDetails.php b/app/controller/artistDetails.php index 5e33c86..10dfe8a 100644 --- a/app/controller/artistDetails.php +++ b/app/controller/artistDetails.php @@ -16,8 +16,15 @@ $artist = $jazzService->getArtistById($artistId); $performances = $jazzService->getPerformancesByArtist($artist); + $words = explode(' ', $artist->Bio); + $wordsPerPart = ceil(count($words) / 2); + $bioPart1 = implode(' ', array_slice($words, 0, $wordsPerPart)); + $bioPart2 = implode(' ', array_slice($words, $wordsPerPart)); + Route::render('jazz.artist.main', [ 'artist' => $artist, 'performances' => $performances, + 'bioPart1' => $bioPart1, + 'bioPart2' => $bioPart2, ]); }); diff --git a/app/controller/artists/createArtist.php b/app/controller/artists/createArtist.php index d29b668..a12f3a8 100644 --- a/app/controller/artists/createArtist.php +++ b/app/controller/artists/createArtist.php @@ -22,14 +22,18 @@ $bio = $props['bio']; $inputService->checkRequiredFields([$name, $bio]); + $inputService->validateArtistBio($bio); - $songs = [$_POST['song1'] ?? null, $_POST['song2'] ?? null, $_POST['song3'] ?? null]; - $albums = [$_POST['album1'] ?? null, $_POST['album2'] ?? null, $_POST['album3'] ?? null]; + $songs = [$props['song1'], $props['song2'], $props['song3']]; + $albums = [$props['album1'], $props['album2'], $props['album3']]; - $headerImgPath = $inputService->checkAndUploadImage('header_img', 'jazz/artists'); - $artistImg1Path = $inputService->checkAndUploadImage('artist_img1', 'jazz/artists'); - $artistImg2Path = $inputService->checkAndUploadImage('artist_img2', 'jazz/artists'); - $performanceImgPath = $inputService->checkAndUploadImage('performance_img', 'jazz/performances'); + $inputService->validateAlbums($albums); + $inputService->validateSongs($songs); + + $headerImgPath = $inputService->validateAndUploadImage('header_img', 'jazz/artists'); + $artistImg1Path = $inputService->validateAndUploadImage('artist_img1', 'jazz/artists'); + $artistImg2Path = $inputService->validateAndUploadImage('artist_img2', 'jazz/artists'); + $performanceImgPath = $inputService->validateAndUploadImage('performance_img', 'jazz/performances'); $jazzService->createArtist($name, $bio, $headerImgPath, $artistImg1Path, $artistImg2Path, $performanceImgPath, $songs, $albums); diff --git a/app/controller/artists/editArtist.php b/app/controller/artists/editArtist.php index cdfe19d..693c665 100644 --- a/app/controller/artists/editArtist.php +++ b/app/controller/artists/editArtist.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/../../service/ValidateInputService.php'; $jazzService = new JazzService(); - + Route::serve('/artists/editArtist', function (array $props) use ($jazzService){ if(!isset($props['id'])) { Route::redirect('/artists/manageArtists'); @@ -33,14 +33,18 @@ $bio = $props['bio']; $validateInputService->checkRequiredFields([$name, $bio]); + $validateInputService->validateArtistBio($bio); + + $songs = [$props['song1'], $props['song2'], $props['song3']]; + $albums = [$props['album1'], $props['album2'], $props['album3']]; - $songs = [$_POST['song1'] ?? null, $_POST['song2'] ?? null, $_POST['song3'] ?? null]; - $albums = [$_POST['album1'] ?? null, $_POST['album2'] ?? null, $_POST['album3'] ?? null]; + $validateInputService->validateAlbums($albums); + $validateInputService->validateSongs($songs); - $headerImgPath = $validateInputService->handleImageUpload('header_img', 'jazz/artists'); - $artistImg1Path = $validateInputService->handleImageUpload('artist_img1', 'jazz/artists'); - $artistImg2Path = $validateInputService->handleImageUpload('artist_img2', 'jazz/artists'); - $performanceImgPath = $validateInputService->handleImageUpload('performance_img', 'jazz/performances'); + $headerImgPath = $validateInputService->updateImage('header_img', 'jazz/artists'); + $artistImg1Path = $validateInputService->updateImage('artist_img1', 'jazz/artists'); + $artistImg2Path = $validateInputService->updateImage('artist_img2', 'jazz/artists'); + $performanceImgPath = $validateInputService->updateImage('performance_img', 'jazz/performances'); $jazzService->updateArtist($id, $name, $bio, $songs, $albums, $headerImgPath, $artistImg1Path, $artistImg2Path, $performanceImgPath); diff --git a/app/controller/jazzdays/createDay.php b/app/controller/jazzdays/createDay.php index 9ac0122..4375061 100644 --- a/app/controller/jazzdays/createDay.php +++ b/app/controller/jazzdays/createDay.php @@ -28,7 +28,7 @@ $note = $props['note']; $validateInputService->checkRequiredFields([$date, $venueId]); - $imgPath = $validateInputService->checkAndUploadImage('image', 'jazz'); + $imgPath = $validateInputService->validateAndUploadImage('image', 'jazz'); $jazzService->createJazzDay($date, $venueId, $note, $imgPath); diff --git a/app/controller/jazzdays/editDay.php b/app/controller/jazzdays/editDay.php index 5af449b..097b1be 100644 --- a/app/controller/jazzdays/editDay.php +++ b/app/controller/jazzdays/editDay.php @@ -36,7 +36,7 @@ $note = $props['note']; $validateInputService->checkRequiredFields([$date, $venueId]); - $imgPath = $validateInputService->handleImageUpload('image', 'jazz'); + $imgPath = $validateInputService->updateImage('image', 'jazz'); $jazzService->updateJazzDay($dayId, $date, $venueId, $note, $imgPath); diff --git a/app/pages/admin/jazz/manage/artists.blade.php b/app/pages/admin/jazz/manage/artists.blade.php index 056d353..5314238 100644 --- a/app/pages/admin/jazz/manage/artists.blade.php +++ b/app/pages/admin/jazz/manage/artists.blade.php @@ -13,7 +13,9 @@ - + +@include('main.navbar') +
@include('admin.panel') diff --git a/app/pages/admin/jazz/manage/days.blade.php b/app/pages/admin/jazz/manage/days.blade.php index b611491..2c8988c 100644 --- a/app/pages/admin/jazz/manage/days.blade.php +++ b/app/pages/admin/jazz/manage/days.blade.php @@ -13,7 +13,11 @@ - + + +@include('main.navbar') +
+
@include('admin.panel') diff --git a/app/pages/admin/jazz/manage/passes.blade.php b/app/pages/admin/jazz/manage/passes.blade.php index 9073921..98ccc3f 100644 --- a/app/pages/admin/jazz/manage/passes.blade.php +++ b/app/pages/admin/jazz/manage/passes.blade.php @@ -13,7 +13,11 @@ - + + +@include('main.navbar') +
+
@include('admin.panel') diff --git a/app/pages/admin/jazz/manage/performances.blade.php b/app/pages/admin/jazz/manage/performances.blade.php index 3050aa9..cccb494 100644 --- a/app/pages/admin/jazz/manage/performances.blade.php +++ b/app/pages/admin/jazz/manage/performances.blade.php @@ -13,7 +13,11 @@ - + + +@include('main.navbar') +
+
diff --git a/app/pages/admin/jazz/manage/venues.blade.php b/app/pages/admin/jazz/manage/venues.blade.php index 638537c..4eb3f8f 100644 --- a/app/pages/admin/jazz/manage/venues.blade.php +++ b/app/pages/admin/jazz/manage/venues.blade.php @@ -13,7 +13,11 @@ - + + +@include('main.navbar') +
+
@include('admin.panel') diff --git a/app/pages/jazz/artist/albums.blade.php b/app/pages/jazz/artist/albums.blade.php index e69de29..5499e9a 100644 --- a/app/pages/jazz/artist/albums.blade.php +++ b/app/pages/jazz/artist/albums.blade.php @@ -0,0 +1,12 @@ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/app/pages/jazz/artist/header.blade.php b/app/pages/jazz/artist/header.blade.php index e69de29..b03ba86 100644 --- a/app/pages/jazz/artist/header.blade.php +++ b/app/pages/jazz/artist/header.blade.php @@ -0,0 +1,7 @@ +
+
+

+ {{ $artist->Name }} +

+
+
\ No newline at end of file diff --git a/app/pages/jazz/artist/main.blade.php b/app/pages/jazz/artist/main.blade.php index 71eca13..d04c6eb 100644 --- a/app/pages/jazz/artist/main.blade.php +++ b/app/pages/jazz/artist/main.blade.php @@ -13,151 +13,78 @@ - -
- @if ($artist->HeaderImg) - {{ $artist->Name }} - @else - -

Header Image

- @endif +@include('main.navbar') -
-

- {{ $artist->Name }} -

-
+@include('jazz.artist.header') + +
+

+ Biography of {{ $artist->Name }} +

- -
-
-
- @php - $bioPart1 = 'Some bio'; - $bioPart2 = 'Some bio'; - if($artist->Bio){ - $words = explode(' ', $artist->Bio); - $wordsPerPart = ceil(count($words) / 2); - $bioPart1 = implode(' ', array_slice($words, 0, $wordsPerPart)); - $bioPart2 = implode(' ', array_slice($words, $wordsPerPart)); - } - @endphp -

+

+ +
+
+

{{ $bioPart1 }}

-
- @if($artist->ArtistImg1) - {{ $artist->Name }} - @else -

Image

- @endif + +
+
+ {{ $artist->Name }} +
-
- @if($artist->ArtistImg2) - {{ $artist->Name }} - @else -

Image

- @endif + +
+
+ {{ $artist->Name }} +
-
+ +
-

+

{{ $bioPart2 }}

-
- -
-

- Discover albums of {{ $artist->Name }}! -

-
-
- @foreach ($artist->Albums as $album) -
-
- -
-
- @endforeach + +
+

+ Discover albums of {{ $artist->Name }} +

-
- - -
-

- Discover most popular songs of {{ $artist->Name }}! -

-
-
-
- @foreach ($artist->Songs as $song) -
-
-
- -
-
-
- @endforeach +
+
+ @foreach ($artist->Albums as $album) + @include('jazz.artist.albums') + @endforeach +
-
- -@foreach ($performances as $performance) -
-
-

- Come to {{ $performance->Day->Venue->Name }} - on {{ date('j F', strtotime($performance->StartDateTime)) }} - to enjoy {{ $artist->Name }}'s music!
- {{ date('H:i', strtotime($performance->StartDateTime)) }} - - {{ date('H:i', strtotime($performance->EndDateTime)) }} - @if (trim($performance->Details) !== '') - | {{ $performance->Details }} - @endif - @if ($performance->Price != '0.00') - - € {{ number_format($performance->Price, 2) }} - @endif -

- @if ($performance->Price != '0.00') -
- @if ($performance->AvailableTickets > 0) - - Buy Tickets! - @else - - @endif -
- @else -
- - For free! - -
- @endif + +
+

+ Discover most popular songs of {{ $artist->Name }}! +

+
+
+
+ @foreach ($artist->Songs as $song) + @include('jazz.artist.songs') + @endforeach
-@endforeach + + @include('jazz.artist.performances') + + @include('main.footer') + diff --git a/app/pages/jazz/artist/performances.blade.php b/app/pages/jazz/artist/performances.blade.php index e69de29..4490182 100644 --- a/app/pages/jazz/artist/performances.blade.php +++ b/app/pages/jazz/artist/performances.blade.php @@ -0,0 +1,39 @@ + + +@foreach ($performances as $performance) +
+
+

+ Come to {{ $performance->Day->Venue->Name }} + on {{ date('j F', strtotime($performance->StartDateTime)) }} + to enjoy {{ $artist->Name }}'s music!
+ {{ date('H:i', strtotime($performance->StartDateTime)) }} + - {{ date('H:i', strtotime($performance->EndDateTime)) }} + @if (trim($performance->Details) !== '') + | {{ $performance->Details }} + @endif + @if ($performance->Price != '0.00') + - € {{ number_format($performance->Price, 2) }} + @endif +

+ @if ($performance->Price != '0.00') +
+ @if ($performance->AvailableTickets > 0) + + Buy Tickets! + @else + + @endif +
+ @else +
+ + For free! + +
+ @endif +
+
+@endforeach \ No newline at end of file diff --git a/app/pages/jazz/artist/songs.blade.php b/app/pages/jazz/artist/songs.blade.php index e69de29..1ab8bcb 100644 --- a/app/pages/jazz/artist/songs.blade.php +++ b/app/pages/jazz/artist/songs.blade.php @@ -0,0 +1,12 @@ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/app/pages/jazz/overview/artists.blade.php b/app/pages/jazz/overview/artists.blade.php index e69de29..06da96b 100644 --- a/app/pages/jazz/overview/artists.blade.php +++ b/app/pages/jazz/overview/artists.blade.php @@ -0,0 +1,15 @@ +
+
+ @foreach ($eventDay['performances'] as $performance) + @if ($artist = $performance->Artist) + +

+ {{ $artist->Name }} +

+ {{ $artist->Name }} +
FIND OUT MORE
+
+ @endif + @endforeach +
+
\ No newline at end of file diff --git a/app/pages/jazz/overview/header.blade.php b/app/pages/jazz/overview/header.blade.php index e69de29..3330cc2 100644 --- a/app/pages/jazz/overview/header.blade.php +++ b/app/pages/jazz/overview/header.blade.php @@ -0,0 +1,13 @@ +
+ {{ $festivalEvent->getFestivalEventName() }} +
+

+ {{ $festivalEvent->getFestivalEventName() }} +

+

+ {{ date('j F', strtotime($festivalEvent->getStartDate())) }} - + {{ date('j F', strtotime($festivalEvent->getEndDate())) }} +

+
+
+ diff --git a/app/pages/jazz/overview/main.blade.php b/app/pages/jazz/overview/main.blade.php index 2ceba69..05869b2 100644 --- a/app/pages/jazz/overview/main.blade.php +++ b/app/pages/jazz/overview/main.blade.php @@ -5,143 +5,43 @@ {{ $festivalEvent->getFestivalEventName() }} - + @include('main.navbar') - -
- {{ $festivalEvent->getFestivalEventName() }} -
-

- {{ $festivalEvent->getFestivalEventName() }} -

-

- {{ date('j F', strtotime($festivalEvent->getStartDate())) }} - - {{ date('j F', strtotime($festivalEvent->getEndDate())) }} -

-
-
-
-

+@include('jazz.overview.header') + +

+

{{ $festivalEvent->getDescription() }}

-
-
-

+ +
+

{{ $festivalEvent->getTitle() }}

- @foreach ($eventDays as $dayNumber => $eventDay) - -
-

- DAY {{ $dayNumber + 1 }} - - {{ date('l, F jS', strtotime($eventDay['day']->Date)) }} 📍 - - {{ $eventDay['day']->Venue->Name }} - - {{ $eventDay['day']->Venue->Name }}
- {{ $eventDay['day']->Venue->Address }}
- {{ $eventDay['day']->Venue->ContactDetails }} - @if (!empty($eventDay['day']->Note)) - {{ $eventDay['day']->Note }} - @endif -
-
-

-
+ @include('jazz.overview.venue') - -
- Jazz Day Image - - - @foreach ($eventDay['performances'] as $index => $performance) -
-
-

- {{ $performance->Artist->Name }} -
{{ date('H:i', strtotime($performance->StartDateTime)) }} - - {{ date('H:i', strtotime($performance->EndDateTime)) }} - @if (!empty($performance->Details)) - | {{ $performance->Details }} - @endif - @if ($performance->Price != '0.00') - - € {{ number_format($performance->Price, 2) }} - @else - - Free! - @endif -

- @if ($performance->Price != '0.00') - @if ($performance->AvailableTickets > 0) - - Buy Tickets! - @else - - @endif - @endif -
-
- @endforeach - - - @php $passesStartOffset = count($eventDay['performances']) * 80 + 40; @endphp - @foreach ($eventDay['passes'] as $index => $pass) -
-
-

- {{ $pass->Note }}
- Price: €{{ number_format($pass->Price, 2) }}
-

- @if($pass->AvailableTickets > 0) - - Buy Jazz Pass! - - @else - - @endif -
-
- @endforeach - +
+ @include('jazz.overview.schedule') + @include('jazz.overview.passes')
- -
-
- @foreach ($eventDay['performances'] as $performance) - @if ($artist = $performance->Artist) - -

- {{ $artist->Name }} -

- {{ $artist->Name }} -
FIND OUT MORE
-
- @endif - @endforeach -
-
- + @include('jazz.overview.artists') + @endforeach @include('main.footer') diff --git a/app/pages/jazz/overview/passes.blade.php b/app/pages/jazz/overview/passes.blade.php new file mode 100644 index 0000000..9ff8c55 --- /dev/null +++ b/app/pages/jazz/overview/passes.blade.php @@ -0,0 +1,20 @@ +@php $passesStartOffset = count($eventDay['performances']) * 80 + 40; @endphp +@foreach ($eventDay['passes'] as $index => $pass) +
+
+

+ {{ $pass->Note }}
+ Price: €{{ number_format($pass->Price, 2) }}
+

+ @if($pass->AvailableTickets > 0) + + Buy Jazz Pass! + + @else + + @endif +
+
+@endforeach \ No newline at end of file diff --git a/app/pages/jazz/overview/schedule.blade.php b/app/pages/jazz/overview/schedule.blade.php new file mode 100644 index 0000000..66402a9 --- /dev/null +++ b/app/pages/jazz/overview/schedule.blade.php @@ -0,0 +1,30 @@ +@foreach ($eventDay['performances'] as $index => $performance) +
+
+

+ {{ $performance->Artist->Name }} +
{{ date('H:i', strtotime($performance->StartDateTime)) }} + - {{ date('H:i', strtotime($performance->EndDateTime)) }} + @if (!empty($performance->Details)) + | {{ $performance->Details }} + @endif + @if ($performance->Price != '0.00') + - € {{ number_format($performance->Price, 2) }} + @else + - Free! + @endif +

+ @if ($performance->Price != '0.00') + @if ($performance->AvailableTickets > 0) + + Buy Tickets! + + @else + + @endif + @endif +
+
+@endforeach diff --git a/app/pages/jazz/overview/venue.blade.php b/app/pages/jazz/overview/venue.blade.php index e69de29..79b7e79 100644 --- a/app/pages/jazz/overview/venue.blade.php +++ b/app/pages/jazz/overview/venue.blade.php @@ -0,0 +1,17 @@ +
+

+ DAY {{ $dayNumber + 1 }} - + {{ date('l, F jS', strtotime($eventDay['day']->Date)) }} 📍 + + {{ $eventDay['day']->Venue->Name }} + + {{ $eventDay['day']->Venue->Name }}
+ {{ $eventDay['day']->Venue->Address }}
+ {{ $eventDay['day']->Venue->ContactDetails }} + @if (!empty($eventDay['day']->Note)) + {{ $eventDay['day']->Note }} + @endif +
+
+

+
\ No newline at end of file diff --git a/app/pages/main/navbar.blade.php b/app/pages/main/navbar.blade.php index f5f592e..de2e5fd 100644 --- a/app/pages/main/navbar.blade.php +++ b/app/pages/main/navbar.blade.php @@ -1,20 +1,27 @@ -