本文整理汇总了PHP中GradebookUtils::get_list_users_certificates方法的典型用法代码示例。如果您正苦于以下问题:PHP GradebookUtils::get_list_users_certificates方法的具体用法?PHP GradebookUtils::get_list_users_certificates怎么用?PHP GradebookUtils::get_list_users_certificates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GradebookUtils
的用法示例。
在下文中一共展示了GradebookUtils::get_list_users_certificates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_lang
if (empty($selectedCourseInfo)) {
Session::write('reportErrorMessage', get_lang('NoCourse'));
header("Location: {$selfUrl}");
exit;
}
$gradebookCategories = Category::load(null, null, $selectedCourseInfo['code'], null, false, $selectedSession);
$gradebook = null;
if (!empty($gradebookCategories)) {
$gradebook = current($gradebookCategories);
}
if (!is_null($gradebook)) {
$exportAllLink = api_get_path(WEB_CODE_PATH) . "gradebook/gradebook_display_certificate.php?";
$exportAllLink .= http_build_query(array("action" => "export_all_certificates", "cidReq" => $selectedCourseInfo['code'], "id_session" => 0, "gidReq" => 0, "cat_id" => $gradebook->get_id()));
$sessionName = api_get_session_name($selectedSession);
$courseName = api_get_course_info($selectedCourseInfo['code'])['title'];
$studentList = GradebookUtils::get_list_users_certificates($gradebook->get_id());
$certificateStudents = array();
if (is_array($studentList) && !empty($studentList)) {
foreach ($studentList as $student) {
if (api_is_student_boss() && !in_array($student['user_id'], $userList)) {
continue;
}
$certificateStudent = array('fullName' => api_get_person_name($student['firstname'], $student['lastname']), 'sessionName' => $sessionName, 'courseName' => $courseName, 'certificates' => array());
$studentCertificates = GradebookUtils::get_list_gradebook_certificates_by_user_id($student['user_id'], $gradebook->get_id());
if (!is_array($studentCertificates) || empty($studentCertificates)) {
continue;
}
foreach ($studentCertificates as $certificate) {
$creationDate = new DateTime($certificate['created_at']);
$creationMonth = $creationDate->format('m');
$creationYear = $creationDate->format('Y');
示例2: array
$filterForm = '<br />' . $form->return_form();
if ($form->validate()) {
$officialCode = $form->getSubmitValue('filter');
if ($officialCode == 'all') {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
} else {
$userList = UserManager::getUsersByOfficialCode($officialCode);
if (!empty($userList)) {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id, $userList);
}
}
} else {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
}
} else {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
}
echo '<div class="btn-group">';
$url = api_get_self() . '?action=generate_all_certificates' . '&' . api_get_cidReq() . '&cat_id=' . $cat_id . '&filter=' . $filterOfficialCode;
echo Display::url(get_lang('GenerateCertificates'), $url, array('class' => 'btn btn-default'));
$url = api_get_self() . '?action=delete_all_certificates' . '&' . api_get_cidReq() . '&cat_id=' . $cat_id . '&filter=' . $filterOfficialCode;
echo Display::url(get_lang('DeleteAllCertificates'), $url, array('class' => 'btn btn-default'));
$hideCertificateExport = api_get_setting('hide_certificate_export_link');
if (count($certificate_list) > 0 && $hideCertificateExport !== 'true') {
$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'));
示例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);
}
}
}
}