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


PHP company::get_companies_rs方法代码示例

本文整理汇总了PHP中company::get_companies_rs方法的典型用法代码示例。如果您正苦于以下问题:PHP company::get_companies_rs方法的具体用法?PHP company::get_companies_rs怎么用?PHP company::get_companies_rs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在company的用法示例。


在下文中一共展示了company::get_companies_rs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_company_selector

 public function add_company_selector($required = true)
 {
     $mform =& $this->_form;
     if (company_user::is_company_user()) {
         $mform->addElement('hidden', 'companyid', company_user::companyid());
     } else {
         $companies = company::get_companies_rs();
         $companyoptions = array('' => get_string('selectacompany', 'block_iomad_company_admin'));
         foreach ($companies as $company) {
             if (company_user::can_see_company($company->shortname)) {
                 $companyoptions[$company->id] = $company->name;
             }
         }
         $companies->close();
         if (count($companyoptions) == 1) {
             $mform->addElement('html', get_string('nocompanies', 'block_iomad_company_admin'));
             return false;
         } else {
             $mform->addElement('select', 'companyid', get_string('company', 'block_iomad_company_admin'), $companyoptions);
             if ($required) {
                 $mform->addRule('companyid', get_string('missingcompany', 'block_iomad_company_admin'), 'required', null, 'client');
             }
             $defaultvalues['companyid'] = array($this->selectedcompany);
             $mform->setDefaults($defaultvalues);
         }
     }
     return true;
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:28,代码来源:lib.php

示例2: get_string

                echo $OUTPUT->header();
                echo $OUTPUT->notification($returnurl, get_string('deletednot', '', $company->name));
                die;
            }
            $transaction->rollback();
        }
    }
}
$blockpage->display_header();
// Check we can actually do anything on this page.
iomad::require_capability('block/iomad_company_admin:company_view', $context);
// Get the number of companies.
$objectcount = $DB->count_records('company');
echo $OUTPUT->paging_bar($objectcount, $page, $perpage, $baseurl);
flush();
if ($companies = company::get_companies_rs($page, $perpage)) {
    $stredit = get_string('edit');
    $strdelete = get_string('delete');
    $strusers = $blockpage->get_string('company_users');
    $strnewuser = $blockpage->get_string('newuser');
    $strmanagers = $blockpage->get_string('company_managers');
    $strcourses = $blockpage->get_string('company_courses');
    $strcreatecourse = $blockpage->get_string('newcourse');
    $strcourseusers = $blockpage->get_string('courseusers');
    $strusersdownload = $blockpage->get_string('users_download');
    $table = new html_table();
    $table->head = array("Name", "Short name", "City", "", "", "", "", "", "", "", "", "");
    $table->align = array("left", "left", "left", "center", "center", "center", "center", "center", "center", "center", "center", "center");
    $table->width = "95%";
    foreach ($companies as $company) {
        if (company_user::can_see_company($company)) {
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:company_list.php


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