本文整理汇总了PHP中GradebookUtils::get_list_gradebook_certificates_by_user_id方法的典型用法代码示例。如果您正苦于以下问题:PHP GradebookUtils::get_list_gradebook_certificates_by_user_id方法的具体用法?PHP GradebookUtils::get_list_gradebook_certificates_by_user_id怎么用?PHP GradebookUtils::get_list_gradebook_certificates_by_user_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GradebookUtils
的用法示例。
在下文中一共展示了GradebookUtils::get_list_gradebook_certificates_by_user_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
Header::location($selfUrl);
}
$sessionList = SessionManager::getSessionsFollowedByUser($selectedStudent);
foreach ($sessionList as $session) {
$sessionCourseList = SessionManager::get_course_list_by_session_id($session['id']);
foreach ($sessionCourseList as $sessionCourse) {
$gradebookCategories = Category::load(null, null, $sessionCourse['code'], null, false, $session['id']);
$gradebook = null;
if (!empty($gradebookCategories)) {
$gradebook = current($gradebookCategories);
}
if (!is_null($gradebook)) {
$sessionName = $session['name'];
$courseName = $sessionCourse['title'];
$certificateStudent = ['fullName' => $selectedStudentInfo['complete_name'], 'sessionName' => $sessionName, 'courseName' => $courseName, 'certificates' => []];
$studentCertificates = GradebookUtils::get_list_gradebook_certificates_by_user_id($selectedStudent, $gradebook->get_id());
if (!is_array($studentCertificates) || empty($studentCertificates)) {
continue;
}
foreach ($studentCertificates as $certificate) {
$certificateStudent['certificates'][] = array('createdAt' => api_convert_and_format_date($certificate['created_at']), 'id' => $certificate['id']);
}
if (count($certificateStudent['certificates']) > 0) {
$certificateStudents[] = $certificateStudent;
}
}
}
}
}
/* View */
$template = new Template(get_lang('GradebookListOfStudentsCertificates'));
示例2: api_get_self
$url = api_get_self() . '?action=export_all_certificates' . '&' . api_get_cidReq() . '&cat_id=' . $cat_id . '&filter=' . $filterOfficialCode;
echo Display::url(get_lang('ExportAllCertificatesToPDF'), $url, array('class' => 'btn btn-default'));
}
echo '</div>';
echo $filterForm;
if (count($certificate_list) == 0) {
echo Display::display_warning_message(get_lang('NoResultsAvailable'));
} else {
echo '<br /><br /><table class="data_table">';
foreach ($certificate_list as $index => $value) {
echo '<tr>
<td width="100%" class="actions">' . get_lang('Student') . ' : ' . api_get_person_name($value['firstname'], $value['lastname']) . ' (' . $value['username'] . ')</td>';
echo '</tr>';
echo '<tr><td>
<table class="data_table">';
$list_certificate = GradebookUtils::get_list_gradebook_certificates_by_user_id($value['user_id'], $cat_id);
foreach ($list_certificate as $value_certificate) {
echo '<tr>';
echo '<td width="50%">' . get_lang('Score') . ' : ' . $value_certificate['score_certificate'] . '</td>';
echo '<td width="30%">' . get_lang('Date') . ' : ' . api_convert_and_format_date($value_certificate['created_at']) . '</td>';
echo '<td width="20%">';
$url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $value_certificate['id'];
$certificates = Display::url(get_lang('Certificate'), $url, array('target' => '_blank', 'class' => 'btn btn-default'));
echo $certificates;
echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token=' . $token . '&cidReq=' . $course_code . '&action=delete&cat_id=' . $cat_id . '&certificate_id=' . $value_certificate['id'] . '">
' . Display::return_icon('delete.png', get_lang('Delete')) . '
</a>';
echo '</td></tr>';
}
echo '</table>';
echo '</td></tr>';
示例3: deleteAllCertificates
/**
* @param int $catId
*/
public static function deleteAllCertificates($catId)
{
$certificate_list = GradebookUtils::get_list_users_certificates($catId);
if (!empty($certificate_list)) {
foreach ($certificate_list as $index => $value) {
$list_certificate = GradebookUtils::get_list_gradebook_certificates_by_user_id($value['user_id'], $catId);
foreach ($list_certificate as $value_certificate) {
$certificate_obj = new Certificate($value_certificate['id']);
$certificate_obj->delete(true);
}
}
}
}