当前位置: 首页>>代码示例>>PHP>>正文


PHP company::get_recursive_departments_licenses方法代码示例

本文整理汇总了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}&amp;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);
        }
    }
}
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:company_license_list.php

示例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');
}
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:company_license_users_form.php


注:本文中的company::get_recursive_departments_licenses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。