當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCompany::getUsers方法代碼示例

本文整理匯總了PHP中CCompany::getUsers方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCompany::getUsers方法的具體用法?PHP CCompany::getUsers怎麽用?PHP CCompany::getUsers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCompany的用法示例。


在下文中一共展示了CCompany::getUsers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
##
##	Companies: View User sub-table
##
global $AppUI, $company_id;
$userList = CCompany::getUsers($AppUI, $company_id);
if (count($userList) > 0) {
    ?>
		<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl">
		<tr>
			<th><?php 
    echo $AppUI->_('Username');
    ?>
</td>
			<th><?php 
    echo $AppUI->_('Name');
    ?>
</td>
		</tr>
		<?php 
    $s = '';
    foreach ($userList as $user) {
        $s .= '<tr><td>';
        $s .= '<a href="./index.php?m=admin&a=viewuser&user_id=' . $user['user_id'] . '">' . $user['user_username'] . '</a>';
        $s .= '<td>' . $user['contact_first_name'] . ' ' . $user['contact_last_name'] . '</td>';
        $s .= '</tr>';
開發者ID:eureka2,項目名稱:web2project,代碼行數:31,代碼來源:vw_users.php

示例2: testGetUsers

 /**
  * Tests loading list of Users for this company.
  */
 public function testGetUsers()
 {
     global $AppUI;
     $users = CCompany::getUsers($AppUI, 2);
     /**
      * getUsers returns both an associative array as well as a indexed array
      * so we need to check both to make sure functionality depending on either does
      * not break.
      */
     $this->assertEquals(2, count($users));
     $this->assertEquals(3, $users[3]['user_id']);
     $this->assertEquals('contact_number_2', $users[3]['user_username']);
     $this->assertEquals('Contact', $users[3]['contact_first_name']);
     $this->assertEquals('Number 2', $users[3]['contact_last_name']);
     $this->assertEquals(3, $users[3][0]);
     $this->assertEquals('contact_number_2', $users[3][1]);
     $this->assertEquals('Contact', $users[3][2]);
     $this->assertEquals('Number 2', $users[3][3]);
     $this->assertEquals(4, $users[4]['user_id']);
     $this->assertEquals('contact_number_3', $users[4]['user_username']);
     $this->assertEquals('Contact', $users[4]['contact_first_name']);
     $this->assertEquals('Number 3', $users[4]['contact_last_name']);
     $this->assertEquals(4, $users[4][0]);
     $this->assertEquals('contact_number_3', $users[4][1]);
     $this->assertEquals('Contact', $users[4][2]);
     $this->assertEquals('Number 3', $users[4][3]);
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:30,代碼來源:companies.test.php


注:本文中的CCompany::getUsers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。