diff --git a/app/lib/App/Teamtable/Team.php b/app/lib/App/Teamtable/Team.php index 540f3b6..077bd8c 100644 --- a/app/lib/App/Teamtable/Team.php +++ b/app/lib/App/Teamtable/Team.php @@ -14,7 +14,7 @@ class Team public string $company = 'NN'; public string $cardnumber = 'NN'; public string $leader = 'NN'; - public int $phone = 0; + public string $phone = 'NN'; public int $participants = 0; public int $rounds = 0; public ?int $bestTime = NULL; @@ -79,9 +79,9 @@ class Team return $this; } - public function setPhone(int $phone): Self + public function setPhone(string $phone): Self { - if ($this->longerThan((string)$phone, 32)) + if ($this->longerThan($phone, 20)) { throw new InvalidArgumentException("Phone number is too long!"); } @@ -91,9 +91,9 @@ class Team public function setParticipants(int $participants): Self { - if ($this->longerThan((string)$participants, 32)) + if ($participants > 9999) { - throw new InvalidArgumentException("Participants is too long!"); + throw new InvalidArgumentException("Too many participants!"); } $this->participants = $participants; return $this; @@ -101,9 +101,9 @@ class Team public function setRounds(int $rounds): Self { - if ($this->longerThan((string)$rounds, 32)) + if ($rounds > 9999) { - throw new InvalidArgumentException("Rounds is too long!"); + throw new InvalidArgumentException("Too many rounds!"); } $this->rounds = $rounds; return $this; diff --git a/app/view/pages/race/configure/teams/update.php b/app/view/pages/race/configure/teams/update.php index d70d6c3..310b5ad 100644 --- a/app/view/pages/race/configure/teams/update.php +++ b/app/view/pages/race/configure/teams/update.php @@ -28,13 +28,13 @@
- +

- +

diff --git a/public/race/configure/teams/update.php b/public/race/configure/teams/update.php index b7565dc..0419b71 100644 --- a/public/race/configure/teams/update.php +++ b/public/race/configure/teams/update.php @@ -28,8 +28,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') $company = filter_input(INPUT_POST, 'company'); $cardnumber = filter_input(INPUT_POST, 'cardnumber'); $leader = filter_input(INPUT_POST, 'leader'); - $phone = filter_input(INPUT_POST, 'phone', FILTER_VALIDATE_INT); - $participants = filter_input(INPUT_POST, 'participants', FILTER_VALIDATE_INT); + $phone = filter_input(INPUT_POST, 'phone'); + $participants = (int)filter_input(INPUT_POST, 'participants'); if (!isset($team)) {