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


PHP Companies::getAll方法代码示例

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


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

示例1: select_company

/**
 * Render select company box
 *
 * @param integer $selected ID of selected company
 * @param array $attributes Additional attributes
 * @return string
 */
function select_company($name, $selected = null, $attributes = null)
{
    $companies = Companies::getAll();
    $options = array(option_tag(lang('none'), 0));
    if (is_array($companies)) {
        foreach ($companies as $company) {
            $option_attributes = $company->getId() == $selected ? array('selected' => 'selected') : null;
            $company_name = $company->getName();
            if ($company->isOwner()) {
                $company_name .= ' (' . lang('owner company') . ')';
            }
            $options[] = option_tag($company_name, $company->getId(), $option_attributes);
        }
        // foreach
    }
    // if
    return select_box($name, $options, $attributes);
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:25,代码来源:application.php

示例2: getGroupedByCompany

 /**
  * Return contacts grouped by company
  *
  * @param void
  * @return array
  */
 static function getGroupedByCompany()
 {
     $companies = Companies::getAll();
     if (!is_array($companies) || !count($companies)) {
         return null;
     }
     // if
     $result = array();
     foreach ($companies as $company) {
         $contacts = $company->getContacts();
         if (is_array($contacts) && count($contacts)) {
             $result[$company->getName()] = array('details' => $company, 'contacts' => $contacts);
             // array
         }
         // if
     }
     // foreach
     return count($result) ? $result : null;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:25,代码来源:Contacts.class.php

示例3:

?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Edit Descriptions</title>
</head>
<body>

<form name="updateDescriptionForm" id="updateDescriptionForm">
  <center>
  Edit company: 
  <select id="company">
    <option value="">Select a company to edit</option>
  <?php 
$companies = Companies::getAll();
foreach ($companies as $company) {
    print "<option value=" . $company['id'] . ">";
    print $company['name'];
    print "</option>";
}
?>
  </select>
  <br><br>
  <table border="1">
    <tr>
      <td valign="top">
        <label for="description" id="descriptionLabel">
          test1
        </label>
      </td>
开发者ID:wesgk,项目名称:TextareaEdit,代码行数:31,代码来源:form.php

示例4: share

 function share()
 {
     $id = array_var($_GET, 'object_id');
     $manager = array_var($_GET, 'manager');
     $obj = get_object_by_manager_and_id($id, $manager);
     if (!$obj instanceof DataObject) {
         flash_error(lang('object dnx'));
         ajx_current("empty");
         return;
     }
     // if
     $contacts = Contacts::getAll();
     $allEmails = array();
     $emailAndComp = array();
     foreach ($contacts as $contact) {
         if (trim($contact->getEmail()) != "") {
             $emailStr = str_replace(",", " ", $contact->getFirstname() . ' ' . $contact->getLastname() . ' <' . $contact->getEmail() . '>');
             $allEmails[] = $emailStr;
             if ($contact->getCompany()) {
                 $emailAndComp[$emailStr] = $contact->getCompany()->getId();
             }
         }
     }
     $companies = Companies::getAll();
     $allCompanies = array();
     foreach ($companies as $comp) {
         $allCompanies[$comp->getId()] = $comp->getName();
     }
     $actuallySharing = array();
     $users = SharedObjects::getUsersSharing($id, $manager);
     foreach ($users as $u) {
         $user = Users::findById($u->getUserId());
         if ($user) {
             $actuallySharing[] = array('name' => $user->getDisplayName(), 'email' => $user->getEmail(), 'company' => $user->getCompany()->getName());
         }
     }
     tpl_assign('allEmails', $allEmails);
     tpl_assign('allCompanies', $allCompanies);
     tpl_assign('emailAndComp', $emailAndComp);
     tpl_assign('actuallySharing', $actuallySharing);
     tpl_assign('object', $obj);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:42,代码来源:ObjectController.class.php


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