Skip to content
Permalink
Browse files

v0.2

use system language for address
view image map
view charging icon
view last update locations
view accuracy
fix links in about
  • Loading branch information...
Anisan committed Apr 11, 2019
1 parent 08591f5 commit d0df2aab1136e2522fa40bcb859eea470af0758c
Showing with 19 additions and 10 deletions.
  1. +4 −1 modules/google_location/google_location.class.php
  2. +15 −9 templates/google_location/action_admin.html
@@ -131,6 +131,7 @@ function admin(&$out) {
$this->getConfig();
$out['COOKIE_FILE']=$this->config['COOKIE_FILE'];
$out['TIMEOUT_UPDATE']=$this->config['TIMEOUT_UPDATE'];
$out['LAST_UPDATE']=$this->config['LAST_UPDATE'];
$out['DEBUG']=$this->config['DEBUG'];
if ($this->view_mode=='update_settings') {
global $cookie_file;
@@ -211,6 +212,8 @@ public function updateLocation() {
}
$this->config['LAST_UPDATE'] = date('Y-m-d H:i:s');
$this->saveConfig();
}
public function sendToGps($location)
@@ -264,7 +267,7 @@ public function getLocation() {
public function getLocationData() {
$this->getConfig();
//$ch = curl_init('https://www.google.com/maps/preview/locationsharing/read?authuser=0&pb=');
$ch = curl_init('https://www.google.com/maps/preview/locationsharing/read?authuser=0&hl=en&gl=us&pb=');
$ch = curl_init('https://www.google.com/maps/preview/locationsharing/read?authuser=0&hl='.SETTINGS_SITE_LANGUAGE.'&gl='.SETTINGS_SITE_LANGUAGE.'&pb=');
curl_setopt($ch, CURLOPT_COOKIEJAR, $this->config['COOKIE_FILE']);
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->config['COOKIE_FILE']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -33,26 +33,32 @@
</div>
<br>
<a class="btn btn-default" href="?view_mode=update_location" ><i class="glyphicon glyphicon-refresh"></i>Get locations</a>
&nbsp;Last update: <#LAST_UPDATE#>
<br><br>
<table class="table table-condensed table-hover table-striped">
<thead class="thead-light">
<tr>
<td>&nbsp;</td>
<td scope="col">User</td>
<td scope="col">Location</td>
<td scope="col">Datetime</td>
<td scope="col">Battery</td>
<td scope="col">Send to GPS module</td>
<td scope="col"><b>User</b></td>
<td scope="col"><b>Location</b></td>
<td scope="col"><b>Accuracy</b></td>
<td scope="col"><b>Last update</b></td>
<td scope="col"><b>Battery</b></td>
<td scope="col"><b>Send to GPS module</b></td>
</tr>
</thead>
<tbody>
[#begin LOCATIONS#]
<tr>
<td><img src="[#IMAGE#]" height="30px" onerror="this.src='../templates/google_location/none.jpg'"></td>
<td valign="top">[#NAME#]</td>
<td valign="top">[#ADDRESS#]</td>
<td valign="top"><a onclick="var url=('https://static-maps.yandex.ru/1.x/?ll=[#LON#],[#LAT#]&size=650,450&z=17&l=map&pt=[#LON#],[#LAT#],pm2blm');
$.fancybox.open({'type': 'image',src: url});return false;">
<i class="glyphicon glyphicon-map-marker"></i> [#ADDRESS#]
</a></td>
<td valign="top">[#ACCURACY#]</td>
<td valign="top">[#LASTUPDATE#]</td>
<td valign="top">[#BATTLEVEL#]%</td>
<td valign="top">[#if CHARGING=="1"#]<i class="glyphicon glyphicon-flash"> </i>[#endif CHARGING#][#BATTLEVEL#]%</td>
<td valign="top">[#if SENDTOGPS=="1"#]
<a class="btn btn-success" href="?view_mode=send_switch&id=[#ID_USER#]" >On</a>
[#else#]
@@ -78,15 +84,15 @@ <h4 class="modal-title">Google location</h4>
<img src="../templates/google_location/image.png" width="48" height="48">
</div>
<p class="float-left"> Модуль Google Location.<br>
Обсуждение модуля <a href="http://majordomo.smartliving.ru/forum/viewtopic.php?f=5&t=" target="_blank">здесь</a>.<br>
Обсуждение модуля <a href="http://majordomo.smartliving.ru/forum/viewtopic.php?f=5&t=6309" target="_blank">здесь</a>.<br>
</p>
<hr size="1">
<p class="float-left">
Поддержать автора материально:
<ul>
<li>Yandex: <a href="https://money.yandex.ru/to/410012076838296/100" target="_blank">410012076838296</a></li>
<li>WebMoney: R366396529511</li>
<li><a href="https://connect.smartliving.ru/tasks/50.html" target="_blank">Connect</a></li>
<li><a href="https://connect.smartliving.ru/tasks/435.html" target="_blank">Connect</a></li>
</ul>
</p>
</div>

0 comments on commit d0df2aa

Please sign in to comment.
You can’t perform that action at this time.