当前位置: 首页>>代码示例>>PHP>>正文


PHP professions类代码示例

本文整理汇总了PHP中professions的典型用法代码示例。如果您正苦于以下问题:PHP professions类的具体用法?PHP professions怎么用?PHP professions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了professions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     //на случай если уже есть глобальная
     //переменная в нужными данными
     global $profs;
     if (!isset($profs)) {
         $prfs = new professions();
         $profs = $prfs->GetAllProfessions("", 0, 1);
         //@todo: передлагаю закешировать навечно чейчас на 60 сек в методе выше
     }
     $this->render('t-service-freelancers-categories', array('profs' => $profs));
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:12,代码来源:TServiceFreelancersCategories.php

示例2: quickMASSetCats

function quickMASSetCats($frm)
{
    $objResponse = new xajaxResponse();
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/project_exrates.php';
    if ($frm) {
        global $DB;
        $frm = preg_replace('/,$/', '', $frm);
        $acats = explode(',', $frm);
        $cats_data = array();
        foreach ($acats as $v) {
            $v = preg_replace('/^mass_cat_span_/', '', $v);
            $c = explode('_', $v);
            if ($c[0] == 0) {
                continue;
            }
            if ($c[1] == 0) {
                $sql = 'SELECT prof_group FROM professions WHERE id=?i';
                $p = $DB->val($sql, $c[0]);
                $cats_data[] = $p . ':' . $c[0];
            } else {
                $cats_data[] = $c[0] . ':0';
            }
        }
        $html = '';
        if ($cats_data) {
            $count = 0;
            foreach ($cats_data as $v) {
                ++$count;
                if (count($cats_data) <= 3 || count($cats_data) >= 4 && $count < 3) {
                    $c = explode(':', $v);
                    $sql = 'SELECT name FROM prof_group WHERE id=?i';
                    $p = $DB->val($sql, $c[0]);
                    $html .= $p;
                    if ($c[1]) {
                        $html .= ' - ' . professions::GetProfName($c[1]) . '<br>';
                    } else {
                        $html .= '<br>';
                    }
                }
            }
            if (count($cats_data) >= 4 && $count > 2) {
                $html .= 'и еще ' . ($count - 2) . ' ' . ending($count - 2, 'другой', 'других', 'других');
            }
            $objResponse->script("\$('quickmas_f_mas_c_count').set('html', '" . count($cats_data) . "');");
            $objResponse->script("\$('quickmas_f_mas_subcat_m').show();");
        } else {
            $objResponse->script("\$('quickmas_f_mas_subcat_m').hide();");
        }
        $objResponse->assign('quickmas_f_mas_subcat', 'innerHTML', $html);
    }
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:55,代码来源:quickmas.server.php

示例3: prolongSpecs

function prolongSpecs()
{
    global $uid;
    $objResponse = new xajaxResponse();
    $err = professions::prolongSpecs($uid, $specs);
    $paid_to_arr = NULL;
    if (!$err && $specs) {
        foreach ($specs as $i => $s) {
            $paid_to_arr[$i] = $s['paid_to'];
        }
    }
    $objResponse->call('prolongSpecs', $paid_to_arr, $err);
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:14,代码来源:professions.server.php

示例4: addHHSpecProf

/**
 * @see hh::addHHSpecProf()
 */
function addHHSpecProf($hh_field, $hh_spec_id, $prof_id) {
    require_once($_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php");
    $objResponse = new xajaxResponse();
    $hh = new hh();
    $hh_field   = intval($hh_field);
    $hh_spec_id = intval($hh_spec_id);
    $prof_id    = intval($prof_id);
    ob_start();
    $pname = professions::GetProfNameWP($prof_id, '::');
    if(!$hh->addHHSpecProf($hh_field, $hh_spec_id, $prof_id))
        $err = "Специализация '{$pname}' уже привязана к данному разделу.";
    ob_end_clean();
    $objResponse->call("addHHSpecProf", $pname, $err);
    return $objResponse;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:18,代码来源:hh.server.php

示例5: isValid

 public function isValid($value)
 {
     $group_id = intval(@$value[$this->group_idx]);
     $spec_id = intval(@$value[$this->spec_idx]);
     $data = professions::getGroupAndProf($group_id, $spec_id);
     if (!isset($data) || $group_id <= 0 || !$data['group_id']) {
         $this->_error(self::GROUP_INVALID);
         return false;
     }
     if ($spec_id > 0 && !$data['prof_id']) {
         $this->_error(self::SPEC_INVALID);
         return false;
     }
     return true;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:15,代码来源:Professions.php

示例6: getProfessionText

 private function getProfessionText()
 {
     $prof_text = '';
     $prof_group_id = $this->options['prof_group_id'];
     $prof_id = $this->options['prof_id'];
     if ($prof_group_id) {
         $prof_text = professions::GetProfGroupTitle($prof_group_id);
     } elseif ($prof_id) {
         $group_id = professions::GetGroupIdByProf($prof_id);
         $prof_text = professions::GetProfGroupTitle($group_id);
         $prof_text .= ' &mdash; ';
         $prof_text .= professions::GetProfName($prof_id);
     } else {
         $prof_text = 'Каталог фрилансеров';
     }
     return $prof_text;
 }
开发者ID:uadev,项目名称:fl-ru-damp,代码行数:17,代码来源:quickPaymentPopupFrlbind.php

示例7: action2

 public function action2()
 {
     global $js_file;
     require_once ABS_PATH . "/classes/professions.php";
     $category = __paramInit('int', NULL, 'category', NULL);
     $subcategory = __paramInit('int', NULL, 'subcategory', NULL);
     if ($category > 0 && $subcategory > 0 && professions::isExistProfId($subcategory, $category)) {
         $data = array();
         $data['kind'] = 1;
         //проект!
         $data['pro_only'] = true;
         $data['verify_only'] = false;
         $data['categories'][] = array('category_id' => $category, 'subcategory_id' => $subcategory);
         $_SESSION['customer_wizard'] = $data;
         $this->redirect('/welcome/customer/3/');
     }
     $professions = professions::GetProfessionsAndGroup('g.cnt DESC, p.pcount DESC NULLS LAST');
     $suffix = isset($_SESSION['pda']) && $_SESSION['pda'] == 1 ? '_pda' : '';
     $js_file['ElementsFactory'] = 'form/ElementsFactory.js';
     $js_file['ElementVerticalSelect'] = 'form/VerticalSelect.js';
     $this->render("step2{$suffix}", array('professions' => $professions, 'default_group' => 2, 'default_spec' => 9));
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:22,代码来源:CustomerController.php

示例8: ending

        <?php 
if ($service['src_id'] == 0) {
    ?>
            в общем каталоге
        <?php 
} else {
    if ($service['src_id'] == -1) {
        //if
        ?>
            на главной странице
        <?php 
    } else {
        //elseif
        ?>
           в каталоге «<?php 
        echo professions::GetProfName($service['src_id']);
        ?>
»
        <?php 
    }
}
//else
?>
        на <?php 
echo $service['op_count'];
?>
 <?php 
echo ending($service['op_count'], 'неделю', 'недели', 'недель');
?>
    </div>
</div>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:tpl.first_page.php

示例9: Lenta_Show

function Lenta_Show($page = 1)
{
    global $DB;
    session_start();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/portfolio.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/commune.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/links.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/lenta.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/users.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/blogs.php";
    /*require_once( $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php' );
        
    $stop_words = new stop_words( false );*/
    $yt_replace_id = array();
    $yt_replace_data = array();
    $uid = get_uid(false);
    $objResponse = new xajaxResponse();
    ob_start();
    if (!($groups = professions::GetAllGroupsLite())) {
        return;
    }
    if (!($lenta = lenta::GetUserLenta($uid))) {
    }
    $sort = $_COOKIE['lenta_fav_order'] != "" ? $_COOKIE['lenta_fav_order'] : "date";
    $favs = lenta::GetFavorites($uid, $sort);
    if (!($myComms = commune::GetCommunes(NULL, $uid, NULL, commune::OM_CM_MY))) {
        $myComms = array();
    }
    if (!($joinedComms = commune::GetCommunes(NULL, NULL, $uid, commune::OM_CM_JOINED))) {
        $joinedComms = array();
    }
    // Все сообщества, доступные пользователю.
    $communes = array();
    foreach ($myComms as $comm) {
        $communes[] = $comm;
    }
    foreach ($joinedComms as $comm) {
        $communes[] = $comm;
    }
    // Блоги
    if (!($blog_grs = blogs::GetThemes($error, 1))) {
        $blog_grs = array();
    }
    $blg = NULL;
    if ($lenta && $lenta['blog_grs'] && !empty($lenta['blog_grs'])) {
        $blg = implode(',', $lenta['blog_grs']);
    }
    $pgs = NULL;
    if ($lenta['all_profs_checked'] == 'f') {
        if ($lenta && $lenta['prof_groups'] && !empty($lenta['prof_groups'])) {
            $pgs = implode(',', $lenta['prof_groups']);
        }
    }
    $allThemesCount = 0;
    $cms = NULL;
    $user_comm_mods = array();
    // Отбираем среди выбранных ранее сообществ в ленте, те которые до сих пор остаются
    // доступными ему для просмотра в ленте (его могли удалить или забанить). А также заполняем массив user_mod-ов на каждое из сообществ.
    if ($lenta && $lenta['communes'] && !empty($lenta['communes'])) {
        $i = 0;
        $cms = '';
        foreach ($lenta['communes'] as $cm_id) {
            if ($uStatus = commune::GetUserCommuneRel($cm_id, $uid)) {
                $ucm = $user_mod;
                $ucm |= commune::MOD_COMM_MODERATOR * $uStatus['is_moderator'];
                $ucm |= commune::MOD_COMM_MANAGER * $uStatus['is_manager'];
                $ucm |= commune::MOD_COMM_ADMIN * ($uStatus['is_admin'] || $uStatus['is_moderator'] || $uStatus['is_manager']);
                $ucm |= commune::MOD_COMM_AUTHOR * $uStatus['is_author'];
                $ucm |= commune::MOD_COMM_ASKED * $uStatus['is_asked'];
                $ucm |= commune::MOD_COMM_ACCEPTED * ($uStatus['is_accepted'] || $ucm & commune::MOD_COMM_ADMIN);
                $ucm |= commune::MOD_COMM_BANNED * $uStatus['is_banned'];
                $ucm |= commune::MOD_COMM_DELETED * $uStatus['is_deleted'];
                $user_comm_mods[$cm_id] = $ucm;
                if (!$uStatus['is_deleted'] && !$uStatus['is_banned'] && $uStatus['is_blocked_commune'] == 0 && ($uStatus['is_accepted'] || $uStatus['is_author'])) {
                    $cms .= (!$i++ ? '' : ',') . $cm_id;
                }
            }
        }
    }
    //if($cms)
    //  $allThemesCount -= commune::GetMyThemesCount($cms, $uid);
    if ($lenta && $lenta['all_profs_checked'] == 't' || $cms || $pgs || $blg) {
        $items = lenta::GetLentaItems($uid, $lenta && $lenta['my_team_checked'] == 't', $lenta && $lenta['all_profs_checked'] == 't', $pgs, $cms, ($page - 1) * lenta::MAX_ON_PAGE, lenta::MAX_ON_PAGE, $allWorkCount, $blg);
    }
    if (!$items) {
        $items = array();
    }
    //    var_dump($favs);
    $stars = array(0 => 'bsg.png', 1 => 'bsgr.png', 2 => 'bsy.png', 3 => 'bsr.png');
    $i = 0;
    foreach ($items as $item) {
        switch ($item['item_type']) {
            case '2':
                // Сообщества
                $top = $item;
                $user_mod = $user_comm_mods[$top['commune_id']];
                if ($top['member_is_banned'] && !($user_mod & (commune::MOD_ADMIN | commune::MOD_COMM_AUTHOR | commune::MOD_COMM_MANAGER)) || $top['is_private'] == 't' && $top['user_id'] != $uid && !($user_mod & (commune::MOD_ADMIN | commune::MOD_COMM_AUTHOR | commune::MOD_COMM_MANAGER)) || $top['is_blocked'] && $top['commune_author_id'] != $uid) {
                    continue;
                }
//.........这里部分代码省略.........
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:lenta.server.php

示例10: _admEditSdelauParseForm

/**
 * Отдает HTML для предложений фрилансеров Сделаю
 * 
 * @param  object $objResponse xajaxResponse
 * @param  string $rec_id идентификатор записи
 * @param  string $rec_type тип записи
 * @param  array $aParams массив дополнительных параметров
 * @return string
 */
function _admEditSdelauParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array())
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer_offers.php';
    $oFreelancerOffers = new freelancer_offers();
    $offer = $oFreelancerOffers->getOfferById($rec_id, false);
    $objUser = new users();
    $objUser->GetUserByUID($offer['user_id']);
    // разделы
    $categories = professions::GetAllGroupsLite();
    $professions = professions::GetAllProfessions();
    array_group($professions, 'groupid');
    $professions[0] = array();
    ob_start();
    include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/sdelau.php';
    $sHtml = ob_get_contents();
    ob_end_clean();
    // текст
    $sOnReady = "if(\$('adm_edit_msg')) \$('adm_edit_msg').set('value', (\$('adm_edit_msg_source')? \$('adm_edit_msg_source').get('value') : null));";
    $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать предложение');
    $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml);
    $objResponse->script($sOnReady);
    $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');");
    $objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное'];");
    $objResponse->script('adm_edit_content.edit();');
    $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_SDELAU . ');');
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:37,代码来源:adm_edit_content.server.php

示例11: header

<?php

if (!defined('IN_STDF')) {
    header("HTTP/1.0 404 Not Found");
    exit;
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/portfolio.php";
$prfs = new professions();
$uid = $user->GetUid($err);
$error .= $err;
$profs = $prfs->GetSelProf($uid);
$portf = new portfolio();
$prjs = $portf->GetPortf($uid);
?>
<script language="JavaScript1.2" type="text/javascript">
<!--
prjprof_id = new Array();
prjname = new Array();
prjlink = new Array();
prjdescr = new Array();
prjid = new Array();

prof_ids = new Array();
profnames = new Array();

<?php 
$i = 0;
if ($prjs) {
    foreach ($prjs as $prj) {
        print "prjprof_id[{$i}] = '" . $prj['prof_id'] . "';\nprjid[{$i}] = '" . $prj['id'] . "';\nprjname[{$i}] = '" . $prj['name'] . "';\nprjlink[{$i}] = '" . $prj['link'] . "';\nprjdescr[{$i}] = '" . $prj['descr'] . "';\n\n";
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:portfolio_inner1.php

示例12: getProfessions

 static function getProfessions($parent_id)
 {
     $profession = new professions();
     return self::sdgJSONencode($profession->retCategorysByParentIds($parent_id, array('id', 'name')));
 }
开发者ID:innova-market,项目名称:JobExpert,代码行数:5,代码来源:ajax.class.php

示例13: header

<?php

if (!$_in_setup) {
    header("HTTP/1.0 403 Forbidden");
    exit;
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/xajax/users.common.php";
$xajax->printJavascript('/xajax/');
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$prfs = new professions();
$profs = $prfs->GetAllProfessionsPortfWithoutMirrored(get_uid());
$mirrors = $prfs->GetAllMirroredProfsId();
?>
<script type="text/javascript">

var mirrors = [];
<?php 
for ($i = 0, $m = count($mirrors); $i < $m; $i++) {
    ?>
mirrors[<?php 
    echo $i;
    ?>
] = {main: <?php 
    echo $mirrors[$i]['main_prof'];
    ?>
, mirror: <?php 
    echo $mirrors[$i]['mirror_prof'];
    ?>
};
<?php 
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:portfolio_in_setup.php

示例14: actionSaveInfoMobile

 /**
  * Заполнение обязательных полей после регистрации через API мобильного приложения.
  * 
  * @param  array $aParams массив входящих данных
  * @return bool true - успех, false - провал
  */
 public function actionSaveInfoMobile($aParams = array())
 {
     $this->setFieldInfo('uname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['first_name'])));
     $this->setFieldInfo('usurname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['last_name'])));
     $this->setFieldInfo('birthday', __paramValue('string', $aParams['birthday']));
     $this->setFieldInfo('country', __paramValue('int', $aParams['country_id']));
     $this->setFieldInfo('city', __paramValue('int', $aParams['city_id']));
     $this->setFieldInfo('info_for_reg', array('birthday' => 0, 'sex' => 0, 'country' => 0, 'city' => 0));
     $gender = __paramValue('int', $aParams['gender']);
     $this->setFieldInfo('sex', $gender == 1 ? 't' : ($gender == 2 ? 'f' : NULL));
     $this->checkedFields();
     if (date('Y-m-d', strtotime($aParams['birthday'])) != $aParams['birthday']) {
         $this->error['birthday'] = 'Укажите некорректную дату дня рождения';
         $this->errno['birthday'] = 2;
     }
     if (empty($this->error)) {
         if (!is_emp()) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer.php';
             $user = new freelancer();
         } else {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
             $user = new employer();
         }
         $user->info_for_reg = serialize($this->info_for_reg);
         $user->uname = $this->uname;
         $user->usurname = $this->usurname;
         $user->sex = $this->sex;
         $user->birthday = $this->birthday;
         $user->country = $this->country;
         $user->city = $this->city;
         if (!is_emp()) {
             $spec = intvalPgSql($aParams['prof_id']);
             if ($spec) {
                 require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
                 $or_spec = professions::GetProfessionOrigin($spec);
                 $spec_mod = professions::getLastModifiedSpec($_SESSION['uid']);
                 if (!is_pro() && $spec_mod['days'] > 0) {
                     $this->error['spec'] = 'Не прошло 30 дней с момента последней смены специализации';
                     $this->errno['spec'] = 2;
                 } else {
                     $user->spec = $spec;
                     $user->spec_orig = $or_spec;
                     professions::setLastModifiedSpec($_SESSION['uid'], $spec);
                 }
             } else {
                 $this->error['spec'] = 'Не указан параметр ID профессии';
                 $this->errno['spec'] = 1;
             }
         }
         if (empty($this->error)) {
             if ($sError = $user->Update($_SESSION['uid'], $res)) {
                 $this->error['save'] = $sError;
             } else {
                 if (!is_emp()) {
                     $_SESSION['specs'] = $user->GetAllSpecs($_SESSION['uid']);
                 }
             }
         }
         if (empty($this->error['save'])) {
             $_SESSION['check_user_access'] = true;
         }
     }
     return empty($this->error);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:70,代码来源:registration.php

示例15: setSelectFilter

 public function setSelectFilter($filter)
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/project_exrates.php";
     $project_exRates = project_exrates::GetAll();
     $set_select[] = "*";
     // Мои специализации
     if ($filter['my_specs'] == 't' && $filter['user_specs']) {
         foreach ($filter['user_specs'] as $spec) {
             $select[] = "(prj_subcategory1 = {$spec} OR prj_subcategory2 = {$spec} OR prj_subcategory3 = {$spec})";
         }
         $set_select[] = "IF(" . implode(" OR ", $select) . ", 1, 0) as my_spec_filter";
         unset($select);
     }
     //Если не нужны завершенные конкурсы
     if ($filter['is_closed_contest']) {
         $set_select[] = "IF(NOT end_date OR end_date > NOW(), 1, 0) as closed_contest";
     }
     // Бюджет
     if ($filter['cost_from'] || $filter['cost_to']) {
         $cr = (int) $filter['currency'];
         $cex = array(2, 3, 4, 1);
         $cost_from = ($cost_from = (double) $filter['cost_from']) < 0 ? 0 : (double) $filter['cost_from'];
         $cost_to = ($cost_to = (double) $filter['cost_to']) < 0 ? 0 : (double) $filter['cost_to'];
         $cost_to = $cost_to < $cost_from && $cost_to != 0 ? $cost_from : $cost_to;
         if ($cost_to || $cost_from) {
             for ($i = 0; $i < 4; $i++) {
                 $exfr = round($cost_from * $project_exRates[$cex[$cr] . $cex[$i]], 4);
                 $exto = round($cost_to * $project_exRates[$cex[$cr] . $cex[$i]], 4);
                 $fSql .= ($i ? ' OR ' : '') . "(p.currency = {$i} AND p.cost >= {$exfr}" . ($cost_to ? " AND p.cost <= {$exto}" : '') . ')';
                 $select[] = "(currency = {$i} AND cost >= {$exfr}" . ($cost_to ? " AND cost <= {$exto}" : '') . ")";
             }
             if ($filter['wo_cost'] == 't') {
                 $select[] = '(cost = 0)';
             }
             $set_select[] = "IF(" . implode(" OR ", $select) . ", 1, 0) as cost_filter";
             unset($select);
         }
     } elseif ($filter['cost_from'] === '0' && $filter['cost_to'] === '0') {
         $set_select[] = "IF(cost = 0, 1, 0) as cost_filter";
     } else {
         $set_select[] = "IF(cost = 0 OR cost > 0, 1, 0) as cost_filter";
     }
     // Разделы/Подразделы
     if ($filter['categories'] && $filter['my_specs'] == 'f') {
         $categories = array();
         for ($ci = 0; $ci < 2; $ci++) {
             if (sizeof($filter['categories'][$ci])) {
                 foreach ($filter['categories'][$ci] as $ckey => $cvalue) {
                     $categories[$ci][] = (int) $ckey;
                 }
             }
         }
         $sProfCat = '';
         $sProfSubcat = '';
         // собираем подразделы выбранных разделов
         if (sizeof($categories[0])) {
             $sProfCat = professions::getProfIdForGroups($categories[0]);
         }
         // собираем выбранные подразделы
         if (sizeof($categories[1])) {
             $sProfSubcat = implode(',', $categories[1]);
         }
         // склеиваем и получаем все подразделы вместе с зеркалами
         $sProf = $sProfCat . ($sProfCat && $sProfSubcat ? ',' : '') . $sProfSubcat;
         $aProf = professions::GetMirroredProfs($sProf);
         foreach ($aProf as $prof) {
             $select[] = "(prj_subcategory1 = {$prof} OR prj_subcategory2 = {$prof} OR prj_subcategory3 = {$prof})";
         }
         if (sizeof($categories[0])) {
             foreach ($categories[0] as $cat) {
                 $select[] = "(prj_category1 = {$cat} OR prj_category2 = {$cat} OR prj_category3 = {$cat})";
             }
         }
         $set_select[] = "IF(" . implode(" OR ", $select) . ", 1, 0) as category_filter";
         unset($select);
     }
     $this->_engine->setSelect(implode(", ", $set_select));
     $this->_engine->setFilter("cost_filter", array(1));
     if ($filter['is_closed_contest']) {
         $this->_engine->setFilter("closed_contest", array(1));
     }
     if ($filter['only_sbr'] == 't') {
         $this->_engine->setFilter("prefer_sbr", array(1));
     }
     if ($filter['my_specs'] == 't' && $filter['user_specs']) {
         $this->_engine->setFilter("my_spec_filter", array(1));
     }
     if ($filter['categories'] && $filter['my_specs'] == 'f') {
         $this->_engine->setFilter("category_filter", array(1));
     }
     if ($filter['country']) {
         $this->_engine->setFilter("country", array($filter['country']));
     }
     if ($filter['city']) {
         $this->_engine->setFilter("city", array($filter['city']));
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:98,代码来源:search_element_projects.php


注:本文中的professions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。