本文整理匯總了PHP中company::get_recursive_departments_licenses方法的典型用法代碼示例。如果您正苦於以下問題:PHP company::get_recursive_departments_licenses方法的具體用法?PHP company::get_recursive_departments_licenses怎麽用?PHP company::get_recursive_departments_licenses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類company
的用法示例。
在下文中一共展示了company::get_recursive_departments_licenses方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
}
$licensecourses = $DB->get_records('companylicense_courses', array('licenseid' => $license->id));
$coursestring = "";
foreach ($licensecourses as $licensecourse) {
$coursename = $DB->get_record('course', array('id' => $licensecourse->courseid));
if (empty($coursestring)) {
$coursestring = "<a href='" . new moodle_url('/course/view.php', array('id' => $licensecourse->courseid)) . "'>" . $coursename->fullname . "</a>";
} else {
$coursestring .= ",</br><a href='" . new moodle_url('/course/view.php', array('id' => $licensecourse->courseid)) . "'>" . $coursename->fullname . "</a>";
}
}
// Create the table data.
$table->data[] = array("{$license->name}", $coursestring, date('d M Y', $license->expirydate), "{$license->validlength}", "{$license->allocation}", "{$license->used}", $editbutton, $deletebutton);
}
} else {
if ($licenses = company::get_recursive_departments_licenses($companydepartment->id)) {
foreach ($licenses as $licenseid) {
// Get the license record.
$license = $DB->get_record('companylicense', array('id' => $licenseid->licenseid));
// Set up the edit buttons.
if (iomad::has_capability('block/iomad_company_admin:edit_licenses', $context)) {
$deletebutton = "<a href=\"company_license_list.php?delete={$license->id}&sesskey=" . sesskey() . "\">{$strdelete}</a>";
$editbutton = "<a href='" . new moodle_url('company_license_edit_form.php', array("licenseid" => $license->id, 'departmentid' => $departmentid)) . "'>{$stredit}</a>";
} else {
$deletebutton = "";
$editbutton = "";
}
$table->data[] = array("{$license->name}", "{$license->expirydate}", "{$license->validlength}", "{$license->allocation}", "{$license->used}", $editbutton, $deletebutton);
}
}
}
示例2: array
$licenselist = array();
if (iomad::has_capability('block/iomad_company_admin:unallocate_licenses', context_system::instance())) {
$userhierarchylevel = $parentlevel->id;
// Get all the licenses.
$licenses = $DB->get_records('companylicense', array('companyid' => $companyid), null, 'id,name,expirydate');
foreach ($licenses as $license) {
if ($license->expirydate > time()) {
$licenselist[$license->id] = $license->name;
} else {
$licenselist[$license->id] = $license->name . " (expired)";
}
}
} else {
$userlevel = company::get_userlevel($USER);
$userhierarchylevel = $userlevel->id;
$licenses = company::get_recursive_departments_licenses($userhierarchylevel);
if (!empty($licenses)) {
foreach ($licenses as $deptlicenseid) {
// Get the license record.
if ($license = $DB->get_records('companylicense', array('id' => $deptlicenseid->licenseid, 'companyid' => $companyid), null, 'id,name')) {
$licenselist[$license[$deptlicenseid->licenseid]->id] = $license[$deptlicenseid->licenseid]->name;
}
}
}
}
$usersform = new company_license_users_form($PAGE->url, $context, $companyid, $licenseid, $userhierarchylevel);
$blockpage->display_header();
// GWL : Check the department is valid.
if (!empty($departmentid) && !company::check_valid_department($companyid, $departmentid)) {
print_error('invaliddepartment', 'block_iomad_company_admin');
}