echo date('H:i', strtotime($event->getRemindMeTime())); } else { echo $event->getRemindMeTime(); } echo ' '; } echo '<i class="fa fa-clock-o"></i> '; if ($event->getAllDay() == '1') { echo "all day"; } else { echo $start_time . '-' . $end_time; } echo '</small>'; echo ' <i class="fa fa-info-circle"></i> '; echo $event->getDescription() . ' <small><a href="/edit_evt.php?id=' . $event->getId() . '">edit</a>'; if ($event->getUserId() == Authentication::get_user() || PermissionMgr::groupHasPermission(Authentication::getUserObject()->getGroupId(), 'is_administrator')) { echo ' <a href="#" onclick="deleteEvt(' . $event->getId() . ', \'' . htmlspecialchars($event->getDescription()) . '\')">delete</a>'; } echo '</small></h5>'; $number += 1; } if ($number == 0) { echo '<i>No events on this date.</i>'; } $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); echo '<hr>'; } ?>
function navbar($active = 0) { ?> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#dk-nav-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand" href="#">Planner</span> </div> <div class="collapse navbar-collapse menu-text" id="dk-nav-collapse"> <ul class="nav navbar-nav"> <li <?php if ($active == 0) { ?> class="active"<?php } ?> ><a href="<?php if ($active == 0) { ?> #<?php } else { ?> index.php<?php } ?> "><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home <!--<span class="sr-only">(current)</span>--></a></li> <li <?php if ($active == 1) { ?> class="active"<?php } ?> ><a href="<?php if ($active == 1) { ?> #<?php } else { ?> timetable.php<?php } ?> "><span class="fa fa-table" aria-hidden="true"></span> Timetable</a></li> <li <?php if ($active == 2) { ?> class="active"<?php } ?> ><a href="<?php if ($active == 2) { ?> #<?php } else { ?> tasks.php<?php } ?> "><span class="fa fa-check" aria-hidden="true"></span> Tasks <span class="badge"><?php echo TaskList::getAllOutstandingCount(Authentication::get_user()); ?> </span></a></li> <li <?php if ($active == 4) { ?> class="active"<?php } ?> ><a href="<?php if ($active == 4) { ?> #<?php } else { ?> calendar.php<?php } ?> "><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> Calendar</a></li> <li <?php if ($active == 3) { ?> class="active"<?php } ?> ><a href="<?php if ($active == 3) { ?> #<?php } else { ?> profile.php<?php } ?> "><span class="glyphicon glyphicon-user" aria-hidden="true"></span> You</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="/<?php echo APP_LOGOUT_LOC; ?> "><i class="fa fa-sign-out"></i> Log out <?php echo Authentication::getUserObject()->getUsername(); ?> </a></li> </ul> </div> </div> </nav> <?php }
echo json_encode(array('status' => 'error', 'reason' => 'Task description not supplied.')); } } else { if ($_POST['action'] == "new_list") { if (isset($_POST['name'])) { if (empty(trim($_POST['name']))) { echo json_encode(array('status' => 'validation', 'reason' => 'Your task list name is empty!')); die; } /*if (strlen($_POST['name']) > 32) { echo json_encode(array('status'=>'validation', 'reason' => 'Your task list name is too long!')); die(); }*/ $tasklist = new TaskList(); $tasklist->setUserId(Authentication::getUserObject()->getId()); $tasklist->setName($_POST['name']); $tasklist->setIcon($_POST['icon']); $tasklist->save(); echo json_encode(array('status' => 'success', 'tasklist-id' => $tasklist->getId())); } else { echo json_encode(array('status' => 'error', 'reason' => 'List name not supplied.')); } } else { if ($_POST['action'] == "delete_list") { if (isset($_POST['id'])) { $list = TaskList::get($where = array('id' => $_POST['id']))[0]; foreach (Task::get($where = array('list_id' => $list->getId())) as $task) { $task->delete(); } $list->delete();
<!DOCTYPE html> <html lang="en"> <?php require 'config.php'; include DIR_LIB . 'helpers/ui.php'; Authentication::require_login(); ?> <head> <?php head(); $user = Authentication::getUserObject(); ?> </head> <body> <?php navbar(3); ?> <div class="container" role="main"> <div class="page-header"> <h1><span class="glyphicon glyphicon-user"></span> <?php echo htmlspecialchars($user->getUsername()); ?> <small><?php $group = PermGroup::get($where = array('id' => $user->getGroupId()))[0];