$eventdata->userto = $email->id;
            //con id
            $send = message_send($eventdata);
        }
        if ($send) {
            echo '<div class="alert alert-info">' . get_string('alertsessioneliminated', 'local_attendance') . '</div>';
            echo '<div class="alert alert-success">' . get_string('emailsent', 'local_attendance') . '</div>';
        }
    }
    $action = 'view_by_session';
}
if ($action == 'view_by_session') {
    $title = $courseName->fullname . ' - ' . get_string('attendancerecord', 'local_attendance');
    echo $OUTPUT->heading($title);
    echo '<br>';
    $table = tables::getAssistByDate($courseid);
    echo html_writer::table($table);
    $back = new moodle_url('/course/view.php?id=' . $courseid);
    echo $OUTPUT->single_button($back, get_string('back', 'local_attendance'));
}
if ($action == 'modify_session_attendance') {
    $sessionid = required_param('sessionid', PARAM_INT);
    $sessionName = $DB->get_record('local_attendance_session', array('id' => $sessionid));
    $subject = get_string('attendancemodified', 'local_attendance');
    $subjectTosend = $courseName->shortname . ': ' . $subject;
    $actionsForm = new actionsForSession();
    if ($fromform = $actionsForm->get_data()) {
        $table = new html_table();
        $table->head = array(get_string('lastname', 'local_attendance'), get_string('firstname', 'local_attendance'), get_string('changes', 'local_attendance'), get_string('report', 'local_attendance'));
        $sessiondate = $DB->get_record('local_attendance_session', array('id' => $fromform->sessionid));
        $name = empty($sessiondate->comment) || is_null($sessiondate->comment) ? get_string('noname', 'local_attendance') : $sessiondate->comment;