+ // Finished validating user input.
+
+ if ($err->no()) {
+
+ $res = false;
+ if ($_POST['btn_hours']){
+
+ // User changed workday hours for team.
+ $hours = (int)$request->getParameter('workdayHours');
+ $res = ttTeamHelper::update($user->team_id, array('name'=>$user->team,'workday_hours'=>$hours));
+ }
+ if ($_POST['btn_submit']){
+ // User pressed the Save button under monthly quotas table.
+ $postedYear = $request->getParameter('year');
+ $selectedYear = intval($postedYear);
+ for ($i = 0; $i < count($months); $i++){
+ $res = $quota->update($postedYear, $i+1, $request->getParameter($months[$i]));
+ }
+ }
+ if ($res) {
+ // header('Location: profile_edit.php');
+ header('Location: quotas.php'); // For debugging.
+ exit();
+ } else {
+ $err->add($i18n->getKey('error.db'));
+ }