本文整理汇总了PHP中Company::getCompany方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::getCompany方法的具体用法?PHP Company::getCompany怎么用?PHP Company::getCompany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company::getCompany方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEdit
public function actionEdit($id = false)
{
if ($id) {
$model = Company::model()->findByPk($id);
} else {
$model = Company::getCompany();
}
if (isset($_POST['ajax']) && $_POST['ajax'] === 'company-form') {
echo UActiveForm::validate(array($model));
Yii::app()->end();
}
if (isset($_POST['Company'])) {
$model->attributes = $_POST['Company'];
$model->fileupload = CUploadedFile::getInstance($model, 'fileupload');
$model->iconupload = CUploadedFile::getInstance($model, 'iconupload');
if ($model->validate()) {
$model->save();
Yii::app()->user->setFlash('companySuccessMessage', ProjectModule::t('Successfully updated'));
//$this->redirect(array('/user/profile'));
} else {
Yii::app()->user->setFlash('companyErrorMessage', ProjectModule::t('Something wrong'));
}
}
//Yii::app()->theme = 'admin';
$this->render('edit', array('model' => $model, 'root' => User::model()->getUserRole() == 'root'));
}
示例2: init
/**
* Initializes the component.
*/
public function init($who = null)
{
if (get_class(Yii::app()) != 'CConsoleApplication' || $who == 'cron') {
$company = Company::getCompany();
if ($company->telfin_id) {
$this->app_id = $company->telfin_id;
}
if ($company->telfin_secret) {
$this->app_secret = $company->telfin_secret;
}
if ($this->app_id && $this->app_secret) {
$this->telfin = new telphin($this->app_id, $this->app_secret, $this->extension, $this->host);
}
}
}
示例3: exdelivry
/**
* 快递单
* */
function exdelivry()
{
$id = IReq::get('id');
$tb_delivery_doc = new IQuery('delivery_doc as dd');
$tb_delivery_doc->fields = 'd.name,dd.delivery_code,fc.freight_name';
$tb_delivery_doc->where = 'order_id=' . $id;
$tb_delivery_doc->join = 'left join delivery as d on dd.delivery_type=d.id left join freight_company as fc on d.freight_id=fc.id';
$delivery_info = $tb_delivery_doc->find();
$get_content = '暂无相关信息!';
if (count($delivery_info) > 0) {
//获得用户申请的id
$config = new Config("site_config");
$config_info = $config->getInfo();
$express_key = isset($config_info['express_key']) ? $config_info['express_key'] : '';
if ($express_key) {
//获得物流名称和物流单号
$delivery_code = $delivery_info[0]['delivery_code'];
$name = $delivery_info[0]['freight_name'];
$get_content = '物流公司或者货运单号错误';
$type = '1';
if ($delivery_code != '' && $name != '') {
$name = str_replace(' ', '', $name);
$delivery_code = str_replace(' ', '', $delivery_code);
$sUrl = $this->module->getBasePath();
include $sUrl . 'plugins/freight/company.php';
$company = new Company();
$name = $company->getCompany($name);
$AppKey = $express_key;
$url = 'http://api.kuaidi100.com/api?id=' . $AppKey . '&com=' . $name . '&nu=' . $delivery_code . '&show=2&muti=1&order=asc';
//请勿删除变量$powered 的信息,否者本站将不再为你提供快递接口服务。
$powered = '查询数据由:<a href="http://kuaidi100.com" target="_blank">KuaiDi100.Com (快递100)</a> 网站提供 ';
//优先使用curl模式发送数据
if (function_exists('curl_init') == 1) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
$get_content = curl_exec($curl);
$type = '2';
curl_close($curl);
} else {
include $sUrl . 'plugins/freight/snoopy.php';
$snoopy = new snoopy();
$snoopy->referer = 'http://www.google.com/';
//伪装来源
$snoopy->fetch($url);
$get_content = $snoopy->results;
$type = '2';
}
}
} else {
$get_content = '您还没有申请ID,请到<a href="http://kuaidi100.com" target="_blank">KuaiDi100.Com (快递100)</a>申请!';
}
}
$this->setRenderData(array('conent' => $get_content, 'type' => $type));
$this->redirect('exdelivry');
}
示例4: elseif
<?php
if (\User::check()) {
$user = \User::getUser();
if ($user->hasAccess('contractor')) {
$contractor = \Contractor::getContractor();
} elseif ($user->hasAccess('company')) {
$company = \Company::getCompany();
} elseif ($user->hasAccess('agency')) {
$agency = \Agency::getAgency();
}
}
$resources = \Site::getAllResources();
?>
@extends('front.app')
@section('title')
Free Resources | Programme Chameleon
@stop
@section('content')
<div id="wrapper">
@include('front.include.header')
<div class="container">
<div id="free-resources-container">
<h2 class="page-header">Free Resources</h2>
<div class="tab-resources">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#res-project" aria-controls="res-initiation" role="tab" data-toggle="tab">Project Management</a>
示例5: Company
$teamName = $thisInfo['Team Assignment'];
$activeStatus = $thisInfo['Managed IT - Active'];
}
$stmt = $pdo->prepare('SELECT * FROM clients WHERE clientid = :clientid');
$stmt->execute(array('clientid' => $clientid));
foreach ($stmt as $cInfo) {
$geoAddress = $cInfo['Address1'] . ', ' . $cInfo['City'] . ', ' . $cInfo['State'];
$recid = $cInfo['ExternalID'];
$zip = $cInfo['Zip'];
$CompanyName = $cInfo['Company'];
$CompanyCity = $cInfo['City'];
$CompanyState = $cInfo['State'];
}
// Get client address from CW
$c = new Company();
$ret = $c->getCompany($recid);
foreach ($ret as $k => $v) {
if (isset($v->DefaultAddress->StreetLines->string[0])) {
$gAdd1 = $v->DefaultAddress->StreetLines->string[0];
} else {
$gAdd1 = "";
}
if (isset($v->DefaultAddress->StreetLines->string[1])) {
$gAdd2 = $v->DefaultAddress->StreetLines->string[1];
} else {
$gAdd2 = "";
}
$gCity = $v->DefaultAddress->City;
$gState = $v->DefaultAddress->State;
$gZip = $v->DefaultAddress->Zip;
$gAddress = $gAdd1 . ' ' . $gAdd2 . ', ' . $gCity . ', ' . $gState . ' ' . $gZip;
示例6: array
<?php
Yii::app()->getClientScript()->registerCssFile(Yii::app()->theme->baseUrl . '/css/plate-form.css');
Yii::app()->getClientScript()->registerCssFile(Yii::app()->theme->baseUrl . '/css/plate-form-media.css');
Yii::app()->clientScript->registerScriptFile('/js/masonry.min.js', CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile('/js/common-masonry.js', CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile('/js/worktypes.js');
/* @var $this ZakazController */
/* @var $model Zakaz */
/* @var $form CActiveForm */
?>
<div class="form-container">
<?php
if ($model->isNewRecord) {
$company = Company::getCompany();
if ($company->text4customers) {
echo '<div class="text4customerts">' . $company->text4customers . '</div>';
}
}
echo '<p class="note">' . ProjectModule::t('Fields with <span class="required">*</span> are required.') . '</p>';
$form = $this->beginWidget('CActiveForm', array('id' => 'zakaz-form', 'action' => isset($model->id) ? $this->createUrl('zakaz/update', ['id' => $model->id]) : 'http://' . $_SERVER['SERVER_NAME'] . '/project/zakaz/create', 'enableAjaxValidation' => false));
?>
<?php
//echo $form->errorSummary($model);
if ($model->unixtime) {
echo $form->hiddenField($model, 'unixtime');
}
echo '<div class="form-item">';
//echo $form->labelEx($model,'max_exec_date');
示例7: init
public function init()
{
// --- Организации
$c_id = Company::getId();
if ($c_id) {
if (Company::getCompany()->frozen) {
echo 'Where is my money, dude ?!?!?!';
die;
}
ProjectChanges::$file_path = 'uploads/c' . $c_id . '/changes_documents';
Zakaz::$files_folder = '/uploads/c' . $c_id . '/';
Yii::app()->language = Company::getLanguage();
} else {
$tmp = explode('.', $_SERVER['SERVER_NAME']);
if (array_shift($tmp) == 'www') {
$this->redirect('http://' . implode('.', $tmp));
} else {
echo 'Requested company not found.';
}
Yii::app()->end();
}
// ---
if (!Yii::app()->user->isGuest) {
switch (User::model()->getUserRole()) {
case 'Manager':
case 'Admin':
case 'root':
Yii::app()->theme = 'admin';
break;
case 'Author':
$menu[] = array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/ownList'));
$menu[] = array('label' => Yii::t('site', 'New projects'), 'url' => array('/project/zakaz/list'));
if (User::model()->isCorrector()) {
$menu[] = array('label' => Yii::t('site', 'New projects for technical'), 'url' => array('/project/zakaz/listtech'));
//if (Company::getCompany()->module_tree) $menu[] = array('label'=>Yii::t('site','Tree structure'), 'url'=>array('/project/zakaz/tree'));
}
if (Company::getCompany()->agreement4executors && Company::getCompany()->agreement4executors != '') {
$menu[] = array('label' => Yii::t('site', 'User Agreement'), 'url' => array('/site/agreement'));
}
//$menu[] = array('label'=>Yii::t('site','Personal account'), 'url'=>array('/user/profile/account'));
$menu[] = array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'));
// Далее выводится в обратном порядке
$menu[] = array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit'));
$this->menu = $menu;
Yii::app()->theme = 'client';
break;
case 'Customer':
$menu[] = array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/customerOrderList'));
if (Company::getCompany()->module_tree) {
$menu[] = array('label' => Yii::t('site', 'Tree structure'), 'url' => array('/project/zakaz/tree'));
}
$menu[] = array('label' => Yii::t('site', 'Create order'), 'url' => array('/project/zakaz/create'));
//$menu[] = array('label'=>Yii::t('site','Personal account'), 'url'=>array('/user/profile/account'));
if (Company::getCompany()->agreement4customers && Company::getCompany()->agreement4customers != '') {
$menu[] = array('label' => Yii::t('site', 'User Agreement'), 'url' => array('/site/agreement'));
}
$menu[] = array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'));
// Даллее выводится в обратном порядке
$menu[] = array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit'));
$this->menu = $menu;
/*$this->authMenu = array(
array('label'=>Yii::t('site','Logout'), 'url'=>array('/user/logout')),
);*/
Yii::app()->theme = 'client';
break;
case 'Webmaster':
$this->menu = array(array('label' => Yii::t('site', 'Stats'), 'url' => array('/partner/stats')), array('label' => Yii::t('site', 'Promo materials'), 'url' => array('/partner/materials')), array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout')), array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit')));
$this->authMenu = array(array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout')));
Yii::app()->theme = 'client';
if (Yii::app()->getRequest()->getRequestUri() == '/project/zakaz/list') {
$this->redirect('/');
}
break;
}
}
// var_dump(Yii::app()->controller->module->id ,Yii::app()->controller->id, Yii::app()->controller->action->id);
// die();
}
示例8: array
echo ProjectModule::t('Deadline') . ':';
?>
<span class="value"><?php
echo Yii::app()->dateFormatter->formatDateTime($order->author_informed);
?>
</span></div>
</div>
<?php
}
?>
<div class="col-xs-4 __changes">
<div class="row">
<?php
$this->renderPartial('_payment', array('order' => $order, 'images' => $PaymentImages));
if (Company::getCompany()->module_tree && (User::model()->isCustomer() || User::model()->isCorrector())) {
$this->widget('application.modules.project.widgets.zakazTree.ZakazTreeWidget', array('project' => $order));
}
if (User::model()->isCustomer()) {
echo '<h7 class="center">' . ProjectModule::t('Completed stages') . ':</h7>';
}
$this->widget('application.modules.project.widgets.zakazParts.ZakazPartWidget', array('projectId' => $order->id));
?>
<div class="col-xs-12 project-changes">
<?php
$this->widget('application.modules.project.widgets.changes.ChangesWidget', array('project' => $order, 'isCorrector' => $isCorrector));
?>
</div>
</div>
</div>
<div class="col-xs-8 __chat">
示例9: removeAffiliate
public function removeAffiliate($agency)
{
if (!($company = \Company::getCompany())) {
throw new \Exception("You are not currently in a company account.", 1);
return;
}
if (!$company->agencies->contains($agency->id)) {
throw new \Exception("This agency has never made a request to you.", 1);
return;
}
$company->agencies()->detach($agency->id);
return $company;
}
示例10: array
?>
</div>
<?php
//echo CHtml::submitButton('Сохранить','');
?>
<?php
$this->endWidget();
?>
</div>
</div>
<hr>
<?php
if (Company::getCompany()->module_tree) {
$this->widget('application.modules.project.widgets.zakazTree.ZakazTreeWidget', array('project' => $model));
}
?>
<?php
Yii::app()->getClientscript()->registerScriptFile(Yii::app()->theme->baseUrl . '/js/manager.js');
?>
<!-- Начало блока добавления этапов менеджера -->
<h5 class="stages"><span class="block-title"><?php
echo ProjectModule::t('Work stages');
?>
:</span><?php
echo Tools::hint($hints['Zakaz_stages'], 'hint-block __stages');
?>
</h5>
示例11: insertVariables
public function insertVariables($in, $orderId)
{
$in = $this->replaceBBCode($in);
preg_match_all("/\\{(.+?)\\}/is", $in, $out);
foreach ($out[1] as $k => $o) {
$var = explode('_', $o);
$model_name = ucfirst(array_shift($var));
if (@class_exists($model_name)) {
if ($model_name == 'Projectpayments') {
$model = ProjectPayments::model()->find('order_id = :ORDER_ID', array(':ORDER_ID' => $orderId));
} elseif ($model_name == 'Company') {
$model = Company::getCompany();
} else {
$model = $model_name::model()->findByPk($orderId);
}
$var = implode('_', $var);
if ($model && in_array($var, $model->attributeNames())) {
$fields[$k] = $model->{$var};
} elseif ($model) {
$fields[$k] = '#wrong property#';
} else {
$fields[$k] = '#cant find model#';
}
} else {
$fields[$k] = '#wrong model#';
}
}
return str_replace($out[0], $fields, $in);
}
示例12: act_getApiCompany
public function act_getApiCompany()
{
$where = ' company_isdelete="0" ';
$filed = ' `company_id` as companyId,`company_name` as companyName,`company_principal` as companyPrincipal,`company_address` as companyAddress,`company_phone` as companyPhone ';
$result = Company::getCompany($filed, $where);
if (!$result) {
self::$errCode = '5906';
self::$errMsg = 'No data or get api company error';
return false;
}
return $result;
}