Ejemplo n.º 1
0
navbar();
?>
	
    <div class="container" role="main">
	    
    <h1 align="center" class="home-greeting-text"> <?php 
echo date('l jS M Y');
?>
</h1>
    
    <p class="lead">You have <?php 
echo TaskList::getAllOutstandingCount(Authentication::get_user());
?>
 tasks outstanding.</p>
    
    <h2>Your Timetable</h2>
	<?php 
print_timetable_by_week(Authentication::get_user(), $week_block);
?>
	    
	</div>
	
	
	<?php 
foot();
?>
  </body>
</html>


Ejemplo n.º 2
0
require 'config.php';
Authentication::require_login();
include DIR_LIB . 'helpers/ui.php';
include DIR_LIB . 'helpers/timetable.php';
$viewing_by_day = false;
$viewing_date = false;
if (isset($_GET['view'])) {
    if ($_GET['view'] == "day") {
        $viewing_by_day = true;
    }
}
if (isset($_GET['date'])) {
    $viewing_date = true;
}
$currentuser_id = Authentication::get_user();
function getWeekBlockbyDate($date)
{
    $blockdate = date('Y-m-d', strtotime('last Monday', strtotime(TIMETABLE_WEEK_BLOCK_BEGIN_DATE)));
    $week_block = 1;
    while (strtotime($date) > strtotime($blockdate)) {
        if ($week_block == 0) {
            $week_block = 1;
        } else {
            $week_block = 0;
        }
        $blockdate = date('Y-m-d', strtotime('+1 week', strtotime($blockdate)));
    }
    return $week_block;
}
$week_block = getWeekBlockByDate(date('Y-m-d'));
Ejemplo n.º 3
0
                echo date('H:i', strtotime($event->getRemindMeTime()));
            } else {
                echo $event->getRemindMeTime();
            }
            echo '&nbsp;';
        }
        echo '<i class="fa fa-clock-o"></i> ';
        if ($event->getAllDay() == '1') {
            echo "all day";
        } else {
            echo $start_time . '-' . $end_time;
        }
        echo '</small>';
        echo '&nbsp;<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 '&nbsp;<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>';
}
?>
     
	
	
Ejemplo n.º 4
0
	<?php 
?>
	
	<div class="modal" id="newTTLessonDlg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="taskEditDlgTitle">Are you sure?</h4>
				</div>
				<form method="POST" action="del_lesson.php">
				<?php 
$periods_st = TimetablePeriod::get($where = array('number' => $_POST['period'], 'weekday' => $_POST['weekday']));
$pds_nd = TimetablePeriod::get($where = array('number' => $_POST['period'], 'weekday' => '0'));
$periods = array_merge($periods_st, $pds_nd);
$allocs = TimetablePeriodAllocation::get($where = array('attendinguser_id' => Authentication::get_user()));
$actual_lesson = 0;
foreach (TimetableLesson::get($where = array('weekday' => $_POST['weekday'], 'week_block' => $_POST['week_block'])) as $lesson) {
    foreach ($periods as $period) {
        if ($period->getId() == $lesson->getPeriodId()) {
            foreach ($allocs as $alloc) {
                if ($alloc->getLessonId() == $lesson->getId()) {
                    echo '<input type="hidden" name="alloc_id" value="' . $alloc->getId() . '" />';
                    $actual_lesson = $lesson;
                    break;
                }
            }
        }
        if ($actual_lesson != 0) {
            break;
        }
Ejemplo n.º 5
0
navbar(2);
?>
	
    <div class="container" role="main">
        <div class="page-header">
        <h1><span class="glyphicon glyphicon-ok"></span>&nbsp;Tasks <small><?php 
$conditions = array('user_id' => Authentication::get_user());
$viewing_single = false;
if (isset($_GET['list'])) {
    if (ctype_digit($_GET['list'])) {
        $conditions['id'] = $_GET['list'];
        $viewing_single = true;
        echo 'single view';
    }
} else {
    echo TaskList::getAllOutstandingCount(Authentication::get_user()) . ' outstanding';
}
?>
</small></h1>
        </div>
        
        <?php 
if ($viewing_single) {
    ?>
	        	<a class="btn btn-info" href="/tasks.php<?php 
    if (isset($_GET['show_complete'])) {
        echo '?show_complete';
    }
    ?>
" role="button"><i class="fa fa-hand-o-left"></i>&nbsp;Return</a>
	        	
Ejemplo n.º 6
0
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>&nbsp;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>&nbsp;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>&nbsp;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>&nbsp;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>&nbsp;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>&nbsp;Log out <?php 
    echo Authentication::getUserObject()->getUsername();
    ?>
</a></li>
				</ul>
			</div>
		</div>
	</nav>    
    
        
        <?php 
}
Ejemplo n.º 7
0
<?php

session_start();
require 'config.php';
if (Authentication::get_user() != -1) {
    // send user to the dashboard
    header("Location: //" . APP_ROOT_URL);
    die;
} else {
    if (isset($_POST['username'])) {
        try {
            $user = new User();
            $user->setUsername($_POST['username']);
            $user->setForename($_POST['firstname']);
            $user->setSurname($_POST['surname']);
            $user->setEmail($_POST['email']);
            $user->setPassword($_POST['password']);
            $user->setGroupId(1);
            $user->save();
        } catch (Exception $e) {
            die($e->getMessage());
        }
        header("Location: //" . APP_ROOT_URL);
        die;
    }
}
?>

<!DOCTYPE html>
<html lang="en">
  <head>