Skip to content

Commit

Permalink
Final Version
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzaib78631 committed Feb 13, 2020
1 parent 6d39bee commit 4059b49
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 229 deletions.
19 changes: 12 additions & 7 deletions app/controllers/SportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ public function process($params)
$this->head['title'] = 'Sports';
$this->data['alerts'] = "";

$sportsManager = new SportsModel;
if($_SESSION['logged'] == true):

if(isset($_POST['submit'])):
$sport_id = $_POST['fav_sport'];
$this->data['alerts'] = $sportsManager->saveSport($_SESSION['id'], $sport_id);
endif;
$sportsManager = new SportsModel;

if(isset($_POST['submit'])):
$sport_id = $_POST['fav_sport'];
$this->data['alerts'] = $sportsManager->saveSport($_SESSION['id'], $sport_id);
endif;

$this->data['sports'] = $sportsManager->getSports();
$this->data['sports'] = $sportsManager->getSports();
$this->view = 'sports';

$this->view = 'sports';
else:
$this->redirect('login');
endif;
}
}

Expand Down
Loading

0 comments on commit 4059b49

Please sign in to comment.