本文整理汇总了PHP中professions::GetAllGroupsLite方法的典型用法代码示例。如果您正苦于以下问题:PHP professions::GetAllGroupsLite方法的具体用法?PHP professions::GetAllGroupsLite怎么用?PHP professions::GetAllGroupsLite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类professions
的用法示例。
在下文中一共展示了professions::GetAllGroupsLite方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _admEditSdelauParseForm
/**
* Отдает HTML для предложений фрилансеров Сделаю
*
* @param object $objResponse xajaxResponse
* @param string $rec_id идентификатор записи
* @param string $rec_type тип записи
* @param array $aParams массив дополнительных параметров
* @return string
*/
function _admEditSdelauParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array())
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer_offers.php';
$oFreelancerOffers = new freelancer_offers();
$offer = $oFreelancerOffers->getOfferById($rec_id, false);
$objUser = new users();
$objUser->GetUserByUID($offer['user_id']);
// разделы
$categories = professions::GetAllGroupsLite();
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
ob_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/sdelau.php';
$sHtml = ob_get_contents();
ob_end_clean();
// текст
$sOnReady = "if(\$('adm_edit_msg')) \$('adm_edit_msg').set('value', (\$('adm_edit_msg_source')? \$('adm_edit_msg_source').get('value') : null));";
$objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать предложение');
$objResponse->assign('div_adm_edit', 'innerHTML', $sHtml);
$objResponse->script($sOnReady);
$objResponse->script("\$('div_adm_reason').setStyle('display', 'none');");
$objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное'];");
$objResponse->script('adm_edit_content.edit();');
$objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_SDELAU . ');');
}
示例2: array
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
$filter_apply = $filter['active'] == 't';
$filter_categories = professions::GetAllGroupsLite(true);
$all_mirrored_specs = professions::GetAllMirroredProfsId();
$mirrored_specs = array();
for ($is = 0; $is < sizeof($all_mirrored_specs); ++$is) {
$mirrored_specs[$all_mirrored_specs[$is]['main_prof']] = $all_mirrored_specs[$is]['mirror_prof'];
$mirrored_specs[$all_mirrored_specs[$is]['mirror_prof']] = $all_mirrored_specs[$is]['main_prof'];
}
$_SESSION['ph_categories'] = $filter['categories'];
$frm_action = '/index.php';
if (!sizeof($profs)) {
$all_specs = professions::GetAllProfessions('', 0, 1);
} else {
$all_specs = $profs;
}
?>
<script type="text/javascript">
//1 = фильтр проектов
//2 = фильтр фрилансеров
var curFBulletsBox = 1;
var filter_user_specs={<?php
if ($filter['user_specs']) {
$i = 0;
foreach ($filter['user_specs'] as $ms) {
print ($i++ ? ',' : '') . $ms . ':1';
示例3: processRequest
//.........这里部分代码省略.........
$list['counters']['moreUsers'] = 0;
$list['dav'] = WDCPREFIX;
return json_encode($list);
break;
case 'getletterdocsearch':
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/letters.php';
$letterdocs = letters::getSearchDocuments($_POST['word'], (int) $_POST['limit']);
$result = array();
$n = 0;
foreach ($letterdocs as $k => $i) {
$result[$n]['uid'] = $i['id'];
$result[$n]['uname'] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['id'] . ' ' . htmlspecialchars($i['group_title']) . ' - ' . htmlspecialchars($i['title']));
$result[$n]['usurname'] = '';
$result[$n]['login'] = '';
$result[$n]['photo'] = '';
$result[$n]['path'] = '';
$result[$n]['isContacts'] = '';
++$n;
}
$list = array();
$list['list'] = $result;
$list['counters']['moreContacts'] = 0;
$list['counters']['moreUsers'] = 0;
$list['dav'] = WDCPREFIX;
return json_encode($list);
break;
case 'getdate':
return date('Y-m-d');
case 'getprofgroups':
$membuf = new memBuff();
$memkey = 'b-combo-getprofgroups';
$result = $membuf->get($memkey);
if (!$result) {
$rows = professions::GetAllGroupsLite();
$result = array();
foreach ($rows as $k => $i) {
$result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
}
$membuf->add($memkey, $result, $expire);
}
return json_encode($result);
case 'getprofessionsandgroups':
$membuf = new memBuff();
$memkey = 'b-combo-getprofandgroups';
$result = $membuf->get($memkey);
if (!$result) {
$rows = professions::GetProfessionsAndGroup();
$result = array();
foreach ($rows as $k => $i) {
if ($result[$i['gid']] === null) {
$result[$i['gid']] = array($i['gid'] => iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['gname']));
if ($i['id'] !== null) {
$result[$i['gid']][$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
} else {
$result[$i['gid']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['gname']);
}
} elseif (is_array($result[$i['gid']])) {
$result[$i['gid']][$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
}
}
$membuf->add($memkey, $result, $expire);
}
return json_encode($result);
case 'getprofessions':
$n = __paramInit('integer', '', 'id');
if ($n !== false) {
示例4: session_start
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stdf.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/masssending.php';
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';
session_start();
if (!($uid = get_uid())) {
header('Location: /fbd.php');
exit;
}
$masssending = new masssending();
$countries = country::GetCountries(true);
$prof_groups = professions::GetAllGroupsLite(true);
$professions = professions::GetProfList();
$exrates = project_exrates::GetAll();
if (!empty($_POST)) {
$frm = $_POST;
//$params['msg'] = stripslashes($frm['msg']);
$params['msg'] = "Здравствуйте!\n\nПриглашаю ознакомиться с проектом '" . change_q_x(stripslashes($frm['title']), false, false, 'b|i|p|ul|li|s|h[1-6]{1}', false, false) . "' " . str_replace('www.n.fl.ru', 'n.fl.ru', $host) . $frm['link'] . " \n\n\n" . LenghtFormatEx(change_q_x(stripslashes($frm['msg']), false, false, 'b|i|p|ul|li|s|h[1-6]{1}', false, false), 300);
$params['max_users'] = intval($_POST['max_users']);
$params['max_cost'] = intval($_POST['max_cost']);
$params['is_pro'] = stripslashes($frm['pro']);
$params['favorites'] = stripslashes($frm['favorites']);
$params['free'] = stripslashes($frm['free']);
$params['sbr'] = stripslashes($frm['bs']);
$params['portfolio'] = stripslashes($frm['withworks']);
$params['inoffice'] = stripslashes($frm['office']);
$params['opi_is_verify'] = stripslashes($frm['ver']);
示例5: time
<?php
$pdrd_disabled = $sbr->scheme_type != sbr::SCHEME_PDRD && time() < strtotime('2011-01-01');
$categories = professions::GetAllGroupsLite(true, true);
$sub_categories = professions::GetProfList();
$frl_ftype = sbr::FT_PHYS;
if ($sbr->frl_id) {
$frl = new freelancer();
$frl->GetUserByUID($sbr->frl_id);
if (!$sbr->frl_login) {
$sbr->data['frl_login'] = $frl->login;
}
if ($frl_reqvs = sbr_meta::getUserReqvs($frl->uid)) {
$frl_ftype = (int) $frl_reqvs['form_type'];
$frl_rtype = $frl_reqvs['rez_type'];
}
}
?>
<script type="text/javascript">
Sbr.prototype.DEBUG=0;
var SBR = new Sbr('createFrm');
window.addEvent('domready', function() { SBR = new Sbr('createFrm'); } );
Sbr.prototype.CATEGORIES={<?php
// категории/подкатегории: {ид_кат:{имя_кат:{ид_подкат:имя_подкат,ид_подкат:...}},ид_кат:...}
foreach ($sub_categories as $sc) {
$cc = $sc['prof_group'];
$ccname = str_replace("'", "\\'", $categories[$cc]['name']);
$scname = str_replace("'", "\\'", $sc['name']);
if ($lcc != $cc) {
echo ($lcc ? '}},' : '') . "{$cc}:{'{$ccname}':{";
$lcc = $cc;
示例6: array
<?php
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
require_once $_SERVER['DOCUMENT_ROOT'] . "/xajax/lenta.common.php";
$xajax->printJavascript('/xajax/');
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;
}
// Блоги
示例7: updateBudget
/**
* Изменить информацию о бюджете проекта
*
* @param integer $prj_id ID проекта
* @param float $prj_cost Стоимость
* @param integer $prj_currency Валюта
* @param integer $prj_costby Тип стоимости(за час/проект/месяц)
* @param boolean $prj_agreement true - стоимость по договоренности
* @return array информация о бюджете проекта
*/
function updateBudget($prj_id, $prj_cost, $prj_currency, $prj_costby, $prj_agreement)
{
global $DB;
if ($prj_agreement) {
$prj_cost = 0;
$prj_currency = 0;
$prj_costby = 0;
$prj_budget_type = 0;
} else {
$prj_cost = floatval($prj_cost);
$prj_currency = intval($prj_currency);
$prj_costby = intval($prj_costby);
$prj_budget_type = 0;
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$categories = professions::GetAllGroupsLite();
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
$professions_cost = array();
$professions_cost['prj'] = array();
$professions_cost['hour'] = array();
$professions_cost['prj']['min'] = array();
$professions_cost['prj']['avg'] = array();
$professions_cost['prj']['max'] = array();
$professions_cost['hour']['min'] = array();
$professions_cost['hour']['avg'] = array();
$professions_cost['hour']['max'] = array();
foreach ($categories as $cat) {
$professions_cost['prj']['min'][$cat['id']] = array();
$professions_cost['prj']['avg'][$cat['id']] = array();
$professions_cost['prj']['max'][$cat['id']] = array();
$professions_cost['hour']['min'][$cat['id']] = array();
$professions_cost['hour']['avg'][$cat['id']] = array();
$professions_cost['hour']['max'][$cat['id']] = array();
$ncount_prj = 0;
$ncount_hour = 0;
$nsum_min_prj = 0;
$nsum_max_prj = 0;
$nsum_avg_prj = 0;
$nsum_min_hour = 0;
$nsum_max_hour = 0;
$nsum_avg_hour = 0;
if (!is_array($professions[$cat['id']])) {
continue;
}
foreach ($professions[$cat['id']] as $subcat) {
$professions_cost['hour']['min'][$cat['id']][$subcat['id']] = $subcat['min_cost_hour'];
$professions_cost['hour']['avg'][$cat['id']][$subcat['id']] = $subcat['avg_cost_hour'];
$professions_cost['hour']['max'][$cat['id']][$subcat['id']] = $subcat['max_cost_hour'];
$professions_cost['prj']['min'][$cat['id']][$subcat['id']] = $subcat['min_cost_prj'];
$professions_cost['prj']['avg'][$cat['id']][$subcat['id']] = $subcat['avg_cost_prj'];
$professions_cost['prj']['max'][$cat['id']][$subcat['id']] = $subcat['max_cost_prj'];
$nsum_min_prj = $nsum_min_prj + $subcat['min_cost_prj'];
$nsum_max_prj = $nsum_max_prj + $subcat['max_cost_prj'];
$nsum_avg_prj = $nsum_avg_prj + $subcat['avg_cost_prj'];
$nsum_min_hour = $nsum_min_hour + $subcat['min_cost_hour'];
$nsum_max_hour = $nsum_max_hour + $subcat['max_cost_hour'];
$nsum_avg_hour = $nsum_avg_hour + $subcat['avg_cost_hour'];
if ($subcat['avg_cost_prj'] != 0) {
$ncount_prj++;
}
if ($subcat['avg_cost_hour'] != 0) {
$ncount_hour++;
}
}
if ($ncount_prj == 0) {
$ncount_prj = 1;
}
if ($ncount_hour == 0) {
$ncount_hour = 1;
}
$professions_cost['prj']['min'][$cat['id']][0] = round($nsum_min_prj / $ncount_prj, 0);
$professions_cost['prj']['avg'][$cat['id']][0] = round($nsum_avg_prj / $ncount_prj, 0);
$professions_cost['prj']['max'][$cat['id']][0] = round($nsum_max_prj / $ncount_prj, 0);
$professions_cost['hour']['min'][$cat['id']][0] = round($nsum_min_hour / $ncount_hour, 0);
$professions_cost['hour']['avg'][$cat['id']][0] = round($nsum_avg_hour / $ncount_hour, 0);
$professions_cost['hour']['max'][$cat['id']][0] = round($nsum_max_hour / $ncount_hour, 0);
}
switch ($prj_costby) {
case '1':
$itype = 'hour';
$ctype = 1;
break;
case '2':
$itype = 'hour';
$ctype = 8;
break;
case '3':
$itype = 'hour';
$ctype = 22 * 8;
//.........这里部分代码省略.........
示例8: session_start
}
session_start();
$uid = get_uid();
if (isset($_GET['unset'])) {
setcookie('mass-files');
unset($_SESSION['masssending']);
}
$fromSearch = __paramInit('int', 'from_search', null, 0);
// если пришли сюда из поиска пользователей
if ($fromSearch === 2) {
// количество найденых
$searchCount = __paramInit('int', 'search_count', 'search_count', false);
}
$masssending = new masssending();
$countries = country::GetCountries(TRUE);
$prof_groups = professions::GetAllGroupsLite(TRUE);
$professions = professions::GetProfList();
$exrates = project_exrates::GetAll();
//print_r($_POST);
//die;
$dc = 0;
if (!empty($_GET['g'])) {
if (preg_match("/^([0-9]+)\\:([0-9]+)\$/", $_GET['g'], $o)) {
$dc = $_GET['g'];
$dcg = $o[1];
$dcp = $o[2];
} else {
if (preg_match("/^[0-9]+\$/", $_GET['g'])) {
$dc = "{$_GET['g']}:0";
$dcg = $_GET['g'];
$dcp = 0;
示例9: commune
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/commune.php";
$proj_groups = professions::GetAllGroupsLite();
$commune = new commune();
$uid = get_uid();
if (!($communes_my = commune::GetCommunes(NULL, $uid, NULL, commune::OM_CM_MY))) {
$communes_my = array();
}
if (!($communes = commune::GetCommunes(NULL, NULL, $uid, commune::OM_CM_JOINED, $uid))) {
$communes = array();
}
foreach ($communes_my as $cm) {
$communes[] = $cm;
}
$c_signed = $commune->getSubscribedCommunes($uid);
$categories = professions::GetAllGroupsLite();
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
?>
<script type="text/javascript">
// function fixCommunes(){
// var ele = $('ch7');
// var list = $('comm_container').getElements('input[type=checkbox]');
// for(var i = 0; i < list.length; i++){
// list[i].disabled = !ele.checked;
// }
// }
window.addEvent('domready', function() {
// fixCommunes();
});
示例10: Array
include_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer.php';
if (empty($no_reset_filter)) {
?>
<script type="text/javascript">exists_pars = new Array();</script>
<?php
}
?>
<div id="head_filter" style="display: <?php
echo $user->mailer && $user->mailer_str != "" ? '' : 'none';
?>
">
<div class="b-select b-select_padbot_10">
<select id="subscr_cat" onchange="applySubcat(this.value); if(this.value != 0){ document.getElementById('addFilterButton').disabled = false;} else { document.getElementById('addFilterButton').disabled = true;}" class="b-select__select b-select__select_width_220">
<option value="0">Выберите раздел</option>
<?php
foreach (professions::GetAllGroupsLite(true) as $cat) {
?>
<option value="<?php
echo $cat['id'];
?>
"><?php
echo $cat['name'];
?>
</option>
<?php
}
?>
</select>
</div>
<div class="b-select b-select_padbot_10">
示例11: NewProj
/**
* @todo НЕ ИСПОЛЬЗУЕТСЯ
*
* @deprecated since 0026073
*
* Рассылка о новых проектах. Вызывается раз в день из hourly.php
*
* @param array $uids - массив идентификаторов пользователей, которым уже отправленя новая рассылка (см. NewProjForMissingMoreThan24h)
*
* @return int количество получивших рассылку
*/
public function NewProj($uids)
{
$projects = projects::GetNewProjects($error, true, 600, 50);
$groups = professions::GetAllGroupsLite(true);
$page = 0;
$count = 0;
if (empty($projects)) {
return 0;
}
$this->subject = 'Новые проекты на FL.ru';
$message = '<p>
Данное письмо отправлено почтовым роботом сервера FL.ru и не требует ответа.
</p>
<p>
На сайте <a href="' . $GLOBALS['host'] . $this->_addUrlParams('f') . '">' . $GLOBALS['host'] . '</a> опубликованы новые Проекты
</p>
%MESSAGE%
<p>
Если вы хотите оперативно получать информацию об опубликованных на FL.ru проектах,
скачайте и установите бесплатное приложение-информер <a href="' . $GLOBALS['host'] . '/promo/freetray/' . $this->_addUrlParams('f') . '">Free-tray</a>.
</p>';
$this->message = $this->GetHtml('%USER_NAME%', $message, array('header' => 'default', 'footer' => 'default'), array('target_footer' => true));
$this->recipient = '';
$massId = $this->send('text/html');
foreach ($projects as $i => $prj) {
$url = $GLOBALS['host'] . getFriendlyURL('project', $projects[$i]['id']);
$projects[$i]['html'] = array('post_date' => date('d.m.y', strtotimeEx($prj['post_date'])), 'name' => $prj['name'] ? reformat($prj['name'], 100, 0, 1) : '', 'descr' => reformat($prj['descr'], 100, 0, 1), 'url' => "<a href='{$url}{$this->_addUrlParams('f')}'>{$url}</a>");
}
while ($users = freelancer::GetPrjRecps($error, ++$page, 50, $uids)) {
$this->recipient = array();
foreach ($users as $user) {
if (empty($user['mailer'])) {
continue;
}
$subj = array();
foreach ($groups as $group) {
if (freelancer::isSubmited($user['mailer_str'], array(array('category_id' => $group['id'])))) {
$subj[$group['id']] = $group['name'];
}
}
$lastKind = 0;
$message = '';
foreach ($projects as $prj) {
if (!freelancer::isSubmited($user['mailer_str'], $prj['specs'])) {
continue;
}
if ($lastKind != $prj['kind']) {
$kindName = '';
switch ($prj['kind']) {
case 1:
$kindName = 'Попроектно';
break;
case 2:
$kindName = 'Конкурсы';
break;
case 3:
$kindName = 'На зарплату';
break;
case 4:
$kindName = 'В офис';
break;
case 7:
$kindName = 'Конкурсы';
break;
}
$message .= "\n";
$message .= "<div>-----------------------------------------------------------------------------------</div>\n";
$message .= "<div>{$kindName}</div>\n";
$message .= "<div>-----------------------------------------------------------------------------------</div>\n";
$lastKind = $prj['kind'];
}
$message .= "\n<div> </div><div>-----</div>\n";
$message .= "<div>{$prj['html']['post_date']}</div>\n";
$message .= "<div>{$prj['html']['name']}</div>\n";
$message .= "<div>-----</div>\n";
$message .= "<div>{$prj['html']['descr']}</div>\n";
$message .= "<div>{$prj['html']['url']}</div>\n";
$message .= "<div>-----------------------------------</div>\n";
}
if (empty($message)) {
continue;
}
$message = '<div>(' . implode('/', $subj) . ')</div><div> </div>' . $message;
if (!$user['unsubscribe_key']) {
$user['unsubscribe_key'] = users::GetUnsubscribeKey($user['login']);
}
$this->recipient[] = array('email' => $user['uname'] . ' ' . $user['usurname'] . ' [' . $user['login'] . '] <' . $user['email'] . '>', 'extra' => array('USER_NAME' => $user['uname'], 'USER_SURNAME' => $user['usurname'], 'USER_LOGIN' => $user['login'], 'MESSAGE' => $message, 'UNSUBSCRIBE_KEY' => $user['unsubscribe_key']));
++$count;
}
//.........这里部分代码省略.........
示例12: quickprjedit_get_prj
function quickprjedit_get_prj($prj_id)
{
$objResponse = new xajaxResponse();
if (hasPermissions('projects')) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
$categories = professions::GetAllGroupsLite();
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
$oprj = new new_projects();
$project = $oprj->getPrj($prj_id);
if ($project['id']) {
$project_categories = $oprj->getSpecs($project['id']);
if (empty($project_categories)) {
$project_categories[] = array('category_id' => 0, 'subcategory_id' => 0);
}
$html_categories = '';
foreach ($project_categories as $project_category) {
$html_categories .= "<div id='category_line'>\n <select name='categories[]' class='b-select__select b-select__select_width_180' onchange='popupQEditPrjRefreshSubCategory(this);'>\n <option value='0'>Выберите раздел</option>\n ";
foreach ($categories as $cat) {
if ($cat['id'] <= 0) {
continue;
}
$html_categories .= "<option value='{$cat['id']}' " . ($project_category['category_id'] == $cat['id'] ? ' selected' : '') . ">{$cat['name']}</option>";
}
$html_categories .= "</select>\n <select name='subcategories[]' class='b-select__select b-select__select_width_180'>\n ";
$categories_specs = $professions[$project_category['category_id']];
for ($i = 0; $i < sizeof($categories_specs); ++$i) {
$html_categories .= "<option value='{$categories_specs[$i]['id']}'" . ($categories_specs[$i]['id'] == $project_category['subcategory_id'] ? ' selected' : '') . ">{$categories_specs[$i]['profname']}</option>";
}
$html_categories .= " <option value='0' " . ($project_category['subcategory_id'] == 0 ? ' selected' : '') . '>Все специализации</option>
</select>
</div>
';
}
$countries = country::GetCountries();
if ($project['country']) {
$cities = city::GetCities($project['country']);
}
$html_location = '';
$html_location .= "<div><select id='popup_qedit_prj_fld_country' name='country' onChange='popupQEditPrjCityUpd(this.value);'><option value='0'>Страна</option>";
foreach ($countries as $country_id => $country) {
$html_location .= "<option value='{$country_id}' " . ($country_id == $project['country'] ? 'selected' : '') . ">{$country}</option>";
}
$html_location .= '</select></div>';
$html_location .= "<div id='frm_city'><select name='city'><option value='0'>Город</option>";
if ($cities) {
foreach ($cities as $city_id => $city) {
$html_location .= "<option value='{$city_id}' " . ($city_id == $project['city'] ? 'selected' : '') . ">{$city}</option>";
}
}
$html_location .= '</select>';
$objResponse->assign('popup_qedit_prj_fld_id', 'value', $project['id']);
$objResponse->assign('popup_qedit_prj_fld_name', 'value', htmlspecialchars_decode($project['name'], ENT_QUOTES));
$objResponse->assign('popup_qedit_prj_fld_descr', 'value', htmlspecialchars_decode($project['descr'], ENT_QUOTES));
$objResponse->assign('popup_qedit_prj_fld_categories', 'innerHTML', $html_categories);
$objResponse->assign('popup_qedit_prj_fld_location', 'innerHTML', $html_location);
$objResponse->script('$("popup_qedit_prj_fld_kind_1").set("checked", false);');
switch ($project['kind']) {
case 1:
$objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "block");');
$objResponse->script('$("popup_qedit_prj_fld_kind_1").set("checked", true);');
$objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "none");');
break;
case 2:
//$objResponse->script('$("sbr_text_block").setStyle("display", "none");');
break;
case 4:
$objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "block");');
$objResponse->script('$("popup_qedit_prj_fld_kind_2").set("checked", true);');
$objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "block");');
break;
case 7:
$objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "block");');
$objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "block");');
$objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "none");');
$objResponse->script('$("popup_qedit_prj_fld_end_date").set("value", "' . date('d-m-Y', strtotime($project['end_date'])) . '");');
$objResponse->script('$("popup_qedit_prj_fld_win_date").set("value", "' . date('d-m-Y', strtotime($project['win_date'])) . '");');
break;
}
if ($project['pro_only'] == 't') {
$objResponse->script('$("popup_qedit_prj_fld_pro_only").set("checked", true);');
} else {
$objResponse->script('$("popup_qedit_prj_fld_pro_only").set("checked", false);');
}
if ($project['verify_only'] == 't') {
$objResponse->script('$("popup_qedit_prj_fld_verify_only").set("checked", true);');
} else {
$objResponse->script('$("popup_qedit_prj_fld_verify_only").set("checked", false);');
}
if ($project['prefer_sbr'] == 't') {
$objResponse->script('$("popup_qedit_prj_fld_prefer_sbr").set("checked", true);');
//.........这里部分代码省略.........
示例13: ShowRSSPopup
/**
* Генерирует попап для выбора раздела в RSS.
*/
public function ShowRSSPopup($kind)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
switch ($kind) {
case 0:
case 1:
$rss_link = 'projects.xml';
break;
case 2:
$rss_link = 'competition.xml';
break;
case 4:
$rss_link = 'office.xml';
break;
case 6:
$rss_link = 'pro.xml';
break;
case 5:
$rss_link = 'all.xml';
break;
default:
$rss_link = 'all.xml';
break;
}
$categories = professions::GetAllGroupsLite();
// $subcat = professions::GetAllProfessions();
// var_dump(professions::GetAllProfessions());
$script = "\n <script type='text/javascript'>\n var sub = new Array();\n ";
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
foreach ($categories as $cat) {
$out_s = array();
$script .= "\n sub[{$cat['id']}] = new Array(\n ";
if (is_array($professions[$cat['id']])) {
foreach ($professions[$cat['id']] as $subcat) {
$out_s[] = " new Array({$subcat['id']}, '" . clearTextForJS($subcat['profname']) . "') ";
}
$script .= implode(', ', $out_s);
}
$script .= '
);
';
}
$script .= "\n function applySubcat(cat){\n if(typeof sub[cat] != 'undefined')\n for(var i = 0; i < sub[cat].length; i++){\n var option = document.createElement('option');\n option.value = sub[cat][i][0];\n option.innerHTML = sub[cat][i][1];\n document.getElementById('rss_sub').appendChild(option);\n }\n }\n\n function getRssUri(){\n var cat = document.getElementById('rss_cat').value;\n var sub = document.getElementById('rss_sub').value;\n var xml_path = '/rss/{$rss_link}';\n if(sub){\n return xml_path+'?subcategory='+sub+(cat ? '&category='+cat : '');\n }else if(cat){\n return xml_path+'?category='+cat;\n }else{\n return xml_path;\n }\n }\n\n function gotoRSS(){\n document.location.href = getRssUri();\n }\n\n function clearSelect(sid)\n {\n\n var oListbox = document.getElementById(sid);\n for (var i=oListbox.options.length-1; i >= 0; i--)\n {\n oListbox.remove(i);\n }\n\n }\n\n function showRSS(){\n clearSelect('rss_sub');\n // var newoption = new Option('Весь раздел', '');\n var newoption = document.createElement('option');\n newoption.value = '';\n newoption.innerHTML = 'Весь раздел';\n document.getElementById('rss_sub').appendChild(newoption);\n document.getElementById('rss_cat').value = '';\n document.getElementById('rsso').style.display='block';\n }\n\n\n function FilterSubCategoryRSS(category)\n {\n var objSel = \$('rss_sub');\n objSel.options.length = 0;\n objSel.disabled = 'disabled';\n objSel.options[objSel.options.length] = new Option('Весь раздел', 0);\n if(category == 0) {\n objSel.set('disabled', true);\n } else {\n objSel.set('disabled', false);\n }\n // var ft = true;\n applySubcat(category);\n // for (i in filter_specs[category]) {\n // if (filter_specs[category][i][0]) {\n // objSel.options[objSel.options.length] = new Option(filter_specs[category][i][1], filter_specs[category][i][0], ft, ft);\n // ft = false;\n // }\n // }\n objSel.value = 0;\n }\n </script>\n ";
// $subcategories = professions::Get
$select = '<select style="width:340px" onchange="FilterSubCategoryRSS(this.value);" name="rss_cat" id="rss_cat">><option value="">Все разделы</option>';
foreach ($categories as $cat) {
if (!$cat['id']) {
continue;
}
$select .= "<option value=\"{$cat['id']}\">{$cat['name']}</option>";
}
$select .= '</select>';
return "\n {$script}\n <div style=\"display: none;\" class=\"overlay ov-out\" id=\"rsso\">\n <b class=\"c1\"></b>\n <b class=\"c2\"></b>\n <b class=\"ov-t\"></b>\n <div class=\"ov-r\">\n <div class=\"ov-l\">\n <div class=\"ov-in\" style=\"height:110px\">\n <label for=\"rss\">Укажите разделы:</label> <br/>{$select}<br/>\n <label for=\"rss_sub\">Укажите подразделы:</label> <br/><select style=\"width:340px\" name=\"rss_sub\" id=\"rss_sub\">\n <option value=\"\">Весь раздел</option>\n </select>\n <div class=\"ov-btns\">\n <input value=\"Подписаться\" class=\"i-btn i-bold\" type=\"button\" onClick=\"gotoRSS(); document.getElementById('rsso').style.display='none'; return false;\">\n <input value=\"Отменить\" class=\"i-btn\" onclick=\"\$(this).getParent('div.overlay').setStyle('display', 'none'); return false;\" type=\"button\">\n </div>\n </div>\n </div>\n </div>\n <b class=\"ov-b\"></b>\n <b class=\"c3\"></b>\n <b class=\"c4\"></b>\n </div>";
}
示例14: getspec
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$profs = professions::GetAllGroupsLite();
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left"><strong>—татистика</strong></td>
<td align="right"><a href="/siteadmin/stats/index.php">“аблица</a></td>
</tr>
</table>
<br><br>
<script>
function getspec(RXGroup) {
var radioRXGroup = document.getElementsByName(RXGroup);
for (var RowR = 0; RowR < radioRXGroup.length; RowR++)
{
if(radioRXGroup[RowR].checked)
{
return radioRXGroup[RowR].value;
break;
}
}
}
</script>
示例15: Lenta_Show
function Lenta_Show($page = 1)
{
global $DB;
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/portfolio.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/commune.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/links.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/lenta.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/users.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/blogs.php";
/*require_once( $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php' );
$stop_words = new stop_words( false );*/
$yt_replace_id = array();
$yt_replace_data = array();
$uid = get_uid(false);
$objResponse = new xajaxResponse();
ob_start();
if (!($groups = professions::GetAllGroupsLite())) {
return;
}
if (!($lenta = lenta::GetUserLenta($uid))) {
}
$sort = $_COOKIE['lenta_fav_order'] != "" ? $_COOKIE['lenta_fav_order'] : "date";
$favs = lenta::GetFavorites($uid, $sort);
if (!($myComms = commune::GetCommunes(NULL, $uid, NULL, commune::OM_CM_MY))) {
$myComms = array();
}
if (!($joinedComms = commune::GetCommunes(NULL, NULL, $uid, commune::OM_CM_JOINED))) {
$joinedComms = array();
}
// Все сообщества, доступные пользователю.
$communes = array();
foreach ($myComms as $comm) {
$communes[] = $comm;
}
foreach ($joinedComms as $comm) {
$communes[] = $comm;
}
// Блоги
if (!($blog_grs = blogs::GetThemes($error, 1))) {
$blog_grs = array();
}
$blg = NULL;
if ($lenta && $lenta['blog_grs'] && !empty($lenta['blog_grs'])) {
$blg = implode(',', $lenta['blog_grs']);
}
$pgs = NULL;
if ($lenta['all_profs_checked'] == 'f') {
if ($lenta && $lenta['prof_groups'] && !empty($lenta['prof_groups'])) {
$pgs = implode(',', $lenta['prof_groups']);
}
}
$allThemesCount = 0;
$cms = NULL;
$user_comm_mods = array();
// Отбираем среди выбранных ранее сообществ в ленте, те которые до сих пор остаются
// доступными ему для просмотра в ленте (его могли удалить или забанить). А также заполняем массив user_mod-ов на каждое из сообществ.
if ($lenta && $lenta['communes'] && !empty($lenta['communes'])) {
$i = 0;
$cms = '';
foreach ($lenta['communes'] as $cm_id) {
if ($uStatus = commune::GetUserCommuneRel($cm_id, $uid)) {
$ucm = $user_mod;
$ucm |= commune::MOD_COMM_MODERATOR * $uStatus['is_moderator'];
$ucm |= commune::MOD_COMM_MANAGER * $uStatus['is_manager'];
$ucm |= commune::MOD_COMM_ADMIN * ($uStatus['is_admin'] || $uStatus['is_moderator'] || $uStatus['is_manager']);
$ucm |= commune::MOD_COMM_AUTHOR * $uStatus['is_author'];
$ucm |= commune::MOD_COMM_ASKED * $uStatus['is_asked'];
$ucm |= commune::MOD_COMM_ACCEPTED * ($uStatus['is_accepted'] || $ucm & commune::MOD_COMM_ADMIN);
$ucm |= commune::MOD_COMM_BANNED * $uStatus['is_banned'];
$ucm |= commune::MOD_COMM_DELETED * $uStatus['is_deleted'];
$user_comm_mods[$cm_id] = $ucm;
if (!$uStatus['is_deleted'] && !$uStatus['is_banned'] && $uStatus['is_blocked_commune'] == 0 && ($uStatus['is_accepted'] || $uStatus['is_author'])) {
$cms .= (!$i++ ? '' : ',') . $cm_id;
}
}
}
}
//if($cms)
// $allThemesCount -= commune::GetMyThemesCount($cms, $uid);
if ($lenta && $lenta['all_profs_checked'] == 't' || $cms || $pgs || $blg) {
$items = lenta::GetLentaItems($uid, $lenta && $lenta['my_team_checked'] == 't', $lenta && $lenta['all_profs_checked'] == 't', $pgs, $cms, ($page - 1) * lenta::MAX_ON_PAGE, lenta::MAX_ON_PAGE, $allWorkCount, $blg);
}
if (!$items) {
$items = array();
}
// var_dump($favs);
$stars = array(0 => 'bsg.png', 1 => 'bsgr.png', 2 => 'bsy.png', 3 => 'bsr.png');
$i = 0;
foreach ($items as $item) {
switch ($item['item_type']) {
case '2':
// Сообщества
$top = $item;
$user_mod = $user_comm_mods[$top['commune_id']];
if ($top['member_is_banned'] && !($user_mod & (commune::MOD_ADMIN | commune::MOD_COMM_AUTHOR | commune::MOD_COMM_MANAGER)) || $top['is_private'] == 't' && $top['user_id'] != $uid && !($user_mod & (commune::MOD_ADMIN | commune::MOD_COMM_AUTHOR | commune::MOD_COMM_MANAGER)) || $top['is_blocked'] && $top['commune_author_id'] != $uid) {
continue;
}
//.........这里部分代码省略.........