function getWeather() { $city = getCity(); $uri = "http://api.map.baidu.com/telematics/v3/weather?location={$city}&output=json&ak=A20cb515b0fa284cb99c36956c06e737"; $str = file_get_contents($uri); return $str; }
private function renderPaymentLink($array = []) { $order = $array; $transaction_details = array('order_id' => Order::max('order_id') + 1, 'gross_amount' => $order['total']); $i = 0; foreach ($order['product'] as $product) { $items_details = [$i => ['id' => $product['id'], 'price' => $product['product_price'], 'quantity' => $product['product_qty'], 'name' => $product['product_name']]]; $i++; } $shipping_fee = ['id' => 'shipping', 'price' => $order['shipping']['fee'], 'quantity' => '1', 'name' => $order['shipping']['service']]; array_push($items_details, $shipping_fee); // Optional $billing_address = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'address' => $order['user']['address'], 'city' => getCity($order['user']['city']), 'postal_code' => "55281", 'phone' => $order['user']['mob_phone'], 'country_code' => 'IDN'); // Optional $customer_details = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'email' => $order['user']['email'], 'phone' => $order['user']['mob_phone'], 'billing_address' => $billing_address, 'shipping_address' => $billing_address); // Fill transaction details $transaction = array('payment_type' => 'vtweb', "vtweb" => array("enabled_payments" => getPayment(), "credit_card_3d_secure" => true, "finish_redirect_url" => url('checkout/complete'), "unfinish_redirect_url" => url('checkout/uncomplete'), "error_redirect_url" => url('checkout/error')), 'transaction_details' => $transaction_details, 'customer_details' => $customer_details, 'item_details' => $items_details); $vtweb_url = Veritrans_VtWeb::getRedirectionUrl($transaction); return $vtweb_url; }
</td> <td align="center"><?php echo getCountry($row['CountryId']); ?> </td> <td align="center"><?php if ($row['State'] != 0) { echo getState($row['State']); } else { echo $row['OtherState']; } ?> </td> <td align="center"><?php 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>
public function update() { //B('FilterString'); if (is_numeric($_POST['province'])) { $_POST['province'] = getProvince($_POST['province']); $_POST['city'] = getCity($_POST['city']); $_POST['dist'] = getDistrict($_POST['dist']); } $_POST['birthday'] = strtotime($_POST['birthday']); $name = $this->getActionName(); $model = CM($name); if (false === $model->create()) { $this->error($model->getError()); } // 更新数据 $list = $model->save(); if (false !== $list) { //成功提示 $this->assign('jumpUrl', Cookie::get('_currentUrl_')); $this->success('编辑成功!'); } else { //错误提示 $this->error('编辑失败!'); } }
' . $user['name'] . '</a></h5><br>'; if ($postcode != "Various") { echo '</div><div class="col s12 m6"> <iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyBvFEWYa4AoCrM2NImuEgff5JDs4Nt360g&q=' . $location . '"> </iframe>'; } else { echo '</div><div class="col s12 m6"> <iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyBvFEWYa4AoCrM2NImuEgff5JDs4Nt360g&q=' . getCity($createdBy) . '"> </iframe>'; } echo '</div></div></div>'; echo '<h5 class="flow-text" id="evdescription">' . $desc . '</h5>'; echo '<div class="row"> <div class="col s12 m12"> <div class="eventGoers">'; $con = connect(); $stmt = $con->prepare("SELECT * FROM UserEvents WHERE `EventID`=?;"); $stmt->bind_param("i", $_GET['id']); $stmt->execute(); $result = $stmt->get_result(); $results = array(); echo '<ul class="collection with-header">'; echo '<li class="collection-header"><h4 class="header light">Attending:</h4></li>';
function Grad() { global $SUBS, $PARAM; $SUBS['PROGRAMA'] = getAgenda($PARAM['id']); if (!($SUBS['GRADA'] = getCity())) { Programa(); return; } //$SUBS['USAPREM'] = getBlock (4); $SUBS['PREMIERI'] = getBlock(1); //$SUBS['ARTICLES'] = getBlock (6); index('_index_grad.htmlt'); }
$rawlng = trim($_GET['lng']); $latlng = getSnappedLatLng($rawlat, $rawlng); $lat = $latlng[0]; $lng = $latlng[1]; $mVehicle = new Vehicle($vehicle); if ($mVehicle == null || $mVehicle->getCompany() != $company) { $setupResponse->status = "FAILURE"; $error = new Error(); $error->reason = "VEHICLE ERROR"; $error->message = "No such vehicle exists"; $result->error = $error; } else { if ($mVehicle->getIMEI() == $imei) { $addressInfo = getAddress($lat, $lng); $address = $addressInfo->results[0]->formatted_address; $city = getCity($addressInfo->results[0]); //echo $address." ".$city; if ($city != "" && $mVehicle->getCurrentCity() != $city) { $vehicleId = $mVehicle->getId(); $driver = $mVehicle->getDriver(); Notification::addLocationNotification($driver, $vehicleId, $lat, $lng, $city); } if (isset($_GET['accuracy']) && $_GET['accuracy'] <= 20) { if ($mVehicle->setLocation($lat, $lng, $address, $city) && $mVehicle->addTrack($lat, $lng, $address)) { $setupResponse->status = "SUCCESS"; $setupResponse->request = "location, track"; } } else { if ($mVehicle->setLocation($lat, $lng, $address, $city)) { $setupResponse->status = "SUCCESS"; $setupResponse->request = "location";
?> </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"> <table align="center" width="100%" cellpadding="1" cellspacing="1" border="0"> <tr class="gredBg"> <td align="center"><b>Name</b></td> <td align="center"><b>Designation</b></td>
<?php echo $row["prenom_user"]; ?> </h3> <p class="text-muted text-center">Inscrit(e) depuis le <?php echo dateFr($row["date_insc_user"]); ?> </p> <hr> <strong><i class="fa fa-map-marker margin-r-5"></i> Adresse</strong> <p class="text-muted"><?php echo $row["adresse_user"]; ?> <br><?php echo getCity($row["ville_user"]); ?> </p> <hr> <strong><i class="fa fa-pencil margin-r-5"></i> Données personnelles</strong> <p class="text-muted">né(e) le <?php echo $row["jour_naissance_user"] . " " . getMonth($row["mois_naissance_user"]) . " " . $row["annee_naissance_user"]; ?> </p> <p class="text-muted"><i class="fa fa-phone margin-r-5"></i> <?php echo $row["tel_user"]; ?> </p> <p class="text-muted"><i class="fa fa-envelope margin-r-5"></i><?php echo $row["mail_user"]; ?>
public function teaList() { import("@.ORG.Page"); //导入分页类 $stu = new StuModel(); $count = $stu->count(); $p = new Page($count, 15); $stu_res = $stu->relation('School')->limit($p->firstRow . ',' . $p->listRows)->order('stu_id desc')->findAll(); $p->setConfig('header', '篇记录'); $p->setConfig('prev', "上一页"); $p->setConfig('next', '下一页'); $p->setConfig('first', '<<'); $p->setConfig('last', '>>'); $page = $p->show(); $school = new SchoolModel(); $school_res = $school->findAll(); $xueji_res = getXueji(); $city_res = getCity(); $this->assign('xueji_res', $xueji_res); $this->assign('city_res', $city_res); $this->assign('school_res', $school_res); $this->assign('stu_res', $stu_res); $this->assign("page", $page); $this->display(); }
} else { $addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId'], 'dft_a' => 1), ' limit 1'); } if ($addrrow = $addrQuery->fetch()) { $addr = $addrrow; } else { $addrrow = array('id' => -1, 'name' => '', 'phone' => '', 'address' => '点击设置收货地址', 'province' => ' ', 'city' => ' ', 'area' => ' '); $addr = $addrrow; } include 'view/order.html.php'; exit; } //地址页面修改已存在地址 if (isset($_GET['alterAddress'])) { $pro = getProvince($_POST['pro']); $city = getCity($_POST['pro'], $_POST['city']); $area = getArea($_POST['pro'], $_POST['city'], $_POST['area']); $value = array('pro_id' => $_POST['pro'], 'city_id' => $_POST['city'], 'area_id' => $_POST['area'], 'area' => $_POST['area'], 'province' => $pro, 'city' => $city, 'area' => $area, 'address' => $_POST['address'], 'name' => $_POST['name'], 'phone' => $_POST['phone']); if (-1 == $_POST['address_id']) { $value['c_id'] = $_SESSION['customerId']; $value['dft_a'] = 0; $addrId = pdoInsert('address_tbl', $value); } else { pdoUpdate('address_tbl', $value, array('id' => $_POST['address_id'])); } $from = isset($_GET['from']) ? '&from=' . $_GET['from'] : ''; header('location:controller.php?editAddress=1' . $from); } if (isset($_GET['editAddress'])) { $to = $_GET['from']; $addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId']), ' limit 5');
$myzs = getAppendix($astr[0]); $mystr = getStrn($astr[0]); if (getPlz($astr[1])) { $myplz = getPlz($astr[1]); } else { $mycity = trim($astr[1]); } } else { if (getPlz($astr[1])) { $myplz = getPlz($astr[1]); } if (getNr($astr[1])) { $mynr = getNr($astr[1]); $myzs = getAppendix($astr[1]); $mystr = getStrn($astr[1]); $mycity = getCity($astr[0]); } else { array_push($both, $astr[0]); array_push($both, $astr[1]); } } } // workflow if (count($both) == 2) { $a = "%" . strtoupper(trim($both[0])) . "%"; $b = "%" . strtoupper(trim($both[1])) . "%"; $v = array($a, $a); $t = array('s', 's'); $sql = "SELECT DISTINCT * FROM (SELECT DISTINCT gem_schl_neu, gemeinde AS gem FROM gis.verwaltungseinheit "; $sql .= "WHERE gemeinde_upper LIKE \$1"; $sql .= "UNION SELECT DISTINCT gem_schl_neu, gemeinde_gem_teile AS gem FROM gis.wohnplatz ";
getStateByID($stateID, $mysqli); } if ($functionname == 'delState') { $stateID = $_POST["stateID"]; delState($stateID, $mysqli); } /*City*/ if ($functionname == 'setCity') { $cityID = $_POST["cityID"]; $cityName = $_POST["cityName"]; $cityCode = $_POST["cityCode"]; $cityStateID = $_POST["cityStateID"]; setCity($cityID, $cityName, $cityCode, $cityStateID, $mysqli); } if ($functionname == 'getCity') { getCity($mysqli); } if ($functionname == 'getCityByID') { $cityID = $_POST["cityID"]; getCityByID($cityID, $mysqli); } if ($functionname == 'delCity') { $cityID = $_POST["cityID"]; delCity($cityID, $mysqli); } if ($functionname == 'getCityByStateID') { $stateID = $_POST["stateID"]; getCityByStateID($stateID, $mysqli); } /*Location*/ if ($functionname == 'setLocation') {
$url = "http://m.weather.com.cn/data/" . $cityId . ".html"; $weather = json_decode(file_get_contents($url)); return $weather; } function json_to_array($web) { $arr = array(); foreach ($web as $k => $w) { if (is_object($w)) { $arr[$k] = json_to_array($w); } else { $arr[$k] = $w; } } return $arr; } $city = getCity(getIP()); echo $city; // $city = str_split($city,strlen($city)-3); // $city =$city[0]; // $cityUrl = "http://evenle.com/wei/20130921/city.php"; // $web=json_decode(file_get_contents($cityUrl)); // $arr=json_to_array($web); // $weatherInfo = getWeather($arr[$city]); // echo('weather('); // echo(json_encode($weatherInfo)); // echo(")"); ?>
foreach ($user_extrainfo_category as $uk => $uv) { $flagArr = str_split($uv['flag']); ?> <h2><?php echo $uv['name']; ?> :</h2> <?php if (!empty($flagArr)) { foreach ($flagArr as $fk => $fv) { $val = 'field' . ($fk + 1) . 'name'; if ($fv) { if ($user_extrainfo[$uv['uecid']]) { if ($uv['uecid'] == 2 && $uv[$val] == '所属学校') { include_once '/var/www/html/site/lib/school.lib.php'; $City_Array = getCity(); $School_Array = getSchool(); $user_extrainfoArr = explode("_", $user_extrainfo[$uv['uecid']][$val]); echo '<span style="white-space:pre-wrap;">' . $uv[$val] . ':' . $City_Array[$user_extrainfoArr[0]] . ' / ' . $School_Array[$user_extrainfoArr[0]][$user_extrainfoArr[1]] . '</span><br />'; } else { ?> <span style="white-space:pre-wrap;"><?php echo $uv[$val]; ?> :<?php echo $user_extrainfo[$uv['uecid']][$val]; ?> </span><br /> <?php } }
$Y=$_REQUEST['Y']; } else { die(return_error('Required parameters are not set')); } $layer=str_replace('_and_', '&', $layer); $layer_tablename=getLayerTablename($layer); $output=getGraphData($layer_tablename, $X, $Y); print $output; break; // /*start*/ These requests are specific to UAP (category structure) case 'getCity': require_once("MultiLayerSearch.php"); $cid=$_REQUEST['cityName']; $result=getCity($cid); print $result; break; case 'getCountry': require_once("MultiLayerSearch.php"); $cName=$_REQUEST['continentName']; $result=getCountry($cName); print $result; break; case 'getCategory': require_once("MultiLayerSearch.php"); print getCategory(); break;
function addCity(&$cities, $doc) { if (isset($doc['city']) and isset($doc['state'])) { $city = getCity($doc['city'] . ', ' . $doc['state']); } else { $city = getCity($doc['location']); } if ($city != null) { if (isset($cities[$city])) { $cities[$city]++; } else { $cities[$city] = 1; } } }
} else { $fbProfile = fbRequest($id); echo '<div id="index-banner" class="parallax-container"> <div class="section no-pad-bot"> <div class="container"> <br><br> <h1 class="header center blue-text">' . $fbProfile['name'] . '</h1> <div class="row center"> <img src="//graph.facebook.com/' . $id . '/picture?type=large"" class="circle responsive-img"> </div> <br><br><br> </div> </div> </div>'; //Link to their profile if (getCity($id) != "") { echo '<div class="container"> <br><br> <div class="row left"> <h4 class="header col s12 light">Events happening here: </h4> </div> <br> </div>'; getCreatedBy($id); } else { if ($_SESSION['id'] == $id) { echo ''; } else { if (!following($id)) { echo '<div class ="container"> <form action="follow.php" method="post">
function graph() { global $MStudent; // All students by month $studentsdata = array(); $students = $MStudent->getAll(); foreach ($students as $student) { $time = (int) ($student['_id']->getTimestamp() / 3600 / 24 / 30.2); if (!isset($studentsdata[$time])) { $studentsdata[$time] = 1; } else { $studentsdata[$time]++; } } ksort($studentsdata); // Students by day $studentsdaydata = array(); $students = $MStudent->getAllwTime(); foreach ($students as $student) { $time = (int) ($student['time'] / 3600 / 24); if (!isset($studentsdaydata[$time])) { $studentsdaydata[$time] = 1; } else { $studentsdaydata[$time]++; } } array_splice($studentsdaydata, 0, -100); ksort($studentsdaydata); // Messages global $MMessage; $msgdata = array(); $msgs = $MMessage->getAll(); foreach ($msgs as $msg) { foreach ($msg['replies'] as $reply) { $time = (int) ($reply['time'] / 3600 / 24); if (!isset($msgdata[$time])) { $msgdata[$time] = 1; } else { $msgdata[$time]++; } } } ksort($msgdata); $data = array('students' => $studentsdata, 'studentsday' => $studentsdaydata, 'msgs' => $msgdata); if (isset($_GET['cities'])) { // Searches global $MApp; $searchdata = array(); $entry = $MApp->getSearches(); $searches = array_slice($entry, -$_GET['cities'], NULL, true); foreach ($searches as $time => $search) { //echo "$time=>"; if ($time != '_id' and !isset($search['type'])) { unset($entry[$time]); $MApp->save($entry); continue; } if ($time == '_id' or !isset($search['type']) or $search['type'] != 'sublets') { continue; } if (!isset($search['city']) or $search['city'] == null) { $location = $search['data']['location']; $city = getCity($location); // Save cities so don't need to recurl in the future $entry[$time]['city'] = $city; $MApp->save($entry); } else { $city = $search['city']; } if (!isset($searchdata[$city])) { $searchdata[$city] = 1; } else { $searchdata[$city]++; } } $data['searchcities'] = $searchdata; } $this->render('stats/graph', $data); }
$data = array(); foreach ($fields as $k) { $data[$k] = $obj[$k]; } if ($obj['date_entered']) { $data['bdate'] = date('Y-m-d', strtotime($obj['date_entered'])); $tmp = mysql_fetch_assoc(query("select date_format(date_buy,'%H') as bhour, date_format(date_buy,'%i') as bminute from panelie_user_check where user_id=" . $obj['user_id'] . ' and check_number=' . intval($obj['check_id']) . " and date_format(date_buy,'%Y-%m-%d')='" . $data['bdate'] . "'")); if ($tmp && ($tmp['bhour'] != 0 || $tmp['bminute'] != 0)) { $data['bhour'] = $tmp['bhour']; $data['bminute'] = $tmp['bminute']; } } $data['first_date'] = getFirstDate($obj['user_id']); $data = array_merge($data, getShop($obj['user_id'], $obj['shop_id'])); $data = array_merge($data, getUnit($obj['unit_id'])); $data = array_merge($data, getCity($obj['city_id'])); $data = array_merge($data, getDistance($obj['user_id'], $obj['shop_id'])); $data = array_merge($data, getBarcode($obj['barcode_value'])); if (!$data['product_name']) { $data['product_name'] = $obj['corrected_name']; if (!$data['product_name']) { unset($data['product_name']); } } $data = array_merge($data, calcWeight($data)); $data = array_merge($data, getRange($obj['date_entered'])); $data = array_merge($data, getNoPurchases($obj['date_entered'])); $data = array_merge($data, getFamilyDetails($obj['user_id'])); $data['discount'] = countDiscount($obj['price'], $obj['discount']); if ($obj['id']) { $data['purchase_id'] = $obj['id'];
<th>Ville</th> <th>Mail</th> <th> </th> </tr></thead><tbody> <?php $result = getAllEspace(); if (FALSE == $result) { echo getError(30); } else { $nb = mysqli_num_rows($result); if ($nb == 0) { echo getError(30); } else { for ($i = 0; $i < $nb; $i++) { $row = mysqli_fetch_array($result); $ville = getCity($row["id_city"]); ?> <tr> <td><?php echo $row["nom_espace"]; ?> </td> <td><?php echo $row["adresse"]; ?> </td> <td><?php echo $ville; ?> </td> <td><?php