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


PHP professions::GetSelFilProf方法代码示例

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


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

示例1: _admEditPrjOfferParseForm

/**
 * Отдает HTML для Редактирование предложения по проектам
 * 
 * @param  object $objResponse xajaxResponse
 * @param  string $rec_id идентификатор записи
 * @param  string $rec_type тип записи
 * @param  array $aParams дополнительные параметры с UID отправителя. остальные - опционально
 * @return string
 */
function _admEditPrjOfferParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array())
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/portfolio.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers_answers.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers_dialogue.php';
    $offer = projects_offers::GetPrjOfferById($rec_id);
    $dialogue = new projects_offers_dialogue();
    $user = new users();
    $account = new account();
    $portfolio = new portfolio();
    $professions = professions::GetSelFilProf($offer['user_id']);
    $professions = $professions ? $professions : array();
    $cur_prof = $professions ? $professions[0]['id'] : 0;
    $op_sum = projects_offers_answers::COLOR_FM_COST;
    if (!($portf_works = $portfolio->GetPortfProf($offer['user_id'], $cur_prof))) {
        $portf_works = array();
    }
    $user->GetUserByUID($offer['user_id']);
    $account->GetInfo($offer['user_id']);
    $offer['dialogue'] = $dialogue->GetDialogueForOffer($offer['id']);
    ob_start();
    include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/projects_offers.php';
    $sHtml = ob_get_contents();
    ob_end_clean();
    // текст
    $sOnReady = "if(document.getElementById('adm_edit_descr')) document.getElementById('adm_edit_descr').value = (\$('adm_edit_descr_source')? \$('adm_edit_descr_source').value : null);";
    // работы -----------------------------------
    $offer['portfolio_work_1_id'] = $offer['portf_id1'];
    $offer['portfolio_work_2_id'] = $offer['portf_id2'];
    $offer['portfolio_work_3_id'] = $offer['portf_id3'];
    $offer['portfolio_work_1'] = $offer['pict1'];
    $offer['portfolio_work_2'] = $offer['pict2'];
    $offer['portfolio_work_3'] = $offer['pict3'];
    $offer['portfolio_work_1_prev_pict'] = $offer['prev_pict1'];
    $offer['portfolio_work_2_prev_pict'] = $offer['prev_pict2'];
    $offer['portfolio_work_3_prev_pict'] = $offer['prev_pict3'];
    $offer['cost_from'] = round($offer['cost_from'], 2);
    $offer['cost_to'] = round($offer['cost_to'], 2);
    $use = array();
    $sWorks = 'adm_edit_content.works_ids   = new Array();
        adm_edit_content.works_names = new Array();
        adm_edit_content.works_prevs = new Array();
        adm_edit_content.works_picts = new Array();
        adm_edit_content.works_links = new Array();';
    if ($portf_works) {
        foreach ($portf_works as $key => $value) {
            $use[$value['id']] = 1;
            $sWorks .= "adm_edit_content.works_ids[{$value['id']}] = '{$value['id']}';\n                adm_edit_content.works_names[{$value['id']}] = '" . htmlspecialchars(addslashes(trim($value['name']))) . "';\n                adm_edit_content.works_prevs[{$value['id']}] = '" . trim($value['prev_pict']) . "';\n                adm_edit_content.works_picts[{$value['id']}] = '" . trim($value['pict']) . "';\n                adm_edit_content.works_links[{$value['id']}] = '" . trim($value['link']) . "';";
        }
    }
    for ($i = 1; $i < 4; $i++) {
        if ($user_offer['portf_id' . $i] > 0 && !isset($use[$user_offer['portf_id' . $i]])) {
            $sId = $user_offer['portf_id' . $i];
            $sWorks .= "adm_edit_content.works_ids[{$sId}] = '{$sId}';\n                adm_edit_content.works_prevs[{$sId}] = '" . trim($user_offer['prev_pict' . $i]) . "';\n                adm_edit_content.works_picts[{$sId}] = '" . trim($user_offer['pict' . $i]) . "';";
        }
    }
    if ($offer['portfolio_work_1'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_1_id']}, '{$offer['portfolio_work_1']}', '{$offer['portfolio_work_1_prev_pict']}');";
    }
    if ($offer['portfolio_work_2'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_2_id']}, '{$offer['portfolio_work_2']}', '{$offer['portfolio_work_2_prev_pict']}');";
    }
    if ($offer['portfolio_work_3'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_3_id']}, '{$offer['portfolio_work_3']}', '{$offer['portfolio_work_3_prev_pict']}');";
    }
    //-------------------------------------------
    $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать предложения по проекту');
    $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml);
    $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');");
    $objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное', 'Файлы'];");
    $objResponse->script('adm_edit_content.edit();');
    $objResponse->script("adm_edit_content.userLogin = '{$user->login}';");
    $objResponse->script($sOnReady);
    $objResponse->script($sWorks);
    $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_PRJ_OFFERS . ');');
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:89,代码来源:adm_edit_content.server.php

示例2: professions

 $user_offer_exist = $obj_offer->OfferExist($prj_id, $uid);
 if ($user_offer_exist) {
     // Предложение данного пользователя по данному проекту.
     $user_offer = $obj_offer->GetPrjOffer($prj_id, $uid);
     if ($project['exec_id'] == $uid) {
         $exec_info = $user_offer;
     }
     // Диалог по предложению данного пользователя.
     $user_offer['dialogue'] = $obj_dialogue->GetDialogueForOffer($user_offer['id']);
 } else {
     // Предложение данного пользователя по данному проекту.
     $user_offer = false;
 }
 // Профессии.
 $obj_profession = new professions();
 $professions = $obj_profession->GetSelFilProf($uid);
 if (!$professions) {
     $professions = array();
     // Текущая профессия.
     $cur_prof = 0;
 } else {
     // Текущая профессия.
     $cur_prof = $professions[0]['id'];
 }
 // Работы.
 $obj_portfolio = new portfolio();
 if (!($portf_works = $obj_portfolio->GetPortfProf($uid, $cur_prof))) {
     $portf_works = array();
 }
 foreach ($portf_works as &$work) {
     $obj_portfolio->GenerateStaticPreview($work, $_SESSION['login']);
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php


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