PHP Method User::company, codiad Code Examples

This page contains top rated real world PHP examples of method User::company from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: ProductController.php Project: kekstlt/promspace
0
 public function start()
 {
     $id = intval(Request::GetPart(0, User::company()));
     if ($id == 0) {
         $id = User::company();
     }
     $this->company = CompanyModel::GetObj()->id($id);
     if ($this->company->id == 0) {
         Site::Message('Профиль не найден');
         $this->Route();
     } elseif ($this->company->id != User::company() and !User::admin()) {
         Site::Message('У Вас недостаточно прав для редактирования данного профиля');
         $this->Route();
     } else {
         switch (Request::GetPart(2, '')) {
             case 'edit':
                 $this->EditAction();
                 break;
             case 'delete':
                 $this->DeleteAction();
                 break;
             default:
                 break;
         }
     }
 }
Example #2
Show file File: FavoritesController.php Project: kekstlt/promspace
0
 public function start()
 {
     if (User::company() <= 0) {
         Site::Message('Для просмотра избранного вы должны войти в систему');
         $this->route();
     } else {
         $this->company = CompanyModel::GetObj()->id(User::company());
     }
 }
Example #3
Show file File: SettingsController.php Project: kekstlt/promspace
0
 public function start()
 {
     if (!User::islogged()) {
         Site::Message('Вы должны войти в систему, для изменения своих настроек');
         $this->Route();
     } else {
         $this->company = CompanyModel::GetObj()->id(User::company());
     }
 }
Example #4
Show file File: ProfileController.php Project: kekstlt/promspace
0
 public function FavoriteSet($id)
 {
     if ($id > 0 and $id != User::company()) {
         $cnt = SQL::Query('SELECT count(*) as cnt FROM `favorites` WHERE host_id = ? AND fav_id = ?', [0 => User::company(), 1 => $id])->fetch(PDO::FETCH_OBJ)->cnt;
         if ($cnt > 0) {
             Site::Message('Компания удалена из избранного');
             FavoriteModel::drop($id);
         } else {
             Site::Message('Компаниия добавлена в избранное');
             FavoriteModel::add($id);
         }
     }
 }
Example #5
Show file File: EditController.php Project: kekstlt/promspace
0
 public function start()
 {
     $id = intval(Request::GetPart(0, User::company()));
     if ($id == 0) {
         $id = User::company();
     }
     $this->company = CompanyModel::GetObj()->id($id);
     if ($this->company->id == 0) {
         Site::Message('Профиль не найден');
         $this->Route();
     } elseif ($this->company->id != User::company() and !User::admin()) {
         Site::Message('У Вас недостаточно прав для редактирования данного профиля');
         $this->Route();
     } else {
         switch (Request::GetPart(2, '')) {
             case 'adress':
                 $this->AdressAction();
                 break;
             case 'region':
                 $this->RegionAction();
                 break;
             case 'setregion':
                 $this->SetregionAction();
                 break;
             case 'group':
                 $this->GroupAction();
                 break;
             case 'setgroup':
                 $this->SetgroupAction();
                 break;
             case 'newgroup':
                 $this->NewgroupAction();
                 break;
             case 'setlogo':
                 $this->SetLogoAction();
                 break;
             default:
                 break;
         }
     }
 }
Example #6
Show file File: NewcompanyController.php Project: kekstlt/promspace
0
 public function ConfirmlogoAction()
 {
     $company = CompanyModel::GetObj()->id(User::company());
     if ($company->id > 0) {
         $this->render('confirmlogo', ['logo' => $company->logo]);
     } else {
         Site::Error('Непредвиденная ошибка');
         $this->route();
     }
 }
Example #7
Show file File: FeedbackController.php Project: kekstlt/promspace
0
 public function IndexAction()
 {
     $company = CompanyModel::GetObj()->id(User::company());
     $this->render('index', ['company' => $company->name, 'adress' => $company->email]);
 }
Example #8
Show file File: userbar.php Project: kekstlt/promspace
0
<?php

$username = User::GetName();
$company = CompanyModel::GetObj()->id(User::company());
if ($company->name != '') {
    $username = $company->name;
}
?>

<?php 
if (User::isLogged()) {
    ?>
	<a href="<?php 
    echo Site::link('profile');
    ?>
" class="username"><?php 
    echo $username;
    ?>
</a>
<div class="button_bar">
    <a href="<?php 
    echo Site::link('logout');
    ?>
" class="green">Выход</a>
<?php 
} else {
    ?>
 
	<a href="<?php 
    echo Site::link('registration');
    ?>
Example #9
Show file File: FavoriteModel.php Project: kekstlt/promspace
0
 public static function drop($id)
 {
     SQL::Query('UPDATE `companys` SET rate = rate - 1 WHERE id = ?', [0 => $id]);
     SQL::Query('DELETE FROM `favorites` WHERE host_id = ? AND fav_id = ?', [0 => User::company(), 1 => $id]);
 }