Example #1
0
		
			<?php 
if (empty($notes)) {
    echo "No notes found for this course.";
} else {
    $note_limit = 12;
    // 12 notes per page
    $note_count = count($notes);
    if (isset($_GET['page'])) {
        $page = $_GET['page'] + 1;
        $offset = $note_limit * $page;
    } else {
        $page = 0;
        $offset = 0;
    }
    $current_notes = Database::getNotesByCourseLimited($searchId, $offset, $note_limit);
    if (empty($current_notes)) {
        echo "No notes found for this page.";
    }
    foreach ($current_notes as $note) {
        ?>
				<div class="float"><a href="download.php?id=<?php 
        echo $note['id'];
        ?>
"><img src="images/pdf.png" alt="" height="150" width=auto></a>
				<?php 
        //if the current user can delete notes files then add a delete link to every notes icon
        if ($account !== NULL && $account->canDelete()) {
            ?>
				<div title='Remove File' class="topleft" onclick='removeNote( <?php 
            echo $note['id'];