本文整理汇总了PHP中getCountry函数的典型用法代码示例。如果您正苦于以下问题:PHP getCountry函数的具体用法?PHP getCountry怎么用?PHP getCountry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCountry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResult
public function getResult()
{
$ip = getenv('HTTP_X_FORWARDED_FOR');
$array_ip = explode(",", $ip);
$country_code = getCountry($array_ip[0]);
$storeCode = Mage::app()->getStore()->getCode();
if (strtolower($country_code) != strtolower($storeCode)) {
return $country_code;
} else {
return false;
}
}
示例2: index
/**
* Show users table
*/
public function index()
{
$clang = Yii::app()->lang;
if (!Permission::model()->hasGlobalPermission('Regions', 'create')) {
Yii::app()->setFlashMessage($clang->gT("You do not have sufficient rights to access this page."), 'error');
$this->getController()->redirect(array("admin/index"));
}
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('styleurl') . "jquery.dataTables.css");
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'jquery.dataTables.min.js');
$userlist = getCountry();
$aData['row'] = 0;
$aData['usr_arr'] = $userlist;
$aData['imageurl'] = Yii::app()->getConfig("adminimageurl");
$this->_renderWrappedTemplate('region/country', 'view_addcountry', $aData);
}
示例3: showCompetitionInfos
function showCompetitionInfos () {
#----------------------------------------------------------------------
global $chosenCompetitionId;
#--- Get the competition infos from the database.
$competition = getFullCompetitionInfos( $chosenCompetitionId );
extract( $competition );
$delegates = getCompetitionDelegates( $chosenCompetitionId );
$wcaDelegate = joinUsers( $delegates, true );
$organizers = getCompetitionOrganizers( $chosenCompetitionId );
// Only show organizer emails if there is no contact info given.
$organizer = joinUsers( $organizers, !$contact );
#--- Show the infos.
echo "<h1>$name</h1>\n";
#--- Start the table.
echo "<div class='table-responsive'>\n";
echo "<table width='100%' id='competitionDetails'><tr valign='top'>\n";
#--- Left part.
echo "<td style='width:70%'><table>";
$country = getCountry($countryId);
showItem( 'key', "Date", array( competitionDate( $competition ), $year ));
showItem( 'key', "City", array( $cityName, $country['name'] ));
showItem( 'key', "Venue", array( $venue ));
showItem( 'sub', "Address", array( $venueAddress ));
showItem( 'sub', "Details", array( $venueDetails ));
showItem( 'key', "Website", array( $website ));
showItem( 'key', "Organizer", array( $organizer ));
showItem( 'key', "WCA Delegate", array( $wcaDelegate ));
showItem( 'key', "Contact", array( $contact ));
echo "</table></td>";
#--- Right part.
echo "<td style='width:30%'><table>";
showItem( 'key', "Information", array( $information ));
showListItemNew( 'View results for', computeCompetitionEvents( $eventSpecs ));
showListItemNew( 'Reports', computeMedia( 'report' ));
showListItemNew( 'Articles', computeMedia( 'article' ));
showListItemNew( 'Multimedia', computeMedia( 'multimedia' ));
echo "</table></td>";
#--- End table.
echo "</tr></table></div>";
}
示例4: list_country
function list_country($c, $lang = '')
{
//Create the country list menu for forms with the given value selected
//$c = selected value
if (empty($c)) {
$c = strtoupper($GLOBALS['phpwcms']['default_lang']);
}
$country_list = '';
$country = getCountry($lang);
foreach ($country as $key => $value) {
$country_list .= ' <option value="' . html($key) . '"';
if ($key == $c) {
$country_list .= ' selected="selected"';
}
$country_list .= '>' . html($value) . '</option>' . LF;
}
return $country_list;
}
示例5: mysql_result
<td style="vertical-align: middle;"><span style="font-size: 30px;"><?php
echo mysql_result($querymodal, 0, 'flightnumber');
?>
</span><br/><span style="font-size: 10px;"><?php
echo airlinename(mysql_result($querymodal, 0, 'flightnumber'));
?>
</span></td>
<td style="vertical-align: middle;"><span style="font-size: 30px; margin-top: 10px;"><?php
echo getCountry(mysql_result($querymodal, 0, 'origin'), "alt") . " " . mysql_result($querymodal, 0, 'origin');
?>
</span><br/><span style="font-size: 10px;"><?php
echo mysql_result($queryorig, 0, 'Name');
?>
</span>
<td style="vertical-align: middle;"><span style="font-size: 30px; margin-top: 10px;"><?php
echo getCountry(mysql_result($querymodal, 0, 'destination'), "alt") . " " . mysql_result($querymodal, 0, 'destination');
?>
</span><br/><span style="font-size: 10px;"><?php
echo mysql_result($querydest, 0, 'Name');
?>
</span>
</tr>
<tr style="border-bottom: 1px solid #444">
<td><b>Aircraft</b> <a href="http://www.airliners.net/search/photo.search?q=<?php
echo str_ireplace(" ", "+", aircraftname(mysql_result($querymodal, 0, 'acft')));
?>
+<?php
echo str_ireplace(" ", "+", airlinename(mysql_result($querymodal, 0, 'flightnumber'), "name"));
?>
" target="_blank" style="color: #333;" onMouseOver="this.style.color='#F00'" onMouseOut="this.style.color='#333'"><i class="icon-camera" title="Click here to see pictures of this aircraft"></i></a></td>
<td><b>Departure Time</b></td>
示例6: getDateFormate
?>
</td>
<td align="center"><?php
echo getDateFormate(getDispatchNumber("DespatchDate", "rec_id", $row['DispatchNumberId']), 1);
?>
</td>
<td align="center"><?php
echo getBuyer('BuyerName', 'rec_id', getDispatchNumber("BuyerId", "rec_id", $row['DispatchNumberId']));
?>
</td>
<td align="center"><?php
echo $row['Port'];
?>
</td>
<td align="center"><?php
echo getCountry(getBuyer('CountryId', 'rec_id', $row['BuyerId']));
?>
</td>
<td align="center"><?php
echo getProduct("ProductName", "rec_id", $row['ProductId']);
?>
</td>
<td align="center"><?php
echo $row['Quantity'];
?>
</td>
<td align="center"><?php
echo $row['Price'];
?>
</td>
<?
示例7:
// Country
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
$pays_id=GETPOST('pays_id');
if (! $pays_id && ! empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) $pays_id=getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,2,$db,$langs);
if (! $pays_id && ! empty($conf->geoipmaxmind->enabled))
{
$pays_code=dol_user_country();
//print $pays_code;
if ($pays_code)
{
$new_pays_id=getCountry($pays_code,3,$db,$langs);
//print 'xxx'.$pays_code.' - '.$new_pays_id;
if ($new_pays_id) $pays_id=$new_pays_id;
}
}
$pays_code=getCountry($pays_id,2,$db,$langs);
print $html->select_country($pays_id,'pays_id');
print '</td></tr>';
// State
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($pays_code) print $formcompany->select_state(GETPOST("departement_id"),$pays_code);
else print '';
print '</td></tr>';
}
// EMail
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
示例8: updateProductOrService
/**
* Update a product or service
*
* @param array $authentication Array of authentication information
* @param Product $product Product
* @return array Array result
*/
function updateProductOrService($authentication, $product)
{
global $db, $conf, $langs;
$now = dol_now();
dol_syslog("Function: updateProductOrService login=" . $authentication['login']);
if ($authentication['entity']) {
$conf->entity = $authentication['entity'];
}
// Init and check authentication
$objectresp = array();
$errorcode = '';
$errorlabel = '';
$error = 0;
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
// Check parameters
if ($product['price_net'] > 0) {
$product['price_base_type'] = 'HT';
}
if ($product['price'] > 0) {
$product['price_base_type'] = 'TTC';
}
if ($product['price_net'] > 0 && $product['price'] > 0) {
$error++;
$errorcode = 'KO';
$errorlabel = "You must choose between price or price_net to provide price.";
}
if ($product['barcode'] && !$product['barcode_type']) {
$errror++;
$errorcode = 'KO';
$errorlabel = "You must set a barcode type when setting a barcode.";
}
if (!$error) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
$newobject = new Product($db);
$newobject->fetch($product['id']);
if (isset($product['ref'])) {
$newobject->ref = $product['ref'];
}
if (isset($product['ref_ext'])) {
$newobject->ref_ext = $product['ref_ext'];
}
$newobject->type = $product['type'];
$newobject->libelle = $product['label'];
// TODO deprecated
$newobject->label = $product['label'];
$newobject->description = $product['description'];
$newobject->note = $product['note'];
$newobject->status = $product['status_tosell'];
$newobject->status_buy = $product['status_tobuy'];
$newobject->price = $product['price_net'];
$newobject->price_ttc = $product['price'];
$newobject->tva_tx = $product['vat_rate'];
$newobject->price_base_type = $product['price_base_type'];
$newobject->date_creation = $now;
if ($product['barcode']) {
$newobject->barcode = $product['barcode'];
$newobject->barcode_type = $product['barcode_type'];
}
$newobject->stock_reel = $product['stock_real'];
$newobject->pmp = $product['pmp'];
$newobject->seuil_stock_alert = $product['stock_alert'];
$newobject->country_id = $product['country_id'];
if ($product['country_code']) {
$newobject->country_id = getCountry($product['country_code'], 3);
}
$newobject->customcode = $product['customcode'];
$newobject->canvas = $product['canvas'];
/*foreach($product['lines'] as $line)
{
$newline=new FactureLigne($db);
$newline->type=$line['type'];
$newline->desc=$line['desc'];
$newline->fk_product=$line['fk_product'];
$newline->total_ht=$line['total_net'];
$newline->total_vat=$line['total_vat'];
$newline->total_ttc=$line['total'];
$newline->vat=$line['vat_rate'];
$newline->qty=$line['qty'];
$newline->fk_product=$line['product_id'];
}*/
//var_dump($product['ref_ext']);
//var_dump($product['lines'][0]['type']);
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
foreach ($extrafields->attribute_label as $key => $label) {
$key = 'options_' . $key;
$newobject->array_options[$key] = $product[$key];
}
$db->begin();
$result = $newobject->update($newobject->id, $fuser);
if ($result <= 0) {
$error++;
}
//.........这里部分代码省略.........
示例9: updateContact
/**
* Update a contact
*
* @param array $authentication Array of authentication information
* @param Contact $contact Contact
* @return array Array result
*/
function updateContact($authentication, $contact)
{
global $db, $conf, $langs;
$now = dol_now();
dol_syslog("Function: updateContact login=" . $authentication['login']);
if ($authentication['entity']) {
$conf->entity = $authentication['entity'];
}
// Init and check authentication
$objectresp = array();
$errorcode = '';
$errorlabel = '';
$error = 0;
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
// Check parameters
if (empty($contact['id'])) {
$error++;
$errorcode = 'KO';
$errorlabel = "Contact id is mandatory.";
}
if (!$error) {
$objectfound = false;
include_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
$object = new Contact($db);
$result = $object->fetch($contact['id']);
if (!empty($object->id)) {
$objectfound = true;
$object->firstname = $contact['firstname'];
$object->lastname = $contact['lastname'];
$object->address = $contact['address'];
$object->zip = $contact['zip'];
$object->town = $contact['town'];
$object->country_id = $contact['country_id'];
if ($contact['country_code']) {
$object->country_id = getCountry($contact['country_code'], 3);
}
$object->province_id = $contact['province_id'];
$object->phone_pro = $contact['phone_pro'];
$object->phone_perso = $contact['phone_perso'];
$object->phone_mobile = $contact['phone_mobile'];
$object->fax = $contact['fax'];
$object->email = $contact['email'];
$object->civility_id = $contact['civility_id'];
$object->poste = $contact['poste'];
$object->statut = $contact['statut'];
//Retreive all extrafield for contact
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
foreach ($extrafields->attribute_label as $key => $label) {
$key = 'options_' . $key;
$object->array_options[$key] = $contact[$key];
}
$db->begin();
$result = $object->update($contact['id'], $fuser);
if ($result <= 0) {
$error++;
}
}
if (!$error && $objectfound) {
$db->commit();
$objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $object->id);
} elseif ($objectfound) {
$db->rollback();
$error++;
$errorcode = 'KO';
$errorlabel = $object->error;
} else {
$error++;
$errorcode = 'NOT_FOUND';
$errorlabel = 'Contact id=' . $contact['id'] . ' cannot be found';
}
}
if ($error) {
$objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
}
示例10: getFullAddress
/**
* Return full address of third party
*
* @param int $withcountry 1=Add country into address string
* @param string $sep Separator to use to build string
* @return string Full address string
*/
function getFullAddress($withcountry = 0, $sep = "\n") {
$ret = '';
if ($withcountry && $this->values->country_id && (empty($this->values->country_id) || empty($this->values->country))) {
require_once(DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php");
$tmparray = getCountry($this->values->country_id, 'all');
$this->values->country = $tmparray['label'];
}
if (in_array($this->values->country_code, array('US'))) {
$ret.=($this->values->address ? $this->values->address . $sep : '');
$ret.=trim($this->values->zip . ' ' . $this->values->town);
if ($withcountry)
$ret.=($this->values->country ? $sep . $this->values->country : '');
}
else {
$ret.=($this->values->address ? $this->values->address . $sep : '');
$ret.=trim($this->values->zip . ' ' . $this->values->town);
if ($withcountry)
$ret.=($this->values->country ? $sep . $this->values->country : '');
}
return trim($ret);
}
示例11: aircraftname
echo aircraftname(mysql_result($query, $i, 'acft'));
?>
</td>
<td style="vertical-align:middle;text-align:center;"><?php
if (mysql_result($query, $i, 'deptime') == "----") {
echo "FROM";
} else {
echo "TO";
}
?>
</td>
<td style="vertical-align:middle"><?php
if (mysql_result($query, $i, 'deptime') == "----") {
echo getCountry(mysql_result($query, $i, 'origin'), "alt", "24") . " " . mysql_result($query, $i, 'origin') . " - " . mysql_result($queryorig, 0, 'Name');
} else {
echo getCountry(mysql_result($query, $i, 'destination'), "alt", "24") . " " . mysql_result($query, $i, 'destination') . " - " . mysql_result($querydest, 0, 'Name');
}
?>
</td>
<td style="vertical-align:middle"><?php
echo mysql_result($query, $i, 'opstime');
?>
Z</td>
<td style="vertical-align:middle"><?php
echo mysql_result($query, $i, 'gate');
?>
</td>
<td><?php
echo mysql_result($query, $i, 'name') . ' (<a href="http://www.ivao.aero/members/person/details.asp?ID=' . mysql_result($query, $i, 'vid') . '">' . mysql_result($query, $i, 'vid') . '</a>)';
?>
</td>
示例12: record_new_connection
function record_new_connection($config, $json)
{
if (!(isset($_SERVER["REMOTE_ADDR"]) || isset($_SERVER["REMOTE_HOST"]))) {
return false;
}
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "INSERT INTO connections (appid,ip,country,custom,`timestamp`) VALUES (:appid,:ip,:country,:custom,:timestamp)";
$db = getDb($config);
$custom = json_encode($json['customField']);
if ($custom === false) {
$custom = null;
}
$ar = [':appid' => intval($json["appid"]), ':ip' => $ip, ':country' => strval(getCountry($ip)), ':timestamp' => intval($json["time"]), ':custom' => $custom];
$s = $db->prepare($sql);
return $s->execute($ar);
}
示例13: getCountry
// Account supplier code
if (!empty($arrayfields['s.code_compta_fournisseur']['checked'])) {
print '<td>' . $obj->code_compta_fournisseur . '</td>';
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
print "<td>" . $obj->town . "</td>\n";
}
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
print "<td>" . $obj->zip . "</td>\n";
}
// Country
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td align="center">';
$tmparray = getCountry($obj->fk_pays, 'all');
print $tmparray['label'];
print '</td>';
}
// Type ent
if (!empty($arrayfields['typent.code']['checked'])) {
print '<td align="center">';
if (count($typenArray) == 0) {
$typenArray = $formcompany->typent_array(1);
}
print $typenArray[$obj->typent_code];
print '</td>';
}
if (!empty($arrayfields['s.siren']['checked'])) {
print "<td>" . $obj->idprof1 . "</td>\n";
}
示例14: if
?>
<tr <? if ($sno%2==1) { ?> bgcolor="#F5F2F1" <? } ?>>
<td align="center"><?php
echo $sno;
?>
</td>
<td align="center"><?php
echo $row['BuyerName'];
?>
</td>
<td align="center"><?php
echo $row['Address'];
?>
</td>
<td align="center"><?php
echo getCountry($row['CountryId']);
?>
</td>
<td align="center"><? if($row['State']!=0){echo getState($row['State']);} else { echo $row['OtherState'];}?></td>
<td align="center"><? if($row['City']!=0){ echo getCity($row['City']);} else{ echo $row['OtherCity'];}?></td>
<td align="center"><?php
echo $row['Email'];
?>
</td>
<td align="center"><?php
echo $row['ContactNumber'];
?>
</td>
<td align="center"><a href="javascript:;" onClick="return hs.htmlExpand(this)">
<img src="images/Find-icon.png" border="0" width="24" height="24" /></a>
<div class="highslide-maincontent">
示例15: change_db
include "func_weather.php";
// EXTERNAL VARIABLES
$aptICAO = $_REQUEST["icao"];
// GLOBAL VARIABLES
global $navdatabase, $rfedatabase, $sqlconn;
// Get Information of the Departure and Arrival airports from the Database
change_db($sqlconn, $navdatabase);
$queryapt = "SELECT Name,Latitude,Longtitude,Elevation FROM airports WHERE ICAO='" . $aptICAO . "'";
$queryapt = mysqlexec($sqlconn, $queryapt);
change_db($sqlconn, $rfedatabase);
?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 style="font-weight: 300"><?php
echo getCountry($aptICAO);
?>
<?php
echo $aptICAO;
?>
- <?php
echo mysql_result($queryapt, 0, 'name');
?>
</h3>
</div>
<div id="modalbody" class="modal-body">
<div class="accordion" id="detailsaccordion">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#detailsaccordion" href="#collapsedetails">