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));
 }
Beispiel #2
0
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;
}
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;
}
/**
 * @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;
}
Beispiel #5
0
 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;
 }
 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;
 }
 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));
 }
Beispiel #8
0
        <?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>
Beispiel #9
0
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;
                }
                $aThemeId = is_array($top['theme_id']) ? $top['theme_id'] : array($top['theme_id']);
                $top['answers'] = $DB->rows("SELECT * FROM commune_poll_answers WHERE theme_id IN (?l) ORDER BY id", array($top['theme_id']));
                $GLOBALS[LINK_INSTANCE_NAME] = new links('commune');
                $user_id = $uid;
                $mod = $user_mod;
                $is_member = $mod & (commune::MOD_ADMIN | commune::MOD_COMM_ACCEPTED | commune::MOD_COMM_AUTHOR);
                $is_moder = $mod & (commune::MOD_ADMIN | commune::MOD_MODER | commune::MOD_COMM_MODERATOR | commune::MOD_COMM_AUTHOR);
                $commune_info = commune::getCommuneInfoByMsgID($top['id']);
                ?>
                                <style>
.lo-m .lo-i-my-d .ac-pro, .lo-m .lo-i-my-d .ac-epro {
margin-right: 0px;
}
.lo .utxt .b-layout__txt .b-icon__lprofi{ vertical-align:baseline !important; top:2px !important;}
.lo .utxt>.b-pic{ margin-right:10px !important;}
</style>
								<div class="lo lo-m" id='idTop_<?php 
                echo $top['id'];
                ?>
' style='margin-bottom:0px !important;'>
									<ul class="lo-p">
										<li class="lo-s">
											<div class="b-layout_bordrad_3">
												<a href="/commune" class="lnk-dot-666">Сообщества</a>
											</div>
										</li>
										<li class="post-f-fav">
                                            <?php 
                $msg_id = $top['id'];
                ?>
                                            <?php 
                if ($favs['CM' . $msg_id]) {
                    ?>
 
                                                <img src="/images/bookmarks/<?php 
                    echo $stars[$favs['CM' . $msg_id]['priority']];
                    ?>
" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'CM' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'CM')" ><?php 
                    }
                    ?>
                                            <?php 
                } else {
                    ?>
                                                <img src="/images/bookmarks/bsw.png" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'CM' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'CM')" ><?php 
                    }
                    ?>
                                            <?php 
                }
                ?>
                                            <ul class="post-f-fav-sel" style="display:none;" id="FavFloat<?php 
                echo $msg_id;
                ?>
"></ul>
										</li>
									</ul>
									<div class="utxt">
<?php 
                print __LentaPrntUsrInfo($top, 'user_', '', '', false, true);
                ?>
										<h3>
                                        <?php 
                if ($top['is_private'] == 't') {
                    ?>
                                        <img src="/images/icons/eye-hidden.png" alt="Скрытый пост" title="Скрытый пост">&nbsp;	            
                                        <?php 
                }
                //if
                ?>
                                        <?php 
                $sTitle = $top['title'];
                ?>
                                        <?php 
                $sMessage = $top['msgtext'];
                ?>
                                        <a href="<?php 
                echo getFriendlyURL('commune', $top['id']);
                ?>
?om=<?php 
                echo commune::OM_TH_NEW;
                ?>
"><?php 
                echo reformat2($sTitle, 30, 0, 1);
                ?>
</a>&nbsp;</h3>
										<p><?php 
                echo reformat2($sMessage, 46, 1, 0, 1);
                ?>
</p>

                                        <!-- Questions -->
			<?php 
                if ($top['question'] != '') {
                    ?>
			<div id="poll-<?php 
                    echo $top['theme_id'];
                    ?>
" class="commune-poll">
				<div class="commune-poll-theme"><?php 
                    echo reformat($top['question'], 43, 0, 1);
                    ?>
</div>
				<div id="poll-answers-<?php 
                    echo $top['theme_id'];
                    ?>
">
				<?php 
                    if ($top['poll_closed'] == 't') {
                        ?>
<table class="b-layout__table b-layout__table_width_full"><?php 
                    }
                    ?>
                <?php 
                    // если надо вывести только количество ответов
                    $showAnswers = $top['poll_votes'] || !$user_id || $top['commune_blocked'] == 't' || $top['user_is_banned'] || $top['member_is_banned'] || !$is_member;
                    if ($showAnswers) {
                        ?>
<table class="poll-variants"><?php 
                    }
                    ?>
				<?php 
                    $i = 0;
                    $max = 0;
                    if ($top['poll_closed'] == 't') {
                        foreach ($top['answers'] as $answer) {
                            $max = max($max, $answer['votes']);
                        }
                    }
                    foreach ($top['answers'] as $answer) {
                        ?>

						<?php 
                        if ($top['poll_closed'] == 't') {
                            ?>
                        	<tr class="b-layout__tr">
                              <td class="b-layout__left b-layout__left_width_50"><label class="b-layout__txt" for="poll_<?php 
                            echo $i;
                            ?>
"><?php 
                            echo reformat($answer['answer'], 30, 0, 1);
                            ?>
</label></td>
                              <td class="b-layout__middle b-layout__middle_width_30 b-layout__middle_center"><?php 
                            echo $answer['votes'];
                            ?>
</td>
                              <td class=" b-layout__right "><div class=" res-line rl1" style="width: <?php 
                            echo $max ? round(100 * $answer['votes'] / $max * 3) : 0;
                            ?>
px;"></div></td>
                            </tr>
                        <?php 
                        } else {
                            ?>
                            <?php 
                            if ($showAnswers) {
                                ?>
                                <tr>
                                    <td class="bp-gres"><?php 
                                echo $answer['votes'];
                                ?>
</td>
                                    <td>
                                        <label><?php 
                                echo $answer['answer'];
                                ?>
</label>
                                    </td>
                                </tr>
                            <?php 
                            } else {
                                ?>
                                <?php 
                                if ($top['poll_multiple'] == 't') {
                                    ?>
                                <div class="b-check b-check_padbot_10">
                                    <input id="poll-<?php 
                                    echo $top['theme_id'];
                                    ?>
_<?php 
                                    echo $i;
                                    ?>
" class="b-check__input" type="checkbox" name="poll_vote[]" value="<?php 
                                    echo $answer['id'];
                                    ?>
" />
                                    <label class="b-check__label b-check__label_fontsize_13" for="poll-<?php 
                                    echo $top['theme_id'];
                                    ?>
_<?php 
                                    echo $i++;
                                    ?>
"><?php 
                                    echo reformat($answer['answer'], 30, 0, 1);
                                    ?>
</label>
                                </div>
                                <?php 
                                } else {
                                    ?>
                                <div class="b-radio__item  b-radio__item_padbot_5">
                                    <table class="b-layout__table b-layout__table_width_full" cellpadding="0" cellspacing="0" border="0">
                                        <tr class="b-layout__tr">
                                            <td class="b-layout__left b-layout__left_width_15"><input id="poll-<?php 
                                    echo $top['theme_id'];
                                    ?>
_<?php 
                                    echo $i;
                                    ?>
" class="b-radio__input b-radio__input_top_-3" type="radio" name="poll_vote" value="<?php 
                                    echo $answer['id'];
                                    ?>
" /></td>
                                            <td class="b-layout__right"><label class="b-radio__label b-radio__label_fontsize_13" for="poll-<?php 
                                    echo $top['theme_id'];
                                    ?>
_<?php 
                                    echo $i++;
                                    ?>
"><?php 
                                    echo reformat($answer['answer'], 30, 0, 1);
                                    ?>
</label></td>
                                        </tr>
                                    </table>
                                </div>
                                <?php 
                                }
                                ?>
                            <?php 
                            }
                            ?>
                            
                        <?php 
                        }
                        ?>

				<?php 
                    }
                    ?>
                <?php 
                    if ($showAnswers) {
                        ?>
</table><?php 
                    }
                    ?>
				<?php 
                    if ($top['poll_closed'] == 't') {
                        ?>
</table><?php 
                    }
                    ?>
				</div>
				<?php 
                    if (!$top['poll_votes'] && $user_id && $top['poll_closed'] != 't' && $top['commune_blocked'] != 't' && !$top['user_is_banned'] && !$top['member_is_banned'] && $is_member) {
                        ?>
                
                <div class="b-buttons b-buttons_inline-block">
                    <span id="poll-btn-vote-<?php 
                        echo $top['theme_id'];
                        ?>
">
                        <a class="b-button b-button_flat b-button_flat_grey" href="javascript: return false;" onclick="poll.vote('Commune', <?php 
                        echo $top['theme_id'];
                        ?>
); return false;">Ответить</a>&nbsp;&nbsp;&nbsp;                
                    </span>                
					<span id="poll-btn-result-<?php 
                        echo $top['theme_id'];
                        ?>
" ><a class="b-buttons__link b-buttons__link_dot_0f71c8" href="javascript: return false;" onclick="poll.showResult('Commune', <?php 
                        echo $top['theme_id'];
                        ?>
); return false;">Посмотреть результаты</a></span>
                </div>
				<?php 
                    } else {
                        ?>
				<span id="poll-btn-vote-<?php 
                        echo $top['theme_id'];
                        ?>
"></span>
				<span id="poll-btn-result-<?php 
                        echo $top['theme_id'];
                        ?>
"></span>
				<?php 
                    }
                    ?>
			</div>
            <br />
			<?php 
                }
                ?>
                                        <!-- /Questions -->

                                        <!-- Youtube -->
<?php 
                if ($top['yt_link']) {
                    $tmp_yt_id = $top['id'] . 'ytlink' . mt_rand(1, 1000000);
                    $tmp_yt_data = show_video($top['id'], $top['yt_link']);
                    array_push($yt_replace_id, '/' . $tmp_yt_id . '/');
                    array_push($yt_replace_data, $tmp_yt_data);
                    echo "<div style='padding-top: 20px'>" . $tmp_yt_id . "</div><br/>";
                }
                ?>


<?php 
                //            (($top['youtube_link'])? ("<div style='padding-top: 20px'>".show_video($top['id'], $top['youtube_link'])."</div><br/>"):"")
                ?>

                                        <!-- /Youtube -->

                                        <!-- Attach -->
<?php 
                if ($top['attach']) {
                    $attach = $top['attach'][0];
                    if ($attach['fname']) {
                        $att_ext = strtolower(CFile::getext($attach['fname']));
                        if ($att_ext == "swf") {
                            print "<br/>" . viewattachExternal($top['user_login'], $attach['fname'], "upload", "/blogs/view_attach.php?user="******"&attach=" . $attach['fname']) . "<br/>";
                        } elseif ($att_ext == 'flv') {
                            print "<br/>" . viewattachLeft($top['user_login'], $attach['fname'], "upload", $file, 1000, 470, 307200, true, $attach['small'] == 't' ? 1 : 0) . "<br/>";
                        } else {
                            print "<br/>" . viewattachLeft($top['user_login'], $attach['fname'], "upload", $file, 1000, 470, 307200, !($attach['small'] == 't'), $attach['small'] == 't' ? 1 : 0) . "<br/>";
                        }
                    }
                    echo '<br/>';
                    if (sizeof($top['attach']) > 1) {
                        echo "<a href=\"" . getFriendlyURL('commune', $top['id']) . "\"><b>" . blogs::ShowMoreAttaches(sizeof($top['attach'])) . "</b></a><br/><br/>";
                    }
                }
                ?>

                                        <!-- /Attach -->


									</div>
									<ul class="lo-i">
                                        <?php 
                $post_year = dateFormat('Y', $top['post_time']);
                ?>
                                        <li class="lo-i-cm">
                                            <a href="<?php 
                echo getFriendlyURL('commune', $top['id']);
                ?>
" <?php 
                echo $top['current_count'] == NULL && intval($top['count_comments']) != 0 ? 'style="font-weight:bold;"' : '';
                ?>
><?php 
                echo $top['closed_comments'] == 't' ? "Комментирование закрыто" : "Комментарии (" . intval($top['count_comments']) . ")";
                ?>
</a>
                                            <?php 
                if ($top['closed_comments'] == 'f') {
                    $top['current_count'] = $top['current_count'] == '' ? $top['a_count'] - 1 : $top['current_count'];
                    if ($top['a_count'] > 1) {
                        $unread = $top['a_count'] - 1 - $top['current_count'];
                    }
                    if ($unread > 0) {
                        ?>
                                                <a href="<?php 
                        echo getFriendlyURL('commune', $top['id']);
                        ?>
#unread" style="color:#6BA813; font-weight:bold;">(<?php 
                        echo $unread;
                        ?>
 <?php 
                        echo $unread == 1 ? "новый" : "новых";
                        ?>
)</a>
                                                <?php 
                    }
                    $unread = 0;
                }
                ?>
                                        </li>
										<li class="lo-i-c"><a href="/commune/?id=<?php 
                echo $top['commune_id'];
                ?>
"><?php 
                echo $top['commune_name'];
                ?>
</a>, <a href="/commune/?gr=<?php 
                echo $top['commune_group_id'];
                ?>
"><?php 
                echo $top['commune_group_name'];
                ?>
</a></li>
										<li><?php 
                echo $post_year > 2000 ? dateFormat("d.m.Y H:i", $top['post_time']) : '';
                ?>
</li>
									</ul>
								</div>
                                <br>

                            <?php 
                break;
            case '1':
                // Портфолио
                $work = $item;
                if ($work['work_is_blocked']) {
                    continue;
                }
                $is_fav = isset($favs['PF' . $work['portfolio_id']]) ? 1 : 0;
                $msg_id = $work['portfolio_id'];
                ?>
								<div class="lo lo-m" style='margin-bottom:0px !important;'>
									<ul class="lo-p">
										<li class="lo-s">
											<div class="b-layout_bordrad_3">
												<a href="/portfolio" class="lnk-dot-666">Работы</a>
											</div>
										</li>
										<li class="post-f-fav">
                                            <?php 
                if ($favs['PF' . $msg_id]) {
                    ?>
 
                                                <img src="/images/bookmarks/<?php 
                    echo $stars[$favs['PF' . $msg_id]['priority']];
                    ?>
" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'PF' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'PF')" ><?php 
                    }
                    ?>
                                            <?php 
                } else {
                    ?>
                                                <img src="/images/bookmarks/bsw.png" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'PF' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'PF')" ><?php 
                    }
                    ?>
                                            <?php 
                }
                ?>
                                            <ul class="post-f-fav-sel" style="display:none;" id="FavFloat<?php 
                echo $msg_id;
                ?>
"></ul>
										</li>
									</ul>
									<div class="utxt">
                                        <?php 
                print __LentaPrntUsrInfo($work, 'user_', '', '', false, true);
                ?>
                                        <?php 
                $sTitle = $work['name'];
                ?>
										<h3><a href="/users/<?php 
                echo $work['user_login'];
                ?>
/viewproj.php?prjid=<?php 
                echo $work['portfolio_id'];
                ?>
"><?php 
                echo reformat2($sTitle, 40, 0, 1);
                ?>
</a>&nbsp;</h3>
                                        <?php 
                $is_preview = $work['pict'] || $work['prev_pict'];
                if ($is_preview && $work['prev_type'] != 1) {
                    echo view_preview($work['user_login'], $work['prev_pict'], "upload", $align, true, true, '', 200) . "<br/><br/>";
                }
                close_tags($work['descr'], array('b', 'i'));
                $sDescr = $work['descr'];
                ?>
										<p><?php 
                echo reformat($sDescr, 80, 0, 0, 1);
                ?>
</p>



									</div>
									<ul class="lo-i">
                                        <?php 
                $post_year = dateFormat('Y', $work['post_time']);
                ?>
										<li class="lo-i-c"><a href="/freelancers/?prof=<?php 
                echo $work['prof_id'];
                ?>
"><?php 
                echo $work['prof_name'];
                ?>
</a></li>
										<li><?php 
                echo $post_year > 2000 ? dateFormat("d.m.Y H:i", $work['post_time']) : '';
                ?>
</li>
									</ul>
								</div>
                                <br>
                            <?php 
                break;
            case '4':
                // Блоги
                $item['thread_id'] = $item['theme_id'];
                $item['answers'] = $DB->rows("SELECT * FROM blogs_poll_answers WHERE thread_id IN (?l) ORDER BY id", array($item['thread_id']));
                $GLOBALS[LINK_INSTANCE_NAME] = new links('blogs');
                $user_id = $uid;
                ?>
								<div class="lo lo-m" id='idBlog_<?php 
                echo $item['thread_id'];
                ?>
' style='margin-bottom:0px !important;'>
									<ul class="lo-p">
										<li class="lo-s">
											<div class="b-layout_bordrad_3">
												<a href="/blogs" class="lnk-dot-666">Блоги</a>
											</div>
										</li>
										<li class="post-f-fav">
                                            <?php 
                $msg_id = $item['theme_id'];
                ?>
                                            <?php 
                if ($favs['BL' . $msg_id]) {
                    ?>
 
                                                <img src="/images/bookmarks/<?php 
                    echo $stars[$favs['BL' . $msg_id]['priority']];
                    ?>
" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'BL' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'BL')" ><?php 
                    }
                    ?>
                                            <?php 
                } else {
                    ?>
                                                <img src="/images/bookmarks/bsw.png" alt="" on="<?php 
                    echo $is_fav ? 1 : 0;
                    ?>
" id="favstar<?php 
                    echo 'BL' . $msg_id;
                    ?>
" <?php 
                    if ($uid) {
                        ?>
onclick="ShowFavFloatLenta(<?php 
                        echo $msg_id;
                        ?>
, <?php 
                        echo $uid;
                        ?>
, 'BL')" ><?php 
                    }
                    ?>
                                            <?php 
                }
                ?>
                                            <ul class="post-f-fav-sel" style="display:none;" id="FavFloat<?php 
                echo $msg_id;
                ?>
"></ul>
										</li>
									</ul>
									<div class="utxt">
                                        <?php 
                print __LentaPrntUsrInfo($item, 'user_', '', '', false, true);
                ?>
                                        <?php 
                $sTitle = $item['title'];
                ?>
                                        <?php 
                $sMessage = $item['msgtext'];
                ?>
										<h3><a href="<?php 
                echo getFriendlyURL("blog", $item['theme_id']);
                ?>
"><?php 
                echo reformat2($sTitle, 30, 0, 1);
                ?>
</a>&nbsp;</h3>
										<p><?php 
                echo reformat($sMessage, 46, 1, -($item['is_chuck'] == 't'), 1);
                ?>
</p>

                                        <!-- Questions -->
			<?php 
                if ($item['question'] != '') {
                    ?>
			<div id="poll-<?php 
                    echo $item['thread_id'];
                    ?>
" class="poll">
				<div class="commune-poll-theme"><?php 
                    echo reformat($item['question'], 43, 0, 1);
                    ?>
</div>
				<div id="poll-answers-<?php 
                    echo $item['thread_id'];
                    ?>
">
				<?php 
                    if ($item['poll_multiple'] != 't') {
                        ?>
<div class="b-radio b-radio_layout_vertical"><?php 
                    }
                    ?>
				<?php 
                    if ($item['poll_closed'] == 't') {
                        ?>
<table class="b-layout__table b-layout__table_width_full"><?php 
                    }
                    ?>
				<?php 
                    $i = 0;
                    $max = 0;
                    if ($item['poll_closed'] == 't') {
                        foreach ($item['answers'] as $answer) {
                            $max = max($max, $answer['votes']);
                        }
                    }
                    foreach ($item['answers'] as $answer) {
                        ?>
				
				<?php 
                        if ($item['poll_closed'] == 't') {
                            ?>
                    <tr class="b-layout__tr">
                      <td class="b-layout__left b-layout__left_width_50"><label class="b-layout__txt" for="poll_<?php 
                            echo $i;
                            ?>
"><?php 
                            echo reformat($answer['answer'], 30, 0, 1);
                            ?>
</label></td>
                      <td class="b-layout__middle b-layout__middle_width_30 b-layout__middle_center"><?php 
                            echo $answer['votes'];
                            ?>
</td>
                      <td class=" b-layout__right "><div class=" res-line rl1" style="width: <?php 
                            echo $max ? round(100 * $answer['votes'] / $max * 3) : 0;
                            ?>
px;"></div></td>
                    </tr>
				<?php 
                        } else {
                            ?>
					<?php 
                            if ($item['poll_votes'] || !$user_id) {
                                ?>
						<div class="bp-gres"><?php 
                                echo $answer['votes'];
                                ?>
</div>
					<?php 
                            } else {
                                ?>
						
						<?php 
                                if ($item['poll_multiple'] == 't') {
                                    ?>
                        	<div class="b-check b-check_padbot_10">
								<input id="poll-<?php 
                                    echo $item['thread_id'];
                                    ?>
_<?php 
                                    echo $i;
                                    ?>
" class="b-check__input" type="checkbox" name="poll_vote[]" value="<?php 
                                    echo $answer['id'];
                                    ?>
" />
                                <label class="b-check__label b-check__label_fontsize_13" for="poll-<?php 
                                    echo $item['thread_id'];
                                    ?>
_<?php 
                                    echo $i++;
                                    ?>
"><?php 
                                    echo reformat($answer['answer'], 30, 0, 1);
                                    ?>
</label>
                            </div>
						<?php 
                                } else {
                                    ?>
                        	<div class="b-radio__item  b-radio__item_padbot_5">
                            	<table class="b-layout__table b-layout__table_width_full" cellpadding="0" cellspacing="0" border="0">
                                	<tr class="b-layout__tr">
                                    	<td class="b-layout__left b-layout__left_width_15"><input id="poll-<?php 
                                    echo $item['thread_id'];
                                    ?>
_<?php 
                                    echo $i;
                                    ?>
" class="b-radio__input b-radio__input_top_-3" type="radio" name="poll_vote" value="<?php 
                                    echo $answer['id'];
                                    ?>
" /></td>
                                        <td class="b-layout__right"><label class="b-radio__label b-radio__label_fontsize_13" for="poll-<?php 
                                    echo $item['thread_id'];
                                    ?>
_<?php 
                                    echo $i++;
                                    ?>
"><?php 
                                    echo reformat($answer['answer'], 30, 0, 1);
                                    ?>
</label></td>
                                    </tr>
                                </table>
                            </div>
						<?php 
                                }
                                ?>
					<?php 
                            }
                            ?>
					
				<?php 
                        }
                        ?>
				
				<?php 
                    }
                    ?>
				<?php 
                    if ($item['poll_closed'] == 't') {
                        ?>
</table><?php 
                    }
                    ?>
				<?php 
                    if ($item['poll_multiple'] != 't') {
                        ?>
</div><?php 
                    }
                    ?>
				</div>
				<?php 
                    if (!$item['poll_votes'] && $user_id && $item['poll_closed'] != 't') {
                        ?>
                <div class="b-buttons b-buttons_inline-block">
                    <span id="poll-btn-vote-<?php 
                        echo $item['thread_id'];
                        ?>
">
                        <a class="b-button b-button_flat b-button_flat_grey" href="javascript: return false;"  onclick="poll.vote('Blogs', <?php 
                        echo $item['thread_id'];
                        ?>
); return false;">Ответить</a>                
                        &nbsp;&nbsp;&nbsp;
                    </span>                
                    <span id="poll-btn-result-<?php 
                        echo $item['thread_id'];
                        ?>
"><a class="b-buttons__link b-buttons__link_dot_0f71c8" href="javascript: return false;" onclick="poll.showResult('Blogs', <?php 
                        echo $item['thread_id'];
                        ?>
); return false;">Посмотреть результаты</a>&nbsp;&nbsp;&nbsp;</span>
                </div>
				<?php 
                    } else {
                        ?>
				<span id="poll-btn-vote-<?php 
                        echo $item['thread_id'];
                        ?>
"></span>
				<span id="poll-btn-result-<?php 
                        echo $item['thread_id'];
                        ?>
"></span>
				<?php 
                    }
                    ?>
			</div>
            <br/>
			<?php 
                }
                ?>
                                        <!-- /Questions -->

                                        <!-- Youtube -->
<?php 
                if ($item['yt_link']) {
                    $tmp_yt_id = $item['id'] . 'ytlink' . rand(1, 1000000);
                    $tmp_yt_data = show_video($item['id'], $item['yt_link']);
                    array_push($yt_replace_id, '/' . $tmp_yt_id . '/');
                    array_push($yt_replace_data, $tmp_yt_data);
                    echo "<div style='padding-top: 20px'>" . $tmp_yt_id . "</div><br/>";
                }
                //            =(($item['yt_link'])? ("<div style='padding-top: 20px'>".show_video($item['id'], $item['yt_link'])."</div>"):"")
                ?>
                                        <!-- /Youtube -->

                                        <!-- Attach -->
<?php 
                if ($item['attach']) {
                    $attach = $item['attach'][0];
                    if ($attach['fname']) {
                        $att_ext = strtolower(CFile::getext($attach['fname']));
                        if ($att_ext == "swf") {
                            print "<br/>" . viewattachExternal($item['user_login'], $attach['fname'], "upload", "/blogs/view_attach.php?user="******"&attach=" . $attach['fname']) . "<br/>";
                        } elseif ($att_ext == 'flv') {
                            print "<br/>" . viewattachLeft($item['user_login'], $attach['fname'], "upload", $file, 1000, 470, 307200, true, $attach['small'] == 2 ? 1 : 0) . "<br/>";
                        } else {
                            print "<br/>" . viewattachLeft($item['user_login'], $attach['fname'], "upload", $file, 1000, 470, 307200, !$attach['small'], $attach['small'] == 2 ? 1 : 0) . "<br/>";
                        }
                    }
                    echo '<br/>';
                    if (sizeof($item['attach']) > 1) {
                        echo "<a href=\"" . getFriendlyURL("blog", $item['theme_id']) . "\"><b>" . blogs::ShowMoreAttaches(sizeof($item['attach'])) . "</b></a><br/><br/>";
                    }
                }
                ?>

                                        <!-- /Attach -->
									</div>
									<ul class="lo-i">
                                        <?php 
                $post_year = dateFormat('Y', $item['post_time']);
                ?>
                                        <li class="lo-i-cm">
                                            <a href="<?php 
                echo getFriendlyURL("blog", $item['theme_id']);
                ?>
" <?php 
                echo $item['current_count'] == NULL && intval($item['count_comments']) != 0 ? 'style="font-weight:bold;"' : '';
                ?>
><?php 
                echo $item['closed_comments'] == 't' ? "Комментирование закрыто" : "Комментарии (" . intval($item['count_comments']) . ")";
                ?>
</a>
                                            <?php 
                if (isset($item['status_comments']) && $item['count_comments'] > 0 && $item['status_comments'] < $item['count_comments'] && $item['status_comments'] != -100 && $item['closed_comments'] == 'f') {
                    $new_comments_num = $item['count_comments'] - $item['status_comments'];
                    ?>
                                              <a href="<?php 
                    echo getFriendlyURL("blog", $item['theme_id']);
                    ?>
#unread" style="color:#6BA813; font-weight:bold;">(<?php 
                    echo $new_comments_num;
                    ?>
 <?php 
                    echo $new_comments_num == 1 ? "новый" : "новых";
                    ?>
)</a>
                                              <?php 
                } else {
                    if (isset($item['status_comments']) && $item['count_comments'] > 0 && $item['status_comments'] < $item['count_comments'] && $item['status_comments'] == -100 && $item['closed_comments'] == 'f') {
                        $new_comments_num = $item['count_comments'];
                        ?>
                                              <a href="<?php 
                        echo getFriendlyURL("blog", $item['theme_id']);
                        ?>
#unread" style="color:#6BA813; font-weight:bold;">(<?php 
                        echo $new_comments_num;
                        ?>
 <?php 
                        echo $new_comments_num == 1 ? "новый" : "новых";
                        ?>
)</a>
                                              <?php 
                    }
                }
                ?>
                                        </li>
										<li class="lo-i-c"><a href="<?php 
                echo getFriendlyURL("blog_group", $item['commune_group_id']);
                ?>
"><?php 
                echo $item['commune_group_name'];
                ?>
</a></li>
										<li><?php 
                echo $post_year > 2000 ? dateFormat("d.m.Y H:i", $item['post_time']) : '';
                ?>
</li>
									</ul>
								</div>
                                <br>
                                    <?php 
                break;
        }
        $i++;
    }
    ?>

                    <?php 
    //                      $allThemesCount = lenta::GetLentaThemesCount($cms);
    ?>


<br/>
                        <?php 
    // Страницы
    $count = 4;
    $pages = ceil(($allWorkCount + $allThemesCount) / lenta::MAX_ON_PAGE);
    $html = '<div class="b-pager" >';
    if (is_array($count)) {
        list($scount, $ecount) = $count;
    } else {
        $scount = $ecount = $count;
    }
    if ($pages > 1) {
        $start = $page - $scount;
        if ($start < 1) {
            $start = 1;
        }
        $end = $page + $ecount;
        if ($end > $pages) {
            $end = $pages;
        }
        $html .= '<ul class="b-pager__back-next">';
        if ($page < $pages) {
            $html .= "<input type=\"hidden\" id=\"next_navigation_link1\" value=\"" . ($page + 1) . "\">";
            $html .= '<li class="b-pager__next" id="nav_next_not_active1"><a class="b-pager__link" href="javascript:void(0)" onClick="document.location.href=\'#lentatop\'; spiner.show(); xajax_Lenta_Show(' . ($page + 1) . '); return false;" id="PrevLink"></a>&nbsp;&nbsp;</li>';
        }
        if ($page > 1) {
            $html .= "<input type=\"hidden\" id=\"pre_navigation_link1\" value=\"" . ($page - 1) . "\">";
            $html .= '<li class="b-pager__back">&nbsp;&nbsp;<a id="NextLink" class="b-pager__link" href="javascript:void(0)" onClick="document.location.href=\'#lentatop\'; spiner.show(); xajax_Lenta_Show(' . ($page - 1) . '); return false;"></a></li>';
        }
        $html .= '</ul>';
        $html .= '<ul class="b-pager__list">';
        for ($i = $start; $i <= $end; $i++) {
            if ($i == $start && $start > 1) {
                $html .= '<li class="b-pager__item"><a class="b-pager__link" href="javascript:void(0)" onClick="document.location.href=\'#lentatop\'; spiner.show(); xajax_Lenta_Show(1); return false;">1</a></li>';
                if ($i == 3) {
                    $html .= '<li class="b-pager__item"><a class="b-pager__link" href="javascript:void(0)" onClick="document.location.href=\'#lentatop\'; spiner.show(); xajax_Lenta_Show(2); return false;">2</a></li>';
                } elseif ($i != 2) {
                    $html .= "<li class='b-pager__item'>&hellip;</li>";
                }
            }
            $html .= $page == $i ? '<li class="b-pager__item b-pager__item_active"><span class="b-pager__b1"><span class="b-pager__b2">' . $i . '</span></span></li>' : '<li class="b-pager__item"><a class="b-pager__link" href="javascript:void(0)" onClick="document.location.href=\'#lentatop\'; spiner.show(); xajax_Lenta_Show(' . $i . '); return false;">' . $i . '</a></li>';
            if ($i == $end && $pages - 1 > $end) {
                $html .= '<li class="b-pager__item">&hellip;</li>';
            }
        }
        $html .= '</ul>';
    }
    echo $html . '</div>';
    // Страницы закончились
    ?>
    	                  
          
<?php 
    $content = ob_get_contents();
    ob_end_clean();
    $content_js = '';
    if ($yt_replace_data) {
        foreach ($yt_replace_data as $key => $value) {
            $yt_replace_data[$key] = preg_replace("/^(.*)<script.*\$/sm", "\$1", $value);
            $content_js .= preg_replace("/^(.*<script type='text\\/javascript'>)(.*)(<\\/script>)\$/sm", "\$2", $value);
        }
        $content = preg_replace($yt_replace_id, $yt_replace_data, $content);
        $objResponse->script($content_js);
    }
    $objResponse->assign('lenta-cnt', 'innerHTML', $content);
    $objResponse->script($content_js);
    $objResponse->script('spiner.hide();');
    $objResponse->script('$$("#lenta_cats_checkboxes input[type=checkbox]").each(function(el) { el.set("disabled", false); });');
    $objResponse->script('fix_banner();');
    return $objResponse;
}
/**
 * Отдает 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 . ');');
}
<?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";
Beispiel #12
0
 static function getProfessions($parent_id)
 {
     $profession = new professions();
     return self::sdgJSONencode($profession->retCategorysByParentIds($parent_id, array('id', 'name')));
 }
<?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 
}
Beispiel #14
0
 /**
  * Заполнение обязательных полей после регистрации через 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);
 }
 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']));
     }
 }
Beispiel #16
0
    ?>
 selected='selected'<?php 
}
?>
>Услуги</option>
        </select>
    </div>
    <div class="b-layout__txt b-layout__txt_padbot_20 b-page__ipad b-page__iphone"><img src="/images/ico_setup.gif" alt="" width="6" height="9" />&nbsp;&nbsp;<a class="b-layout__link b-layout__link_fontsize_11" href="/users/<?php 
echo $user->login;
?>
/setup/portfsetup/">Изменить разделы</a></div>
    <div class="b-layout__txt b-layout__txt_padbot_15 b-layout__txt_fontsize_11"><a class="b-layout__link b-layout__link_fontsize_11 b-layout__link_color_0f71c8" href="/users/<?php 
echo $user->login;
?>
/setup/specsetup/" id="ap11">Специализация</a>:&nbsp;&nbsp;<?php 
echo professions::GetProfNameWP($user->spec, ' / ', 'Нет специализации');
?>
</div>
    <?php 
if (!is_pro()) {
    ?>
    <div class="b-layout__txt b-layout__txt_padbot_15 b-layout__txt_fontsize_11">Чтобы увеличить количество специализаций и получить дополнительные возможности, рекомендуем приобрести аккаунт <?php 
    echo view_pro(false, false, true, 'владельцев платного аккаунта');
    ?>
</div>
    <?php 
} else {
    ?>
    <div class="b-layout__txt b-layout__txt_padbot_15 b-layout__txt_fontsize_11"><a class="b-layout__link b-layout__link_fontsize_11 b-layout__link_color_0f71c8" href="/users/<?php 
    echo $user->login;
    ?>
Beispiel #17
0
 /**
  * Возвращает блок ссылок для Дополнительного фильтра фрилансеров.
  * 
  * @param int $nSide   Где показывать ссылку: 0 - в левой колонке, 1 - над фильтром
  * @param int $sProfId опционально. Раздел каталога (id из professions). Если не указано - то $this->sProfId
  *
  * @return array
  */
 public function fseoGetLinksBlock($nSide = 0, $sProfId = null)
 {
     global $DB;
     $aProfId = $sProfId ? professions::GetMirroredProfs($sProfId) : array($this->sProfId);
     $sQuery = 'SELECT id, title FROM freelancer_seo WHERE side = ?i AND prof_id IN (?l)';
     $aReturn = is_array($aProfId) && count($aProfId) ? $DB->rows($sQuery, $nSide, $aProfId) : array();
     return $aReturn;
 }
Beispiel #18
0
            <div class="b-pager">
                <ul class="b-pager__list">
                    <li class="b-pager__item">
                        <a class="b-pager__link" href="/projects/">Все проекты</a>
                    </li>
                </ul>
            </div>
        </div>
<?php 
    }
    //Выходим, далее шаблон не выводим
    return;
}
//$is_send_offers = projects_offers::offerSpecIsAllowed($project['id']);
if (!is_pro()) {
    $spec_modified = professions::getLastModifiedSpec($_SESSION['uid']);
}
$count_hidden_offers = 0;
?>


 
 <a name="offers"></a>

    <?php 
$notHiddenOffersCount = count($offers) + (int) $user_offer_exist;
// сколько ответов будет показано
$count_hidden_offers = $real_offers_count - $notHiddenOffersCount;
?>

<?php 
Beispiel #19
0
    // проверка статусов платежей paymaster при возврате
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/pmpay.php";
    $pm = new pmpay();
    if (DEBUG) {
        $pm->setDebugUrl($GLOBALS['host'] . '/norisk2/admin/pm-server-test.php');
    }
    $pm->checkRefund();
}
if (SERVER === 'release') {
    /*
     * @todo: https://beta.free-lance.ru/mantis/view.php?id=29134#c87337
     * 
    require_once($_SERVER['DOCUMENT_ROOT'] . "/classes/qiwipay.php");
    $qiwipay = new qiwipay();
    $qiwipay->checkBillsStatus($error);
    */
    if (date('i') % 10 == 0) {
        // проверка статусов платежей paymaster
        require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/pmpay.php";
        $pm = new pmpay();
        $pm->checkInvoiced();
    }
}
// запускаетс¤ в 0 и 1 минуту каждого часа с начала суток до 5 утра
if (date('i') == 0 && date('H') >= 0 && date('H') <= 5) {
    $log = new log('minutly/' . SERVER . '-%d%m%Y[%H].log', 'w');
    // разморозка ѕ–ќ
    $log->TRACE(payed::freezeUpdateProUsers());
}
professions::autoProlongSpecs();
Beispiel #20
0
"><?php 
        echo $sStageName;
        ?>
</a></p>
                        <?php 
    } else {
        ?>
                            <p>Этап: <?php 
        echo $sStageName;
        ?>
</p>
                        <?php 
    }
    ?>
                        <p><span>Категория: <?php 
    echo professions::GetProfNameWP($theme['sub_category']);
    ?>
</span></p>
                        <p><span><?php 
    echo date('d.m.Y H:i', strtotime($theme['stage_closed']));
    ?>
</span></p>
                    </div>
                    <b class="b2"></b>
                    <b class="b1"></b>
                </div>
                <?php 
    /* !!! классы sbrmsgblock, editsbrblock, editFromSbr не существуют, необходимы для точной обработки логики вызывания через XAJAX функции редактирования нескольких отзывов*/
    ?>
                <div id="op_message_<?php 
    echo $theme['id'];
Beispiel #21
0
 function GetFilter($user_id)
 {
     global $DB;
     if (!$user_id) {
         return false;
     }
     $sql = "SELECT * FROM projects_filters_pda WHERE user_id=?i";
     $ret = $DB->row($sql, $user_id);
     if ($DB->error || !$ret) {
         return false;
     }
     if (isset($ret['cost_from']) && $ret['cost_from'] == 0) {
         $ret['cost_from'] = '';
     }
     if (isset($ret['cost_to']) && $ret['cost_to'] == 0) {
         $ret['cost_to'] = '';
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     $ret['user_specs'] = professions::GetProfessionsByUser($user_id, false, true);
     return $ret;
 }
Beispiel #22
0
    if ($prjid) {
        $error .= $portf->DelPortf(get_uid(false), $prjid, hasPermissions('users'));
    }
    $pattern = "#(/users/[\\w_\\d]+/)viewproj\\.php\\?prjid=[0-9]+.*#";
    $locate_url = preg_replace($pattern, '$1', $_SERVER['REQUEST_URI']);
    header("location: {$locate_url}");
    exit;
}
$proj = portfolio::GetPrj($prjid, $uid);
$width = $height = 0;
if (!$proj || $proj['is_blocked'] == 't' && $uid != get_uid(false) && !hasPermissions('users')) {
    $fpath = '../';
    include ABS_PATH . '/404.php';
    exit;
} else {
    $spec_text = professions::GetProfName($proj['spec']);
    if ($proj['pict']) {
        $imgTitle = $proj['name'] . ' (' . $spec_text . ') - фри-лансер ' . $proj['uname'] . ' ' . $proj['usurname'] . ' [' . $proj['login'] . ']. ';
        $str = viewattach($proj['login'], $proj['pict'], 'upload', $file, -1, -1, 1048576, 0, 0, 'center', false, 1, $proj['name'], true, false, $imgTitle, $proj['wmode']);
    }
    //elseif ($proj['link'] && !$proj['descr']) header("Location: http://" . $proj['link']);
    $pathinfo = pathinfo($proj['pict']);
    $proj['pict_ext'] = strtolower($pathinfo['extension']);
    $js_file = array('banned.js');
    //Мета-теги
    SeoTags::getInstance()->initByPortfolio($proj, $spec_text);
    $page_title = SeoTags::getInstance()->getTitle();
    $page_descr = SeoTags::getInstance()->getDescription();
    $page_keyw = SeoTags::getInstance()->getKeywords();
    $FBShare = array('title' => htmlspecialchars($proj['name'], ENT_QUOTES), 'description' => '', 'image' => HTTP_PREFIX . 'www.free-lance.ru/images/free-lance_logo.jpg');
    $content = 'tpl.viewproj.php';
Beispiel #23
0
//------------------------------------------------------------------------------
/*
 * Пересчет количества пользователей ТУ в данной категории
 */
if (date('H') == 2) {
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices_categories.php';
    tservices_categories::ReCalcCategoriesCount();
}
//------------------------------------------------------------------------------
if (date('H') == 6) {
    $log->TRACE(professions::ReCalcProfessionsCount());
    $hh = new hh();
    $log->TRACE($hh->delOldFilters());
    $log->TRACE($mail->employerHelpInfo());
}
$log->TRACE(professions::PaidSpecsEndingReminder());
// ban
$usr = new users();
$log->TRACE($usr->GetBanTimeout());
//выкидываем неактивных юзеров
$log->TRACE($usr->UpdateInactive());
if (date('H') == 0 || date('H') == 6 || date('H') == 12 || date('H') == 18) {
    // генерация xml для webprof
    $log->TRACE(freelancer::webprofGenerateRss('upload/webprof.xml'));
}
// генерация xml для Яндекс.Работа
$log->TRACE(new_projects::yandexGenerateRss('upload/yandex-office.xml', array(4)));
$log->TRACE(new_projects::yandexGenerateRss('upload/yandex-project.xml', array(1, 2, 7)));
// генерация xml для Jooble.ru, indeed и trovit
$projects_for_xml = new_projects::getProjectsForXml('1 month');
$log->TRACE(new_projects::joobleGenerateRss('upload/jooble.xml', $projects_for_xml));
Beispiel #24
0
                quickPaymentPopupTservicebind::getInstance()->init(array('uid' => $uid, 'kind' => tservices_binds::KIND_LANDING));
            }
            $popup_id = quickPaymentPopupTservicebind::getInstance()->getPopupId($tservice['id']);
            $popups[] = quickPaymentPopupTservicebind::getInstance()->render(array('is_prolong' => true, 'date_stop' => $tservice['date_stop'], 'popup_id' => $popup_id, 'tservices_cur' => $tservice['id'], 'tservices_cur_text' => $tservice['title']));
            if ($key > 0) {
                $isExistsBindUp = true;
                require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/quick_payment/quickPaymentPopupTservicebindup.php';
                if (quickPaymentPopupTservicebindup::getInstance()->inited == false) {
                    quickPaymentPopupTservicebindup::getInstance()->init(array('uid' => $uid, 'tservices_id' => $tservice['id'], 'tservices_title' => $tservice['title'], 'kind' => tservices_binds::KIND_LANDING));
                }
                $popup_id = quickPaymentPopupTservicebindup::getInstance()->getPopupId($tservice['id']);
                $popups[] = quickPaymentPopupTservicebindup::getInstance()->render(array('popup_id' => $popup_id, 'tservices_cur' => $tservice['id'], 'tservices_cur_text' => $tservice['title']));
            }
        }
    }
    if ($isExistsBindUp) {
        $tservicesBinds = new tservices_binds(tservices_binds::KIND_LANDING);
        $bindUpPrice = $tservicesBinds->getPrice(true, $uid);
    }
}
$suffix = $uid <= 0 ? '_anon' : (is_emp() ? '_emp' : '_frl');
$content_landing_image = $_SERVER['DOCUMENT_ROOT'] . "/templates/landings/tpl.landing_image{$suffix}.php";
$content = $_SERVER['DOCUMENT_ROOT'] . "/templates/landings/tpl.landing_tservices.php";
// Список профессий
$prfs = new professions();
$profs = $prfs->GetAllProfessions("", 0, 1);
// Сортировка категорий профессий по названию
//usort($profs, function($a, $b) { return strcmp($a['groupname'], $b['groupname']);});
$page_title = 'Фриланс сайт удаленной работы №1. Фрилансеры, работа на дому, freelance : FL.ru';
// отрисовка страницы
include $_SERVER['DOCUMENT_ROOT'] . "/template3.php";
Beispiel #25
0
<?php

if (!defined('IS_SITE_ADMIN')) {
    header('Location: /404.php');
    exit;
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$profs = professions::GetAllProfessions();
if (!(hasPermissions('adm') && hasPermissions('adminspam'))) {
    header("Location: /404.php");
    exit;
}
?>
<script type="text/javascript">
CKEDITOR.config.customConfig = '/scripts/ckedit/config_simple.js';

function checkexts() {
            var val = 0;
            var grp = document.getElementById('idForm')['attach[]'];
            if (typeof grp.length != 'undefined') {
                for (i=0; i<grp.length; i++) {
                    if (!allowedExt(grp[i].value)) return false;
                }
            } else {
                if (!allowedExt(grp.value)) return false;
            }
            return true;
        }
</script>
<style>
	.addButton INPUT { width: 28px; }
Beispiel #26
0
/**
 * формирует превью проекта на главной странице.
 */
function GetPreview($data)
{
    $objResponse = new xajaxResponse();
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/CFile.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/HTML/projects_lenta.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/project_exrates.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/memBuff2.php';
    $kind = 1;
    $memBuff = new memBuff();
    $htmlLenta = $memBuff->get('projectsLentaHTML');
    if (!$htmlLenta) {
        $prj = new new_projects();
        $prjs = $prj->getProjects($num_prjs, -1, 1, false, null, true);
        foreach ($prjs as &$proj) {
            // стираем принадлежность проекта к пользователю, чтобы не появилось кнопок РЕДАКТИРОВАТЬ и пр.
            unset($proj['user_id']);
        }
        unset($proj);
        $htmlPrj = new HTMLProjects();
        $htmlPrj->template = '/projects/tpl.lenta.new.php';
        $prj_content = $htmlPrj->ShowProjects($num_prjs, $prjs, 1, 1, null, true);
        $prfs = new professions();
        $profs = $prfs->GetAllProfessions('', 0, 1);
        // подложка с лентой проектов
        ob_start();
        include $_SERVER['DOCUMENT_ROOT'] . '/templates/main.php';
        $htmlLenta = ob_get_clean();
        // кэшируем ленту проектов
        $memBuff->set('projectsLentaHTML', $htmlLenta, 1800);
    }
    // подготавливаем данные для шаблона в ленту проектов
    $row = array();
    $row['kind'] = __paramValue('int', $data['kind']);
    $row['cost'] = __paramValue('int', $data['cost']);
    $row['currency'] = __paramValue('int', $data['currency_db_id']);
    $row['priceby'] = __paramValue('int', $data['priceby_db_id']);
    $row['name'] = stripslashes(__paramValue('html', $data['name'], null, true));
    $contacts = array('phone' => array('name' => 'Телефон', 'value' => ''), 'site' => array('name' => 'Сайт', 'value' => ''), 'icq' => array('name' => 'ICQ', 'value' => ''), 'skype' => array('name' => 'Skype', 'value' => ''), 'email' => array('name' => 'E-mail', 'value' => ''));
    if (isset($data['contacts'])) {
        foreach ($data['contacts'] as $name => $value) {
            if (!isset($contacts[$name])) {
                continue;
            }
            switch ($name) {
                case 'site':
                    if (!url_validate(ltrim(ltrim($value, 'http://'), 'https://')) && trim($value) != '') {
                        $error["contact_{$name}"] = 'Поле заполнено некорректно';
                    }
                    if (strpos($value, 'htt') === false && trim($value) != '') {
                        $value = 'http://' . $value;
                    }
                    break;
                case 'email':
                    if (!is_email($value) && trim($value) != '') {
                        $error["contact_{$name}"] = 'Поле заполнено некорректно';
                    }
                    break;
            }
            $contacts[$name]['value'] = __paramValue('htmltext', stripslashes($value));
        }
        $row['contacts'] = serialize($contacts);
    }
    $descrFull = stripslashes(__paramValue('html', $data['descr'], null, true));
    $descr = preg_replace('/^ /', "", $descrFull);
    $descr = preg_replace("/(\n) /", "\$1", $descr);
    $descr = reformat(strip_tags(htmlspecialchars(LenghtFormatEx(htmlspecialchars_decode($descr, ENT_QUOTES), 180), ENT_QUOTES), '<br />'), 50, 1, 0, 1);
    $descr = preg_replace("//", '&nbsp;', $descr);
    $row['descr'] = $descr;
    $row['t_is_payed'] = $data['logo_ok'] || $data['top_ok'];
    $row['t_is_ontop'] = __paramValue('bool', $data['top_ok']);
    $row['t_pro_only'] = $data['pro_only'] ? 't' : 'f';
    $row['t_verify_only'] = $data['verify_only'] ? 't' : 'f';
    $row['t_urgent'] = $data['urgent'] ? 't' : 'f';
    $row['t_hide'] = $data['hide'] ? 't' : 'f';
    $row['create_date'] = date('Y-m-d H:i', strtotime(date('Y-m-d H:i:s')) - 120);
    // делаем дату публикации 2 минуты назад
    $row['end_date'] = __paramValue('string', $data['end_date']);
    $row['win_date'] = __paramValue('string', $data['win_date']);
    $row['country'] = __paramValue('int', $data['project_location_columns'][0]);
    $row['city'] = __paramValue('int', $data['project_location_columns'][1]);
    list($row['country_name'], $row['city_name']) = explode(': ', __paramValue('string', $data['location']));
    $logoOK = __paramValue('bool', $data['logo_ok']);
    $topOK = __paramValue('bool', $data['top_ok']);
    $row['link'] = __paramValue('string', $data['link']);
    if ($logoOK) {
        $logoAttach = new attachedfiles($data['logo_attachedfiles_session']);
        $logoFiles = $logoAttach->getFiles(array(1));
        if (count($logoFiles)) {
            $logoFile = array_pop($logoFiles);
            // загружено может быть несколько файлов, берем последний
            $logoCFile = new CFile($logoFile['id']);
        } elseif (__paramValue('int', $data['logo_file_id'])) {
            $logoCFile = new CFile(__paramValue('int', $data['logo_file_id']));
        }
        $row['logo_name'] = $logoCFile->name;
        $row['logo_path'] = $logoCFile->path;
    }
    $is_ajax = true;
    // подготовка данных для подробной страницы проекта
    $project = $row;
    $categories = array();
    for ($i = 0; $i < 3; ++$i) {
        $categoryID = __paramValue('int', $data['project_profession' . $i . '_columns'][0]);
        $subcategoryID = __paramValue('int', $data['project_profession' . $i . '_spec_columns'][0]);
        if ($categoryID || $subcategoryID) {
            $categories[] = array('category_id' => $categoryID, 'subcategory_id' => $subcategoryID);
        }
    }
    $project['spec_txt'] = projects::_getSpecsStr($categories, ' / ', ', ', true);
    $project['ico_payed'] = $logoOK;
    $project['is_upped'] = $topOK;
    $project['descr'] = $descrFull;
    $project['logo_id'] = $logoCFile->id;
    $project['prefer_sbr'] = __paramValue('bool', $data['prefer_sbr']) ? 't' : 'f';
    $project['urgent'] = __paramValue('bool', $data['urgent']) ? 't' : 'f';
    $project['hide'] = __paramValue('bool', $data['hide']) ? 't' : 'f';
    if (trim($project['contacts']) != '') {
        $contacts_employer = unserialize($project['contacts']);
        $empty_contacts_employer = 0;
        foreach ($contacts_employer as $name => $contact) {
            if (trim($contact['value']) == '') {
                $empty_contacts_employer++;
            }
        }
        $is_contacts_employer_empty = count($contacts_employer) == $empty_contacts_employer;
    }
    $isPreview = true;
    $project_exRates = project_exrates::GetAll();
    $translate_exRates = array(0 => 2, 1 => 3, 2 => 4, 3 => 1);
    ob_start();
    include $_SERVER['DOCUMENT_ROOT'] . '/public/new/tpl.preview.php';
    ?>
    <?php 
    $htmlProject = ob_get_clean();
    $objResponse->assign('project_preview_lenta', 'innerHTML', $htmlLenta);
    $objResponse->assign('project_preview_content', 'innerHTML', $htmlProject);
    $objResponse->script('Public.showPreview()');
    return $objResponse;
}
Beispiel #27
0
;
var filter_bullets = [[],[]];
<?php 
if (sizeof($_SESSION['ph_categories'])) {
    for ($ci = 0; $ci < 2; $ci++) {
        $ph_categories[$ci] = array();
        if (sizeof($_SESSION['ph_categories'][$ci])) {
            foreach ($_SESSION['ph_categories'][$ci] as $fkey => $fvalue) {
                if ($fkey) {
                    if (!freelancers_filters::mirrorExistsInArray($fkey, $ph_categories[$ci], $mirrored_specs)) {
                        if (!$fvalue) {
                            $proftitle = professions::GetGroup($fkey, $error);
                            $proftitle = $proftitle['name'];
                        } else {
                            $proftitle = professions::GetProfName($fkey);
                            $prof_group = professions::GetProfField($fkey, 'prof_group');
                        }
                        ?>
filter_bullets[<?php 
                        echo $fvalue;
                        ?>
][<?php 
                        echo $fkey;
                        ?>
] = new Array();
filter_bullets[<?php 
                        echo $fvalue;
                        ?>
][<?php 
                        echo $fkey;
                        ?>
Beispiel #28
0
<?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";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/kwords.php";
setlocale(LC_ALL, 'ru_RU.CP1251');
$portf = new portfolio();
$prjs = $portf->GetPortf($user->uid, 'NULL', true);
$prfs = new professions();
$profs = $prfs->GetAllProfessionsPortfWithoutMirrored($user->uid, "AND t.user_id IS NOT NULL");
$is_not_spec = sizeof($profs) <= 0;
$first_profs = current($profs);
$html_keyword_js = '<a href="/freelancers/?word=$1" class="inherit">$2</a>';
$html_keyword = preg_replace('/\\$\\d/', '%s', $html_keyword_js);
if ($user->uid == $_SESSION['uid']) {
    $spec_modified = professions::getLastModifiedSpec($user->uid);
}
?>

<?php 
if ((int) $user->spec == 0 && $user->uid == $_SESSION['uid']) {
    ?>
<div class="b-fon b-fon_pad_20">
    <div class="b-fon__body b-fon__body_pad_10 b-fon__body_padleft_30 b-fon__body_fontsize_13 b-fon__body_bg_ffeeeb">
        <span class="b-icon b-icon_sbr_rattent b-icon_margleft_-25"></span><a class="b-layout__link" href="/users/<?php 
    echo $user->login;
    ?>
Beispiel #29
0
$answer_pay = __paramInit('bool', NULL, 'answer_pay');
$spec_pay = __paramInit('bool', NULL, 'spec_pay');
$spec_prolong = __paramInit('bool', NULL, 'prolong_specs');
if ($spec_prolong) {
    return;
    // #0022795
    if ($err = professions::prolongSpecs($uid)) {
        $error['prolong_specs'] = $err;
    }
    $answer_pay = null;
} else {
    if ($spec_pay) {
        return;
        // #0022795
        if ($spec_cnt = __paramInit('int', NULL, 'spec_cnt')) {
            $err = professions::buySpec($uid, $spec_cnt, $tr_id, '1 mon', 0);
            if ($err) {
                $error['spec'] = $err;
            } else {
                $_SESSION['bill.GET']['addinfo'] = "<a href=\"/users/{$_SESSION['login']}/setup/specaddsetup/\">—траница управлени¤ специализаци¤ми</a>";
            }
        } else {
            $error['spec'] = 'Ќе верно указано заначение количества доп. специализаций ';
        }
    }
}
if ($answer_pay) {
    if ($_POST['answers_sum'] > 0) {
        $num_answers = intval($_POST['num_answers']);
        if (!($err = $answers->BuyByFM($uid, $num_answers, $tr_id, 0))) {
            $_SESSION['answers_ammount'] = $_POST['num_answers'];
Beispiel #30
0
//}
//
//if ($_GET['firstpage'] == 1 && isset($_GET['hour'])) {
//    firstpage::autoPayedReminder($_GET['firstpage'], 'hour', true);
//}
//
?>
<!--<p>Чтобы проверить резервы вручную используйте ссылку beta.free-lance.ru/test/test-payed.php?check_reserve=1</p>--><?php 
//
//if ($_GET['check_reserve']) {
//    billing::checkOldReserve();
//    echo '<p><strong>Проверка резерва</strong> - ОК</p>';
//}
//$pmail = new pmail;
//$pmail->DepositMail(329);
//firstpage::autoPayedReminder(3, true);
$profs = new professions();
$allProfs = $profs->GetAllProfessions();
$allProfsID = array();
foreach ($allProfs as $prof) {
    $allProfsID[$prof['id']] = $prof['profname'];
}
?>
<p>Айдишники профессий [в квадратных скобках]</p>
<pre><?php 
echo var_dump($allProfsID);
?>
</pre>