コード例 #1
0
ファイル: index.php プロジェクト: blech/geoplanet-explorer
                echo render($p);
            }
        } else {
            echo render($all->query->results->place);
        }
        echo '</ul>';
    } else {
        echo '<h2>Nothing to see here...</h2>';
        echo '<p>Sorry but I was unable to find a place of that name.</p>';
    }
}
?>
      
      <?php 
if (isset($_GET['woeid'])) {
    $all = getdetails($_GET['woeid']);
    if ($all->query->results) {
        echo '<div class="yui-gd">';
        echo '<div class="yui-u first">';
        echo '<h2>Place info</h2>';
        echo '<ul id="placeinfo">';
        echo renderlist($all->query->results->results[0]->place);
        $current = $all->query->results->results[0]->place;
        $name = $current->name;
        $mlat = $current->centroid->latitude;
        $mlon = $current->centroid->longitude;
        $mnelat = $current->boundingBox->northEast->latitude;
        $mnelon = $current->boundingBox->northEast->longitude;
        $mswlat = $current->boundingBox->southWest->latitude;
        $mswlon = $current->boundingBox->southWest->longitude;
        $url = 'http://local.yahooapis.com/MapsService/V1/mapImage?' . 'appid=' . $staticmapskey . '&image_height=270&image_width=470&output=php' . '&location=' . $all->query->results->results[0]->place->name;
コード例 #2
0
ファイル: priceNepal.php プロジェクト: superego546/SMSGyan
    $cleared = preg_replace("~\\b(india|mobile|cars?|bikes?|vegetables?|grocery|veg)\\b~", "", $cleared);
    $arMobBrand = array("Chevrolet", "Daihatsu", "Ford", "Great Wall Motors", "Honda", "Hyundai", "Jonway", "Kia motors", "Mahindra", "Maruti Suzuki", "Mazda", "Nissan", "Perodua", "Proton", "Skoda", "Ssangyong", "Tata", "Toyota", "Volkswagen", "Alcatel", "Apple", "Beetel", "Bird", "BlackBerry", "Colors Mobile", "Gadgets Mobile", "GFIVE", "HTC", "Intex", "Karbonn Mobile", "Lava Mobiles", "LG", "Micromax", "Motorola", "Nokia", "Oxygen Mobile", "Samsung", "Sony Ericsson", "Spice Mobile", "Anna Lifan", "Bajaj", "Daelim", "Hartford", "Hero Moto Corp", "Hyosung", "KTM", "Mahindra", "Royal Enfield", "Suzuki", "TVS", "Yamaha");
    foreach ($arMobBrand as $brand) {
        if (preg_match("~\\b" . $brand . "\\b~si", $cleared)) {
            $cleared = str_replace("price", "", $cleared);
            include 'nepal_price.php';
            break;
        }
    }
    $total_return = "Sorry, no prices found for '" . trim($cleared) . "'";
    $to_logserver['isresult'] = 0;
    $to_logserver['source'] = 'price_nepal';
    $free = true;
    putOutput($total_return);
    exit;
}
if (preg_match('~__nepalprice__(.+)__~', $req, $matched)) {
    echo '<h3>Inside Nepal Price </h3>';
    $pdt_url = trim($matched[1]);
    $details = getdetails($pdt_url);
    if (!empty($details)) {
        $total_return = $details;
        $source_machine = $machine_id;
        $current_file = "/temp/{$numbers}";
        file_put_contents(DATA_PATH . $current_file, $total_return);
        include 'allmanip.php';
        $to_logserver['source'] = 'price_nepal';
        putOutput($total_return);
        exit;
    }
}
コード例 #3
0
ファイル: portfolio.inc.php プロジェクト: ciplpj/vsm
<?php

include 'db_connect.inc.php';
$user_id = $_SESSION['vsm_user_id'];
$arr = getdetails($user_id);
$stock_arr = getstock($user_id);
$currentcash = $arr[0];
$currentholdings = $arr[1];
function getdetails($param)
{
    global $con;
    $ret = array();
    $sql = "SELECT ROUND(current_cash,1) as cc , ROUND(holdings,1) as hh from players where user_id = '{$param}' ";
    $query = mysqli_query($con, $sql);
    if (!$query && !mysqli_num_rows($query)) {
        echo mysqli_error();
    }
    $row = mysqli_fetch_assoc($query);
    array_push($ret, $row['cc'], $row['hh']);
    return $ret;
}
function getstock($par)
{
    global $con;
    $ret = array();
    $sql = "SELECT  b.stock_id, b.stock_name, SUM( number_of_stocks ) AS numb, ROUND(a.current_stock_price,1) AS csp, ROUND(SUM( amount ),1) AS amount , b.timestamp as timest\nFROM transactions AS b\nINNER JOIN stocks AS a ON a.stock_id = b.stock_id\nWHERE user_id = '{$par}' AND b.type = 0\nGROUP BY stock_id ORDER BY b.timestamp DESC";
    $query = mysqli_query($con, $sql);
    if (!$query && !mysqli_num_rows($query)) {
        echo "Some error occured" . mysqli_error();
    }
    if (mysqli_num_rows($query) > 0) {