本文整理汇总了PHP中getCountries函数的典型用法代码示例。如果您正苦于以下问题:PHP getCountries函数的具体用法?PHP getCountries怎么用?PHP getCountries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCountries函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCountryCode
function getCountryCode($file = null, $name = "")
{
if ($file == null) {
$file = realpath(dirname(__FILE__)) . '/countries';
}
$countries = getCountries($file);
foreach ($countries as $country) {
if ($country[0] == $name) {
return strtolower($country[1]);
}
}
return "";
}
示例2: display
function display()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$l = Movim\i18n\Locale::start();
$this->view->assign('conf', $cd->get());
$this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files')));
$this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>'));
$json = requestURL(MOVIM_API . 'websockets', 3);
$json = json_decode($json);
if (isset($json) && $json->status != 404) {
$this->view->assign('websockets', $json);
}
$this->view->assign('timezones', getTimezoneList());
$this->view->assign('langs', $l->getList());
$this->view->assign('countries', getCountries());
}
示例3: prepareForm
function prepareForm($me)
{
$vcardform = $this->tpl();
$vcardform->assign('me', $me);
$vcardform->assign('desc', trim($me->description));
$vcardform->assign('gender', getGender());
$vcardform->assign('marital', getMarital());
$vcardform->assign('countries', getCountries());
$me->isValidDate();
$vcardform->assign('submit', $this->call('ajaxVcardSubmit', "MovimUtils.formToJson('vcard4')"));
$vcardform->assign('privacy', $this->call('ajaxChangePrivacy', "this.checked"));
// The datepicker arrays
$days = $months = $years = [];
for ($i = 1; $i <= 31; $i++) {
if ($i < 10) {
$j = '0' . $i;
} else {
$j = (string) $i;
}
$days[$i] = $j;
}
for ($i = 1; $i <= 12; $i++) {
if ($i < 10) {
$j = '0' . $i;
} else {
$j = (string) $i;
}
$m = getMonths();
$months[$j] = $m[$i];
}
for ($i = date('o'); $i >= 1920; $i--) {
array_push($years, $i);
}
$vcardform->assign('days', $days);
$vcardform->assign('months', $months);
$vcardform->assign('years', $years);
return $vcardform->draw('_vcard4_form', true);
}
示例4: getCountryCode
function getCountryCode($n)
{
$x = getCountries();
return $x[$n];
}
示例5: getFullCountryName
/**
* Return full name of a country
*
* @return String Name of country
*/
function getFullCountryName($countrycode)
{
$countriesarray = getCountries();
return isArrayKeyAnEmptyString($countrycode, $countriesarray) ? '' : $countriesarray[$countrycode];
}
示例6: getAllIps
<?php
require_once "functions.inc.php";
$all_ips = getAllIps();
$countries = getCountries($all_ips);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<title>CSF Attack Map</title>
<!--CSS-->
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<!--JavaScript-->
<script type="text/javascript" src="js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;
// works out the left or right hand reset position, based on scroll
// behavior, current direction and new direction
示例7: getCountries
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
<!--
* Created on 28-Nov-08
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
-->
<?php
include 'Services/DBServices.php';
include 'Services/GeneralServices.php';
include 'Services/UserRegService.php';
$allCountries = getCountries();
$action = $_REQUEST['action'];
$status = "";
if ($action == "regUser") {
$user_id = $_REQUEST['userId'];
$user_name = $_REQUEST['userName'];
$user_lstname = $_REQUEST['userLstName'];
$password = $_REQUEST['Password'];
$user_dob = $_REQUEST['userdob'];
//= new date("F j, Y, g:i a");
$user_addr1 = $_REQUEST['useraddr1'];
$user_addr2 = $_REQUEST['useraddr2'];
$user_city_id = $_REQUEST['city'];
$user_country_id = $_REQUEST['country'];
//var $user_langugage_id;
$user_email = $_REQUEST['useremail'];
示例8: process
//.........这里部分代码省略.........
return new Carton($this->data->id, $session->warehouseId);
}
break;
case 'addCarton':
$locationId = null;
$paletteId = null;
if (isset($this->data->location)) {
$locationId = $this->data->location;
}
if (isset($this->data->palette)) {
$paletteId = $this->data->palette;
}
$carton = new Carton(null, $session->warehouseId, $locationId, $paletteId);
return $carton->id;
case 'deleteCarton':
if (isset($this->data->id)) {
$carton = new Carton($this->data->id, $session->warehouseId);
return $carton->delete();
}
break;
case 'editCarton':
if (isset($this->data->id)) {
$carton = new Carton($this->data->id, $session->warehouseId);
if (isset($this->data->location)) {
$carton->locationId = $this->data->location;
} else {
$carton->locationId = null;
}
if (isset($this->data->palette)) {
$carton->paletteId = $this->data->palette;
} else {
$carton->paletteId = null;
}
return $carton->edit();
}
break;
case 'addArticle':
if (isset($this->data->carton) && isset($this->data->category) && isset($this->data->amount)) {
return Stock::addArticle($this->data->carton, $this->data->category, isset($this->data->male) ? $this->data->male : false, isset($this->data->female) ? $this->data->female : false, isset($this->data->children) ? $this->data->children : false, isset($this->data->baby) ? $this->data->baby : false, isset($this->data->winter) ? $this->data->winter : false, isset($this->data->summer) ? $this->data->summer : false, $this->data->amount >= 0 ? $this->data->amount : 0, $this->data->amount < 0 ? $this->data->amount : 0);
}
break;
case 'getStock':
return Stock::getStock($session->warehouseId, isset($this->data->carton) ? $this->data->carton : null, isset($this->data->category) ? $this->data->category : null, isset($this->data->palette) ? $this->data->palette : null, isset($this->data->location) ? $this->data->location : null, isset($this->data->male) ? $this->data->male : false, isset($this->data->female) ? $this->data->female : false, isset($this->data->children) ? $this->data->children : false, isset($this->data->baby) ? $this->data->male : false, isset($this->data->summer) ? $this->data->male : false, isset($this->data->winter) ? $this->data->male : false, isset($this->data->details) ? $this->data->details : false);
case 'getBarcodeUri':
if (isset($this->data->text)) {
// create barcode object
$bc = new Barcode39($this->data->text);
if (isset($this->data->textSize)) {
$bc->barcode_text_size = $this->data->textSize;
}
if (isset($this->data->barThin)) {
$bc->barcode_bar_thin = $this->data->barThin;
}
if (isset($this->data->barThick)) {
$bc->barcode_bar_thick = $this->data->barThick;
}
// generate barcode image
$img = "barcode_" . mt_rand(0, 100) . ".png";
$bc->draw($img);
// get data uri
$uri = Barcode39::getDataURI($img);
unlink($img);
return $uri;
}
break;
}
} else {
// process unrestricted function
switch ($this->f) {
case 'getActiveSessions':
return Session::getActiveSessionsNumber();
case 'getWarehouses':
return Warehouse::getWarehouses();
case 'addWarehouse':
$data = $this->data;
if (isset($data->name) && isset($data->description) && isset($data->country) && isset($data->city) && isset($data->password) && isset($data->mail)) {
$warehouse = new Warehouse();
Log::debug('new warehouse' . $warehouse->id);
$warehouse->name = $data->name;
$warehouse->description = $data->description;
$warehouse->country = $data->country;
$warehouse->city = $data->city;
$warehouse->setPassword($data->password);
$warehouse->setMail($data->mail);
return $warehouse->edit();
}
break;
case 'getCountries':
return getCountries();
break;
case 'getCountryCode':
$data = $this->data;
if (isset($data->name)) {
return getCountryCode(null, $data->name);
}
return false;
}
}
return false;
}
示例9: foreach
foreach ($t as $k => $v) {
echo "<option value={$k} " . ($post_state == '' && $v == 'New South Wales' || "'" . $post_state . "'" == $k ? "selected" : "") . ">" . $v . "</option>";
}
?>
</select>
</div>
</div>
<div style="clear: right;"></div><div style="clear: left;"></div>
<div class="form_row" style="margin-top:20px;">
<div class="form_tdlabel">
<label>Country :</label>
</div>
<div class="form_tdinput">
<select class="form_input" style="width: 140px;" name="country" id="country">
<?php
$t = getCountries();
foreach ($t as $k => $v) {
echo "<option value={$k} " . ($post_country == '' && $v == 'Australia' || "'" . $post_country . "'" == $k ? "selected" : "") . ">" . $v . "</option>";
}
?>
</select>
</div>
</div>
<div style="clear: right;"></div><div style="clear: left;"></div>
</div>
<div class="form" style="margin-right:0px;margin-left:100px;width:222px;margin-top:20px;">
<div class="form_row" style="padding-bottom:10px">
<br><br><br><br><br><br><br><br><br>
<div class="form_tdlabel" style="font-size:11px;text-align:left;">
示例10: input
</table>
</div>
<div id="myaccount-data" style="display:none" class="col-md-6">
<form method="POST" action="<?php
echo ACTUAL_URL;
?>
?op=update_data">
<?php
echo input('name', 'Nombre', $_GET['op'] == 'update_data' ? $_POST['name'] : $user->name);
?>
<?php
echo input('vat', 'C.I./RIF/DNI', $_GET['op'] == 'update_data' ? $_POST['vat'] : $user->vat);
?>
<!-- <?php
echo select('country', 'País', '', getCountries(), $_GET['op'] == 'update_data' ? array($_POST['country']) : array($user->country));
?>
-->
<?php
echo input('address', 'Dirección', $_GET['op'] == 'update_data' ? $_POST['address'] : $user->address);
?>
<?php
echo input('phone', 'Teléfono', $_GET['op'] == 'update_data' ? $_POST['phone'] : $user->phone);
?>
<button type="button" onclick="$('#myaccount-data').hide()" class="btn btn-info">Cancelar</button>
<button type="submit" class="btn btn-default navbar-btn">Actualizar Datos</button>
</form>
</div>
<div id="myaccount-user" style="display:none" class="col-md-6">
<form method="POST" action="<?php
echo ACTUAL_URL;
示例11: executeQuery
}
function executeQuery($query)
{
$pdo = connect();
$ret = $pdo->query($query);
$pdo = close($pdo);
return $ret;
}
if (!empty($_GET['init'])) {
if (!empty($_GET['getActors'])) {
foreach (getActors() as $actor) {
echo '<option value="' . $actor['Id'] . '">' . $actor['Nom'] . '</option>';
}
} else {
if (!empty($_GET['getCountries'])) {
foreach (getCountries() as $country) {
echo '<option value="' . $country['Pays'] . '">' . $country['Pays'] . '</option>';
}
}
}
} else {
$select = 'SELECT Titre';
$from = 'FROM Film F';
$where = 'WHERE 1';
if (!empty($_GET['actors'])) {
$actorsIdsList = urldecode($_GET['actors']);
$actorsIdsArray = explode(',', $actorsIdsList);
$i = 0;
foreach ($actorsIdsArray as $actorId) {
$from .= ' JOIN Film_Acteur FA' . $i . ' ON F.Id = FA' . $i . '.IdFilm';
$where .= ' AND FA' . $i . '.IdActeur=' . $actorId;
示例12: getOptionCountry
function getOptionCountry($langSelected, $countrySelected, $title)
{
$langSelected = checkLang($langSelected);
$countryArray = getCountries($langSelected);
$options = "<option id=\"default_" . rand() . "\" value=\"" . Select_default . "\"";
if ($countrySelected == "") {
$options .= " selected=\"selected\"";
}
$options .= ">" . $title . "</option>\n";
for ($i = 0; $i < $countryArray['Count']; $i++) {
$ISO = $countryArray[$i]["Iso"];
// $enName = $countryArray[$i]["En_name"];
$enName = strtr($countryArray[$i]["En_name"], ' ,().\'', '_______');
$Name = $countryArray[$i]["Name"];
$options .= "<option id=\"" . $enName . "\" value=\"" . $ISO . "\"";
if ($countrySelected == $ISO) {
$options .= " selected=\"selected\"";
}
$options .= ">" . $Name . "</option>\n";
}
return $options;
}
示例13: countryName
function countryName($code)
{
$list = getCountries();
$code = strtoupper($code);
return $list[$code];
}
示例14: readCSV
</div>
<!-- /#mapMenu -->
<div class="mapBody">
<div class="leftCol">
<div class="af map"></div>
<div class="as map"></div>
<div class="cr map"></div>
<div class="ca map"></div>
<div class="eu map" style="display:block;"></div>
<div class="na map"></div>
<div class="oc map"></div>
<div class="sa map"></div>
</div>
<div class="rightCol">
<h3>Europe</h3>
<div id="autoCompleteWrapper">
<?php
$airports = readCSV();
echo getCountries('eu', $airports);
?>
</div>
<div id="autoItemsWrapper"></div>
</div>
</div>
</div>
<!-- / #airportsByMap -->
</body>
</html>
<?php
}
示例15: test
/** Function getInfoFilm
return all movies with all information. It's possible to precised an attribute of the movie
@param db connector PDO of the db
@param attr array of filter for table movies /!\ Special syntax !!! Look example /!\
@param filter array of filter for other table /!\ Special syntax
@return Success = array of Movies, Echec = False
@example
Example of attributes
- field is the field in database
- value : is the value for the test ('%r%' or '1', ...)
- sign : is the sign for the comparation for permit compart string with special test % or _ ( '=' or 'LIKE', ...)
$attr = array(
'field' => array(
'value', 'sign'
);
Example of filter
- field is the type of filter ('genres', 'countries', 'studios', 'actor', 'writer', 'director', 'producer', )
- value is the value for make filter /!\ add % caracter where you want for actor, writer, director and producer
$filter = array(
'field' => value,
'actor' => %sara%toto%
)
*/
function getInfoMovies($db, $attr = array(), $filter = array())
{
//recure filter array
$secur = array('genres' => false, 'studios' => false, 'countries' => false, 'actor' => false, 'writer' => false, 'producer' => false, 'director' => false);
$filter = array_merge($secur, $filter);
$query = 'SELECT * FROM movies ';
$query .= 'INNER JOIN files ON files.`fkMovies` = movies.`idMovies` ';
$first = true;
foreach ($attr as $key => $value) {
$sign = $value[1];
if ($first) {
$first = false;
$query .= "WHERE movies.{$key} {$sign} '{$value[0]}' ";
} else {
$query .= "AND movies.{$key} {$sign} '{$value[0]}' ";
}
}
$query .= "GROUP BY movies.`idMovies`";
$req = $db->prepare($query);
if (!$req->execute()) {
$error = $req->errorCode();
$error = "Error occurred during the execution of the request ('{$error}')";
//echo $error;
return false;
}
if ($req->rowCount() >= 1) {
$result = $req->fetchAll();
} else {
return false;
}
for ($i = 0, $size = count($result); $i < $size; $i++) {
$id = $result[$i]["idMovies"];
/* Need REWORK ! */
if (($result[$i]["genres"] = getGenres($db, $id, $filter['genres'])) === false && $filter['genres'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["countries"] = getCountries($db, $id, $filter['countries'])) === false && $filter['countries'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["writer"] = getPeople($db, $id, DB_WRITER_TYPE, $filter['writer'])) === false && $filter['writer'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["director"] = getPeople($db, $id, DB_DIRECTOR_TYPE, $filter['director'])) === false && $filter['director'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["actor"] = getPeople($db, $id, DB_ACTOR_TYPE, $filter['actor'])) === false && $filter['actor'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["producer"] = getPeople($db, $id, DB_PRODUCER_TYPE, $filter['producer'])) === false && $filter['producer'] !== false) {
unset($result[$i]);
continue;
}
if (($result[$i]["studios"] = getStudios($db, $id, $filter['studios'])) === false && $filter['studios'] !== false) {
unset($result[$i]);
continue;
}
}
return $result;
}