}
     if (!get_course_students($courseID)) {
         error(get_string('theCOurseNowNoStudent6', 'block_report_module'));
     } else {
         if ($course = $DB->get_record('course', array('id' => $courseID))) {
             $userPass = true;
             $timeDifferent = getTimeDifferent($dateform);
             $courseUserLogData = produceUserCourseLog($userID, $courseID, $timeDifferent);
             $courseUserArray[$courseID] = produceCourseUserArray($userID, $courseID, $courseUserLogData, $userPass);
             $userPassArray[$courseID] = $userPass;
         } else {
             error(get_string('pleaseSelectRightCourseName6', 'block_report_module'));
         }
     }
 } else {
     $courses = reportmycoursesdata($userID);
     foreach ($courses as $theCourseID => $theCourseName) {
         if (get_course_students($theCourseID)) {
             //!the course no student
             if ($DB->get_record('reportmodule', array('courseid' => $theCourseID))) {
                 //!the course don't setup stardard
                 if ($courseActionItem = getCourseActionItem($theCourseID)) {
                     //!the course no action
                     $userPass = true;
                     $timeDifferent = getTimeDifferent($dateform);
                     $courseUserLogData = produceUserCourseLog($userID, $theCourseID, $timeDifferent);
                     $courseUserArray[$theCourseID] = produceCourseUserArray($userID, $theCourseID, $courseUserLogData, $userPass);
                     $userPassArray[$theCourseID] = $userPass;
                 }
             }
         }
require_once '../../../config.php';
require_once '../lib/function.php';
httpsrequired();
require_login();
if (isguestuser()) {
    die;
}
//get login user information from user select item
$loginUserid = $USER->id;
if (!($user = $DB->get_record('user', array('id' => $loginUserid)))) {
    echo get_string('noStudentinformation10', 'block_report_module');
    exit;
}
//make function for get content
$courses = reportmycoursesdata($loginUserid);
echo "<form action=\"{$CFG->wwwroot}/blocks/report_module/studenttrack/index.php\" method=\"post\">\n";
echo '<input type="hidden" name="loginuserid" value="' . $loginUserid . '" />';
echo '<table border="1" id="courseClick" cellpadding="3">';
echo '<tr>';
echo '<td>' . get_string('courseCategory10', 'block_report_module') . '</td>';
echo '<td>' . get_string('courseName10', 'block_report_module') . '</td>';
echo '<td>' . get_string('startCourseDate10', 'block_report_module') . '</td>';
echo '<td>' . get_string('viewReport10', 'block_report_module') . '</td>';
echo '</tr>';
foreach ($courses as $courseID => $courseName) {
    if ($course = $DB->get_record('course', array('id' => $courseID))) {
        if ($DB->get_record('reportmodule', array('courseid' => $courseID))) {
            $category = $DB->get_record('course_categories', array('id' => $course->category));
            echo '<tr>';
            echo '<td>' . format_string($category->name) . '</td>';