本文整理汇总了PHP中city类的典型用法代码示例。如果您正苦于以下问题:PHP city类的具体用法?PHP city怎么用?PHP city使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了city类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: RFGetCitysByCid
/**
* Возвращает 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;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:34,代码来源:countrys.server.php
示例2: ChangeCity
/**
* Формирует список городов для выбранной страны.
*
* @param integer $country_id код страны
* @param integer $city_id код города
*/
function ChangeCity($country_id, $city_id)
{
$objResponse = new xajaxResponse();
// $countries = country::GetCountries();
$cities = city::GetCities($country_id);
$select = '<select name="ff_city" id="ff_city" ';
$select .= 'style="width:254px;">';
$select .= '<option value="0"';
if ($city_id == 0) {
$select .= ' selected';
}
$select .= '>Все города</option>';
if ($cities) {
foreach ($cities as $id => $city) {
$select .= '<option value="' . $id . '"';
if ($id == $city_id) {
$select .= ' selected';
}
$select .= '>' . $city . '</option>';
}
$select .= '</select>';
}
$objResponse->assign('city_select', 'innerHTML', $select);
return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:employers.server.php
示例3: ChangeCity
/**
* Формирует список городов для выбранной страны.
*
* @param integer $country_id код страны
* @param integer $city_id код города
*/
function ChangeCity($country_id, $city_id)
{
$objResponse = new xajaxResponse();
// $countries = country::GetCountries();
$cities = city::GetCities($country_id);
$select = "<select name=\"ff_city\" id=\"ff_city\" ";
$select .= "style=\"width:254px;\">";
$select .= "<option value=\"0\"";
if ($city_id == 0) {
$select .= " selected";
}
$select .= ">Все города</option>";
if ($cities) {
foreach ($cities as $id => $city) {
$select .= "<option value=\"" . $id . "\"";
if ($id == $city_id) {
$select .= " selected";
}
$select .= ">" . $city . "</option>";
}
$select .= "</select>";
}
$objResponse->assign("city_select", "innerHTML", $select);
return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:employers.server.php
示例4: getCitys
public function getCitys()
{
$citys = city::getCity(Tools::getValue());
foreach ($citys as $city) {
$this->citys[] = array('id' => $city['id_egms_city'], 'name' => $city['cityname1']);
}
}
开发者ID:evgrishin,项目名称:mh16014,代码行数:7,代码来源:AdminEGMSShopsController.php
示例5: GetCities
function GetCities($country, $city)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
$response = new xajaxResponse();
$cities = city::GetCities(intval($country));
/*$html = '<option value="0">Все города</option>';
foreach ($cities as $id=>$val) {
$html .= '<option value="'.$id.'">'.htmlspecialchars($val).'</option>';
}*/
$script = "document.getElementById('cities').options.length = 0; \n";
$script .= "document.getElementById('cities').options[0] = new Option('Все города', 0); \n";
$i = 1;
foreach ($cities as $id => $val) {
$script .= "document.getElementById('cities').options[{$i}] = new Option('" . htmlspecialchars($val) . "', {$id}); \n";
++$i;
}
$response->assign('cities', 'innerHTML', $html);
$response->assign('cities', 'disabled', false);
$script .= "document.getElementById('btnAddLocation').onclick = function() { locations.add(); return false; }; \n";
if ($city) {
$script .= "\n\t\t\tfor (var i=0; i<document.getElementById('cities').options.length; i++) {\n\t\t\t\tif (document.getElementById('cities').options[i].value == {$city}) {\n\t\t\t\t\tdocument.getElementById('cities').selectedIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t} \n\n\t\t";
}
$script .= 'if (spam.busy > 1) { spam.busy = 0; spam.send(); } spam.busy = 0;';
$response->script($script);
return $response;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:26,代码来源:masssending.server.php
示例6: getFieldsValues
public function getFieldsValues()
{
$id_egms_city = Tools::getValue('id_egms_city');
if ($id_egms_city != false) {
$row = city::getCity($id_egms_city);
}
return array('id_egms_city' => $id_egms_city, 'cityname1' => $row[0]['cityname1'], 'cityname2' => $row[0]['cityname2'], 'cityname3' => $row[0]['cityname3'], 'psyname' => $row[0]['psyname'], 'alias' => $row[0]['alias']);
}
开发者ID:evgrishin,项目名称:mh16014,代码行数:8,代码来源:AdminEGMSCitysController.php
示例7: setupNewUser
function setupNewUser()
{
global $db;
require_once dirname(__FILE__) . '/connectDB.php';
mysql_query("INSERT INTO server_data (server_id,user_id,`key`,value) VALUES (" . $this->server->getID() . ",{$this->userid},'gold'," . $this->server->getInitialGold() . ")", $db) or die(mysql_error());
$this->gold = $this->server->getInitialGold();
mysql_query("INSERT INTO server_data (server_id,user_id,`key`,value) VALUES (" . $this->server->getID() . ",{$this->userid},'city_count',0)", $db) or die(mysql_error());
mysql_query("INSERT INTO server_data (server_id,user_id,`key`,value) VALUES (" . $this->server->getID() . ",{$this->userid},'last_online',0)", $db) or die(mysql_error());
mysql_query("INSERT INTO server_data (server_id,user_id,`key`,value) VALUES (" . $this->server->getID() . ",{$this->userid},'rank',0)", $db) or die(mysql_error());
for ($i = 0; $i < $this->server->getInitialCityCount(); $i++) {
city::build_city($this, $this->server, false);
}
//end for $i < $this->server->getInitialCities()
}
开发者ID:honchoman,项目名称:singpolyma,代码行数:14,代码来源:user.php
示例8: GetCitysByCid
function GetCitysByCid($country_id)
{
$objResponse = new xajaxResponse();
if ($country_id) {
$cities = city::GetCities($country_id);
}
$out_text = '<select name="city" class="apf-select"><option value="0">Не выбрано</option>';
if ($cities) {
foreach ($cities as $cityid => $city) {
$out_text .= '<option value=' . $cityid . '>' . $city . '</option>';
}
}
$out_text .= '</select>';
$objResponse->assign('frm_city', 'innerHTML', $out_text);
return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:16,代码来源:public.server.php
示例9: GetCitysByCid
function GetCitysByCid($country_id)
{
$objResponse = new xajaxResponse();
if ($country_id) {
$cities = city::GetCities($country_id);
}
$out_text = "<select name=\"city\" class=\"apf-select\"><option value=\"0\">Не выбрано</option>";
if ($cities) {
foreach ($cities as $cityid => $city) {
$out_text .= "<option value=" . $cityid . ">" . $city . "</option>";
}
}
$out_text .= "</select>";
$objResponse->assign("frm_city", "innerHTML", $out_text);
return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:16,代码来源:public.server.php
示例10: run
public function run()
{
$user = $this->order[$this->is_emp ? 'freelancer' : 'employer'];
//получаем общее кол-во отзывов
$oplinks = NULL;
$opcount = opinions::GetCounts($user['uid'], array('total'));
if (array_sum($opcount['total']) > 0) {
$oplinks = array('p' => getSortOpinionLinkEx('frl', "total", 1, $user['login'], zin($opcount['total']['p']), null, 0), 'n' => getSortOpinionLinkEx('frl', "total", 2, $user['login'], zin($opcount['total']['n']), null, 0), 'm' => getSortOpinionLinkEx('frl', "total", 3, $user['login'], zin($opcount['total']['m']), null, 0));
}
//город юзера
$city_id = $this->order['is_meet'] == 't' && $this->order['city'] > 0 ? $this->order['city'] : $user['city'];
$user['place_title'] = '';
if ($city_id > 0) {
$user['place_title'] = city::getCountryName($city_id) . ', ' . city::getCityName($city_id);
}
//собираем шаблон
$this->render('t-service-order-user-profile', array('user' => $user, 'oplinks' => $oplinks));
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:18,代码来源:TServiceOrderUserProfile.php
示例11: getInformationUser
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));
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:25,代码来源:registration.php
示例12: elseif
echo '<b>' . $message . '</b>';
} elseif ($_POST['attack_id']) {
echo '<b>Troop movements started!</b>';
}
if (!$tocity) {
echo '<h2>Select a City to Attack/Move to</h2><ul>';
if ($fromcity) {
$close_upper_bound = intval($fromcity->getValue('id')) + 25000;
$dbcities = mysql_query("SELECT user_id,city_id FROM server_cities WHERE server_id=" . $server->getID() . " AND city_id < {$close_upper_bound} ORDER BY city_id DESC LIMIT 50", $db) or die(mysql_error());
} else {
$dbcities = mysql_query("SELECT user_id,city_id FROM server_cities WHERE server_id=" . $server->getID() . " ORDER BY user_id LIMIT 50", $db) or die(mysql_error());
}
//end if-else fromcity
while ($city = mysql_fetch_assoc($dbcities)) {
$user = new user($city['user_id'], $server);
$city = new city($city['city_id']);
echo '<li>';
echo '<a href="/server/' . $server->getID() . '/attack/' . $city->getValue('id') . '+' . $cities[1] . '">';
if ($city->getValue('name')) {
echo htmlentities($city->getValue('name')) . ' / ';
}
echo 'Location: ' . str_pad($city->getValue('id'), 6, '0', STR_PAD_LEFT);
echo '</a>';
echo ' / Population: ' . $city->getValue('population') . ' / Defense: ' . (intval($city->getValue('defense')) + 1) . ' / User: <a href="/server/' . $server->getID() . '/user/' . $user->getValue('userid') . '">' . htmlentities($user->getValue('nickname')) . '</a>';
$can_access = $city->getValue('user_' . $LOGIN_DATA['user_id'] . '_access');
$can_access = $can_access === true || intval($can_access) > time();
if ($can_access) {
echo ' - <a href="/server/' . $server->getID() . '/city/' . $city->getValue('id') . '">view</a>';
}
echo '</li>';
}
开发者ID:honchoman,项目名称:singpolyma,代码行数:31,代码来源:attack.php
示例13: tu_validation
/**
* Проверка данных из формы.
*/
function tu_validation(&$tservice, $is_exist_feedbacks = 0)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices_categories.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/validation.php';
$errors = array();
$validator = new validation();
$tservices_categories = new tservices_categories();
//---
//$tservice->title = trim(htmlspecialchars(InPost('title'),ENT_QUOTES,'cp1251'));
//$tservice->title = antispam(__paramInit('string', NULL, 'name', NULL, 60, TRUE));
$tservice->title = sentence_case(__paramInit('html', null, 'title', null, 100, true));
$title = trim(stripslashes(InPost('title')));
if (!$validator->required($title)) {
$errors['title'] = validation::VALIDATION_MSG_REQUIRED;
} elseif (!$validator->symbols_interval($title, 4, 100)) {
$errors['title'] = sprintf(validation::VALIDATION_MSG_SYMBOLS_INTERVAL, 4, 100);
}
//---
$tservice->price = intval(trim(InPost('price')));
if (!$validator->is_natural_no_zero($tservice->price)) {
$errors['price'] = validation::VALIDATION_MSG_REQUIRED_PRICE;
} elseif (!$validator->greater_than_equal_to($tservice->price, 300)) {
$errors['price'] = sprintf(validation::VALIDATION_MSG_PRICE_GREATER_THAN_EQUAL_TO, '300 р.');
} elseif (!$validator->less_than_equal_to($tservice->price, 999999)) {
$errors['price'] = sprintf(validation::VALIDATION_MSG_PRICE_LESS_THAN_EQUAL_TO, '999 999 р.');
}
//---
$days_db_id = intval(trim(InPost('days_db_id')));
if (!$validator->is_natural_no_zero($days_db_id) || !in_array($days_db_id, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 21, 30, 45, 60, 90))) {
$errors['days'] = validation::VALIDATION_MSG_FROM_LIST;
$days_db_id = 1;
}
$tservice->days = $days_db_id;
//---
//Если есть отзывы то не даем изменить категорию
if (!(InPost('action') == 'save' && $is_exist_feedbacks > 0)) {
$category_id = intval(trim(InPost('category_db_id')));
$parent_category_id = $tservices_categories->getCategoryParentId($category_id);
if ($parent_category_id === false) {
$errors['category'] = validation::VALIDATION_MSG_CATEGORY_FROM_LIST;
} else {
$tservice->category_id = $category_id;
//$this->property()->parent_category_id = $parent_category_id;
}
}
//---
$str_tags = trim(preg_replace('/\\s+/s', ' ', strip_tags(InPost('tags'))));
$tags = strlen($str_tags) > 0 ? array_unique(array_map('trim', explode(',', $str_tags))) : array();
$tags = array_filter($tags, function ($el) {
$len = strlen(stripslashes($el));
return $len < 80 && $len > 2;
});
$tags_cnt = count(array_unique(array_map('strtolower', $tags)));
$tags = array_map(function ($value) {
return htmlspecialchars($value, ENT_QUOTES, 'cp1251');
}, $tags);
$tservice->tags = $tags;
if (!$validator->required($str_tags)) {
$errors['tags'] = validation::VALIDATION_MSG_REQUIRED;
} elseif ($tags_cnt > 10) {
$errors['tags'] = sprintf(validation::VALIDATION_MSG_MAX_TAGS, 10);
}
//---
$videos = __paramInit('array', null, 'videos', array());
$videos = is_array($videos) ? array_values($videos) : array();
if (count($videos)) {
$tservice->videos = null;
foreach ($videos as $key => $video) {
if ($validator->required($video)) {
$_video_data = array('url' => $video, 'video' => false, 'image' => false);
//$_video = $validator->video_validate($video);
$_video = $validator->video_validate($video);
$is_error = true;
if ($_video) {
$_video_data['url'] = $_video;
if ($_video_meta = $validator->video_validate_with_thumbs($_video, 0)) {
$_video_data = array_merge($_video_data, $_video_meta);
$is_error = false;
}
}
if ($is_error) {
$errors['videos'][$key] = validation::VALIDATION_MSG_BAD_LINK;
}
$tservice->videos[$key] = $_video_data;
}
}
}
//---
//$tservice->description = trim(htmlspecialchars(InPost('description'),ENT_QUOTES, "cp1251"));
//$description = trim(InPost('description'));
$tservice->description = trim(__paramInit('html', null, 'description', null, 5000, true));
$description = trim(stripslashes(InPost('description')));
if (!$validator->required($description)) {
$errors['description'] = validation::VALIDATION_MSG_REQUIRED;
} elseif (!$validator->symbols_interval($description, 4, 5000)) {
$errors['description'] = sprintf(validation::VALIDATION_MSG_SYMBOLS_INTERVAL, 4, 5000);
//.........这里部分代码省略.........
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:functions.php
示例14: city
<?php
require 'components/get_listview_referrer.php';
require 'subclasses/city.php';
$dbh_city = new city();
$dbh_city->set_where("city_id='" . quote_smart($city_id) . "'");
if ($result = $dbh_city->make_query()->result) {
$data = $result->fetch_assoc();
extract($data);
}
开发者ID:seans888,项目名称:Bgy-Project,代码行数:10,代码来源:form_data_city.php
示例15: getAddresssave
public function getAddresssave(Request $request, $id = 0)
{
$request->session()->reflash();
$user = $request->user();
$locations = $user->locationDetected();
$citys = city::apiGet();
$userCity = City::showCity($locations['city']);
$TITLE = '添加地址';
$address = '';
if ($id) {
$TITLE = '修改地址';
$address = Address::apiFind($id);
}
return view('auth.account.addressave', ['TITLE' => $TITLE, 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => 'auth.account.addressave', 'user' => $user, 'citys' => $citys, 'userCity' => $userCity, 'address' => $address, 'id' => $id]);
}
开发者ID:verchielxy,项目名称:ttx,代码行数:15,代码来源:AccountController.php
示例16: _admEditProjectsParseForm
/**
* Отдает 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'); } });");
}
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:60,代码来源:adm_edit_content.server.php
示例17: array
<?php
$city = city::select()->where("`name` = '?'", $parts[1])->one();
if ($city === false) {
return 404;
}
$smarty->contentType('text', 'json');
$venues = venue::select()->where(isset($parts[2]) ? array($city, 'type' => $parts[2]) : $city)->order_by('title')->many();
echo '{"license": "Copyright, All Rights Reserved, Usage of this data without explicit permission is strictly forbidden!", "name": "' . $city->name . '", "title": "' . $city->title . '", "data": [';
foreach ($venues as $key => $venue) {
if ($key > 0) {
echo ",";
}
$data = $venue->get_row();
$hours = hours::select()->where($venue)->many();
unset($data['id']);
unset($data['city_id']);
$data['hours'] = array(null, null, null, null, null, null, null);
foreach ($hours as $hour) {
foreach (explode(',', $hour->weekday) as $day) {
switch ($day) {
case 'mon':
$data['hours'][0] = array($hour->open, $hour->close);
break;
case 'tue':
$data['hours'][1] = array($hour->open, $hour->close);
break;
case 'wed':
$data['hours'][2] = array($hour->open, $hour->close);
break;
case 'thu':
开发者ID:vkpriyesh,项目名称:isitopen,代码行数:31,代码来源:data.php
示例18: foreach
<td><?php
echo $cntr['cnt'];
?>
</td>
</tr>
<?php
}
}
?>
</table>
</td>
<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/city.php';
$citys = city::CountAll(10);
if ($citys) {
foreach ($citys as $ikey => $city) {
?>
<tr>
<td width="130"><?php
echo $city['city_name'];
?>
</td>
<td><?php
echo $city['cnt'];
?>
</td>
</tr>
<?php
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:inner_index_c.php
示例19: dirname
}
require_once dirname(__FILE__) . '/include/connectDB.php';
if (!$LOGIN_DATA['user_id']) {
die('<head><title>Please log in</title></head><body><h2>Please log in.</h2></body></html>');
}
if (!$server) {
$server = new server($_REQUEST['server_id']);
}
if (!$current_user) {
$current_user = new user($LOGIN_DATA['user_id'], $server);
}
if ($_POST['build_city']) {
if ($_REQUEST['city_name'] == 'City Name (optional)') {
$_REQUEST['city_name'] = '';
}
$message = city::build_city($current_user, $server, true, $_REQUEST['city_name']);
if (isset($_REQUEST['ajax'])) {
if ($message) {
die($message);
} else {
exit('City built.');
}
}
//end if ajax
}
//end if build city
?>
<head>
<title>The Project - <?php
echo $server->getName();
?>
开发者ID:honchoman,项目名称:singpolyma,代码行数:31,代码来源:server.php
示例20: init_cobalt
//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig ([email protected])
//****************************************************************************************
require 'path.php';
init_cobalt('Edit city');
if (isset($_GET['city_id'])) {
$city_id = urldecode($_GET['city_id']);
require 'form_data_city.php';
}
if (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_submit']);
require 'components/query_string_standard.php';
require 'subclasses/city.php';
$dbh_city = new city();
$object_name = 'dbh_city';
require 'components/create_form_data.php';
extract($arr_form_data);
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_city.php?{$query_string}");
}
if ($_POST['btn_submit']) {
log_action('Pressed submit button');
$message .= $dbh_city->sanitize($arr_form_data)->lst_error;
extract($arr_form_data);
if ($dbh_city->check_uniqueness_for_editing($arr_form_data)->is_unique) {
//Good, no duplicate in database
} else {
$message = "Record already exists with the same primary identifiers!";
开发者ID:seans888,项目名称:Bgy-Project,代码行数:31,代码来源:edit_city.php
注:本文中的city类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论