<?php //weighvolution.php require_once 'Business/ChallengeService.php'; require_once 'algemenefuncties.php'; require_once 'debugger.php'; session_start(); if (!isset($_SESSION[redirect_arrayName()]) || $_SESSION[redirect_arrayName()] !== redirect_par()) { header("location:aanmelden.php"); exit(0); } else { $challengeSvc = new ChallengeService(); $service = $challengeSvc->checkChallenge($_SESSION["username"]); if ($service) { $challenge = $challengeSvc->getChallegeby($_SESSION["username"]); $height = 500; $width = 1000; $topG = $challenge->getStartGewicht() + 5; $bottomG = $challenge->getEindGewicht() + 5; $bereik = ($challenge->getStartGewicht() + 5 - ($challenge->getEindGewicht() - 5)) * 10; // var_dump($bereik); $gpRatio = $height / $bereik; $startIdeaalLijn = 0 . "," . round(($topG - $challenge->getStartGewicht()) * 10 * $gpRatio, 0, PHP_ROUND_HALF_UP); // var_dump($startIdeaalLijn); $EindeIdeaalLijn = 1000 . "," . round(($topG - $challenge->getEindGewicht()) * 10 * $gpRatio, 0, PHP_ROUND_HALF_UP); // var_dump($EindeIdeaalLijn); include_once 'Presentation/weighvolutionChart.php'; } else { header("location:challengeAdjust.php"); exit(0); }
//require_once 'Exceptions/InvalidInputException.php'; session_start(); /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ if (isset($_GET["action"]) && $_GET["action"] == "login") { if (isset($_POST["username"]) && isset($_POST["password"])) { unset($_SESSION["msg"]); unset($_SESSION["warningmsg"]); try { $userSvc = new UserService(); $service = $userSvc->checkLogin($_POST["username"], $_POST["password"]); if ($service == "access granted") { $_SESSION[redirect_arrayName()] = redirect_par(); $_SESSION["username"] = $_POST["username"]; header("location:index.php"); exit(0); } } catch (LoginException $ex) { $_SESSION["warningmsg"] = $ex->getMessage(); } } } if (isset($_GET["action"]) && $_GET["action"] == "new") { if (isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["name"]) && isset($_POST["surname"]) && isset($_POST["email"])) { unset($_SESSION["msg"]); unset($_SESSION["warningmsg"]); try { $userSvc = new UserService();