本文整理汇总了PHP中professions::GetProfessionsAndGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP professions::GetProfessionsAndGroup方法的具体用法?PHP professions::GetProfessionsAndGroup怎么用?PHP professions::GetProfessionsAndGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类professions
的用法示例。
在下文中一共展示了professions::GetProfessionsAndGroup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action2
public function action2()
{
global $js_file;
require_once ABS_PATH . "/classes/professions.php";
$category = __paramInit('int', NULL, 'category', NULL);
$subcategory = __paramInit('int', NULL, 'subcategory', NULL);
if ($category > 0 && $subcategory > 0 && professions::isExistProfId($subcategory, $category)) {
$data = array();
$data['kind'] = 1;
//проект!
$data['pro_only'] = true;
$data['verify_only'] = false;
$data['categories'][] = array('category_id' => $category, 'subcategory_id' => $subcategory);
$_SESSION['customer_wizard'] = $data;
$this->redirect('/welcome/customer/3/');
}
$professions = professions::GetProfessionsAndGroup('g.cnt DESC, p.pcount DESC NULLS LAST');
$suffix = isset($_SESSION['pda']) && $_SESSION['pda'] == 1 ? '_pda' : '';
$js_file['ElementsFactory'] = 'form/ElementsFactory.js';
$js_file['ElementVerticalSelect'] = 'form/VerticalSelect.js';
$this->render("step2{$suffix}", array('professions' => $professions, 'default_group' => 2, 'default_spec' => 9));
}
示例2: processRequest
//.........这里部分代码省略.........
$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) {
$membuf = new memBuff();
$memkey = "b-combo-getprofbygroup{$n}";
$result = $membuf->get($memkey);
if (!$result) {
$rows = professions::GetProfs($n);
$result = array(0 => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все специальности'));
foreach ($rows as $k => $i) {
$result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
}
$membuf->add($memkey, $result, $expire);
}
$data = array(array('parentId' => "{$n}"), $result);
return json_encode($data);
示例3: memBuff
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/classes/stdf.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$membuf = new memBuff();
$memkey = "b-combo-getprofandgroups";
$s = $membuf->get($memkey);
if (!$s) {
$rows = professions::GetProfessionsAndGroup();
$result = array();
foreach ($rows as $k => $i) {
if ($result[$i["gid"]] === null) {
$result[$i["gid"]] = array('0' => iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["gname"]), "undefined_value" => iconv("WINDOWS-1251", "UTF-8//IGNORE", 'Все специальности'));
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"]);
}
} else {
if (is_array($result[$i["gid"]])) {
$result[$i["gid"]][$i["id"]] = iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["name"]);
}
}
}
$s = json_encode($result);
$membuf->add($memkey, $s);
}
print 'var professionsList = ' . $s . '; professionsList["0"]["0"] = "Другое";professionsList["0"]["undefined_value"] = "Нет специализации";';
示例4: isset
}
$_user_action = isset($_REQUEST['user_action']) && $_REQUEST['user_action'] ? substr(htmlspecialchars($_REQUEST['user_action']), 0, 25) : '';
$_user_action = trim($_user_action);
switch ($_user_action) {
case 'tu':
if (isset($_SESSION['tu_ref_uri'])) {
$redirect_to = HTTP_PFX . $_SERVER['HTTP_HOST'] . urldecode($_SESSION['tu_ref_uri']);
}
break;
case 'new_tu':
$redirect_to = HTTP_PFX . $_SERVER['HTTP_HOST'] . '/users/' . $_SESSION['login'] . '/tu/new/';
break;
case 'promo_verification':
$redirect_to = '/promo/verification/';
break;
case 'buypro':
$redirect_to = '/payed/';
break;
}
header("Location: {$redirect_to}");
exit;
}
//Если есть другой редирект то выставляем этот флаг
$is_other_redirect = isset($_SESSION['ref_uri']) || isset($_REQUEST['user_action']);
//Получить список профессий с указанной сортировкой
$professions_data = professions::GetProfessionsAndGroup('gname, name');
$stretch_page = true;
$header = '../header.php';
$footer = '../footer.html';
$content = 'tpl.profession.php';
include '../template3.php';
示例5: NewProjForMissingMoreThan24h
/**
* Рассылка о новых проектах лицам, отсутствовавшим на сайте более суток и менее года. Вызывается раз в день из hourly.php.
*
* @param array &$uids - массив идентификаторов пользователей, подписанных на новые проекты но которым отправлено это уведомление
* необходимо передать в smail::NewProj
*
* @return int количество получивших рассылку
*/
public function NewProjForMissingMoreThan24h(&$uids)
{
$projects = projects::GetNewProjectsWithBudjet($error);
//сортировка по стоимости
foreach ($projects as $key => $prj) {
$prj['sort_cost'] = $prj['cost'];
if ($prj['currency'] == 0) {
$prj['sort_cost'] *= 30;
//в данном случае точный курс не важен, важно отсортировать
}
if ($prj['currency'] == 1) {
$prj['sort_cost'] *= 40;
//в данном случае точный курс не важен, важно отсортировать
}
$projects[$key] = $prj;
}
$all_mirrored_specs = professions::GetAllMirroredProfsId();
$professions = professions::GetProfessionsAndGroup();
$professionsTree = array();
foreach ($professions as $k => $i) {
if ($professionsTree[$i['gid']] === null) {
$professionsTree[$i['gid']] = array('gid' => $i['gname']);
if ($i['id'] !== null) {
$professionsTree[$i['gid']][$i['id']] = $i['name'];
} else {
$professionsTree[$i['gid']] = $i['gname'];
}
} elseif (is_array($professionsTree[$i['gid']])) {
$professionsTree[$i['gid']][$i['id']] = $i['name'];
}
}
$page = 0;
$count = 0;
// total
$countBs = 0;
// БС
$countCar = 0;
// карусель
$countPro = 0;
// ПРО
$countPayed = 0;
// платные места
$countVerify = 0;
// верификация
$this->subject = 'Новые проекты и конкурсы на FL.ru';
$pHost = $GLOBALS['host'];
ob_start();
include $_SERVER['DOCUMENT_ROOT'] . '/masssending/tpl.missing_more_than_24h.php';
$this->message = ob_get_clean();
$this->recipient = '';
$massId = $this->masssend();
$dbStat = new DB('master');
while ($users = freelancer::GetMissingMoreThan24h($error, ++$page, 100)) {
$this->recipient = array();
foreach ($users as $user) {
if (!$user['unsubscribe_key']) {
$user['unsubscribe_key'] = users::GetUnsubscribeKey($user['login']);
}
$unsubscribe_link = "{$pHost}/unsubscribe?ukey=" . $user['unsubscribe_key'];
$advert_template = $this->getAdvertTemplate($user, $n);
//номер рекламного блока 0 - БС, 1 - карусель, 2 - ПРО, 3 - платные места, 4 - верификация
switch ($n) {
case 0:
$countBs++;
break;
case 1:
$countCar++;
break;
case 2:
$countPro++;
break;
case 3:
$countPayed++;
break;
case 4:
$countVerify++;
break;
}
$pList = $this->getProjectsForUser($projects, $user, $all_mirrored_specs, $professionsTree);
$length = count($pList);
if ($length == 0) {
continue;
}
for ($i = 0; $i < count($pList); ++$i) {
for ($j = $i; $j < count($pList); ++$j) {
$a = $pList[$i];
$b = $pList[$j];
if ($b['sort_cost'] > $a['sort_cost']) {
$buf = $pList[$i];
$pList[$i] = $pList[$j];
$pList[$j] = $buf;
}
//.........这里部分代码省略.........
示例6: define
<?php
define('IS_PHP_JS', true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/classes/stdf.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$membuf = new memBuff();
$memkey = "b-combo-getprofandgroups";
$s = $membuf->get($memkey);
if (!$s) {
$rows = professions::GetProfessionsAndGroup('g.cnt DESC, p.pcount DESC NULLS LAST');
$result = array();
foreach ($rows as $k => $i) {
if ($result[$i["gid"]] === null) {
$result[$i["gid"]] = array('0' => array(iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["gname"]), "{$i["gcnt"]}"), "undefined_value" => array(iconv("WINDOWS-1251", "UTF-8//IGNORE", 'Все специальности'), "0"));
if ($i["id"] !== null) {
$result[$i["gid"]][$i["id"]] = array(iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["name"]), "{$i["pcount"]}");
} else {
$result[$i["gid"]] = array(iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["gname"]), "{$i["gcnt"]}");
}
} else {
if (is_array($result[$i["gid"]])) {
$result[$i["gid"]][$i["id"]] = array(iconv("WINDOWS-1251", "UTF-8//IGNORE", $i["name"]), "{$i["pcount"]}");
}
}
}
$s = json_encode($result);
$membuf->add($memkey, $s);
}
print 'var professionsList = ' . $s . '; professionsList["0"]["0"] = ["Другое","0"]; professionsList["0"]["undefined_value"] = ["Нет специализации","0"];';
示例7: _settings_get_filter
/**
* Получение настроек фильтра
*
* @return array
*/
private function _settings_get_filter()
{
require_once ABS_PATH . '/classes/projects_filter.php';
require_once ABS_PATH . '/classes/professions.php';
$aReturn = array();
$nPage = self::$_aPlatform[$this->_sPlatform]['filter_page'];
// какой фильтр получать
$oFilter = new projects_filters();
$aFilter = $oFilter->GetFilter($_SESSION['uid'], $error, $nPage);
// фильтр из базы даных
if ($this->_sPlatform == 'ios' || $this->_sPlatform == 'android') {
$aReturn['enabled'] = $aFilter['use_main_filter'] == 't' ? 1 : 0;
// наследовать фильтр с главной
}
$aReturn['keyword'] = iconv('cp1251', 'utf-8', $aFilter['keywords']);
// ключевые слова
$aReturn['items'] = array();
// группы профессий, где выбран весь раздел
if (!empty($aFilter['categories']) && !empty($aFilter['categories'][0]) && is_array($aFilter['categories'][0])) {
foreach ($aFilter['categories'][0] as $nId => $nFake) {
$aReturn['items'][] = array('categories_group_id' => $nId, 'categories_id' => 0);
}
}
// профессии, где выбрана конкретная
if (!empty($aFilter['categories']) && !empty($aFilter['categories'][1]) && is_array($aFilter['categories'][1])) {
$aProfsAndGroups = professions::GetProfessionsAndGroup();
$aProfsToGroups = array();
foreach ($aProfsAndGroups as $aOne) {
$aProfsToGroups[$aOne['id']] = $aOne['gid'];
}
foreach ($aFilter['categories'][1] as $nId => $nFake) {
$aReturn['items'][] = array('categories_group_id' => $aProfsToGroups[$nId], 'categories_id' => $nId);
}
}
return $aReturn;
}