function list_countries() { $query = $this->con->genericQuery("select * from " . $this->table . " order by name"); $objReturn = array(); foreach ($query as $value) { $country = new country(); $country->open($value); $objReturn[] = $country; } return $objReturn; }
function pickrandom($time) { $active = contest::active(); $activeCountries = country::stateSortVotes('active'); if ($activeCountries->count() == 0) { $final = country::stateSortVotes('finale'); $finalCount = $final->count(); $ranks = [1 => 'gold', 2 => 'silver', 3 => 'bronze']; for ($i = 1; $i <= 3 && $i <= $finalCount; $i++) { $final->found(); new medal(['type' => $ranks[$i], 'votes' => $final->votes, 'contest#' => $active->id, 'country#' => $final->id]); } country::resetVotes(); $active->end = $time; $new = contest::nextActive(); $new->start = $time; $new->update(); pickFromQueue(); } else { $activeCountries->state = 'finale'; $activeCountries->votes = 0; while ($activeCountries->found()) { $activeCountries->state = 'eliminated'; } pickFromQueue(); } }
/** * Возвращает select со списком городов указанной страны в для фильтра регионов в каталоге фрилансеров. * * @param int $country название страны транслит * @param array $attr опционально. атрибуты select например: array('name'=>'pf_city', 'class'=>'flt-p-sel',...); * * @return unknown */ function RFGetCitysByCid($country, $attr = array()) { $objResponse = new xajaxResponse(); if (!$attr) { $attr = array('name' => 'pf_city', 'class' => 'b-select__select'); } $sAttr = ''; foreach ($attr as $key => $val) { $sAttr .= ' ' . $key . '="' . $val . '"'; } if ($country) { $cities = city::GetCities(country::getCountryIDByTranslit($country)); } $objResponse->script('$("b-select__city").set("html","");'); $objResponse->script('new Element("option", { value: "0", text: "Все города" }).inject($("b-select__city"));'); $js = ''; if ($cities) { foreach ($cities as $cityid => $city) { $js .= 'new Element("option", { value: "' . translit(strtolower($city)) . '", text: "' . $city . '" }).inject($("b-select__city"));' . "\n"; } } if ($js) { $objResponse->script($js); } return $objResponse; }
public function actionAjaxState() { $country = country::model()->findByPk($_POST['address']['address_country_ID']); if ($country && $country->contain_states == 1) { echo CHtml::dropDownList('address[address_state_ID]', '', state::items($country->country_ID), array('id' => 'state')); } else { echo CHtml::dropDownList('address[address_state_ID]', '', array(0 => '----------------------------------------'), array('id' => 'state')); } }
public function loadModel() { if ($this->_model == null) { if (isset($_GET['id'])) { $condition = ''; $this->_model = country::model()->findByPk($_GET['id'], $condition); } if ($this->_model == null) { throw new CHttpException(404, "The requested page does not exist!"); } } return $this->_model; }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { $insert = $request->all(); $safeName = false; //upload image if ($file = Input::file('image')) { $fileName = $file->getClientOriginalName(); $extension = $file->getClientOriginalExtension() ?: 'png'; $folderName = '/uploads/'; $destinationPath = Config::get('app.path') . $folderName; $safeName = time() . "_" . str_random(10) . '.' . $extension; $file->move($destinationPath, $safeName); $insert['image'] = $safeName ? $folderName . $safeName : ''; } if (isset(Country::$boolean)) { foreach (country::$boolean as $field) { if (isset($insert[$field]) && $insert[$field] == "on") { $insert[$field] = 1; } } } country::create($insert); return redirect('admin/countries')->with('success', Lang::get('message.success.create')); }
public function getInformationUser($uid = false) { require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/employer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/country.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/city.php"; if (!$uid) { $uid = $_SESSION['uid']; } if (is_emp()) { $user = new employer(); } else { $user = new freelancer(); } $user->GetUserByUID($uid); $this->setFieldInfo('uname', $user->uname); $this->setFieldInfo('usurname', $user->usurname); $this->setFieldInfo('birthday', $user->birthday); $this->setFieldInfo('country', $user->country); $this->setFieldInfo('country_name', country::GetCountryName($user->country)); $this->setFieldInfo('city', $user->city); $this->setFieldInfo('city_name', city::GetCityName($user->city)); $this->setFieldInfo('sex', $user->sex == 't' ? 1 : ($user->sex == 'f' ? 0 : -1)); $this->setFieldInfo('info_for_reg', unserialize($user->info_for_reg)); }
/** * Обрабатывает POST переменную action и возвращает null или данные. * * @return string */ public function processRequest() { $expire = 1; //3600; $action = __paramInit('string', '', 'action'); switch ($action) { case 'getdays': $days = array(1 => iconv('WINDOWS-1251', 'UTF-8//IGNORE', '1 день')); $max = __paramInit('integer', '', 'max', 1); $all = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 21, 30, 45, 60, 90); if ($max > 1) { $days = array(); foreach ($all as $day) { if ($day >= $max) { break; } $days[$day] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $day . ending($day, ' день', ' дня', ' дней')); } } $days = array(array('parentId' => '0'), $days); return json_encode($days); break; case 'gettucategories': $expire = 300; //3600; $membuf = new memBuff(); $memkey = 'b-combo-gettucategories'; $result = $membuf->get($memkey); if (!$result) { /* * Получаем из базы иерархию категорий для * типовой услуги */ $DB = new DB('master'); $sql = 'SELECT g.id AS gid, g.title AS gname, g.ucnt AS gucnt, p.id AS pid, p.title AS name, p.ucnt AS pucnt FROM tservices_categories AS g INNER JOIN tservices_categories AS p ON p.parent_id = g.id ORDER BY g.ucnt DESC, p.ucnt DESC --gid, pid --g.n_order, p.n_order'; $rows = $DB->rows($sql); $result = array(); if (count($rows)) { 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['gucnt'])); if ($i['pid'] !== null) { $result[$i['gid']][$i['pid']] = array(iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']), $i['pucnt']); } else { $result[$i['gid']] = array(iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['gname']), $i['gucnt']); } } elseif (is_array($result[$i['gid']])) { $result[$i['gid']][$i['pid']] = array(iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']), $i['pucnt']); } } } //print_r($result); //exit; $result = json_encode($result); $membuf->add($memkey, $result, $expire); } return $result; break; case 'getlettergrouplist': require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/letters.php'; $lettergroups = letters::getGroups($_POST['word'], (int) $_POST['limit']); $result = array(); $n = 0; foreach ($lettergroups as $k => $i) { $result[$n]['uid'] = $i['id']; $result[$n]['uname'] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $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 'getlettergroupinfo': require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/letters.php'; $group = letters::getGroup($_POST['uid']); if ($group) { $data = array('record' => array('uid' => $group['id'], 'uname' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', $group['title']), 'usurname' => '', 'login' => '', 'photo' => '', 'path' => '', 'isContacts' => ''), 'found' => 1, 'dav' => WDCPREFIX); } return json_encode($data); break; case 'getletterdocinfo': require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/letters.php'; $doc = letters::getDocument($_POST['uid']); if ($doc) { $data = array('record' => array('uid' => $doc['id'], 'uname' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', $doc['id'] . ' ' . htmlspecialchars($doc['group_title']) . ' - ' . htmlspecialchars($doc['title'])), 'usurname' => '', 'login' => '', 'photo' => '', 'path' => '', 'isContacts' => ''), 'found' => 1, 'dav' => WDCPREFIX); } return json_encode($data); break; case 'getletterdoclist': require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/letters.php'; $letterdocs = letters::getDocuments($_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 '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) { $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); } case 'get_pro_types': $membuf = new memBuff(); $memkey = 'b-combo-get_pro_type'; $result = $membuf->get($memkey); if (!$result) { $rows = op_codes::getCodes(array(47, 48, 49, 50, 51)); $result = array(); foreach ($rows as $k => $i) { $result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['op_name']); } $result[76] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'На несколько недель'); $membuf->add($memkey, $result, $expire); } return json_encode($result); case 'getcountries': case 'getrelevantcountries': $membuf = new memBuff(); $memkey = 'b-combo-getcountriesr'; $result = $membuf->get($memkey); if (!$result) { $rows = country::GetCountriesByCountUser(); $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 'getcities': $n = __paramInit('integer', '', 'id'); if ($n !== false) { $membuf = new memBuff(); $memkey = "b-combo-getcitybycountry{$n}"; $result = $membuf->get($memkey); if (!$result) { $rows = city::GetCities($n); $result = array('0' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все города')); if (is_array($rows)) { foreach ($rows as $k => $i) { $result[$k] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i); } } $membuf->add($memkey, $result, $expire); } $data = array(array('parentId' => "{$n}"), $result); return json_encode($data); } case 'getcitiesbyid': $n = __paramInit('integer', '', 'id'); if ($n !== false) { $membuf = new memBuff(); $memkey = "b-combo-getcitybycountry{$n}"; $result = $membuf->get($memkey); if (!$result) { $rows = city::GetCities($n); $result = array('0' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все города')); foreach ($rows as $k => $i) { $result[$k] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i); } $membuf->add($memkey, $result, $expire); } return json_encode($result); } case 'getuserlistbysbr': case 'getuserlistold': case 'getuserlist': return $this->getUsersList($_POST['word'], (int) $_POST['limit'], (int) $_POST['userType'], (int) $_POST['scope']); case 'get_user_info': return json_encode(users::GetUserShortInfo((int) $_POST['uid'])); case 'getusersandcompanies': return $this->getUsersAndCompany($_POST['word'], (int) $_POST['limit'], (int) $_POST['userType'], (int) $_POST['scope'], false); case 'get_user_or_company_info': return $this->getUserOrCompanyRecord(); case 'getsms': require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/registration.php'; $registration = new registration(); $registration->listenerAction(__paramInit('string', null, 'action')); } return false; }
<div class="b-menu b-menu_line b-menu_relative b-menu_padbot_10 b-menu__cat b-menu_zindex_6" > <?php if (false) { $region_filter_txt = '<strong>Все</strong>'; if ($filter_apply) { $region_filter_country_id = $mFilter['country']; $region_filter_city_id = $mFilter['city']; } else { $region_filter_country_id = $_SESSION['region_filter_country']; $region_filter_city_id = $_SESSION['region_filter_city']; } $_SESSION['region_filter_country'] = $region_filter_country_id; $_SESSION['region_filter_city'] = $region_filter_city_id; $region_filter_countries = country::GetCountries(); if ($region_filter_country_id) { $region_filter_cities = city::GetCities($region_filter_country_id); } if ($region_filter_country_id) { foreach ($region_filter_countries as $countid => $country) { if ($countid == $region_filter_country_id) { $region_filter_country_txt = $country; } } $region_filter_txt = '<strong>' . $region_filter_country_txt . '</strong>'; if ($region_filter_city_id) { foreach ($region_filter_cities as $cityid => $city) { if ($cityid == $region_filter_city_id) { $region_filter_city_txt = $city; }
/** * Перевод для юр лиц - "Банковский перевод для юридических лиц (рубли)". */ public function bankAction() { front::og('tpl')->page = 'index'; $act = $this->uri[0]; if ($act == 'delete') { unset($_SESSION['sum']); require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php'; $did = intval($this->uri[1]); if ($did) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php'; $reqv = new reqv(); $reqv->Del($did, " AND user_id='" . get_uid() . "'"); header("Location: /{$this->name_page}/bank/"); exit; } unset($reqv); } if ($_POST['sum'] > 0) { $_SESSION['sum'] = floatval($_POST['sum']); } else { front::og('tpl')->sum = floatval($_SESSION['sum']); } // Обработка подстраницы редактирования данных для перевода if ($act == 'edit') { /** * Подключение всех необходимых классов для вывода данной страницы. */ require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv_ordered.php'; if ($_POST['update']) { $reqv = new reqv(); $reqv->BindRequest($_POST); $error = $reqv->CheckInput(); if (!$error) { $reqv->user_id = get_uid(); $reqv->Update($reqv->id, " AND user_id='" . get_uid() . "'"); header("Location: /{$this->name_page}/bank/#reqv" . $reqv->id); exit; } else { $action = 'edit'; $edit_mode = 1; $eid = intval($reqv->id); } front::og('tpl')->error = $error; } front::og('tpl')->countries = country::GetCountries(); $reqvs = new reqv(); $reqvByUid = $reqvs->GetByUid(get_uid()); $reqvs_ord = new reqv_ordered(); $billNum = sizeof($reqvs_ord->GetByUid(get_uid())); $sum = trim($this->uri[2]); $norisk_id = intval(trim($_REQUEST['noriskId'])); front::og('tpl')->reqvs = $reqvs; front::og('tpl')->sum = $sum; front::og('tpl')->reqvByUid = $reqvByUid; front::og('tpl')->reqvs_ord = $reqvs_ord; front::og('tpl')->billNum = $billNum; front::og('tpl')->norisk_id = $norisk_id; front::og('tpl')->edit_mode = $edit_mode = 1; front::og('tpl')->eid = $eid = intval($this->uri[1]); // Событие нажатия кнопки - Обновить if (!$_POST['update']) { foreach ($reqvByUid as $ikey => $value) { $reqvs->BindRequest($value); if ($edit_mode && $reqvs->id == $eid) { $reqvkey = $ikey; } } $reqv = new reqv(); if ($act == 'edit' && !$error) { $reqv->BindRequest($reqvByUid[$reqvkey]); } elseif ($error) { $reqv->BindRequest($_POST); } } front::og('tpl')->reqv = $reqv; front::og('tpl')->display('bill/bill_bank_step2.tpl'); exit; } else { // Иначе выводим главную страницу, где необходимо заполнять поля require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv_ordered.php'; front::og('tpl')->countries = country::GetCountries(); $reqvs = new reqv(); $reqvByUid = $reqvs->GetByUid(get_uid()); $reqvs_ord = new reqv_ordered(); $billNum = sizeof($reqvs_ord->GetByUid(get_uid())); $sum = trim(!$_POST['sum'] ? $_SESSION['sum'] : floatval($_POST['sum'])); $norisk_id = intval(trim($_REQUEST['noriskId'])); front::og('tpl')->reqvs = $reqvs; front::og('tpl')->sum = $sum; front::og('tpl')->reqvByUid = $reqvByUid; front::og('tpl')->reqvs_ord = $reqvs_ord; front::og('tpl')->billNum = $billNum; front::og('tpl')->norisk_id = $norisk_id; $reqv = new reqv(); if ($action == 'edit' && !$error) { $reqv->BindRequest($reqvByUid[$reqvkey]); } elseif ($error) { $reqv->BindRequest($_POST); } front::og('tpl')->reqv = $reqv; /* * Переход на следующую страницу для того чтобы подтвердить введенные данные */ if ($_POST['send']) { $reqv = new reqv(); $reqv->BindRequest($_POST); $error = $reqv->CheckInput(); //var_dump($error); if (!$error && !$_POST['editing']) { //$reqv->user_id = get_uid(); //$reqv->Add($err); front::og('tpl')->sum = !$_POST['sum'] ? $_SESSION['sum'] : floatval($_POST['sum']); //front::og("tpl")->sum = $_POST['sum']; front::og('tpl')->reqv = $reqv; front::og('tpl')->display('bill/bill_bank_step3.tpl'); exit; } front::og('tpl')->sum = !$_POST['sum'] ? $_SESSION['sum'] : floatval($_POST['sum']); //front::og("tpl")->sum = $_POST['sum']; front::og('tpl')->reqv = $reqv; front::og('tpl')->error = $error; //array("firm"=>"Введите название"); //front::og("tpl")->display("bill/bill_bank_step2.tpl"); //exit; } /* * Поддветрждение данных и выписка счета. */ if ($_POST['next']) { $reqv = new reqv(); $reqv->BindRequest($_POST); $error = $reqv->CheckInput(); if (!$error) { $reqv->user_id = get_uid(); $reqv->Add($err); header("Location: /{$this->name_page}/bank/"); exit; } front::og('tpl')->sum = !$_POST['sum'] ? $_SESSION['sum'] : floatval($_POST['sum']); //front::og("tpl")->sum = $_POST['sum']; front::og('tpl')->reqv = $reqv; front::og('tpl')->error = $error; } front::og('tpl')->display('bill/bill_bank_step2.tpl'); } //front::og("tpl")->display("bill/bill_bank_step1.tpl"); }
$_SESSION['no_of_room'] = $no_of_room; $room_type_id = $_REQUEST['room_type_id']; print(" <script type='text/javascript'> var check_in_date='" . $check_in_date . "'; var check_out_date='" . $check_out_date . "'; var room_type_id='" . $room_type_id . "'; var room_bed_type='" . $room_bed_type . "'; var room_meal_type='" . $_SESSION['room_meal_type'] . "'; var num_rooms='" . $no_of_room . "'; </script> "); $hotel_room_type = new HotelRoomType(); $hotel = new Hotels(); $country = new country(); $hotel->setHotelId($hotels_id); $hotel->extractor($hotel->getHotelFromId()); $country->setCountryId($_SESSION['country_id']); $hotel_room_type->setRoomTypeId($room_type_id); $hotel_room_type->extractor($hotel_room_type->getHotelRoomTypeFromId()); if ($hotels_id != $hotel_room_type->roomTypeHotelId()) { echo "Error"; die(); }
public function completeData($type_role = 1) { if ($this->isDisable()) { header("Location: /wizard/registration/?step=1"); exit; } require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/employer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/city.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/country.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/blogs.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/commune.php"; $themes_blogs = blogs::getRandomThemes(5); $themes_commune = commune::getRandomCommunes(3); $month = array('1' => 'января', '2' => 'февраля', '3' => 'марта', '4' => 'апреля', '5' => 'мая', '6' => 'июня', '7' => 'июля', '8' => 'августа', '9' => 'сентября', '10' => 'октября', '11' => 'ноября', '12' => 'декабря'); if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) { $user = new employer(); $checkPRO = $this->checkWizardPRO(array(step_employer::OP_CODE_PRO)); $pro_emp = $checkPRO['id'] > 0 ? 1 : 0; if ($pro_emp) { $week_pro = round($checkPRO['ammount'] / 10); } } else { $user = new freelancer(); $checkPRO = $this->checkWizardPRO(step_freelancer::getOperationCodePRO()); $pro_frl = $checkPRO['id'] > 0 ? 1 : 0; if ($pro_frl) { $op_code = $checkPRO['op_code']; } } $user->GetUserByUID(wizard::getUserIDReg()); $info_for_reg = unserialize($user->info_for_reg); $uname = $user->uname; $usurname = $user->usurname; $sex = $user->sex == 't' ? 1 : ($user->sex == 'f' ? 0 : -1); $birthday = strtotime($user->birthday); if ($birthday) { $bday = date('d', $birthday); $bmonth = (int) date('m', $birthday); $bmonth_value = $month[$bmonth]; $byear = date('Y', $birthday); } else { $bday = ''; $bmonth = (int) date('m', $birthday); $bmonth_value = $month[$bmonth]; $byear = ''; } $city = $user->city; if ($city) { $city_value = city::GetCityName($city); } $country = $user->country; if ($country) { $country_value = country::GetCountryName($country); } if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) { $company = $user->compname; $about_company = $user->company; $logo_name = $user->logo; $dir = "users/" . substr($user->login, 0, 2) . "/" . $user->login . "/logo/"; $logo_path = WDCPREFIX . "/" . $dir . $user->logo; } $info['site'] = $this->loadMultiVal('site', 'site', $user); $info['email'] = $this->loadMultiVal('second_email', 'email', $user); $info['phone'] = $this->loadMultiVal('phone', 'phone', $user); $info['icq'] = $this->loadMultiVal('icq', 'icq', $user); $info['skype'] = $this->loadMultiVal('skype', 'skype', $user); $info['jabber'] = $this->loadMultiVal('jabber', 'jabber', $user); $info['lj'] = $this->loadMultiVal('ljuser', 'lj', $user); $action = __paramInit('string', null, 'action'); if ($action == 'upd_info') { $info_for_reg = $_POST['info_for_reg']; if ($info_for_reg['email_0'] !== null) { $info_for_reg['second_email'] = $info_for_reg['email_0']; unset($info_for_reg['email_0']); } if ($info_for_reg['phone_0'] !== null) { $info_for_reg['phone'] = $info_for_reg['phone_0']; unset($info_for_reg['phone_0']); } if ($info_for_reg['site_0'] !== null) { $info_for_reg['site'] = $info_for_reg['site_0']; unset($info_for_reg['site_0']); } if ($info_for_reg['lj_0'] !== null) { $info_for_reg['ljuser'] = $info_for_reg['lj_0']; unset($info_for_reg['lj_0']); } if ($info_for_reg['jabber_0'] !== null) { $info_for_reg['jabber'] = $info_for_reg['jabber_0']; unset($info_for_reg['jabber_0']); } if ($info_for_reg['skype_0'] !== null) { $info_for_reg['skype'] = $info_for_reg['skype_0']; unset($info_for_reg['skype_0']); } if ($info_for_reg['icq_0'] !== null) { $info_for_reg['icq'] = $info_for_reg['icq_0']; unset($info_for_reg['icq_0']); } if ($info_for_reg['compname'] !== null) { $info_for_reg['company'] = $info_for_reg['compname']; unset($info_for_reg['compname']); } $info_for_reg = array_map('intval', $info_for_reg); $user->info_for_reg = serialize($info_for_reg); $uname = __paramInit('string', null, 'uname', null, 21); $usurname = __paramInit('string', null, 'usurname', null, 21); if ($uname == '') { $error['uname'] = "Поле заполнено некорректно"; } if ($usurname == '') { $error['usurname'] = "Поле заполнено некорректно"; } if (!preg_match("/^[-a-zA-Zа-яёА-ЯЁ]+\$/", $uname)) { $error['uname'] = "Поле заполнено некорректно"; } else { $user->uname = $uname; } if (!preg_match("/^[-a-zA-Zа-яёА-ЯЁ]+\$/", $usurname)) { $error['usurname'] = "Поле заполнено некорректно"; } else { $user->usurname = $usurname; } $sex = __paramInit('int', null, 'sex', 1); // по умолчанию мужской пол $user->sex = $sex == 1 ? 't' : 'f'; $bday = __paramInit('int', null, 'bday', null); $bmonth = __paramInit('int', null, 'bmonth_db_id', 1); $bmonth_value = __paramInit('string', null, 'bmonth'); $byear = __paramInit('int', null, 'byear', null); if ($bday != null && $byear != null) { if (!is_numeric($bday) || !is_numeric($byear) || !checkdate($bmonth, $bday, $byear) || $byear < 1945 || $byear > date('Y')) { $error['birthday'] = "Поле заполнено некорректно"; } else { $user->birthday = dateFormat("Y-m-d", $byear . "-" . $bmonth . "-" . $bday); } } else { $user->birthday = "1910-01-01"; } if (!$error['birthday'] && $user->birthday && date("Y", strtotime($user->birthday)) >= date("Y")) { $error['birthday'] = "Поле заполнено некорректно"; } $city = __paramInit('int', null, 'city_db_id', 0); $city_value = __paramInit('string', null, 'city', false); $country = __paramInit('int', null, 'country_db_id', 0); $country_value = __paramInit('string', null, 'country', false); if ($city == 0 && strlen($city_value) != 0) { $error['city'] = 'Поле заполнено некорректно'; } if ($country == 0 && strlen($country_value) != 0) { $error['country'] = 'Поле заполнено некорректно'; } $user->country = $country; $user->city = $city; $company = __paramInit('string', null, 'company') ? substr(__paramInit('string', null, 'company'), 0, 64) : ''; $about_company = __paramInit('string', null, 'about_company'); $user->compname = $company; if (strlen($about_company) > 500) { $error['company'] = "Количество знаков в тексте о компании превышает допустимое значение"; } else { $user->company = $about_company; } $logo_id = __paramInit('int', null, 'logo_company'); $logo_name = __paramInit('string', null, 'logo_name'); if ($logo_name) { $user->logo = $logo_name; $user->Update(wizard::getUserIDReg(), $res); } $info['site'] = $this->initMultiVal('site'); $info['email'] = $this->initMultiVal('email'); $info['phone'] = $this->initMultiVal('phone'); $info['icq'] = $this->initMultiVal('icq'); $info['skype'] = $this->initMultiVal('skype'); $info['jabber'] = $this->initMultiVal('jabber'); $info['lj'] = $this->initMultiVal('lj'); if (!empty($info['site'])) { foreach ($info['site'] as $i => $value) { $name = 'site' . ($i != 0 ? "_{$i}" : ""); if (!url_validate(addhttp($value), true) && trimhttp($value) != '') { $error[$name] = "Поле заполнено некорректно"; } else { $user->{$name} = addhttp($value); } } } if (!empty($info['email'])) { foreach ($info['email'] as $i => $value) { if ($i == 0) { $name_save = "second_email"; } else { $name_save = "email_{$i}"; } $name = 'email' . ($i != 0 ? "_{$i}" : ""); if (!is_email($value) && $value != '') { $error[$name] = "Поле заполнено некорректно"; } else { $user->{$name_save} = $value; } } } if (!empty($info['phone'])) { foreach ($info['phone'] as $i => $value) { $name = 'phone' . ($i != 0 ? "_{$i}" : ""); if (!preg_match("/^[-+0-9)( #]*\$/", $value)) { $error[$name] = "Поле заполнено некорректно"; } else { $user->{$name} = $value; } } } if (!empty($info['icq'])) { foreach ($info['icq'] as $i => $value) { $name = 'icq' . ($i != 0 ? "_{$i}" : ""); if (!preg_match("/^[-0-9\\s]*\$/", $value) && !is_email($value)) { $error[$name] = "Поле заполнено некорректно"; } else { $user->{$name} = $value; } } } if (!empty($info['skype'])) { foreach ($info['skype'] as $i => $value) { $name = 'skype' . ($i != 0 ? "_{$i}" : ""); $user->{$name} = $value; } } if (!empty($info['jabber'])) { foreach ($info['jabber'] as $i => $value) { $name = 'jabber' . ($i != 0 ? "_{$i}" : ""); if (strlen($value) > 255) { $error[$name] = "Количество знаков превышает допустимое значение"; } else { $user->{$name} = $value; } } } if (!empty($info['lj'])) { foreach ($info['lj'] as $i => $value) { if ($i == 0) { $name_save = "ljuser"; } else { $name_save = "lj_{$i}"; } $name = 'lj' . ($i != 0 ? "_{$i}" : ""); if (!preg_match("/^[a-zA-Z0-9_-]*\$/", $value)) { $error[$name] = "Поле заполнено некорректно"; } else { $user->{$name_save} = $value; } } } if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) { $pro_emp = __paramInit('int', null, 'pro-emp', false); if ($pro_emp) { $week_pro = round(__paramInit('int', null, 'week_pro', 0)); } } else { $ammount = 0; $pro_frl = __paramInit('int', null, 'pro-frl', false); if ($pro_frl) { $pro = __paramInit('string', null, 'pro', -1); switch ($pro) { case "1week": $op_code = 76; $ammount = 7; break; case "1": $op_code = 48; $ammount = 19; break; case "3": $op_code = 49; $ammount = 54; break; case "6": $op_code = 50; $ammount = 102; break; case "12": $op_code = 51; $ammount = 180; break; case "-1": default: $ammount = 0; break; } } } if (!$error && wizard::getUserIDReg()) { $error['save'] = $user->Update(wizard::getUserIDReg(), $res); if (!$error['save']) { if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) { $ammount = $week_pro * 10; if ($ammount > 0) { $checkPRO = $this->checkWizardPRO(step_employer::OP_CODE_PRO); if ($checkPRO['id'] > 0) { $update = array("ammount" => $ammount); wizard_billing::editPaidOption($update, $checkPRO['id']); } else { $insert = array("wiz_uid" => step_wizard::getWizardUserID(), "op_code" => step_employer::OP_CODE_PRO, "type" => 3, "ammount" => $ammount, "parent" => wizard::getUserIDReg()); wizard_billing::addPaidOption($insert); } } else { $sql = "DELETE FROM wizard_billing WHERE wiz_uid = ? AND op_code = ?"; $this->_db->query($sql, step_wizard::getWizardUserID(), step_employer::OP_CODE_PRO); } } else { // Чистим $sql = "DELETE FROM wizard_billing WHERE wiz_uid = ? AND op_code IN (?l)"; $this->_db->query($sql, step_wizard::getWizardUserID(), step_freelancer::getOperationCodePRO()); if ($ammount > 0) { $insert = array("wiz_uid" => step_wizard::getWizardUserID(), "op_code" => $op_code, "type" => 4, "ammount" => $ammount, "parent" => wizard::getUserIDReg()); wizard_billing::addPaidOption($insert); } } $this->parent->setCompliteStep(true); $this->parent->setNextStep($this->parent->getPosition() + 1); header("Location: /wizard/registration/"); exit; } } if ($logo_id > 0) { $file = new CFile($logo_id); $logo_path = WDCPREFIX . "/" . $file->path . $file->name; } } include $_SERVER['DOCUMENT_ROOT'] . "/wizard/registration/steps/tpl.step.info.php"; }
if (!($info_for_reg['country'] && !$uid) && $user->country) { ?> <div class="b-layout__hover_bg_f0ffdf b-layout_padlr_10 b-layout_pad_3"> <div class="b-layout__txt b-layout__txt_padleft_35 b-layout__txt_lineheight_1 b-layout__txt_padtop_1"> <span class="b-icon b-icon__cont b-icon__cont_map b-icon_margleft_-35"></span> <?php if ($info_for_reg['country'] && !$uid) { ?> <?php echo $reg_string; ?> <?php } elseif ($user->country) { ?> <?php echo country::GetCountryName($user->country); if ($user->city && !($info_for_reg['city'] && !$uid)) { ?> , <?php echo city::GetCityName($user->city); } ?> <?php } ?> </div> </div> <?php } ?>
</div> </div> <div class="<?php echo $color[$c++ % 2]; ?> " id="leaderboard"> <div class="headconbody"> <div class="row"> <div class="description"> <h3>[nav_leaderboard]</h3> <p>[leaderboarddesc]</p> <div class="contentrow"> <?php $country = new country(false); while ($country->found()) { ?> <div class="col-md-4"> <div class="conx"> <h1><?php echo $country->name; ?> </h1> <div class="medals"> <p><?php echo $country->medal()->count(); ?>
<?php $a = $_POST['Data']; include_once '../config/country.php'; $ob = new country(); $res = $ob->select_location($a); echo '<option value="0">--Select--</option>'; while ($r = mysqli_fetch_array($res)) { echo '<option value="' . $r['id'] . '">' . $r['location'] . "</option>"; }
<?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']);
$filter_prof = array(1 => array($prof_id => 1)); } elseif ($prof_group_id > 0) { $profs = professions::GetProfs($prof_group_id); $filter_prof = array(); foreach ($profs as $prof) { $filter_prof[1][$prof['id']] = 1; } } $filter = array("is_pro" => $is_pro, 'prof' => $filter_prof); $string_professions = ''; if ($action == "search_advanced") { $filter = array("active" => "t", "prof" => $filter_prof, "cost_type" => intval(@$_POST['cost_type_db_id']), "from_cost" => $from_cost, "to_cost" => $to_cost, "curr_type" => intval(@$_POST['curr_type_db_id']), "exp" => is_array($_POST['exp']) ? array_map("intval", $_POST['exp']) : @$_POST['exp'], "exp_from" => $exp[0], "exp_to" => $exp[1], "age" => is_array($_POST['age']) ? array_map("intval", $_POST['age']) : @$_POST['age'], "age_from" => $age[0], "age_to" => $age[1], "country" => (int) @$_POST['location_columns'][0], "city" => (int) @$_POST['location_columns'][1], "in_office" => (bool) @$_POST['in_office'], "in_fav" => (bool) @$_POST['in_fav'], "only_free" => (bool) @$_POST['only_free'], "is_pro" => $is_pro, "is_verify" => (bool) @$_POST['is_verify'], "is_preview" => (bool) @$_POST['is_preview'], "sbr_is_positive" => (bool) @$_POST['sbr_is_positive'], "sbr_not_negative" => (bool) @$_POST['sbr_not_negative'], "opi_is_positive" => (bool) @$_POST['sbr_is_positive'], "opi_not_negative" => (bool) @$_POST['sbr_not_negative']); if ($filter['cost_type']) { $filter['cost'][] = array('cost_type' => $filter['curr_type'], 'cost_from' => $filter['from_cost'], 'cost_to' => $filter['to_cost'], 'type_date' => $filter['cost_type']); } $countryObj = new country(); $countryCityName = $countryObj->getCountryAndCityNames($filter['country'], $filter['city']); $countryCityName = @$countryCityName['name']; } if (!empty($filter["prof"]) && is_array($filter["prof"][1])) { $raw_professions = professions::GetProfessionsTitles(array_keys($filter["prof"][1])); $a_professions = array(); foreach ($raw_professions as $profession_item) { $a_professions[$profession_item["name"]] = '(@name_prof "' . $profession_item["name"] . '" | @additional_specs "' . $profession_item["name"] . '")'; } $string_professions = '(' . join(" | ", $a_professions) . ')'; } $string_query = $search_string; // @todo Кажется, это никогда не используется? $string_query .= !empty($string_professions) ? ' ' . $string_professions : ''; $type = 'users_ext';
public function hookDisplayCarrierList($params) { $parcelStoresAllInOne = DpdDeliveryPoints::collectDeliveryPoints(country::getIsoById(country::getIdByName(null, $params['address']->country)), false, false); $parcelStoresAllInOne = $this->parcelSort($parcelStoresAllInOne, 'company'); $parcel_stores_city = array(); foreach ($parcelStoresAllInOne as $company) { $parcel_stores_city[trim($company['city'])][] = $company; } ksort($parcel_stores_city); self::setKeyPriority($parcel_stores_city, self::stringToarray(',', ',' . Configuration::get(self::CONST_PREFIX . 'CITY_PRIORITY'))); $carrier_id = (int) $this->context->cart->id_carrier; if ($carrier_id == Configuration::get('DELIVERYPOINTS_CARRIER_ID')) { $this->context->smarty->assign(array('id_carrier' => $params['cart']->id_carrier, 'id_address' => $params['address']->id, 'delivery_terminals' => $parcel_stores_city, 'delivery_option' => $params['address']->id, 'current_city' => $params['address']->city, 'carrier_name' => $this->getCarrierName($carrier_id), 'type_parcel_display' => Configuration::get(self::CONST_PREFIX . 'TYPE_PARCEL_DISPLAY'), 'short_office_name' => Configuration::get(self::CONST_PREFIX . 'SHORT_OFFICE_NAME'))); //$this->context->controller->addJS(_PS_MODULE_DIR_.'dynamicparceldistribution/views/js/script.js', 'all'); //$this->context->controller->addJS(_PS_MODULE_DIR_.'dynamicparceldistribution/views/js/script.js'); //print_r(_PS_MODULE_DIR_.'dynamicparceldistribution/views/js/script.js'); //$this->context->controller->addCSS($this->_path.'/views/css/mycss.css'); if (count($parcel_stores_city)) { //return $this->display(__FILE__, 'views/templates/hook/deliverypoints.tpl'); $output = $this->context->smarty->fetch($this->local_path . 'views/templates/hook/deliverypoints.tpl'); return $output; } else { self::log('hookDisplayCarrierList -> Not found any parcel stores. maybe user and password is not correct?'); } return ''; } if ($carrier_id == Configuration::get('COURIERSERVICE_CARRIER_ID')) { if (Configuration::get(self::CONST_PREFIX . 'SHOW_DELIVERY_TIME')) { $this->getDeliveryTimeAvailable($params['address']->city); //Leave only available times if (empty(self::$delivery_time)) { //Last check for how much available return ''; } $this->context->smarty->assign(array('delivery_option' => $params['address']->id, 'id_carrier' => $params['cart']->id_carrier, 'id_address' => $params['address']->id, 'carrier_name' => $this->getCarrierName($carrier_id), 'delivery_time' => self::$delivery_time)); if (count(self::$delivery_time)) { //return $this->display(__FILE__, 'views/templates/hook/courierservice.tpl'); $output = $this->context->smarty->fetch($this->local_path . 'views/templates/hook/courierservice.tpl'); return $output; } else { self::log('hookDisplayCarrierList -> Not found any delivery time'); } } } return ''; }
<br><br> <table width="100%" cellspacing="2" cellpadding="2" border="0"> <tr> <td style="padding: 5px;"><b>Страны</b></td> <td style="padding: 5px;"><b>Города</b></td> <td style="padding: 5px;"><b>Возраст</b></td> </tr> <tr> <td valign="top" style="padding: 5px;"> <table width="100%" cellspacing="2" cellpadding="2" border="0" class="brd-tbl"> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php'; $countr = country::CountAll(10); if ($countr) { foreach ($countr as $ikey => $cntr) { ?> <tr> <td width="130"><?php echo $cntr['country_name']; ?> </td> <td><?php echo $cntr['cnt']; ?> </td> </tr> <?php }
/** * Возвращает название текущей страны. * * @return mixed */ public function getCountryTitle() { if (is_null($this->_country)) { $this->_country = ''; if ($this->filter->country) { $countryModel = new country(); $this->_country = $countryModel->getCountryName($this->filter->country) . ': Все города'; } } return $this->_country; }
* @copyright © Pan American Health Organization, 2013. All rights reserved. * @access public * @version v0.13.46 * @package ProEthos-Admin * @subpackage Country */ require "cab.php"; /* Admin Common */ $ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO')); if ($ok == 0) { redirecina('main.php'); } require $include . 'sisdoc_colunas.php'; require $include . 'sisdoc_debug.php'; require "_class/_class_ajax_pais.php"; $clx = new country(); $tabela = $clx->tabela; $label = msg('tit_' . $tabela); $http_edit = 'admin_country_ed.php'; $editar = True; $http_ver = ''; $http_redirect = page() . '?dd98=' . $dd[98] . '&dd97=' . $dd[97]; $clx->row(); $busca = true; $offset = 20; //$pre_where = " e_mailing = '".$cl->mail_codigo."' "; $order = "pais_nome"; echo '<TABLE width="' . $tab_max . '" align="center"><TR><TD>'; require $include . 'sisdoc_row.php'; echo '</table>'; echo '</div>';
</tr> <tr id="disp"> <th >* Sales Person Name :</th> <td><input type="text" name="sales_name" id="sales_name"></td> </table> </div> <div class="company_header"> <h4>Company Details</h4> </div> <div class="company_body"> <?php include_once '../config/category.php'; include_once '../config/country.php'; $ob = new category(); $res = $ob->select(); $ob1 = new country(); $res1 = $ob1->select(); ?> <table width="647" border="0"> <tr> <th width="342" height="37">* Company Name :</th> <td width="240"><input type="text" name="company_name" id="company_name"></td> </tr> <tr> <th height="79">* Industry:</th> <td><select name="industry[]" size="7" multiple id="industry"> <?php while ($r = mysqli_fetch_array($res)) { ?> <option value="<?php echo $r['Id'];
/** * Отдает HTML для Редактирование проектов и конкурсов * * @param object $objResponse xajaxResponse * @param string $rec_id идентификатор записи * @param string $rec_type тип записи * @param array $aParams дополнительные параметры с UID отправителя. остальные - опционально * @return string */ function _admEditProjectsParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array()) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php'; $sTmpKey = md5(uniqid($_SESSION['uid'])); $tmpPrj = new tmp_project($sTmpKey); $prj = $tmpPrj->init(1, $rec_id); $tmpPrj->fix(); // $aFolders = projects::getUserFolders( $prj['user_id'] ); // папки $remTPeriod = $tmpPrj->getRemainingTopPeriod($remTD, $remTH, $remTM, $remtverb); // закрепление // страны и города $countries = country::GetCountries(); if ($prj['country']) { $cities = city::GetCities($prj['country']); } // разделы $categories = professions::GetAllGroupsLite(); $professions = professions::GetAllProfessions(); array_group($professions, 'groupid'); $professions[0] = array(); $project_categories = new_projects::getSpecs($rec_id); if (empty($project_categories)) { $project_categories[] = array('category_id' => 0, 'subcategory_id' => 0); } ob_start(); include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/projects.php'; $sHtml = ob_get_contents(); ob_end_clean(); // текст $sOnReady = "if(document.getElementById('adm_edit_descr')) \n document.getElementById('adm_edit_descr').value = (\$('adm_edit_descr_source')? \$('adm_edit_descr_source').value : null);"; // аттачи $sAttach = getAttachedFilesJs(projects::GetAllAttach($rec_id), tmp_project::MAX_FILE_COUNT, tmp_project::MAX_FILE_SIZE, 'project'); $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать ' . ($rec_type == '7' ? 'конкурс' : 'проект')); $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml); $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');"); $objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное', 'Файлы', 'Платные услуги'];"); $objResponse->script('adm_edit_content.edit();'); $objResponse->script($sAttach); $objResponse->script($sOnReady); $objResponse->script("var mx = new MultiInput('adm_edit_professions','category_line'); mx.init();"); $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_PROJECTS . ');'); // для конкурса даты окончания и определения победителей if ($prj['kind'] == 7) { $objResponse->script("new tcal ({ 'formname': 'adm_edit_frm', 'controlname': 'adm_edit_end_date', 'iconId': 'end_date_btn', 'clickEvent': function(){ adm_edit_content.hideError('end_date'); } });"); $objResponse->script("new tcal ({ 'formname': 'adm_edit_frm', 'controlname': 'adm_edit_win_date', 'iconId': 'win_date_btn', 'clickEvent': function(){ adm_edit_content.hideError('win_date'); } });"); } }
<?php require_once "../config.php"; $discAdd = false; $discUpd = false; $discDel = false; if (!$_GET['user']) { die; } else { $idUser = $_GET['user']; } $country = new country(); $country->open($company->fk_country); $newUser = new user(); $newUser->open($idUser); if ($_POST['action'] == 'Save') { if (isset($_POST['hdId'])) { $newUser->saveDiscplines($_POST['hdId'], $_POST['discPrices']); $discUpd = true; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="shortcut icon" href="../img/icon.png"> <title>Disciplines | FOLearn</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="" />
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/xajax/countrys.common.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"; $xajax->printJavascript('/xajax/'); $is_show_adv = isset($_SESSION['search_advanced'][$type]); if (!$filter) { $filter = $_SESSION['search_advanced'][$type]; } $categories = professions::GetAllGroupsLite(TRUE); $subcategories = professions::GetAllProfessions(1); $countries = country::GetCountries(); if ($filter['country']) { $cities = city::GetCities($filter['country']); } $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']; } //создаем массив специализаций (для фильтра на главной он уже есть в $prfs, для фильтра в проектах фрилансера его нет, поэтому делаем проверку на существование if (!sizeof($profs)) { $all_specs = professions::GetAllProfessions("", 0, 1); } else { $all_specs = $profs; } ?> <script type="text/javascript">
function orderCreate($orderId) { $systemSetting = new systemSetting(); $order = new order(); $customer = new customer(); $currency_object = new CurrencyWord(); $currency = new currency(); $orderProduct = new orderProduct(); $payment = new payment(); $country = new country(); $order->setOrderId($orderId); $order->extractor($order->getOrderById()); $orderProduct->setOrderPOrderId($order->orderId()); $orderProduct_rows = $orderProduct->getProductsByOrderId(); $payment->setPaymentOrderId($order->orderId()); $result = $orderProduct->getTotalDetailByOrderId(); $systemSetting->extractor($systemSetting->getSettings()); $customer->setCustomerId($order->orderCustomerId()); $customer->extractor($customer->getCustomerById()); $currency->setCurrId(1); $currencyName = $currency->getCurrencyNameById(); $country->setCountryId($order->orderDeliveryCity()); $countryName = $country->getCountryNameById(); $filename = $systemSetting->sySettingDocumentName() . 'Invoice_' . $order->orderInvoiceRefNumber() . '.pdf'; $subject = $systemSetting->sySettingCompanyName() . " - New Order Place....!"; $strContent = ' <table width="800" border="0" style="font-family:Arial, Helvetica, sans-serif; background:#eee; font-size:12px; color:#333333;"> <tr> <td colspan="3" rowspan="8" align="left" valign="top"> <img src="' . DOC_ROOT . 'uplode-img/company-logo/' . $systemSetting->sySettingCompanyLogo() . '" /> </br> <div style="padding-left:20px;font-size:16px; font-weight:bold; margin-bottom:8px;margin-top:20px;">' . $systemSetting->sySettingCompanyName() . ' </div> <div style="padding-left:30px;margin-bottom:5px;font-size:10px;font-size:13px;">' . $systemSetting->sySettingCompanyAddress() . '</div> <div style="padding-left:30px;margin-bottom:5px;font-size:10px;font-size:13px;">Telephone : ' . $systemSetting->sySettingCompanyPhon() . '</div> <div style="padding-left:30px;margin-bottom:5px;font-size:10px;font-size:13px;">Email : ' . $systemSetting->sySettingCompanyEmail() . '</div> </td> <td colspan="3" bgcolor="#CC0000" style="color:#FFF; font-size:14px; padding:5px; text-align:right; font-weight:700; letter-spacing:1px;">C u s t o m e r I n v o i c e</td> </tr> <tr> <td > </td> <td colspan="2"> </td> </tr> <tr> <td > </td> <td colspan="2"> </td> </tr> <tr> <td> </td> <td colspan="2"> </td> </tr> <tr> <td style="padding:3px; border-bottom:1px #484848 dotted;"><div style=" width:80px;background-color:#ddd; float:left; margin-top:2px; padding:2px 5px;">Date</div></td> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;text-align:right;">' . date('l jS \of F Y ', strtotime($order->orderCreatedDate())) . '</td> </tr> <tr> <td style="padding:3px; border-bottom:1px #484848 dotted;"><div style=" width:80px;background-color:#ddd; float:left; margin-top:2px; padding:2px 5px;">Invoice No</div></td> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;text-align:right;">' . $order->orderInvoiceRefNumber() . '</td> </tr> <tr> <td style="padding:3px; border-bottom:1px #484848 dotted;"><div style=" width:80px;background-color:#ddd; float:left; margin-top:2px; padding:2px 5px;">Order No</div></td> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;text-align:right;">' . $order->orderRefNumber() . '</td> </tr> <tr> <td colspan="3" > </td> <td> </td> <td> </td> </tr> <tr> <td colspan="6" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px;">To</td> </tr> <tr> <td colspan="6" style="padding:3px; border-bottom:1px #484848 dotted;"> <div style="margin-bottom:5px; margin-top:5px; font-weight:700;">' . $customer->customerName() . ' </div> <div style="font-size:10px;font-size:10px;">' . $customer->customerAddress() . '</div></td> </tr> <tr> <td colspan="6"> </td> </tr> <tr> <td width="19%" align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:5%;">No</td> <td width="11%" align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:15%">Item Code</td> <td width="11%" align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:35%">Description</td> <td align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:10%">Quantity</td> <td width="22%" align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:15%">Unit Price</td> <td width="23%" align="center" bgcolor="#333333" style="color:#fff; padding:3px 0 3px 8px; font-weight:bold; font-size:13px; width:20%">Total Price</td> </tr>'; $count = 1; for ($i = 0; $i < count($orderProduct_rows); $i++) { $orderProduct->extractor($orderProduct_rows, $i); $strContent .= ' <tr> <td align="center" style="padding:3px; border-bottom:1px #484848 dotted;">' . $count . '</td> <td align="center" style="padding:3px; border-bottom:1px #484848 dotted;">' . $orderProduct->orderPProductCode() . '</td> <td align="center" style="padding:3px; border-bottom:1px #484848 dotted;">' . $orderProduct->orderPProductName() . '</td> <td align="center" valign="bottom" style="padding:3px; border-bottom:1px #484848 dotted;">' . $orderProduct->orderPProductQuantity() . '</td> <td align="right" valign="bottom" style="padding:3px; border-bottom:1px #484848 dotted;">' . $currency->convetNumberFormatDefault($orderProduct->orderPProductUnitPrice()) . '</td> <td align="right" valign="bottom" style="padding:3px; border-bottom:1px #484848 dotted;">' . $currency->convetNumberFormatDefault($orderProduct->orderPProductTotalPrice()) . '</td> </tr> '; $count++; } $strContent .= ' <tr> <td colspan="5" style="padding:3px; border-bottom:1px #484848 dotted;">'; $TOTAL_VAL = $result[0]['PRI']; $strContent .= $currency_object->get_bd_amount_in_text($result[0]['PRI'], 'Say ' . $currencyName . ' ', ' Cents '); $strContent .= ' </td> <td style="padding:3px; border-bottom:2px #000 double;" align="right"><span style="border-bottom:1px #909090 dashed; float:right; text-align:right;"> ' . $currency->convetNumberFormatDefault($TOTAL_VAL) . '</span></td> </tr> <tr> <td> </td> <td colspan="2"> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td colspan="2"> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="6" bgcolor="#333333" style="font-size:12px; color:#FFF; padding:5px;" >General Terms And Conditions</td> </tr> <tr> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;"><div style="padding:3px 10px; width:200px; float:left; font-weight:700;">Invoice Price Currency</div></td> <td colspan="4" style="padding:3px; border-bottom:1px #484848 dotted;">' . $currencyName . '</td> </tr> <tr> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;"><div style="padding:3px 10px; width:200px; float:left; font-weight:700;">Validity of Price Till</div></td> <td colspan="4" style="padding:3px; border-bottom:1px #484848 dotted;"> </td> </tr> <tr> <td colspan="2"> </td> <td colspan="4"> </td> </tr> <tr> <td colspan="6"> </td> </tr> <tr> <td colspan="6" bgcolor="#333333" style="font-size:12px; color:#FFF; padding:5px;" >Product Preferences</td> </tr> <tr> <td colspan="6" style="padding:3px; border-bottom:1px #484848 dotted;">' . $order->orderClientNote() . '</td> </tr> <tr> <td colspan="2"> </td> <td colspan="4"> </td> </tr> <tr> <td colspan="6" bgcolor="#333333" style="font-size:12px; color:#FFF; padding:5px;" >Delivery Details</td> </tr> <tr> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;"><div style="padding:3px 10px; width:200px; float:left; font-weight:700;">Delivery Address</div></td> <td colspan="4" style="padding:3px; border-bottom:1px #484848 dotted;">' . $order->orderDeliveryAddress() . '</td> </tr> <tr> <td colspan="2" style="padding:3px; border-bottom:1px #484848 dotted;"><div style="padding:3px 10px; width:200px; float:left; font-weight:700;">Delivery Note</div></td> <td colspan="4" style="padding:3px; border-bottom:1px #484848 dotted;">' . $order->orderDeliveryNote() . '</td> </tr> <tr> <td colspan="2"> </td> <td colspan="4"> </td> </tr> <tr> <td colspan="6"> </td> </tr> <tr> <td colspan="6"> <br> <p> Looking forward to see you online<br/> ' . $systemSetting->sySettingCompanyName() . '<br/><br/> Best Regards,<br/> Web Admin Team<br/> <strong>' . $systemSetting->sySettingCompanyName() . ' - on ' . date('Y-m-d h:i a') . '</strong><br/> </p> <hr/> <span style="color:#666; font-size:11px; font-family:Arial, Helvetica, sans-serif;">You are receiving this email, because an account has been registered at the ' . $systemSetting->sySettingCompanyName() . ' Online Shoping cart portal. If you have not made any registration or unaware of the same, please email administrator at ' . $systemSetting->sySettingCompanyEmail() . ' to remove you from this panel.</span></td> </tr> </table> '; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = $systemSetting->sySettingHost(); // sets GMAIL as the SMTP server $mail->Port = $systemSetting->sySettingPort(); // set the SMTP port $mail->Username = $systemSetting->sySettingSmtpUsername(); // GMAIL username $mail->Password = $systemSetting->sySettingSmtpPassword(); // GMAIL password $mail->From = $systemSetting->sySettingSmtpUsername(); $mail->FromName = $systemSetting->sySettingFromName(); $mail->Subject = $subject; $mail->WordWrap = 50; // set word wrap $mail->MsgHTML($strContent); $mail->AddAddress($customer->customerEmail(), $systemSetting->sySettingCompanyName()); $mail->AddCC($systemSetting->sySettingCompanyEmail(), $systemSetting->sySettingCompanyName()); $mail->IsHTML(true); // send as HTML $mail->AddAttachment(DOC_ROOT . "my-account/invoice-pdf/" . $filename); $mail->Send(); unlink(DOC_ROOT . "my-account/invoice-pdf/" . $filename); return true; }
} }); } </script> <div id="results"></div> <div id="customer"> <fieldset> <p><b>The customer mail is new, so you may proceed to create the new customer also:</b></p> <label for="name">Full Name:</label><br><br> <input type="text" id="name" name="name" /><br><br> <label for="city">City:</label><br><br> <input type="text" id="city" name="city" /><br><br> <label for="country">Country:</label><br><br> <select name="country"> <?php $country = new country(); $country->select(); ?> </select><br><br> <label for="phone">Phone:</label><br><br> <input type="text" id="phone" name="phone" /><br><br> </fieldset> </div> <br><br> <div id="button"></div> </form> </fieldset> </div> <?php //theme footer
</a><?php echo view_mark_user(array('login' => $dContent['login'], 'is_pro' => true, 'role' => $dContent['role'], 'is_team' => $dContent['is_team'])); ?>  <?php echo $dContent['completed_sbr_cnt'] ? view_sbr_shield() : ''; ?> </h4> <p>На сайте: <?php echo ElapsedMnths(strtotime($dContent['reg_date'])); ?> </p> <p> <?php if (!$info_for_reg['country'] || get_uid(false)) { if (intval($dContent['country']) != 0) { print country::GetCountryName($dContent['country']); if ($dContent['city'] && !$info_for_reg['city'] || get_uid(false)) { if (intval($dContent['city']) != 0) { print ", " . city::GetCityName($dContent['city']); } } } } //else ?> </p> </div> <?php if ($n == 3) { echo '<div style="clear:both;"> </div>'; $n = 0;
// $filter_page -- код страницы (см. таблицу projects_filters). // $filter_show -- 1: фильтр развернут, 0: свернут. /Параметр больше не используется - Эдуард, 8.10.2009/ // $filter_inputs -- дополнительные INPUT-ы в форму. // $kind -- ид. закладки (если фильтр на главной странице). // $page -- номер страницы (если фильтр на главной странице). // Плюс должны быть включены заранее все xajax функции, которые тут используются. if (!$uid) { return 0; } require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/country.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/city.php"; $has_hidd = TRUE; $filter_apply = $filter['active'] == "t"; $filter_categories = professions::GetAllGroupsLite(TRUE); $filter_countries = country::GetCountries(); if ($filter['country']) { $filter_cities = city::GetCities($filter['country']); } switch ($filter_page) { case 1: $frm_action = '/proj/?p=list'; $prmd = '&'; $has_hidd = FALSE; break; default: $frm_action = '/'; $prmd = '?'; } if (!$filter) { $filter = array('user_id' => $uid, 'cost_from' => '', 'cost_to' => '', 'currency' => 0, 'wo_cost' => 't', 'only_sbr' => 'f', 'country' => 0, 'city' => 0, 'keywords' => '', 'categories' => array());
<?php define('IS_PHP_JS', true); require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stdf.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php'; $membuf = new memBuff(); $memkey = 'b-combo-getcitiesandcountries'; $s = 0; //$membuf->get($memkey); if (!$s) { $rows = country::GetCountriesByCountUser(); $result = array(0 => "'0' : 'Все страны'"); foreach ($rows as $k => $i) { $i['name'] = str_replace('"', '"', $i['name']); $result[$i['id']] = str_replace("'", "\\'", $i['name']); } //города России 1 $rows = city::GetCities(1); $cResult = array('0' => "'0' : 'Россия'", 'undefined_value' => "'undefined_value' : 'Все города'"); foreach ($rows as $k => $i) { $i = str_replace('"', '"', $i); $i = str_replace("'", "\\'", $i); $cResult[$k] = "'{$k}' : '{$i}'"; } $result[1] = $cResult; //города Украины 2 $rows = city::GetCities(2); $cResult = array('0' => "'0' : 'Украина'", 'undefined_value' => "'undefined_value' : 'Все города'"); foreach ($rows as $k => $i) { $i = str_replace('"', '"', $i);