本文整理汇总了PHP中get_country函数的典型用法代码示例。如果您正苦于以下问题:PHP get_country函数的具体用法?PHP get_country怎么用?PHP get_country使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_country函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wp_trim_words
?>
</p>
<p class="[ post__excerpt ]"><?php
echo wp_trim_words(get_the_excerpt(), 26, '...');
?>
</p>
<p class="[ post__info_sector ]">Sector: <br/><span><?php
echo get_sector($post->ID);
?>
</span></p>
<p class="[ post__info_sector ]">by: <br/><span><?php
the_author();
?>
</span></p>
<p class="[ post__info post__country ][ hidden ]"><?php
echo get_country($post->ID);
?>
</p>
<p class="[ post__info post__date ][ hidden ]" ><?php
echo get_the_time('U');
?>
</p>
</a>
</div>
<?php
}
}
?>
</aticle>
开发者ID:pcuervo,项目名称:odc,代码行数:30,代码来源:page-resource-centre-results.php
示例2: header
<?php
header('Content-Type:text/plain;charset=UTF-8');
$ip = $_SERVER['REMOTE_ADDR'];
get_country($ip);
function get_country($ip_address)
{
// This code demonstrates how to lookup the country, region, city,
// postal code, latitude, and longitude by IP Address.
// It is designed to work with GeoIP/GeoLite City
// Note that you must download the New Format of GeoIP City (GEO-133).
// The old format (GEO-132) will not work.
require_once "geoipcity.inc";
require_once "geoipregionvars.php";
// uncomment for Shared Memory support
// geoip_load_shared_mem("/usr/local/share/GeoIP/GeoIPCity.dat");
// $gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat",GEOIP_SHARED_MEMORY);
$gi = geoip_open("GeoLiteCity.dat", GEOIP_STANDARD);
$geo_data = array();
if (!($record = geoip_record_by_addr($gi, $ip_address))) {
$geo_data['geo_country'] = 'US';
$geo_data['geo_countryName'] = 'United States';
return false;
}
$geo_data['geo_country'] = $record->country_code;
$geo_data['geo_countryName'] = $record->country_name;
geoip_close($gi);
$key = strtolower($geo_data['geo_country']);
$keywordNum = 10;
$keywordLIst = [];
if ($key == 'cn') {
开发者ID:hugoYe,项目名称:HybridLockerEclipse,代码行数:31,代码来源:geo_getcitywords.php
示例3: getName
/**
* Get Bg Image Name
*
* @return string
*/
function getName()
{
$fileName = get_country('code') . '.jpg';
return $fileName;
}
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:10,代码来源:ImageService.php
示例4: getCountrySetCoockie
private function getCountrySetCoockie()
{
$this->load->helper('geoip/geoip_helper');
$country = get_country();
setcookie('country', $country, time() + 3600 * 24);
return $country;
}
开发者ID:skybee,项目名称:france,代码行数:7,代码来源:Background.php
示例5: home
/**
* Home Page
*
* @param ImageService $image
* @return \Illuminate\View\View
*/
public function home(ImageService $image)
{
$image = $image->getHomePageImageUrl();
$summary = $this->api->summary();
$countries = count($summary->country_summary);
$resources = count($summary->resource_summary);
$contracts = $summary->contract_count;
$countryName = get_country('name');
return view('site.home', compact('countries', 'resources', 'contracts', 'image', 'countryName'));
}
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:16,代码来源:SiteController.php
示例6: create
/**
* Create new Page
*
* @param $input
* @return static
*/
public function create($input)
{
$input = ['title' => (object) $input['title'], 'content' => (object) $input['content'], 'slug' => str_slug($input['title']['en']), 'country' => get_country('code')];
$validate = $this->page->where('slug', $input['slug'])->country()->count();
if ($validate == 0) {
return $this->page->create($input);
} else {
return false;
}
}
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:16,代码来源:PageService.php
示例7: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$country = get_country('code');
$pages = [['title' => ['en' => 'About', 'fr' => 'Fr About'], 'slug' => 'about', 'content' => ['en' => 'About content for country ' . $country, 'fr' => 'Fr About Content'], 'country' => $country], ['title' => ['en' => 'Contact', 'fr' => 'Fr Contact'], 'slug' => 'contact', 'content' => ['en' => 'Contact content for country ' . $country, 'fr' => 'Fr Contact Content'], 'country' => $country], ['title' => ['en' => 'Resources', 'fr' => 'Fr Resources'], 'slug' => 'resources', 'content' => ['en' => 'Guide content for country ' . $country, 'fr' => 'Fr Guide Content'], 'country' => $country], ['title' => ['en' => 'FAQs', 'fr' => 'Fr Faqs'], 'slug' => 'faqs', 'content' => ['en' => 'FAQs content for country ' . $country, 'fr' => 'Fr FAQS Content'], 'country' => $country], ['title' => ['en' => 'Glossary', 'fr' => 'Fr Glossary'], 'slug' => 'glossary', 'content' => ['en' => 'Glossary content for country ' . $country, 'fr' => 'Fr Glossary Content'], 'country' => $country], ['title' => ['en' => 'Publish Contracts', 'fr' => 'Publish Contracts'], 'slug' => 'publish-contracts', 'content' => ['en' => 'Publish Contracts for country ' . $country, 'fr' => 'Fr Publish Contract Content'], 'country' => $country]];
foreach ($pages as $page) {
$validate = Page::where('slug', $page['slug'])->country()->count();
if ($validate == 0) {
Page::create($page);
}
}
}
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:17,代码来源:DatabaseSeeder.php
示例8: get_country
echo '<td>';
echo $val['strRestoLandline'];
echo '</td>';
echo '<td style="width:20%">';
if ($val['strRestoAddress'] != '') {
$strRestoAddress = $val['strRestoAddress'] . ', ';
} else {
$strRestoAddress = '';
}
if ($val['strRestoCity'] != '') {
$strRestoCity = $val['strRestoCity'] . ', ';
} else {
$strRestoCity = '';
}
if ($val['strRestoCountry'] != '') {
$strRestoCountry = get_country($val['strRestoCountry']);
} else {
$strRestoCountry = '';
}
echo $strRestoAddress . $strRestoCity . $strRestoCountry;
echo '</td>';
echo '<td style="width:20%">';
echo $val['strFirstName'] . ' ' . $val['strMiddleName'] . ' ' . $val['strLastName'];
echo '</td>';
echo '<td style="width:11%">';
echo '<div class="btn-group controlHolder">';
echo '<a href="' . base_url() . 'dashboard/view_branches_account/' . $val['intRestoID'] . '" data-lng ="' . $latlang[1] . '" data-lat = "' . $latlang[0] . '"data-id="' . $val['intRestoID'] . '" data-title="' . $val['strRestoName'] . '" data-img="' . $val['strRestoThumb'] . '" data-assets="' . $val['strRestoAssets'] . '" data-date="' . $val['dateRestoCreated'] . '" data-location="' . $val['strRestoCity'] . '" data-description="' . strip_tags($val['strRestoDescr']) . '" class="btn btn-mini viewresto" ><i class="icon-eye-open"></i> <span>View</span></a>';
echo '</div>';
echo '</td>';
echo '</tr>';
}
开发者ID:aspire04,项目名称:summon-restaurant-reservation,代码行数:31,代码来源:index.php
示例9: downloadAPI
/**
* call API
*
* @param $resource
* @param array $query
* @param bool $array
* @return null
*/
protected function downloadAPI($resource, array $query = [], $array = false)
{
try {
$request = new Request('GET', $this->apiURL($resource));
$query['country_code'] = get_country('code');
$request->setQuery($query);
$response = $this->client->send($request);
$data = $response->getBody()->getContents();
$filename = "export" . date('Y-m-d');
header('Content-type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="' . $filename . '.csv"');
print $data;
die;
} catch (\Exception $e) {
Log::error($resource . ":" . $e->getMessage(), $query);
return null;
}
}
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:26,代码来源:APIService.php
示例10: get_anonymous_user
/**
* Function used to get anonymous user
*/
function get_anonymous_user()
{
global $db;
$uid = config('anonymous_id');
if ($this->user_exists($uid)) {
return $uid;
} else {
$result = $db->select(tbl("users"), "userid", " level='6' AND status='unverified' ", "1");
if ($result[0]['userid']) {
return $result[0]['userid'];
} else {
$pass = RandomString(10);
if ($_SERVER['HTTP_HOST'] != 'localhost') {
$email = 'anonymous' . RandomString(5) . '@' . $_SERVER['HTTP_HOST'];
} else {
$email = 'anonymous' . RandomString(5) . '@' . $_SERVER['HTTP_HOST'] . '.tld';
}
//Create Anonymous user
$uid = $this->signup_user(array('username' => 'anonymous' . RandomString(5), 'email' => $email, 'password' => $pass, 'cpassword' => $pass, 'country' => get_country(config('default_country_iso2')), 'gender' => 'Male', 'dob' => '2000-10-10', 'category' => '1', 'level' => '6', 'active' => 'yes', 'agree' => 'yes'), false);
return $uid;
}
}
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:26,代码来源:user.class.php
示例11: stats_title
// Developers by Nationality
case "nationality":
stats_title($t->translate("Developers listed by Nationality"));
$db->query("SELECT *,COUNT(*) AS nat_cnt FROM developers GROUP BY developers.nationality ORDER BY nat_cnt DESC");
while ($db->next_record()) {
stats_display(get_country($db->f("nationality")), $db->f("nat_cnt"), "", "", $total_number_dev);
}
stats_end();
break;
// Developers by Countries currently live in
// Developers by Countries currently live in
case "lives_in":
stats_title($t->translate("Developers listed by Countries currently live in"));
$db->query("SELECT *,COUNT(*) AS nat_cnt FROM developers GROUP BY developers.actual_country ORDER BY nat_cnt DESC");
while ($db->next_record()) {
stats_display(get_country($db->f("actual_country")), $db->f("nat_cnt"), "", "", $total_number_dev);
}
stats_end();
break;
// Developers by Mother Tonque
// Developers by Mother Tonque
case "mother_tonque":
stats_title($t->translate("Developers listed by Mother Tongue"));
$db->query("SELECT *,COUNT(*) AS nat_cnt FROM developers GROUP BY developers.mother_tongue ORDER BY nat_cnt DESC");
while ($db->next_record()) {
stats_display(get_lang($db->f("mother_tongue")), $db->f("nat_cnt"), "", "", $total_number_dev);
}
stats_end();
break;
}
}
开发者ID:BackupTheBerlios,项目名称:devcounter-svn,代码行数:31,代码来源:stats.php
示例12: db
<?php
include 'db.php';
$db = new db();
extract($_POST);
$sql = "SELECT count(*) total from registros where cedula = '{$cedula}' and id_promo = {$id_promo}";
$total = $db->SelectUnico($sql);
//$response = array();
if ($total == 0) {
$edad = age($anio . '-' . $mes . '-' . $dia);
$pais_ip = get_country(get_IP_address());
$sql = "INSERT INTO `registros` (`id_registro`, `id_promo`, `nombre`, `apellido`, `email`, `pais`, `ciudad`, `cedula`, `celular`,`sexo`, `edad`, `dia_nacimiento`, `mes_nacimiento`, `anio_nacimiento`, `ip`, `pais_ip`, `fecha`) VALUES (null, {$id_promo}, '{$nombre}', '{$apellido}', '{$email}', '{$pais}', '{$ciudad}', '{$cedula}', '{$celular}','{$sexo}', '" . $edad . "', '{$dia}', '{$mes}', '{$anio}', '" . get_IP_address() . "', '" . $pais_ip . "', NOW()); ";
$response['status'] = $db->Insert($sql);
$sql = "SELECT mailing,texto_mailing from promos where id_promo = {$id_promo}";
$a_data = $db->Select($sql);
$HTML = $a_data[0]['texto_mailing'] . '<br/><br/><img src="http://bonovirtualcolineal.com/admin/actions/uploads/' . $a_data[0]['mailing'] . '" />';
sendHTMLemail($HTML, $email, 'COLINEAL - Bono Virtual');
} else {
$response['status'] = 0;
}
header("Content-Type: application/json", true);
echo json_encode($response);
function get_IP_address()
{
foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {
if (array_key_exists($key, $_SERVER) === true) {
foreach (explode(',', $_SERVER[$key]) as $IPaddress) {
$IPaddress = trim($IPaddress);
// Just to be safe
if (filter_var($IPaddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {
return $IPaddress;
开发者ID:rbravo86,项目名称:colineal,代码行数:31,代码来源:saveUser.php
示例13: transaction_results
//.........这里部分代码省略.........
$message .= " - " . $product_data[0]['name'] . $variation_list . " " . $message_price . " " . TXT_WPSC_CLICKTODOWNLOAD . ": {$link}\n";
$message_html .= " - " . $product_data[0]['name'] . $variation_list . " " . $message_price . " <a href='{$link}'>" . TXT_WPSC_DOWNLOAD . "</a>\n";
} else {
$plural = '';
if ($row['quantity'] > 1) {
$plural = "s";
}
$message .= " - " . $row['quantity'] . " " . $product_data[0]['name'] . $variation_list . " " . $message_price . "\n - " . TXT_WPSC_SHIPPING . ":" . $shipping_price . "\n\r";
$message_html .= " - " . $row['quantity'] . " " . $product_data[0]['name'] . $variation_list . " " . $message_price . "\n - " . TXT_WPSC_SHIPPING . ":" . $shipping_price . "\n\r";
}
$report .= " - " . $product_data[0]['name'] . $variation_list . " " . $message_price . "\n";
}
if ($purchase_log['discount_data'] != '') {
$coupon_data = $wpdb->get_row("SELECT * FROM `" . $wpdb->prefix . "wpsc_coupon_codes` WHERE coupon_code='" . $wpdb->escape($purchase_log['discount_data']) . "' LIMIT 1", ARRAY_A);
if ($coupon_data['use-once'] == 1) {
$wpdb->query("UPDATE `" . $wpdb->prefix . "wpsc_coupon_codes` SET `active`='0', `is-used`='1' WHERE `id`='" . $coupon_data['id'] . "' LIMIT 1");
}
}
//$wpdb->query("UPDATE `".$wpdb->prefix."download_status` SET `active`='1' WHERE `fileid`='".$product_data[0]['file']."' AND `purchid` = '".$purchase_log['id']."' LIMIT 1");
$total_shipping = nzshpcrt_determine_base_shipping($total_shipping, $shipping_country);
$total = $total + $total_shipping - $purchase_log['discount_value'];
// $message.= "\n\r";
$message .= "Your Purchase No.: " . $purchase_log['id'] . "\n\r";
if ($purchase_log['discount_value'] > 0) {
$message .= TXT_WPSC_DISCOUNT . ": " . nzshpcrt_currency_display($purchase_log['discount_value'], 1, true) . "\n\r";
}
$message .= TXT_WPSC_TOTALSHIPPING . ": " . nzshpcrt_currency_display($total_shipping, 1, true) . "\n\r";
$message .= TXT_WPSC_TOTAL . ": " . nzshpcrt_currency_display($total, 1, true) . "\n\r";
$message_html .= "Your Purchase No.: " . $purchase_log['id'] . "\n\n\r";
if ($purchase_log['discount_value'] > 0) {
$message_html .= TXT_WPSC_DISCOUNT . ": " . nzshpcrt_currency_display($purchase_log['discount_value'], 1, true) . "\n\r";
}
$message_html .= TXT_WPSC_TOTALSHIPPING . ": " . nzshpcrt_currency_display($total_shipping, 1, true) . "\n\r";
$message_html .= TXT_WPSC_TOTAL . ": " . nzshpcrt_currency_display($total, 1, true) . "\n\r";
if (isset($_GET['ti'])) {
$message .= "\n\r" . TXT_WPSC_YOURTRANSACTIONID . ": " . $_GET['ti'];
$message_html .= "\n\r" . TXT_WPSC_YOURTRANSACTIONID . ": " . $_GET['ti'];
$report .= "\n\r" . TXT_WPSC_TRANSACTIONID . ": " . $_GET['ti'];
} else {
$report_id = "Purchase No.: " . $purchase_log['id'] . "\n\r";
}
if ($email != '' && $purchase_log['email_sent'] != 1) {
if ($purchase_log['processed'] < 2) {
$payment_instructions = strip_tags(get_option('payment_instructions'));
$message = TXT_WPSC_ORDER_PENDING . "\n\r" . $payment_instructions . "\n\r" . $message;
mail($email, TXT_WPSC_ORDER_PENDING_PAYMENT_REQUIRED, $message, "From: " . get_option('return_email') . "");
} else {
mail($email, TXT_WPSC_PURCHASERECEIPT, $message, "From: " . get_option('return_email') . "");
}
}
$report_user = TXT_WPSC_CUSTOMERDETAILS . "\n\r";
$form_sql = "SELECT * FROM `" . $wpdb->prefix . "submited_form_data` WHERE `log_id` = '" . $purchase_log['id'] . "'";
$form_data = $wpdb->get_results($form_sql, ARRAY_A);
if ($form_data != null) {
foreach ($form_data as $form_field) {
$form_sql = "SELECT * FROM `" . $wpdb->prefix . "collect_data_forms` WHERE `id` = '" . $form_field['form_id'] . "' LIMIT 1";
$form_data = $wpdb->get_results($form_sql, ARRAY_A);
$form_data = $form_data[0];
if ($form_data['type'] == 'country') {
$report_user .= $form_data['name'] . ": " . get_country($form_field['value']) . "\n";
} else {
$report_user .= $form_data['name'] . ": " . $form_field['value'] . "\n";
}
}
}
$report_user .= "\n\r";
$report = $report_user . $report_id . $report;
if (get_option('purch_log_email') != null && $purchase_log['email_sent'] != 1) {
mail(get_option('purch_log_email'), TXT_WPSC_PURCHASEREPORT, $report, "From: " . get_option('return_email') . "");
}
if ($purchase_log['gateway'] == 'testmode' && $purchase_log['processed'] < 2) {
echo "<br />" . nl2br(str_replace("\$", '\\$', $message_html));
return;
}
$_SESSION['nzshpcrt_cart'] = '';
$_SESSION['nzshpcrt_cart'] = array();
if (true === $echo_to_screen) {
echo '<div class="wrap">';
if ($sessionid != null) {
echo TXT_WPSC_THETRANSACTIONWASSUCCESSFUL . "<br />";
echo "<br />" . nl2br(str_replace("\$", '\\$', $message_html));
}
echo '</div>';
}
} else {
if (true === $echo_to_screen) {
echo '<div class="wrap">';
echo TXT_WPSC_BUYPRODUCTS;
echo '</div>';
}
}
if ($purchase_log['email_sent'] != 1 and $sessionid != '') {
if (preg_match("/^[\\w\\s._,-]+\$/", $transaction_id)) {
$transact_id_sql = "`transactid` = '" . $transaction_id . "',";
}
$update_sql = "UPDATE `" . $wpdb->prefix . "purchase_logs` SET {$transact_id_sql} `date` = '" . time() . "',`email_sent` = '1', `processed` = '{$order_status}' WHERE `sessionid` = " . $sessionid . " LIMIT 1";
$wpdb->query($update_sql);
}
}
}
开发者ID:alx,项目名称:barceloneta,代码行数:101,代码来源:transaction_result_functions.php
示例14: disabled_states
disabled_states($vars['states']);
break;
case 'load_countries':
load_countries();
break;
case 'load_countries_disabled':
load_countries_disabled();
break;
case 'load_states':
load_states($vars['country']);
break;
case 'load_states_disabled':
load_states_disabled($vars['country']);
break;
case 'get_country':
get_country($vars['country']);
break;
case 'get_state':
get_state($vars['state']);
break;
case 'save_country':
save_country($vars['country'], $vars['title'], $vars['tag'], $vars['act']);
break;
case 'save_state':
save_state($vars['country'], $vars['state'], $vars['title'], $vars['tag'], $vars['act']);
break;
case 'get_expire':
get_expire($vars['product_id'], $vars['begin_date']);
break;
case 'calculate_tax':
calculate_tax($vars['product_id'], $vars['member_id'], $vars['amount'], $vars['incl_tax']);
开发者ID:subashemphasize,项目名称:test_site,代码行数:31,代码来源:ajax_cnt.php
示例15: get_option
//pokazh($message,"message");
//exit;
if (isset($cart) && $cart != null && $cart_content != '' && $errorcode == 0) {
$headers = "From: " . get_option('return_email') . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n";
$purch_sql = "SELECT * FROM `wp_purchase_logs` WHERE `id`!='" . $check[0]['id'] . "'";
$purch_data = $wpdb->get_results($purch_sql, ARRAY_A);
$report_user = "О заказчике. ";
$form_sql = "SELECT * FROM `wp_submited_form_data` WHERE `log_id` = '" . $check[0]['id'] . "'";
$form_data = $wpdb->get_results($form_sql, ARRAY_A);
if ($form_data != null) {
foreach ($form_data as $form_field) {
$form_sql = "SELECT * FROM `wp_collect_data_forms` WHERE `id` = '" . $form_field['form_id'] . "' LIMIT 1";
$form_data = $wpdb->get_results($form_sql, ARRAY_A);
$form_data = $form_data[0];
if ($form_data['type'] == 'country') {
$report_user .= $form_data['name'] . ": " . get_country($form_field['value']) . "\n";
} else {
$report_user .= $form_data['name'] . ": " . $form_field['value'] . "\n";
}
}
}
$report_user .= "\n\r";
$report = $report_user . $report;
if ($email != '') {
$mess = $report . " <br /><br /> " . $message;
//mail($email, 'Подтверждение покупки изображения. Cartoonbank.ru .', $message, $headers);
//mail("[email protected]", 'Подтверждение покупки изображения. Копия.', $mess, $headers);
// Send licenses as attchment
send_email_multi_attachments($email, $result_no_license_text);
send_email_multi_attachments("[email protected]", $result_no_license_text);
send_email_multi_attachments("[email protected]", $result_no_license_text);
开发者ID:laiello,项目名称:cartonbank,代码行数:31,代码来源:transaction_results.php
示例16: getBlock_Select_country
function getBlock_Select_country($id = '')
{
$res = get_country();
$options = '';
while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
$options .= '<option ' . ($row['country_id'] == $id ? ' selected ' : '') . ' value="' . $row['country_id'] . '" >' . $row['name'] . '</option>';
}
return '<select class="element select medium" name="country_id">' . $options . '</select>';
}
开发者ID:snenko,项目名称:chechur,代码行数:9,代码来源:db.php
示例17: odbcClass
<?php
require "config.php";
require "includes/functions.php";
require "includes/mysql.php";
require "includes/geoip.php";
$db = new odbcClass();
// если есть ось и идентификатор бота
if (isset($_GET["bid"]) && isset($_GET["os"])) {
$bid = $_GET["bid"];
$os = get_os($_GET['os']);
// правильный ли формат идентификатора бота
if (preg_match("/^[[:xdigit:]]{16}\$/", $bid)) {
// смотрим страну по IP. А IP проверяем на валидность.
$ip = getip();
$cc = get_country($ip);
// вставляем в базу идентификатор бота, если такой уже есть то изменяем время последнего захода
$db->query("INSERT INTO `bots` (`id`,`ip`,`cc`,`first_time`,`last_time`,`system`) VALUES ('" . $bid . "','" . $ip . "','" . $cc . "','" . time() . "','" . time() . "','" . $os . "') ON DUPLICATE KEY UPDATE `last_time` = '" . time() . "';");
// работа с задачами
// выбираем задачу + данные из таблицы стран относящиеся к задаче + табличку с лимитами ГДЕ id бота в таблице заданий есть как у пришедшего и в списке стран есть страна которая соответствует нашей, и бот не в списке финишировавших для этой задачи
$task = $db->query("SELECT * FROM tasks\r\nLEFT JOIN ccTaskFilter ON ccTaskFilter.taskId = tasks.id \r\nWHERE tasks.bot = '" . $bid . "' \r\nAND (tasks.count < tasks.`limit` OR tasks.`limit` = 0)\r\nAND (ccTaskFilter.cc = '" . $cc . "' OR ccTaskFilter.cc='all') \r\nAND '" . $bid . "' NOT IN (SELECT botId FROM finished WHERE finished.taskId = tasks.id)\r\nAND (tasks.stop = '0' OR tasks.stop = '-1')");
if ($task[0] == 0) {
// выбираем задачу + данные из таблицы стран относящиеся к задаче + табличку с лимитами ГДЕ id бота в таблице заданий для всех и в списке стран есть страна которая соответствует нашей, и бот не в списке финишировавших для этой задачи
$task = $db->query("SELECT * FROM tasks\r\nLEFT JOIN ccTaskFilter ON ccTaskFilter.taskId = tasks.id \r\nWHERE tasks.bot = 'all' \r\nAND (tasks.count < tasks.`limit` OR tasks.`limit` = 0)\r\nAND (ccTaskFilter.cc = '" . $cc . "' OR ccTaskFilter.cc='all') \r\nAND '" . $bid . "' NOT IN (SELECT botId FROM finished WHERE finished.taskId = tasks.id)\r\nAND (tasks.stop = '0' OR tasks.stop = '-1')");
}
$task[0] == 0 ? exit(SECRET_KEY) : false;
// формируем вывод задания
$taskOut = '';
foreach ($task as $k => $v) {
$v['flags'] = trim($v['flags']);
if (!empty($v['flags'])) {
开发者ID:sucof,项目名称:footlocker,代码行数:31,代码来源:task.php
示例18: foreach
<tbody>
<?php
if (!empty($allowed_users)) {
foreach ($allowed_users as $user) {
if ($user->get_id() == $my_session) {
$me = "style='font-weight: bold;'";
$action = "<img class='dis_logout' src='../pixmaps/menu/logout.gif' alt='" . $user->get_login() . "' title='" . $user->get_login() . "'/>";
} else {
$action = "<a onclick=\"logout('" . $user->get_id() . "');\"><img src='../pixmaps/menu/logout.gif' alt='" . _("Logout") . " " . $user->get_login() . "' title='" . _("Forced logout") . " " . $user->get_login() . "'/></a>";
$me = null;
}
$gi = geoip_open("/usr/share/geoip/GeoIP.dat", GEOIP_STANDARD);
$s_country = strtolower(geoip_country_code_by_addr($gi, $user->get_ip()));
$s_country_name = geoip_country_name_by_addr($gi, $user->get_ip());
$geo_code = get_country($s_country, $s_country_name);
$flag = !empty($geo_code) ? "<img src='" . $geo_code . "' border='0' align='top'/>" : "";
$logon_date = gmdate("Y-m-d H:i:s", Util::get_utc_unixtime($dbconn, $user->get_logon_date()) + 3600 * Util::get_timezone());
$activity_date = Util::get_utc_unixtime($dbconn, $user->get_activity());
$style = Session_activity::is_expired($activity_date) ? "background:#EFE1E0;" : "background:#EFFFF7;";
$expired = Session_activity::is_expired($activity_date) ? "<span style='color:red'>(" . _("Expired") . ")</span>" : "";
$agent = explode("###", $user->get_agent());
if ($agent[1] == "av report scheduler") {
$agent = array("AV Report Scheduler", "wget");
}
echo " <tr style='{$style}' id='" . $user->get_id() . "'>\n\t\t\t\t\t\t\t\t\t<td class='ops_user' {$me}><img class='user_icon' src='" . get_user_icon($user->get_login(), $pro) . "' alt='" . _("User icon") . "' title='" . _("User icon") . "' align='absmiddle'/> " . $user->get_login() . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_ip'>" . $user->get_ip() . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_host'>" . Host::ip2hostname($dbconn, $user->get_ip()) . $flag . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_agent'><a txt='" . htmlentities($agent[1]) . "' class='info_agent'>" . htmlentities($agent[0]) . "</a></td>\n\t\t\t\t\t\t\t\t\t<td class='ops_id'>" . $user->get_id() . " {$expired}</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_logon'>" . $logon_date . "</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<td class='ops_activity'>" . _(TimeAgo($activity_date, gmdate("U"))) . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_actions'>{$action}</td>\t\n\t\t\t\t\t\t\t\t</tr>";
}
} else {
echo "<tr><td colspan='8' id='no_sessions' class='nobborder'><div class='ossim_info'>" . _("No active sessions") . "</td></tr>";
}
?>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:30,代码来源:opened_sessions.php
示例19: form_login_info
function form_login_info()
{
echo "<div class=\"row\">";
echo "<strong>Account Information</strong>";
echo "</div>";
echo "<div class=\"row\">";
echo "<span class=\"label\">Full Name:</span>";
echo "<span class=\"formw\"><input maxlength=\"30\" name=\"register[realname]\" /></span>";
echo "</div>";
echo "<div class=\"row\">";
echo "<span class=\"label\">E-mail:</span>";
echo "<span class=\"formw\"><input maxlength=\"40\" name=\"register[email]\" /></span>";
echo "</div>";
echo "<div class=\"row\">";
echo "<span class=\"formw\"><font size=\"-2\">A valid e-mail is required.</font></span>";
echo "</div>";
// Martel: Never ask for country again
echo "<input name=\"register[country]\" type=\"hidden\" value=\"" . get_country() . "\" />";
echo "<div class=\"row\">";
echo "<span class=\"label\">Login Name:</span>";
echo "<span class=\"formw\"><input maxlength=\"20\" name=\"register[login]\" /></span>";
echo "</div>";
echo "<div class=\"row\">";
echo "<span class=\"label\">Password:</span>";
echo "<span class=\"formw\"><input maxlength=\"20\" type=\"password\" name=\"register[password]\" /></span>";
echo "</div>";
echo "<div class=\"row\">";
echo "<span class=\"label\">Confirm Password:</span>";
echo "<span class=\"formw\"><input maxlength=\"20\" type=\"password\" name=\"register[verify]\" /></span>";
echo "</div>";
}
开发者ID:BrorHolm,项目名称:Orkfia-2008,代码行数:31,代码来源:register1.inc.php
示例20: foreach
echo "<strong>" . TXT_WPSC_CUSTOMERDETAILS . "</strong>";
echo "<table>";
$form_sql = "SELECT * FROM `" . $wpdb->prefix . "submited_form_data` WHERE `log_id` = '" . $purchase['id'] . "'";
$input_data = $wpdb->get_results($form_sql, ARRAY_A);
//exit("<pre>".print_r($input_data,true)."</pre>");
if ($input_data != null) {
foreach ((array) $input_data as $form_field) {
$form_sql = "SELECT * FROM `" . $wpdb->prefix . "collect_data_forms` WHERE `active` = '1' AND `id` = '" . $form_field['form_id'] . "' LIMIT 1";
$form_data = $wpdb->get_results($form_sql, ARRAY_A);
if ($form_data != null) {
$form_data = $form_data[0];
if ($form_data['type'] == 'country') {
if ($form_field['value'] != null) {
echo " <tr><td>" . $form_data['name'] . ":</td><td>" . get_country($form_field['value']) . "</td></tr>";
} else {
echo " <tr><td>" . $form_data['name'] . ":</td><td>" . get_country($purchase['shipping_country']) . "</td></tr>";
}
} else {
echo " <tr><td>" . $form_data['name'] . ":</td><td>" . $form_field['value'] . "</td></tr>";
}
}
}
} else {
echo " <tr><td>" . TXT_WPSC_NAME . ":</td><td>" . $purchase['firstname'] . " " . $purchase['lastname'] . "</td></tr>";
echo " <tr><td>" . TXT_WPSC_ADDRESS . ":</td><td>" . $purchase['address'] . "</td></tr>";
echo " <tr><td>" . TXT_WPSC_PHONE . ":</td><td>" . $purchase['phone'] . "</td></tr>";
echo " <tr><td>" . TXT_WPSC_EMAIL . ":</td><td>" . $purchase['email'] . "</td></tr>";
}
if (get_option('payment_method') == 2) {
$gateway_name = '';
foreach ((array) $GLOBALS['nzshpcrt_gateways'] as $gateway) {
开发者ID:alx,项目名称:barceloneta,代码行数:31,代码来源:user-log.php
注:本文中的get_country函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论