本文整理匯總了PHP中CCompany::listCompaniesByType方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCompany::listCompaniesByType方法的具體用法?PHP CCompany::listCompaniesByType怎麽用?PHP CCompany::listCompaniesByType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCompany
的用法示例。
在下文中一共展示了CCompany::listCompaniesByType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
$company_internal_id = intval(dPgetParam($_GET, "company_internal_id", 0));
$contact_id = intval(dPgetParam($_GET, "contact_id", 0));
// check permissions for this record
$canEdit = getPermission($m, 'edit', $project_id);
$canAuthor = getPermission($m, 'add', $project_id);
if (!($canEdit && $project_id || $canAuthor && !$project_id)) {
$AppUI->redirect('m=public&a=access_denied');
}
// get a list of permitted companies
require_once $AppUI->getModuleClass('companies');
$row = new CCompany();
$companies = $row->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => ''), $companies);
// get internal companies
// 6 is standard value for internal companies
$companies_internal = $row->listCompaniesByType(array('6'));
$companies_internal = arrayMerge(array('0' => ''), $companies_internal);
// pull users
$q = new DBQuery();
$q->addTable('users', 'u');
$q->addTable('contacts', 'con');
$q->addQuery('user_id');
$q->addQuery('CONCAT_WS(", ",contact_last_name,contact_first_name)');
$q->addOrder('contact_last_name');
$q->addWhere('u.user_contact = con.contact_id');
$users = $q->loadHashList();
// load the record data
$row = new CProject();
if (!$row->load($project_id, false) && $project_id > 0) {
$AppUI->setMsg('Project');
$AppUI->setMsg("invalidID", UI_MSG_ERROR, true);