Ejemplo n.º 1
0
            if (!empty($id_attach)) {
                delete_attachment_file($id_attach);
            }
            display_agenda_items();
            break;
    }
}
// this is for students and whenever the courseaministrator has not chosen any action. It is in fact the default behaviour
if (!$_GET['action'] or $_GET['action'] == "showall" or $_GET['action'] == "showcurrent" or $_GET['action'] == "view") {
    if ($_GET['origin'] != 'learnpath') {
        if (!$_SESSION['view'] or $_SESSION['view'] != 'month') {
            if (!empty($_GET['agenda_id'])) {
                display_one_agenda_item((int) $_GET['agenda_id']);
            } else {
                display_agenda_items();
            }
        } else {
            display_monthcalendar($select_month, $select_year);
        }
    } else {
        display_one_agenda_item((int) $_GET['agenda_id']);
    }
}
echo "&nbsp;</td></tr></table>";
/*
		FOOTER
*/
// The footer is displayed only if we are not in the learnpath
if ($_GET['origin'] != 'learnpath') {
    Display::display_footer();
}
Ejemplo n.º 2
0
$year = '';
$month = '';
$today = getdate();
if (isset($_GET['year'])) {
    $year = intval($_GET['year']);
} else {
    $year = $today['year'];
}
if (isset($_GET['month'])) {
    $month = intval($_GET['month']);
} else {
    $month = $today['mon'];
}
$agendaitems = get_agendaitems($month, $year);
$monthName = $langMonthNames['long'][$month - 1];
display_monthcalendar($agendaitems, $month, $year, $langDay_of_weekNames['long'], $monthName, $langToday);
/*
 * @brief getagenda items
 *
 * @param resource $query MySQL resource
 * @param string $month
 * @param string $year
 * @return array of agenda items
 */
function get_agendaitems($month, $year)
{
    global $urlServer, $uid;
    if ($month < 10) {
        $month = '0' . $month;
    }
    $query = Database::get()->queryArray("SELECT course.code k, course.public_code fc,\n                                course.title i, course.prof_names t, course.id id\n                            FROM course, course_user, course_module\n                            WHERE course.id = course_user.course_id\n                            AND course.visible != " . COURSE_INACTIVE . "\n                            AND course_user.user_id = {$uid}\n                            AND course_module.module_id  = " . MODULE_ID_AGENDA . "\n                            AND course_module.visible = 1\n                            AND course_module.course_id = course.id");