<?php include_once "include/greetingHeader.php"; include_once "services/BugServices.php"; include_once "services/UserServices.php"; include_once "services/StatusServices.php"; include_once "models/Bug.php"; $bug_id = $_REQUEST['id']; $bug_access_object = new BugServices(); $bug = $bug_access_object->getBugById($bug_id); $user_access_object = new UserServices(); $users = $user_access_object->getAllUsers(); $status_access_object = new StatusServices(); $statuses = $status_access_object->getAllStatus(); ?> <?php if (isset($_POST['editBug'])) { $title = $_POST['title']; $description = $_POST['description']; $status = $_POST['status']; $user_id = $_POST['user']; if ($title == '') { $title = $bug->getTitle(); } if ($description == '') { $description = $bug->getDescription(); } if ($status == $bug->getStatus()->getNumber() || $status == 99) { $status = $bug->getStatus()->getNumber(); }
<?php include_once "services/BugServices.php"; include_once "include/functions.php"; $bug_id = $_REQUEST['id']; $bug_access_object = new BugServices(); $bug_access_object->deleteBugById($bug_id); redirect_to("bugPage.php");
public function getUserBugs() { $bug_access_object = new BugServices(); return $this->bugs = $bug_access_object->getBugsWhere(array("user_id" => $this->id)); }
<?php include_once "include/greetingHeader.php"; include_once "dao/BugDao.php"; include_once "dao/UserDao.php"; include_once "services/UserServices.php"; include_once "services/BugServices.php"; $user_access_object = new UserServices(); $user = $user_access_object->getUserById($_SESSION['SESS_USER_ID']); $bug_access_object = new BugServices(); ?> <?php if (isset($_POST['submitBug'])) { $title = $_POST['title']; $description = $_POST['description']; //Input Validations if ($title == '' || $description == '') { echo '<div class="ui error message" style="margin-top: 5%"><div class="header">ERROR</div> Title and/or description field(s) missing input.</div>'; } else { $bug = new Bug($title, $description, $user, new Status(null, "OPEN", 1)); $bug_access_object->insertNewBug($bug); echo '<div class="ui success message" style="margin-top: 5%"><div class="header">SUCCESS</div> Bug has been stored.</div>'; } } ?> <div class="ui one column relaxed grid" style="margin-top: 3%;"> <div class="column"> <div class="ui fluid form segment"> <div class="two fields"> <div class="field">