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/main.blade.php b/app/pages/jazz/artist/main.blade.php index 95655ce..d04c6eb 100644 --- a/app/pages/jazz/artist/main.blade.php +++ b/app/pages/jazz/artist/main.blade.php @@ -34,14 +34,14 @@
-
- {{ $artist->Name }} +
+ {{ $artist->Name }}
-
- {{ $artist->Name }} +
+ {{ $artist->Name }}
diff --git a/app/pages/jazz/artist/performances.blade.php b/app/pages/jazz/artist/performances.blade.php index 701f126..4490182 100644 --- a/app/pages/jazz/artist/performances.blade.php +++ b/app/pages/jazz/artist/performances.blade.php @@ -19,7 +19,7 @@ @if ($performance->Price != '0.00')
@if ($performance->AvailableTickets > 0) - + Buy Tickets! @else