示例#1
0
文件: newsid.php 项目: sembrono/mz
function qqlogin($uin, $p, $vcode, $pt_verifysession)
{
    $v1 = 0;
    $url = 'http://ptlogin2.qzone.com/login?verifycode=' . $vcode . '&u=' . $uin . '&p=' . $p . '&pt_randsalt=0&ptlang=2052&low_login_enable=0&u1=http%3A%2F%2Fm.qzone.com%2Finfocenter%3Fg_f%3D&from_ui=1&fp=loginerroralert&device=2&aid=549000929&pt_ttype=1&pt_3rd_aid=0&ptredirect=1&h=1&g=1&pt_uistyle=9&pt_vcode_v1=' . $v1 . '&pt_verifysession_v1=' . $pt_verifysession . '&';
    $ret = curlget($url, 0, 0, 0, 1);
    if (preg_match("/ptuiCB\\('(.*?)'\\);/", $ret, $arr)) {
        $r = str_replace("', '", "','", $arr[1]);
        $r = explode('\',\'', $r);
        if ($r[0] == 0) {
            preg_match('/skey=(@.{9});/', $ret, $skey);
            $array['uin'] = $uin;
            $array['skey'] = $skey[1];
            if ($sid = getsid($r[2])) {
                $array['sid'] = $sid;
            }
            return $array;
        } elseif ($r[0] == 4) {
            return 4;
        } elseif ($r[0] == 3) {
            return 3;
        } elseif ($r[0] == 19) {
            return 19;
        } else {
            return 0;
        }
    } else {
        return 0;
    }
}
示例#2
0
 function iptocity($ip)
 {
     //http://ipinfo.io/206.208.102.250
     $str = md5($ip);
     $folder = 'cache/iptocityipinfo_io_cache/' . substr($str, 0, 2);
     if (!is_dir($folder)) {
         mkdir($folder, 0755);
         chmod($folder, 0755);
     }
     $file = $folder . '/' . $str . '.txt';
     if (file_exists($file)) {
         return json_decode(file_get_contents($file), 1);
         exit;
     }
     $url = 'http://ipinfo.io/' . $ip;
     $string = curlget($url);
     $arr = array();
     $data = json_decode($string, 1);
     $arr['result']['ip'] = $data['ip'];
     $arr['result']['city'] = $data['city'];
     $arr['result']['region'] = $data['region'];
     $arr['result']['country'] = $data['country'];
     $tmp = explode(',', $data['loc']);
     $arr['result']['lat'] = $tmp[0];
     $arr['result']['lng'] = $tmp[1];
     $arr['result']['postal'] = $data['postal'];
     $arr['originalData'] = $data;
     $arr['xtras']['url'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
     $arr['xtras']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
     $arr['xtras']['referrer'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
     $arr['xtras']['date'] = date('r');
     $details = json_encode($arr);
     file_put_contents($file, $details);
     return $arr;
 }
示例#3
0
function countryBids($uid, $country, $bid)
{
    ///api/help/bid/state?uid=&state=&bid=
    $url = APIHTTPPATH . '/help/bid/country?uid=' . $uid . '&country=' . $country . '&bid=' . $bid;
    $countryBids = curlget($url);
    $countryBids = json_decode($countryBids, 1);
    return $countryBids;
}
示例#4
0
 public function forgot()
 {
     $email = $this->input->get_post('email');
     $url = 'http://wc5.org/api/v1/index.php?type=user&action=forgot&email=' . $email;
     $result = curlget($url);
     $result = json_decode($result, 1);
     $this->json_($result);
 }
 public function upload($url)
 {
     $arr = array();
     $arr['url'] = $url;
     $arr['key'] = IMAGESHACK_KEY;
     $arr['a_username'] = IMAGESHACK_USERNAME;
     $arr['a_password'] = IMAGESHACK_PASSWORD;
     $arr = array_filter($arr);
     $result = curlget(IMAGESHACK_APIURL_IMAGES, 1, $arr);
     $content = simplexml_load_string($result);
     $return['image'] = sprintf("%s", $content->links->image_link);
     $return['image_thumb_link'] = sprintf("%s", $content->links->thumb_link);
     return $return;
 }
function findCity($city_id)
{
    $url = APIHTTPPATH . '/citydetail.php?nearby=1&id=' . $city_id;
    $cityList = curlget($url);
    $cityList = json_decode($cityList, 1);
    if (empty($cityList[0])) {
        header("Locations: " . HTTPPATH . "/locations/country");
        exit;
    }
    $cityDetails = $cityList[0];
    $cityDetails['url'] = HTTPPATH . '/city-' . url_name_v2($cityDetails['city']) . '-' . $cityDetails['id'];
    $cityDetails['pageTitle'] = $cityDetails['city'] . ', ' . $cityDetails['statename'] . ', ' . $cityDetails['countryname'];
    return $cityDetails;
}
示例#7
0
 public function answers()
 {
     $data = array('error' => 1, 'url' => '');
     if ($this->input->get('kw')) {
         $kw = $this->input->get('kw');
         if (($rs = $this->cache->load('answers')) === false) {
             $rs[$kw] = $kw;
             $this->cache->save($rs, 'answers');
         } else {
             $rs1[$kw] = $kw;
             $rs = array_merge($rs1, $rs);
             $rs = array_slice($rs, 0, $this->limit);
             $this->cache->save($rs, 'answers');
         }
         $string = md5($kw);
         $kw = urlencode($kw);
         $url = 'http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=' . YAHOOAPPLICATIONID . '&query=' . $kw . '&results=50&output=json';
         if (($rs2 = $this->cache2->load($string)) === false) {
             $result = curlget($url);
             $result = json_decode($result, true);
             if (!empty($result['all']['questions'])) {
                 $data = array();
                 $data['records'] = $result['all']['questions'];
                 $this->cache2->save($data, $string);
             } else {
                 $url = 'http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=' . YAHOOAPPLICATIONID . '&query=' . $kw . '&results=50&output=json';
                 if (($rs2 = $this->cache2->load($string)) === false) {
                     $result = curlget($url);
                     $result = json_decode($result, true);
                     if (!empty($result['all']['questions'])) {
                         $data = array();
                         $data['records'] = $result['all']['questions'];
                         $this->cache2->save($data, $string);
                     }
                 }
             }
         } else {
             $data = $rs2;
         }
         $data['url'] = $url;
     }
     //$this->load->view('y/answers', $data);
     $data['html'] = $this->load->view('y/answers', $data, true);
     $this->_custom_output('', array('html' => $data['html'], 'url' => $data['url']), true, 'json');
 }
示例#8
0
function iptocity($ip)
{
    $str = md5($ip);
    $folder = 'cache/iptocity_cache/' . substr($str, 0, 2);
    if (!is_dir($folder)) {
        mkdir($folder, 0755);
        chmod($folder, 0755);
    }
    $file = $folder . '/' . $str . '.txt';
    if (file_exists($file)) {
        return file_get_contents($file);
        exit;
    }
    $url = IPSNIFF_URL . 'key=' . IPSNIFF_KEY . '&ip=' . $ip;
    $string = curlget($url);
    //$string = 'OK;;63.150.3.118;US;UNITED STATES;CALIFORNIA;SAN JOSE;95101;37.3169;-121.874;-08:00';
    $tmp = explode(';', $string);
    $arr = array();
    $arr['result']['ip'] = $ip;
    $arr['originalData'] = $tmp;
    $arr['xtras']['status'] = !empty($tmp[0]) ? trim($tmp[0]) : '';
    $arr['xtras']['text1'] = !empty($tmp[1]) ? trim($tmp[1]) : '';
    $arr['xtras']['ip'] = !empty($tmp[2]) ? trim($tmp[2]) : '';
    $arr['xtras']['countrycode'] = !empty($tmp[3]) ? trim($tmp[3]) : '';
    $arr['result']['country'] = !empty($tmp[4]) ? trim($tmp[4]) : '';
    $arr['result']['state'] = !empty($tmp[5]) ? trim($tmp[5]) : '';
    $arr['result']['city'] = !empty($tmp[6]) ? trim($tmp[6]) : '';
    $arr['result']['zip'] = !empty($tmp[7]) ? trim($tmp[7]) : '';
    $arr['result']['lat'] = !empty($tmp[8]) ? trim($tmp[8]) : '';
    $arr['result']['lon'] = !empty($tmp[9]) ? trim($tmp[9]) : '';
    $arr['xtras']['timezone'] = !empty($tmp[10]) ? trim($tmp[10]) : '';
    $arr['xtras']['url'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
    $arr['xtras']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
    $arr['xtras']['referrer'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    $details = json_encode($arr);
    file_put_contents($file, $details);
    return $details;
}
示例#9
0
 function iptocity($ip)
 {
     define('IPSNIFF_URL', 'http://api.ipinfodb.com/v3/ip-city/?');
     define('IPSNIFF_KEY', '0b3b2f8bd9f606ba8032ef0b9fbe054041788fb0f9d7c21214cd050a9b561845');
     $url = IPSNIFF_URL . 'key=' . IPSNIFF_KEY . '&ip=' . $ip;
     $string = curlget($url);
     //$string = 'OK;;63.150.3.118;US;UNITED STATES;CALIFORNIA;SAN JOSE;95101;37.3169;-121.874;-08:00';
     $tmp = explode(';', $string);
     $arr['status'] = !empty($tmp[0]) ? trim($tmp[0]) : '';
     $arr['text1'] = !empty($tmp[1]) ? trim($tmp[1]) : '';
     $arr['ip'] = !empty($tmp[2]) ? trim($tmp[2]) : '';
     $arr['countrycode'] = !empty($tmp[3]) ? trim($tmp[3]) : '';
     $arr['country'] = !empty($tmp[4]) ? trim($tmp[4]) : '';
     $arr['state'] = !empty($tmp[5]) ? trim($tmp[5]) : '';
     $arr['city'] = !empty($tmp[6]) ? trim($tmp[6]) : '';
     $arr['zip'] = !empty($tmp[7]) ? trim($tmp[7]) : '';
     $arr['lat'] = !empty($tmp[8]) ? trim($tmp[8]) : '';
     $arr['lon'] = !empty($tmp[9]) ? trim($tmp[9]) : '';
     $arr['timezone'] = !empty($tmp[10]) ? trim($tmp[10]) : '';
     $arr['url'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
     $arr['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
     $arr['referrer'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
     //$email[] = '*****@*****.**';
     //$from = 'From: system<system@'._base_domain.'>';
     //$msg = var_export($arr, 1);
     //foreach ($email as $to) {
     //mail2($to, 'IP Check', $msg, $from);
     //}
     return $arr;
 }
示例#10
0
            throw new Exception('Please fill the description. ');
        }
        if (empty($_POST['categories'])) {
            throw new Exception('Please choose category. ');
        }
        if (!ft_nonce_is_valid($_POST['_nonce'], $nonce_key . $_SESSION['_nonce'], $_SESSION['user']['id'])) {
            throw new Exception('Invalid Request');
        }
        if (empty($error)) {
            //submit the form
            $url = APIHTTPPATH . '/help/services/add';
            $params = $_POST;
            $params['uid'] = $_SESSION['user']['id'];
            $params['city_id'] = $city_id;
            $POSTFIELDS = http_build_query($params);
            $return = curlget($url, 1, $POSTFIELDS);
            $data = json_decode($return, 1);
            if ($data['success'] == 0) {
                $error = $data['msg'];
            } else {
                unset($_POST);
                $error = $data['data']['confirm'];
                unset($_SESSION['_nonce']);
            }
        }
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}
if (empty($_SESSION['_nonce'])) {
    $str = md5(time() . '-' . $_SESSION['user']['id']);
示例#11
0
    $su = str_replace('s', 'shareid=', $su);
    $su = str_replace('u', '&uk=', $su);
    $dir = rawurldecode($dir);
    $dir = urlencode($dir);
    $dir = '&dir=' . $dir;
    $dirurl = 'http://pan.baidu.com/share/list?page=1&' . $su . $dir;
    $pagefile = curlget($dirurl);
    $jsonobj = json_decode($pagefile);
} else {
    if (strpos($panid, 'f')) {
        $panid = str_replace('f', '&fid=', $panid);
    }
    $panid = str_replace('s', 'shareid=', $panid);
    $panid = str_replace('u', '&uk=', $panid);
    $panlink = 'http://pan.baidu.com/share/link?' . $panid;
    $pagefile = curlget($panlink);
    $re = '/\\[\\{.*\\}\\]/';
    preg_match_all($re, $pagefile, $result);
    $jsonstr = str_replace('\\\\', '$ma^rk$', $result[0][0]);
    $jsonstr = str_replace('\\', '', $jsonstr);
    $jsonstr = str_replace('$ma^rk$', '\\', $jsonstr);
    $jsonstr = '{"errno":0,"list":' . $jsonstr . '}';
    $jsonobj = json_decode($jsonstr);
}
$dlink = $jsonobj->list[$p]->dlink;
header("location:{$dlink}");
function curlget($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
示例#12
0
function doLogin()
{
    global $username, $password, $urlname, $userId;
    echo "Mata-site is: " . $urlname . "<br>";
    $result = curlget("https://{$urlname}/api/sessie", true, "Gebruikersnaam=" . $username . "&Wachtwoord=" . $password);
    $result = json_decode($result, true);
    $naam = $result["Naam"];
    $userId = $result["GebruikersId"];
    $session = $result["SessieId"];
    $msg = $result["Message"];
    echo "Welkom, {$naam}<br>\nUw gebruikersId is: {$userId}<br>\nUw sessie is: {$session}<br>\nBericht: {$msg}\n";
    ob_flush();
}
示例#13
0
<?php

check_login();
$pageTitle = 'My Messages';
$url = APIHTTPPATH . '/help/messages/view?uid=' . $_SESSION['user']['id'];
$returnMyMessage = curlget($url);
$dataMyMessage = json_decode($returnMyMessage, 1);
if ($dataMyMessage['success'] == 0) {
    $errorMyMessage = $dataMyMessage['msg'];
}
if (empty($dataMyMessage['data'])) {
    $errorMyMessage = 'No Message Found in Your List.';
}
if (!empty($errorMyMessage)) {
    ?>
<div class="row">
  <div class="col-lg-12">
    <div class="bs-component">
      <div class="error"><?php 
    echo $errorMyMessage;
    ?>
</div>
    </div>
  </div>
</div>
<?php 
} else {
    ?>
<div class="row">
  <div class="col-lg-12">
    <div class="bs-component">
示例#14
0
    if (!empty($_POST['id'])) {
        $url = 'http://world.mkgalaxy.com/api/help/websites/edit?id=' . $_POST['id'] . '&token=';
    } else {
        $url = 'http://world.mkgalaxy.com/api/help/websites/add?token=';
    }
    $r = curlget($url, 1, http_build_query($post));
    $result = json_decode($r, 1);
    $error = $result['data']['confirm'];
    if ($result['success'] == 0) {
        $error = $result['msg'];
    }
}
$data = array();
if (isset($_GET['website_id'])) {
    $url = 'http://world.mkgalaxy.com/api/help/websites/detail?id=' . $_GET['website_id'] . '&cache=0&token=';
    $r = curlget($url);
    $current = json_decode($r, 1);
    if ($current['success'] == 1) {
        $data = json_decode($current['data']['content'], 1);
    }
}
pr($data);
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Create New Website</title>
</head>

<body>
示例#15
0
function userDetails($uid, $cache = 1)
{
    //api/help/bid/mybids?uid=
    $url = APIHTTPPATH . '/help/users/detail?uid=' . $uid . '&cache=' . $cache;
    $userDetails = curlget($url);
    $userDetails = json_decode($userDetails, 1);
    return $userDetails;
}
示例#16
0
<?php

$pageTitle = 'Selecting State/Province';
if (empty($_GET['country'])) {
    header("Location: " . HTTPPATH . "/locations/country");
    exit;
}
$country = $_GET['country'];
$url = APIHTTPPATH . '/locations/states.php?id=' . $country;
$stateList = curlget($url);
$stateList = json_decode($stateList, 1);
include SITEDIR . '/libraries/addresses/nearby.php';
?>
<!-- body -->
<h3>Choose State</h3>
<!-- body -->
<form method="get" name="form1" id="form1" action="<?php 
echo HTTPPATH;
?>
/locations/city">
<select name="state" id="state">
<option value="">Select---</option>
<?php 
if (!empty($stateList)) {
    foreach ($stateList as $i => $state) {
        ?>
<option value="<?php 
        echo $state['id'];
        ?>
"><?php 
        echo $i + 1 . '. ' . $state['state'];
示例#17
0
preg_match_all($sharepagere, $sharepage, $panid);
$s = implode("", $panid['shareid']);
$u = implode("", $panid['uk']);
//判断文件夹
$dirnum = strpos($panlink, '#dir/path=');
if ($dirnum) {
    $dir = substr($panlink, $dirnum + 10);
    $isdir = true;
} else {
    $isdir = false;
}
if ($isdir) {
    //$dirbaselink = substr($panlink,0,$dirbaselinknum+10);
    $linkid = 's' . $s . 'u' . $u . 'd' . $dir;
    $dirurl = 'http://pan.baidu.com/share/list?page=1&shareid=' . $s . '&uk=' . $u . '&dir=' . $dir;
    $pagefile = curlget($dirurl);
    $jsonobj = json_decode($pagefile);
    if ($jsonobj->errno != 0) {
        die("<p>分享的文件已经被取消或不存在!</p>" . $backhome);
    }
} else {
    $linkid = 's' . $s . 'u' . $u;
    if (strpos($panlink, '#dir')) {
        $panlink = str_replace('#dir', '', $panlink);
    }
    $pagefile = $sharepage;
    $re = '/\\[\\{.*\\}\\]/';
    if (preg_match_all($re, $pagefile, $result)) {
        $jsonstr = str_replace('\\\\', '$ma^rk$', $result[0][0]);
        $jsonstr = str_replace('\\', '', $jsonstr);
        $jsonstr = str_replace('$ma^rk$', '\\', $jsonstr);
示例#18
0
        $params['id'] = $row_rsView['history_id'];
        $params['fromlat'] = $row_rsSettings['latitude'];
        $params['fromlng'] = $row_rsSettings['longitude'];
        $params['fromdate'] = $row_rsSettings['dob'];
        $params['tolat'] = $row_rsView['history_lat'];
        $params['tolng'] = $row_rsView['history_lng'];
        $params['todate'] = $row_rsView['history_date'];
        $data['params'][] = $params;
    } while ($row_rsView = mysql_fetch_assoc($rsView));
    $rows = mysql_num_rows($rsView);
    if ($rows > 0) {
        mysql_data_seek($rsView, 0);
        $row_rsView = mysql_fetch_assoc($rsView);
    }
    if (!empty($data['params'])) {
        $content = curlget('http://horo.mkgalaxy.com/api/matchMultiLatLonDays', 1, http_build_query($data));
        $result = json_decode($content, 1);
        if (!empty($result) && empty($result['error'])) {
            foreach ($result as $k => $v) {
                $d = array();
                $d['history_points'] = $v['points']['points'];
                $d['history_points_results'] = $v['points']['result'];
                $where = sprintf('history_id = %s', $modelGeneral->qstr($k));
                $modelGeneral->updateDetails('z_history', $d, $where);
            }
        }
    }
}
?>
<div class="page-header">
  <h1>My History</h1>
        $arr['uid'] = $_SESSION['user']['id'];
        $arr['address'] = $_GET['address'];
        $arr['lat'] = $_GET['lat'];
        $arr['lng'] = $_GET['lng'];
        $arr['url'] = $url;
        $arr['updated_dt'] = date('Y-m-d H:i:s');
        $General->addDetails('maps_addressbook', $arr);
        $General->clearCache($query2, $params2);
    } else {
        $arr = array();
        $arr['updated_dt'] = date('Y-m-d H:i:s');
        $where = sprintf('addr_id = %s', $General->qstr($returnCheck['addr_id']));
        $General->updateDetails('maps_addressbook', $arr, $where);
        $General->clearCache($query2, $params2);
    }
    $results = curlget($url);
    $routes = json_decode($results, 1);
}
$addressBook = $General->fetchAll($query2, $params2, 600);
?>
<a href="<?php 
echo $url;
?>
" target="_blank">External Link</a> | <a href="/">Home</a> | <a href="/directionsNoMap">Refresh</a>
<script language="javascript">

$(document).on("keypress", 'form', function (e) {
    var code = e.keyCode || e.which;
    if (code == 13) {
        var str = e.target.className;
        var n = str.indexOf("addressBox");
示例#20
0
if (!empty($to_uid) && !empty($_SESSION['user']['id'])) {
    $messageCurrentPath = HTTPPATH . $_SERVER['REQUEST_URI'];
    if (empty($baseMessage)) {
        $baseMessage = "\n\n" . '----------------------------------------------------------------------------------
Original Posting: ' . HTTPPATH . $_SERVER['REQUEST_URI'];
    }
    if (isset($_POST['MM_Message'])) {
        //submit the form
        $url = APIHTTPPATH . '/help/messages/add';
        $params = $_POST;
        $params['data']['uid'] = $_SESSION['user']['id'];
        $params['data']['to_uid'] = $to_uid;
        $params['data']['message'] = $_POST['message'];
        $params['data']['subject'] = $_POST['subject'];
        $POSTFIELDS = http_build_query($params);
        $returnMessage = curlget($url, 1, $POSTFIELDS);
        $dataMessage = json_decode($returnMessage, 1);
        if ($dataMessage['success'] == 0) {
            $errorMessage = $dataMessage['msg'];
        } else {
            $errorMessage = $dataMessage['data']['confirm'];
        }
    }
    ?>
<div class="row">
  <div class="col-lg-12">
    <div class="bs-component">
      <div class="alert alert-dismissable alert-danger" style="text-align:center;">
        Send Message<a name="messageForm"></a>
      </div>
    </div>
示例#21
0
<?php

$pageTitle = 'Selecting City';
if (empty($_GET['state'])) {
    header("Location: " . HTTPPATH . "/locations/country");
    exit;
}
$state = $_GET['state'];
$url = APIHTTPPATH . '/locations/cities.php?id=' . $state;
$cityList = curlget($url);
$cityList = json_decode($cityList, 1);
include SITEDIR . '/libraries/addresses/nearby.php';
?>
<!-- body -->
<h3>Choose City</h3>
<!-- body -->
<form method="get" name="form1" id="form1" action="<?php 
echo HTTPPATH;
?>
/locations/cityDetail">
<select name="city_id" id="city_id">
<option value="">Select---</option>
<?php 
if (!empty($cityList)) {
    foreach ($cityList as $i => $city) {
        ?>
<option value="<?php 
        echo $city['id'];
        ?>
"><?php 
        echo $i + 1 . '. ' . $city['city'];
示例#22
0
 $longitude = $_GET['lng'];
 $kw = !empty($_GET['keyword']) ? $_GET['keyword'] : '';
 $location = $globalCity['city'] . ', ' . $globalCity['statename'] . ', ' . $globalCity['countryname'];
 if (!empty($_GET['geo_s']) && !empty($_GET['geo_c']) && !empty($_GET['geo_co'])) {
     $location = $_GET['geo_c'] . ', ' . $_GET['geo_s'] . ', ' . $_GET['geo_co'];
 }
 $url = 'http://api.indeed.com/ads/apisearch?publisher=5171288687589967&l=' . urlencode($location) . '&sort=&radius=&st=&jt=&start=' . $startRow_rsView . '&limit=25&fromage=&filter=&latlong=1&co=us&chnl=&userip=' . $_SERVER['REMOTE_ADDR'] . '&v=2';
 if (!empty($kw)) {
     $url .= '&q=' . urlencode($kw);
 }
 //echo $url;
 $searchQuery = md5($url . date('Y-m-d'));
 $check1 = $modelGeneral->fetchRow("select * from auto_pre_biz WHERE biz_query = ? AND biz_type = 'Indeed'", array($searchQuery), 0);
 if (empty($check1)) {
     $modelGeneral->clearCache($modelGeneral->sql);
     $res = curlget($url);
     $results = simplexml_load_string($res);
     //add in biz table
     $d = array();
     $d['biz_type'] = 'Indeed';
     $d['biz_query'] = $searchQuery;
     $d['biz_results'] = $res;
     $d['module_id'] = $colname_rsModule;
     $modelGeneral->addDetails('auto_pre_biz', $d);
     if (!empty($results->results->result)) {
         foreach ($results->results->result as $k => $v) {
             $date = sprintf("%s", $v->date);
             $biz = array('title' => sprintf("%s", $v->jobtitle), 'company' => sprintf("%s", $v->company), 'description' => sprintf("%s", $v->snippet), 'category' => 33, 'photos' => array(), 'videos' => array(), 'urls' => array(sprintf("%s", $v->url)), 'address' => sprintf("%s", $v->formattedLocationFull), 'address2' => sprintf("%s", $v->formattedLocationFull), 'showAddress' => 1, 'lat' => sprintf("%s", $v->latitude), 'lng' => sprintf("%s", $v->longitude), 'jobkey' => sprintf("%s", $v->jobkey), 'custom_date' => date('Y-m-d H:i:s', strtotime($date)), 'rc_approved' => 1);
             $checkRow = $modelGeneral->fetchRow("select * from " . $tablename . " WHERE jobkey = ?", array($v->jobkey), 0);
             if (empty($checkRow)) {
                 $return = createNewPost($biz, $currentURL, $globalCity, $colname_rsModule, $resultModule, $resultModuleFields, $modelGeneral, $tablename, 'System0000', 1);
示例#23
0
 if (empty($check1)) {
     $modelGeneral->clearCache($modelGeneral->sql);
     $res = curlget($url);
     $results = json_decode($res, 1);
     //add in yelp table
     $d = array();
     $d['biz_type'] = 'Google';
     $d['biz_query'] = $google_query;
     $d['biz_results'] = $res;
     $d['module_id'] = $colname_rsModule;
     $modelGeneral->addDetails('auto_pre_biz', $d);
     //adding ends
     $businesses = array();
     if (!empty($results['results'])) {
         foreach ($results['results'] as $k => $v) {
             $detailJson = curlget('https://maps.googleapis.com/maps/api/place/details/json?placeid=' . $v['place_id'] . '&key=' . DEVELOPERKEY);
             $details = json_decode($detailJson, 1);
             $detail = $details['result'];
             $biz = array('title' => $v['name'], 'description' => $v['name'], 'category' => $v['types'], 'photos' => array(), 'videos' => array(), 'urls' => array($detail['url']), 'address' => $detail['formatted_address'], 'address2' => $detail['formatted_address'], 'showAddress' => 1, 'lat' => $v['geometry']['location']['lat'], 'lng' => $v['geometry']['location']['lng'], 'phone_number' => !empty($detail['international_phone_number']) ? $detail['international_phone_number'] : NULL, 'place_id' => $v['place_id'], 'place_id_type' => 'Google', 'rc_approved' => 1);
             /*
                         $imgShack = new Library_Imageshack();
                         $imgUrl = 'https://maps.googleapis.com/maps/api/staticmap?center='.$v['geometry']['location']['lat'].','.$v['geometry']['location']['lng'].'&maptype=roadmap&markers=color:blue%7Clabel:S%7C'.$v['geometry']['location']['lat'].','.$v['geometry']['location']['lng'].'&zoom=16&size=400x400&key='.DEVELOPERKEY; //'https://maps.googleapis.com/maps/api/streetview?size=400x400&location='.$v['geometry']['location']['lat'].','.$v['geometry']['location']['lng'].'&fov=90&heading=100&pitch=10';
                         echo $imgUrl;
                         exit;
                         $imgs = $imgShack->upload($imgUrl);
                         pr($imgs);
                         exit;*/
             $checkRow = $modelGeneral->fetchRow("select * from " . $tablename . " WHERE place_id = ? AND place_id_type = ?", array($v['id'], 'Google'), 0);
             if (empty($checkRow)) {
                 $return = createNewPost($biz, $currentURL, $globalCity, $colname_rsModule, $resultModule, $resultModuleFields, $modelGeneral, $tablename, 'System0000', 1);
             }
示例#24
0
<?php

if (empty($_GET['place_id'])) {
    header("Locations: " . HTTPPATH . "/locations/country");
    exit;
}
//https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=AddYourOwnKeyHere
$url = 'https://maps.googleapis.com/maps/api/place/details/json?placeid=' . $_GET['place_id'] . '&key=' . PLACESAPIKEY;
$data = curlget($url);
$content = json_decode($data, 1);
$error = '';
if ($content['status'] === 'OK') {
    $result = $content['result'];
    $placeName = !empty($result['name']) ? $result['name'] : '';
    include SITEDIR . '/modules/businesses/categories.php';
} else {
    $error = $content['status'];
    $placeName = 'No Place Found';
}
if (empty($_GET['city_id'])) {
    header("Locations: " . HTTPPATH . "/locations/country");
    exit;
}
include SITEDIR . '/modules/navLeftSideVars.php';
$city_id = $_GET['city_id'];
$pageTitle = $placeName;
?>
        <div class="row">
          <div class="col-lg-12">
            <div class="bs-component">
              <?php 
示例#25
0
    $error = '';
    $result = array();
    $url = APIHTTPPATH . '/help/jobs/view?';
    if (!empty($_GET['category'])) {
        if (!is_array($_GET['category'])) {
            $_GET['category'] = array($_GET['category']);
        }
        $url .= '&category=' . implode(',', $_GET['category']);
    }
    if (!empty($_GET['city'])) {
        $url .= '&city_id=' . implode(',', $_GET['city']);
    } else {
        $nearbyCities = getNearbyCities($globalCity['nearby']);
        $url .= '&city_id=' . $nearbyCities[1];
    }
    $return = curlget($url);
    $data = json_decode($return, 1);
    if ($data['success'] == 0) {
        $error = $data['msg'];
    } else {
        $result = $data['data'];
        if ($result['total'] == 0) {
            $error = 'No Result Found.';
        }
    }
} catch (Exception $e) {
    $error = $e->getMessage();
}
?>
<div class="row">
        <div class="col-lg-12">
示例#26
0
<?php

$pageTitle = 'Select Country';
$url = APIHTTPPATH . '/locations/countries.php';
$countryList = curlget($url);
$countryList = json_decode($countryList, 1);
include SITEDIR . '/libraries/addresses/nearby.php';
?>
<!-- body -->
<h3>Choose Country</h3>
<form method="get" name="form1" id="form1" action="<?php 
echo HTTPPATH;
?>
/locations/state">
<select name="country" id="country">
<option value="">Select---</option>
<?php 
if (!empty($countryList)) {
    foreach ($countryList as $i => $country) {
        ?>
<option value="<?php 
        echo $country['id'];
        ?>
"><?php 
        echo $i + 1 . '. ' . $country['country'];
        ?>
</option>
<?php 
    }
}
?>