本文整理汇总了PHP中professions::GetGroupName方法的典型用法代码示例。如果您正苦于以下问题:PHP professions::GetGroupName方法的具体用法?PHP professions::GetGroupName怎么用?PHP professions::GetGroupName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类professions
的用法示例。
在下文中一共展示了professions::GetGroupName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionPortfolio
/**
* Обработка информации по шагу портфолио
*/
public function actionPortfolio()
{
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$category = intval($_COOKIE['your_categories']);
$spec = intval($_COOKIE['your_subcategories']);
if ($category > 0) {
$category_name = professions::GetGroupName($category);
} else {
$category = 0;
}
if ($spec > 0) {
$subcategory_name = professions::GetProfName($spec);
} else {
$spec = 0;
}
$action = __paramInit('string', null, 'action');
if ($action == 'upd_portf') {
$error = $this->actionProcessingPortfolio();
if ($error) {
$data = $this->request;
$portf_insert = $this->portf_insert;
/*if($data['resume'] > 0) {
$resume = new CFile($data['resume']);
}*/
}
} else {
// запись в базе для текущего портфолио
$field = $this->parent->getFieldsUser();
// все данные портфолио
$data = unserialize($field['portfolio']);
// сохраненные работы для текущего портфолио
$portf_insert = $this->getWorks();
}
if ($data['resume'] > 0) {
$resume = new CFile($data['resume']);
}
$curr_hour_name = $this->CURRENCY_TYPE[$data['cost_type_hour']];
$curr_month_name = $this->CURRENCY_TYPE[$data['cost_type_month']];
// подготовка специализации для вывода в шаблон
$spec = $data['spec'];
$specString = professions::GetProfNameWP($spec, '/', null, false);
list($category_name, $subcategory_name) = explode('/', $specString);
$count_portf = $this->getCountWorks();
$answersExists = $this->_getCountAnswers();
include $_SERVER['DOCUMENT_ROOT'] . "/wizard/registration/steps/tpl.step.portfolio.php";
}
示例2: GetPrjHistory
/**
* Взять все данные по проекту из истории
*
* @param integer $prj_id Ид проекта
* @return array
*/
function GetPrjHistory($prj_id)
{
global $DB;
$sql = "SELECT p.*, city.city_name, country.country_name \n FROM projects_history AS p \n LEFT JOIN city ON city.id = p.city\n LEFT JOIN country ON country.id = p.country\n WHERE p.id=?i";
$project = $DB->row($sql, $prj_id);
if ($project) {
$project['spec_txt'] = '';
if ($project['specs']) {
$sp = array();
$spec_t = preg_split("/,/", $project['specs']);
foreach ($spec_t as $spec_t_item) {
$spec_t_i = preg_split("/\\|/", $spec_t_item);
array_push($sp, array('category_id' => $spec_t_i[0], 'subcategory_id' => $spec_t_i[1]));
}
$parts = array();
foreach ($sp as $item) {
$name = '';
if ($item['subcategory_id']) {
$name = professions::GetProfNameWP($item['subcategory_id'], ' / ');
} elseif ($item['category_id']) {
$name = professions::GetGroupName($item['category_id']);
} else {
continue;
}
$parts[] = $name;
}
$project['spec_txt'] = implode(' ', $parts);
}
if ($project['files']) {
$files = preg_split("/,/", $project['files']);
$project['attach'] = array();
$month = date('Ym');
foreach ($files as $file) {
array_push($project['attach'], array('name' => $file, 'path' => 'projects/upload/' . $month));
}
}
}
return $project;
}
示例3: retrieveProfession
/**
* достает профессии из sbr_to_spec и помещает их в $this->data['professions'].
*/
public function retrieveProfession()
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
global $DB;
if (!$this->data['id']) {
return;
}
$sql = 'SELECT category_id, subcategory_id FROM sbr_to_spec WHERE sbr_id = ?i ORDER BY id DESC';
$res = $DB->rows($sql, $this->data['id']);
$this->data['professions'] = array();
if (is_array($res)) {
foreach ($res as $prof) {
$prof['prof_name'] = $prof['subcategory_id'] ? professions::GetProfNameWP($prof['subcategory_id'], ': ', '', false) : professions::GetGroupName($prof['category_id']);
if ($prof['subcategory_id']) {
$prof['default'] = $prof['subcategory_id'];
$prof['default_column'] = 1;
} else {
$prof['default'] = $prof['category_id'];
$prof['default_column'] = 0;
}
$this->data['professions'][] = $prof;
}
} else {
$this->data['professions'] = array();
}
}
示例4: unserialize
// Все изменения $tmpPrj->_project переносим в переменную.
$project = $tmpPrj->getProject();
if (trim($project['contacts']) != '') {
$contacts = unserialize($project['contacts']) ? unserialize($project['contacts']) : $contacts;
}
if ($project['country']) {
$location = country::GetCountryName($project['country']);
if ($project['city']) {
$location .= ': ' . city::GetCityName($project['city']);
}
$project['location'] = $location;
}
$prj_categories = $tmpPrj->getCategories();
if ($prj_categories) {
foreach ($prj_categories as $ind => $category) {
$prj_categories[$ind]['prof_name'] = $category['subcategory_id'] ? professions::GetProfNameWP($category['subcategory_id'], ': ', '', false) : professions::GetGroupName($category['category_id']);
}
}
if ($step > 0) {
$tmpPrj->fix();
}
if (!$additional_header) {
$additional_header = '';
}
//$additional_header .= '<script type="text/javascript" src="/scripts/tawl_bem.js"></script>';
$js_file[] = 'tawl_bem.js';
if ($content == 'content2.php') {
//$additional_header .= '<script type="text/javascript" src="/css/block/b-shadow/b-shadow.js"></script>';
$js_file[] = '/css/block/b-shadow/b-shadow.js';
} else {
if ($content == 'new/tpl.step_1.php') {
示例5: GetOrderInfo
/**
* Информация о заказе в HTML по id в account_operations: логин, имя пользователя, где размещено, время действия.
* @param integer $bill_id id операции в account_operations
* @param integer $uid uid пользователя
* @return string данные о заказе в виде HTML
*/
public function GetOrderInfo($bill_id, $uid)
{
include_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
global $DB;
$sql = "SELECT * FROM mass_sending WHERE account_op_id = ? LIMIT 1";
$row = $DB->row($sql, $bill_id);
$out = "Для " . $row['all_count'] . " " . getTermination($row['all_count'], array('пользователя', 'пользователей', 'пользователей'));
$sql = "SELECT * FROM mass_sending_profs WHERE mass_sending_id = ?";
$row2 = $DB->rows($sql, $row['id']);
if (is_array($row2) && count($row2)) {
$sect = array();
foreach ($row2 as $ms) {
if ((int) $ms['prof_id']) {
$sect[] = professions::GetProfNameWP((int) $ms['prof_id']);
} else {
$sect[] = professions::GetGroupName((int) $ms['group_id']) . "/Все разделы";
//'Все разделы';
}
}
$out .= ', ' . implode(', ', $sect);
}
return $out;
}
示例6: actionProjects
//.........这里部分代码省略.........
$error['logo_link'] = 'Не верно введен адрес';
}
} else {
$data['logo_id'] = null;
}
$price = 0;
// закрепление на верху
if ($option['top'] == 1 && $option['top_count'] > 0) {
if ($option['top_count'] > 999) {
$option['top_count'] = 999;
}
$price = (int) $option['top_count'] * ($data['kind'] == 7 ? $cTopPrice : $pTopPrice);
$data['top_count'] = (int) $option['top_count'];
$pay_option[] = array('wiz_uid' => $this->getWizardUserID(), 'op_code' => new_projects::OPCODE_PAYED, 'option' => self::PROJECT_OPTION_TOP, 'type' => $data['kind'] == 7 ? self::BILL_TYPE_CONTEST : self::BILL_TYPE_PROJECT, 'ammount' => $price);
} else {
$data['top_count'] = 0;
}
// выделение цветом
if ($option['color'] == 1) {
$price += (int) $colorPrc;
$data['is_color'] = true;
$pay_option[] = array('wiz_uid' => $this->getWizardUserID(), 'op_code' => new_projects::OPCODE_PAYED, 'option' => self::PROJECT_OPTION_COLOR, 'type' => $data['kind'] == 7 ? self::BILL_TYPE_CONTEST : self::BILL_TYPE_PROJECT, 'ammount' => $colorPrc);
} else {
$data['is_color'] = false;
}
// выделение жирным
if ($option['bold'] == 1) {
$price += (int) $boldPrc;
$data['is_bold'] = true;
$pay_option[] = array('wiz_uid' => $this->getWizardUserID(), 'op_code' => new_projects::OPCODE_PAYED, 'option' => self::PROJECT_OPTION_BOLD, 'type' => $data['kind'] == 7 ? self::BILL_TYPE_CONTEST : self::BILL_TYPE_PROJECT, 'ammount' => $boldPrc);
} else {
$data['is_bold'] = false;
}
if ($option['logo'] == 1) {
$price += (int) $logoPrc;
$pay_option[] = array('wiz_uid' => $this->getWizardUserID(), 'op_code' => new_projects::OPCODE_PAYED, 'option' => self::PROJECT_OPTION_LOGO, 'type' => $data['kind'] == 7 ? self::BILL_TYPE_CONTEST : self::BILL_TYPE_PROJECT, 'ammount' => $logoPrc);
}
if ($price > 0) {
$data['payed'] = (int) $price;
}
if (!$error) {
$data['wiz_uid'] = $this->getWizardUserID();
// если проект уже есть
if ($existPrjID) {
// то просто обновляем его
$prj_id = $this->updateProject($data, $existPrjID);
// и очищаем все платные опции для этого проекта
wizard_billing::clearPayedOptions($prj_id);
} else {
$prj_id = $this->createProject($data);
}
if ($prj_id && $_POST['attachedfiles_session']) {
$attachedfiles = new attachedfiles($_POST['attachedfiles_session']);
$files = $attachedfiles->getFiles(array(1, 2, 3, 4));
$this->parent->addAttachedFiles($files, $prj_id);
$attachedfiles->clear();
}
if ($prj_id && $data['kind'] == 7) {
$insert = array('wiz_uid' => $data['wiz_uid'], 'op_code' => new_projects::OPCODE_KON_NOPRO, 'type' => self::BILL_TYPE_CONTEST, 'ammount' => new_projects::getKonkursPrice(), 'parent' => $prj_id);
wizard_billing::addPaidOption($insert);
}
if ($price > 0 && $prj_id) {
foreach ($pay_option as $k => $opt) {
$opt['parent'] = $prj_id;
wizard_billing::addPaidOption($opt);
}
}
if ($prj_id) {
$_SESSION['view_wizard_project'] = $prj_id;
header('Location: /wizard/registration/');
exit;
} else {
$error['project'] = 'Ошибка записи проекта';
}
}
$currency_name = __paramInit('string', null, 'currency');
$priceby_name = __paramInit('string', null, 'priceby');
}
// Генерируем данные для вывода ошибок и заполнения полей
$loc[] = country::GetCountryName($data['country']);
if ($data['city']) {
$loc[] = city::GetCityName($data['city']);
}
$location_name = implode(': ', $loc);
$cat[] = professions::GetGroupName($category);
if ($subcategory) {
$cat[] = professions::GetProfName($subcategory);
}
$category_name = implode(': ', $cat);
if ($data['logo_id']) {
$file = new CFile($data['logo_id']);
$logo_path = WDCPREFIX . '/' . $file->path . $file->name;
}
include $_SERVER['DOCUMENT_ROOT'] . '/wizard/registration/steps/tpl.step.project.php';
} else {
$project = $this->getProjectById($prj_id);
$attached = $this->getProjectAttach($prj_id);
include $_SERVER['DOCUMENT_ROOT'] . '/wizard/registration/steps/tpl.step.project.view.php';
}
}