-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from haarlem-festival-gr2/jazz
Jazz
- Loading branch information
Showing
35 changed files
with
997 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
<?php | ||
|
||
use Core\Route\Route; | ||
use service\JazzService; | ||
|
||
require_once __DIR__.'/../repository/BaseRepository.php'; | ||
require_once __DIR__.'/../service/JazzService.php'; | ||
|
||
Route::serve('/artist', function (array $props) { | ||
Route::render('artist', []); | ||
$artistId = $props['id']; | ||
//var_dump($artistId); | ||
|
||
$jazzService = new JazzService(); | ||
|
||
$artist = $jazzService->getArtistById($artistId); | ||
$albums = $jazzService->getAlbumsByArtistId($artistId); | ||
$songs = $jazzService->getSongsByArtistId($artistId); | ||
$performances = $jazzService->getPerformancesByArtistId($artistId); | ||
//foreach($performances as $performance){ | ||
// $performance->setArtist($artist); | ||
//} | ||
$events = []; | ||
foreach($performances as $performance) { | ||
$venue = $jazzService->getVenueByPerformanceId($performance->getPerformanceID()); | ||
$events[] = [ | ||
'performance' => $performance, | ||
'venue' => $venue | ||
]; | ||
} | ||
|
||
Route::render('jazz.artist', [ | ||
'artist' => $artist, | ||
'albums' => $albums, | ||
'songs' => $songs, | ||
'events' => $events, | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,43 @@ | ||
<?php | ||
|
||
use Core\Route\Route; | ||
use Repository\JazzRepository; | ||
use service\FestivalEventService; | ||
use service\JazzService; | ||
|
||
require_once __DIR__.'/../repository/BaseRepository.php'; | ||
require_once __DIR__.'/../repository/JazzRepository.php'; | ||
require_once __DIR__.'/../model/FestivalEvent.php'; | ||
require_once __DIR__.'/../service/FestivalEventService.php'; | ||
require_once __DIR__.'/../service/JazzService.php'; | ||
|
||
Route::serve('/jazz', function (array $props) { | ||
$repo = new JazzRepository(); | ||
$festivalEventService = new FestivalEventService(); | ||
$jazzService = new JazzService(); | ||
|
||
$festivalEvent = $repo->getFestivalEventByName('Haarlem Jazz'); | ||
$jazzDays = $repo->getAllJazzDays(); | ||
$user = Route::auth(); | ||
|
||
$festivalEvent = $festivalEventService->getFestivalEventByName('Haarlem Jazz'); | ||
$jazzDays = $jazzService->getAllJazzDays(); | ||
|
||
$jazzDaysWithPerformances = []; | ||
|
||
foreach ($jazzDays as $day) { | ||
$performancesForDay = $repo->getPerformancesByJazzDay($day->getDayId()); | ||
$venue = $repo->getVenueById($day->getVenueID()); | ||
$performancesForDay = $jazzService->getPerformancesByJazzDay($day->getDayId()); | ||
$venue = $jazzService->getVenueById($day->getVenueID()); | ||
$jazzPasses = $jazzService->getJazzPassesByDate($day->getDate()); | ||
$jazzDaysWithPerformances[] = [ | ||
'day' => $day, | ||
'venue' => $venue, | ||
'performances' => $performancesForDay, | ||
'passes' => $jazzPasses, | ||
]; | ||
} | ||
|
||
Route::render('jazz', [ | ||
//if (!$user) { | ||
// Route::redirect('/login'); | ||
//} | ||
|
||
Route::render('jazz.jazz', [ | ||
'festivalEvent' => $festivalEvent, | ||
'jazzDaysWithPerformances' => $jazzDaysWithPerformances, | ||
'user' => $user, | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
namespace model; | ||
|
||
|
||
class JazzPass | ||
{ | ||
private int $JazzPassID; | ||
private float $Price; | ||
private string $StartDateTime; | ||
private string $EndDateTime; | ||
private string $Note; | ||
|
||
private int $TotalTickets; | ||
|
||
private int $AvailableTickets; | ||
|
||
public function getJazzPassID(): int | ||
{ | ||
return $this->JazzPassID; | ||
} | ||
|
||
public function setJazzPassID(int $JazzPassID): void | ||
{ | ||
$this->JazzPassID = $JazzPassID; | ||
} | ||
|
||
public function getPrice(): float | ||
{ | ||
return $this->Price; | ||
} | ||
|
||
public function setPrice(float $Price): void | ||
{ | ||
$this->Price = $Price; | ||
} | ||
|
||
public function getStartDateTime(): string | ||
{ | ||
return $this->StartDateTime; | ||
} | ||
|
||
public function setStartDateTime(string $StartDateTime): void | ||
{ | ||
$this->StartDateTime = $StartDateTime; | ||
} | ||
|
||
public function getEndDateTime(): string | ||
{ | ||
return $this->EndDateTime; | ||
} | ||
|
||
public function setEndDateTime(string $EndDateTime): void | ||
{ | ||
$this->EndDateTime = $EndDateTime; | ||
} | ||
|
||
public function getNote(): string | ||
{ | ||
return $this->Note; | ||
} | ||
|
||
public function setNote(string $Note): void | ||
{ | ||
$this->Note = $Note; | ||
} | ||
|
||
public function getAvailableTickets(): int | ||
{ | ||
return $this->AvailableTickets; | ||
} | ||
|
||
public function setAvailableTickets(int $AvailableTickets): void | ||
{ | ||
$this->AvailableTickets = $AvailableTickets; | ||
} | ||
|
||
public function getTotalTickets(): int | ||
{ | ||
return $this->TotalTickets; | ||
} | ||
|
||
public function setTotalTickets(int $TotalTickets): void | ||
{ | ||
$this->TotalTickets = $TotalTickets; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.