<?php require_once './app/models/userMod.php'; $uMod = new usersModel(); if (isset($_POST['fname'])) { $uMod->register($_POST['fname'], $_POST['lname'], $_POST['uname'], $_POST['pass'], $_POST['email'], $_POST['terms']); } elseif (isset($_GET['password'])) { $uMod->login($_GET['username'], $_GET['password']); } elseif (isset($_FILES['userfile'])) { $imageUp = $uMod->upload($_SESSION['userId'], $_SESSION['username'], $_FILES['userfile'], $_POST['title'], $_POST['description']); $images = $uMod->getImgs($_SESSION['userId']); header("Location: ./"); } elseif (isset($_GET['logout'])) { session_destroy(); header("Location: ./"); } elseif (isset($_SESSION['userId']) && !isset($_GET['photostream']) && !isset($_GET['upload'])) { $images = $uMod->getImgs($_SESSION['userId']); require_once 'app/views/photostream.php'; } elseif (isset($_SESSION['userId']) && isset($_GET['photostream'])) { $images = $uMod->getImgs($_SESSION['userId']); require_once 'app/views/photostream.php'; } elseif (isset($_SESSION['userId']) && isset($_GET['upload'])) { require_once 'app/views/upload.php'; }
<?php require_once 'models/userMod.php'; $uMod = new usersModel(); if (isset($_GET['yaPass'])) { $uMod->login($_GET['yaName'], $_GET['yaPass']); } elseif (isset($_GET['userId'])) { $clients = $uMod->getClients(); require_once 'views/userpage.php'; } elseif (isset($_GET['delClient'])) { $uMod->deleteClient($_GET['delClient']); header('Location: ./'); } elseif (isset($_GET['update'])) { $uMod->update($_GET['id'], $_GET['title'], $_GET['message']); header('Location: ./?clientId=' . $clientId); } elseif (isset($_GET['delete'])) { $uMod->delete($_GET['id']); header('Location: ./?clientId=' . $_GET['clientId']); } elseif (isset($_GET['title'])) { $uMod->insert($_GET['clientId'], $_GET['title'], $_GET['message']); header('Location: ./?clientId=' . $_GET['clientId']); } elseif (isset($_GET['signout'])) { session_destroy(); header('Location: index.php'); } elseif (isset($_GET['newClient'])) { $uMod->newClient($_GET['newClient']); header('Location: index.php'); } elseif (isset($_GET['clientId'])) { $messages = $uMod->getMsgs($_GET['clientId']); require_once 'views/msgview.php'; } elseif (isset($_SESSION['userId'])) {