public static function refreshSessionCookie()
 {
     if (CookieController::cookieExists("session")) {
         $user = CookieController::readSessionCookie();
         CookieController::setSessionCookie($user);
         return $user;
     }
     return false;
 }
 public static function run()
 {
     if (CookieController::cookieExists("session")) {
         if (($user = CookieController::refreshSessionCookie()) === false) {
             header("Location: home");
         } else {
             ProfileView::show($user);
         }
     } else {
         header("Location: home");
     }
 }
 public static function run()
 {
     if (CookieController::cookieExists("session")) {
         if (($user = CookieController::refreshSessionCookie()) === false) {
             echo "<h1>No User Found</h1><hr/>";
             LogInController::run(null);
         } else {
             DashboardView::show($user);
         }
     } else {
         LandingView::show(null);
     }
 }
 public static function run()
 {
     if (CookieController::cookieExists("session")) {
         if (($user = CookieController::readSessionCookie()) === false) {
             header("Location: home");
         } else {
             $maps = MapDatabase::getAllUserMaps($user->getID());
             MyTripsView::show($maps);
         }
     } else {
         header("Location: home");
     }
 }
 public static function run($map)
 {
     if (CookieController::cookieExists("session")) {
         if (($user = CookieController::readSessionCookie()) !== false) {
             $map;
             if ($_SERVER["REQUEST_METHOD"] == "POST") {
                 $mapID = "";
                 $mapName = "";
                 $latLng = "";
                 if (isset($_POST["map-id"])) {
                     $mapID = $_POST["map-id"];
                 }
                 if (isset($_POST["map-name"])) {
                     $mapName = $_POST["map-name"];
                 }
                 if (isset($_POST["lat-lng"])) {
                     $latLng = $_POST["lat-lng"];
                 }
                 $map = new Map($mapID, $mapName, $latLng);
                 if (empty($mapID)) {
                     MapDatabase::addMap($map, $user->getID());
                 } else {
                     MapDatabase::updateMap($map);
                 }
                 MapView::show($map);
             } else {
                 if (isset($_GET["selection"])) {
                     $mapID = $_GET["selection"];
                     $map = MapDatabase::getMap($mapID);
                 }
                 MapView::show($map);
             }
         } else {
             header("Location: home");
         }
     } else {
         header("Location: home");
     }
 }