Ejemplo n.º 1
0
 public function IndexAction()
 {
     Site::$keywords = $this->company->tags;
     Site::$title = $this->company->name . ' на PromSpace';
     $group_tags_array = GroupModel::GetList();
     $region_tags_array = RegionModel::GetList();
     $region_tags_array[0] = 'Вся Россия';
     $group_tags_array[0] = 'Не определено';
     $products = ProductModel::GetAll()->where('company_id = ?', [0 => $this->company->id]);
     $contacts = array();
     if (!User::isLogged()) {
         if ($this->company->open == 2) {
             $contacts = ContactsModel::GetAll()->where('company_id = ?', [0 => $this->company->id]);
         }
         $this->render('nologged', ['company' => $this->company, 'group_tags' => $group_tags_array, 'region_tags' => $region_tags_array, 'contacts' => $contacts, 'products' => $products, 'simmilar' => $this->GetSimmilar()]);
     } elseif ($this->company->id == User::company() or User::admin()) {
         if ($this->company->logo == '') {
             Site::Message('Мы рекомендуем Вам установить логтип для профиля, это сделает его более привлекательным для клиентов');
         }
         $contacts = ContactsModel::GetAll()->where('company_id = ?', [0 => $this->company->id]);
         $this->render('edit', ['company' => $this->company, 'group_tags' => $group_tags_array, 'region_tags' => $region_tags_array, 'contacts' => $contacts, 'products' => $products, 'simmilar' => $this->GetSimmilar()]);
     } else {
         if ($this->company->open == 0 and FavoriteModel::i_friend($this->company->id) or $this->company->open > 0) {
             $contacts = ContactsModel::GetAll()->where('company_id = ?', [0 => $this->company->id]);
         }
         $this->render('index', ['company' => $this->company, 'group_tags' => $group_tags_array, 'region_tags' => $region_tags_array, 'favorite' => FavoriteModel::my_friend($this->company->id) ? 'favorite.png' : 'star.png', 'contacts' => $contacts, 'products' => $products, 'simmilar' => $this->GetSimmilar()]);
     }
 }
Ejemplo n.º 2
0
 /**
  * Construct
  * Initiate needed classes
  */
 public function __construct()
 {
     self::$title = '+Task';
     self::$action = false;
     self::$section = false;
     self::$subsection = false;
     self::$do = false;
     /*
      * References to instances of classes accessible for other classes
      */
     self::$i18n = new i18n();
     self::$db = new dBase();
     self::$auth = new Auth();
     self::$user = Auth::$user;
     $config = Config::getInstance();
     self::$defaults = $config->getSection('DEFAULTS');
     self::$debug = $config->getSection('DEBUG');
     self::getOffsetArray();
     self::display();
     self::getDebug();
     self::$log = new log();
     ##FB::info($_REQUEST, 'Request data');
     ##FB::info($_SERVER, 'Site construct');
 }
Ejemplo n.º 3
0
<?php

#---Define--
mb_internal_encoding("UTF-8");
define('ROOT', dirname(__FILE__) . '/../');
#Default Page
define('default_page', 'main');
#Admin_login
define('admin_login', '*****@*****.**');
#Автозагрузчики
include ROOT . 'classes/_autoload.php';
include ROOT . 'models/_autoload.php';
include ROOT . 'controllers/_autoload.php';
#Подключение библиотеки SQL
SQL::connect(include ROOT . 'config/db.php');
#User Init
User::LoginByCookie(Request::cookie('userid', ''));
#QueryStringload
Request::Load();
#WebSite Init
$controller = mb_strtolower(Request::GetPart(0, default_page));
$action = Request::GetPart(1, 'index');
//if (!User::isLogged()) $controller = 'login';
#Загрузка шаблонизатора
Site::$home = 'http://localhost/promspace/';
Site::$template = 'main';
Site::$title = 'PromSpace - Вся промышленность России';
Site::$keywords = 'Вся промышленность России, Предприятия России, Компании России';
Site::Show($controller, $action);
Ejemplo n.º 4
0
 public function getInterface()
 {
     Site::$title = 'cmdtask/' . Site::$section . '';
     Site::$vars['section'] = '' . Site::$section . '';
     Site::$vars['aside'] = self::getAside();
     Site::$vars['items'] = self::writeLists();
     Site::$header = Site::parseFile('view/tasker/top.phtml');
     Site::$page = Site::parseFile('view/tasker/import.phtml');
     Site::$footer = Site::parseFile('view/tasker/bot.phtml');
     Site::$inlinejs .= Site::parseFile('static/javascript/import.js');
 }
Ejemplo n.º 5
0
">
    <meta property="og:title" content="<?php 
echo Site::title();
?>
 | <?php 
echo Site::name();
?>
">

    <!-- Google+ Snippets -->
    <meta itemprop="url" content="<?php 
echo Url::current();
?>
">
    <meta itemprop="name" content="<?php 
echo Site::title();
?>
 | <?php 
echo Site::name();
?>
">

    <!-- Styles -->
    <?php 
Stylesheet::add('public/assets/css/app.css', 'frontend', 2);
?>
    <?php 
Stylesheet::load();
?>

    <?php 
Ejemplo n.º 6
0
 private function ShowList($companies, $total = 0)
 {
     Site::$title = 'PromSpace - ' . $this->regions_array[$this->region_id] . ' - ' . $this->groups_array[$this->group_id];
     Site::$sub = '<div class="pwd">' . "\n" . '<a href="' . Site::Link('list/setregion') . '">' . $this->regions_array[$this->region_id] . '</a> / <a href="' . Site::Link('list/setgroup/') . '">' . $this->groups_array[$this->group_id] . '</a></div>' . "\n";
     if (Count($companies) > 0) {
         $this->render('index', ['group_id' => $this->group_id, 'region_id' => $this->region_id, 'companys' => $companies, 'group_tags' => $this->groups_array, 'region_tags' => $this->regions_array, 'page_links' => $this->GetPageLinks($total), 'adw_group' => AdwareModel::Get($this->group_id, $this->search)]);
     } else {
         $this->render('empty', ['group_id' => $this->group_id, 'region_id' => $this->region_id, 'group_tags' => $this->groups_array, 'region_tags' => $this->regions_array, 'search' => $this->search, 'adw_group' => AdwareModel::Get($this->group_id, $this->search)]);
     }
 }