示例#1
0
                if ($announce->module_auto_id) {
                    if ($announce->module_auto_id == 1) {
                        $tool_content .= $langExercise;
                    } elseif ($announce->module_auto_id == 2) {
                        $tool_content .= $langAssignment;
                    }
                    if ($announce->auto) {
                        $tool_content .= "<br>({$langAttendanceInsAut})";
                    } else {
                        $tool_content .= "<br>({$langAttendanceInsMan})";
                    }
                } else {
                    $tool_content .= $langAttendanceActivity;
                }
                $tool_content .= "</td>";
                $tool_content .= "<td>" . userAttendTotalActivityStats($announce->id, $participantsNumber) . "</td>";
                $tool_content .= "<td class='text-center option-btn-cell'>" . action_button(array(array('title' => $langDelete, 'icon' => 'fa-times', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;delete={$announce->id}", 'confirm' => $langConfirmDelete, 'class' => 'delete'), array('title' => $langAttendanceBook, 'icon' => 'fa-plus', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;ins={$announce->id}"), array('title' => $langModify, 'icon' => 'fa-edit', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;modify={$announce->id}"))) . "</td></tr>";
            }
            // end of while
            $tool_content .= "</table></div></div></div>";
        } else {
            $tool_content .= "<div class='alert alert-warning'>{$langAttendanceNoActMessage1} <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;addActivity=1'>{$langHere}</a> {$langAttendanceNoActMessage3}</div>";
        }
    }
} else {
    //============Student View==================
    $pageName = $langAttendance;
    $userID = $uid;
    $result = Database::get()->queryArray("SELECT * FROM attendance_activities  WHERE attendance_id = ?d  ORDER BY `DATE` DESC", $attendance_id);
    $announcementNumber = count($result);
    if ($announcementNumber > 0) {
示例#2
0
/**
 * @brief display attendance activities
 * @global type $tool_content
 * @global type $course_code
 * @global type $langAttendanceActList
 * @global type $langTitle
 * @global type $langType
 * @global type $langAttendanceActivityDate
 * @global type $langAttendanceAbsences
 * @global type $langAttendanceNoTitle
 * @global type $langExercise
 * @global type $langAssignment
 * @global type $langAttendanceInsAut
 * @global type $langAttendanceInsMan
 * @global type $langDelete
 * @global type $langEditChange
 * @global type $langConfirmDelete
 * @global type $langAttendanceNoActMessage1
 * @global type $langAttendanceActivity
 * @global type $langHere
 * @global type $langAttendanceNoActMessage3
 * @global type $langToA
 * @global type $langcsvenc1
 * @global type $langcsvenc2
 * @global type $langConfig
 * @global type $langUsers
 * @global type $langGradebookAddActivity
 * @global type $langInsertWorkCap
 * @global type $langInsertExerciseCap
 * @global type $langAdd
 * @global type $langExport
 * @param type $attendance_id
 */
function display_attendance_activities($attendance_id) {
    
    global $tool_content, $course_code, $attendance,
           $langAttendanceActList, $langTitle, $langType, $langAttendanceActivityDate, $langAttendanceAbsences,
           $langGradebookNoTitle, $langExercise, $langAssignment,$langAttendanceInsAut, $langAttendanceInsMan,
           $langDelete, $langEditChange, $langConfirmDelete, $langAttendanceNoActMessage1, $langAttendanceActivity,
           $langHere, $langAttendanceNoActMessage3, $langToA, $langcsvenc1, $langcsvenc2,
           $langConfig, $langStudents, $langGradebookAddActivity, $langInsertWorkCap, $langInsertExerciseCap,
           $langAdd, $langExport, $langBack, $langNoRegStudent;
    
   
    $tool_content .= action_bar(
            array(
                array('title' => $langAdd,                 
                      'level' => 'primary-label', 
                      'options' => array(
                          array('title' => $langGradebookAddActivity,
                                'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;addActivity=1",
                                'icon' => 'fa fa-plus space-after-icon',
                                'class' => ''),
                          array('title' => "$langInsertWorkCap",
                                'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;addActivityAs=1",
                                'icon' => 'fa fa-flask space-after-icon',
                                'class' => ''),
                          array('title' => "$langInsertExerciseCap",
                                'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;addActivityEx=1",
                                'icon' => 'fa fa-edit space-after-icon',
                                'class' => '')),
                     'icon' => 'fa-plus'),
                array('title' => $langStudents,
                      'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;attendanceBook=1",
                      'level' => 'primary-label',
                      'icon' => 'fa-users'),                
                array('title' => $langBack,
                  'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code",
                  'icon' => 'fa-reply',
                  'level' => 'primary-label'),
                array('title' => $langConfig,
                      'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;editSettings=1",
                      'icon' => 'fa-cog'),
                array('title' => "$langExport $langToA $langcsvenc1",
                        'url' => "dumpattendancebook.php?course=$course_code&amp;attendance_id=$attendance_id&amp;enc=1253",
                    'icon' => 'fa-file-excel-o'),
                array('title' => "$langExport $langToA $langcsvenc2",
                        'url' => "dumpattendancebook.php?course=$course_code&amp;attendance_id=$attendance_id",                                              
                        'icon' => 'fa-file-excel-o'),                
            ),
            true
        );
    
        
    $participantsNumber = Database::get()->querySingle("SELECT COUNT(id) AS count 
                                            FROM attendance_users WHERE attendance_id=?d ", $attendance_id)->count;
    if ($participantsNumber == 0) {
        $tool_content .= "<div class='alert alert-warning'>$langNoRegStudent <a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=" . $attendance->id . "&amp;editUsers=1'>$langHere</a>.</div>";
    }
    //get all the available activities
    $result = Database::get()->queryArray("SELECT * FROM attendance_activities WHERE attendance_id = ?d  ORDER BY `DATE` DESC", $attendance_id);  
    if (count($result) > 0) {
        $tool_content .= "<div class='row'><div class='col-sm-12'><div class='table-responsive'>
                        <table class='table-default'>
                        <tr class='list-header'><th class='text-center' colspan='5'>$langAttendanceActList</th></tr>
                        <tr class='list-header'>                            
                            <th>$langTitle</th>
                            <th>$langAttendanceActivityDate</th>
                            <th>$langType</th>
                            <th>$langStudents</th>
                            <th class='text-center'><i class='fa fa-cogs'></i></th>
                        </tr>";
        foreach ($result as $details) {            
            $content = ellipsize_html($details->description, 50);            
            $tool_content .= "<tr><td>";
             if (empty($details->title)) {
                $tool_content .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;ins=" . getIndirectReference($details->id). "'>$langGradebookNoTitle</a>";
            } else {
                $tool_content .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;ins=" . getIndirectReference($details->id) . "'>".q($details->title)."</a>";
            }
            $tool_content .= "</td>
                    <td>" . nice_format($details->date, true, true) . "</td>";
            $tool_content .= "<td>";
            
            if($details->module_auto_id) {
                if($details->module_auto_type == GRADEBOOK_ACTIVITY_EXERCISE) {
                        $tool_content .= $langExercise;
                } elseif($details->module_auto_type == GRADEBOOK_ACTIVITY_ASSIGNMENT) {
                        $tool_content .= $langAssignment;
                }
                if($details->auto) {
                    $tool_content .= "<small class='help-block'>($langAttendanceInsAut)</small>";
                } else {
                    $tool_content .= "<small class='help-block'>($langAttendanceInsMan)</small>";
                }                 
            } else {
                $tool_content .= $langAttendanceActivity;
            }                        
            $tool_content .= "</td>";
            $tool_content .= "<td>" . userAttendTotalActivityStats($details->id, $participantsNumber, $attendance_id) . "</td>";
            $tool_content .= "<td class='text-center option-btn-cell'>".                        
                    action_button(array(
                                array('title' => $langEditChange,
                                    'icon' => 'fa-edit',
                                    'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;attendance_id=$attendance_id&amp;modify=" . getIndirectReference($details->id)
                                    ),                            
                                array('title' => $langDelete,
                                    'icon' => 'fa-times',
                                    'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;&amp;attendance_id=$attendance_id&amp;delete=" .getIndirectReference($details->id),
                                    'confirm' => $langConfirmDelete,
                                    'class' => 'delete'))).
                    "</td></tr>";
        } // end of while
        $tool_content .= "</table></div></div></div>";
    } else {
        $tool_content .= "<div class='alert alert-warning'>$langAttendanceNoActMessage1 $langAttendanceNoActMessage3</div>";
    }
}