Exemplo n.º 1
0
            $arrOrderBy = array('act_datetime' => 'DESC');
            $smarty->assign('vacancys', $vacancy->getAnnounces($strWhere, false, $arrOrderBy));
            $smarty->assign('link', chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=vacancy&action=view&id='));
        } else {
            //$arrErrors[] = ERROR_SELECTED_COMPANY;
            messages::error404();
        }
    }
} else {
    // Формируем TITLE страницы
    $arrTitle = array();
    $seo = seo::getTitle('companies', $currLang);
    $arrTitle[] = array('name' => !empty($seo) ? $seo : MENU_COMPANIES);
    // СЕО данные
    $smarty->assign('meta_keywords', seo::getKeywords('companies', $currLang));
    $smarty->assign('meta_description', seo::getDescription('companies', $currLang));
    //смещение, всегда 0 (затем берется из $_GET)
    $offset = !empty($_GET['offset']) && is_numeric($_GET['offset']) && $_GET['offset'] > 0 ? $_GET['offset'] : 0;
    //смещение, всегда 0 (затем берется из $_GET)
    $path = CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=companies&action=offset&';
    //получаем массив, содержащий текущий обработанный URL
    $arrFields = array(array('conf_users', 'id'), array('conf_users', 'company_name'), array('conf_users', 'company_city'), array('conf_users', 'company_description'), array('conf_users', 'logo'));
    $strWhere = "conf_users.token IN ('active') AND conf_users.user_type IN ('company')";
    CONF_COMPANIES_SHOW_ONLY_WITH_LOGO ? $strWhere .= " AND conf_users.logo!=''" : null;
    $strLimit = $offset . ',' . CONF_COMPANIES_PERPAGE;
    $arrCompanies = $user->getCombinedUsersData($arrFields, $strWhere, false, $strLimit);
    $smarty->assignByRef('arrCompanies', $arrCompanies);
    // формируем страницы
    $allRecords = $user->cntUsers();
    $strPages = strings::generatePage($allRecords, $offset, CONF_COMPANIES_PERPAGE, $path);
    // формируем странциы