Skip to content
Permalink
Browse files

v0.3.2

view error cookies file (detail in hint)
color old datetime in list user
  • Loading branch information...
Anisan committed Apr 14, 2019
1 parent 267924a commit 942cc8f43ba4d1cbaa525afbd22ea48b49e82e4a
Showing with 20 additions and 10 deletions.
  1. +9 −5 modules/google_location/google_location.class.php
  2. +11 −5 templates/google_location/action_admin.html
@@ -179,13 +179,17 @@ function admin(&$out) {
}
}
$locations = SQLSelect("select * from google_locations");
for($i=0;$i<count($locations);$i++) {
if (time() - strtotime($locations[$i]["LASTUPDATE"]) > 60*60)
$locations[$i]['WARNING'] = '1';
}
$out['LOCATIONS'] = $locations;
$cookies_files = [];//array_diff(scandir($directory_cookies), array('..', '.'));
if($handle = opendir($directory_cookies)){
while(false !== ($file = readdir($handle))) {
if($file != "." && $file != "..") {
$cookies_files[] = array("NAME" => $file, "DATE"=>date("F d Y H:i:s", filectime($directory_cookies.$file)), "SIZE"=>filesize($directory_cookies.$file));
$cookies_files[] = array("NAME" => $file, "DATE"=>date("F d Y H:i:s", filectime($directory_cookies.$file)), "SIZE"=>filesize($directory_cookies.$file), "ERROR"=>$this->config["ERROR_".$file]);
}
}
closedir( $handle );
@@ -214,7 +218,7 @@ function usual(&$out) {
$this->admin($out);
}
function processSubscription($event, $details='') {
$this->getConfig();
$this->getConfig();
if ($event=='MINUTELY') {
$timeout = $this->config['TIMEOUT_UPDATE'];
$m=date('i',time());
@@ -255,8 +259,6 @@ public function updateLocation() {
$rec['ID_USER'] = $location['id'];
$rec['ID']=SQLInsert('google_locations', $rec); // adding new record
}
}
$this->config['LAST_UPDATE'] = date('Y-m-d H:i:s');
$this->saveConfig();
@@ -270,16 +272,18 @@ public function sendToGps($location)
}
public function getLocation($cookie_file) {
$path_parts = pathinfo($cookie_file);
try {
$result = $this->getLocationData($cookie_file);
} catch (Exception $e) {
//$this->google_connect();
//$result = $this->google_callLocationUrl();
$this->log($e);
$this->config['ERROR_'.$path_parts['basename']]=$e->getMessage();
return [];
}
$this->config['ERROR_'.$path_parts['basename']]='';
$return = array();
$path_parts = pathinfo($cookie_file);
$return[] = array(
'id' => crc32($cookie_file),
'name' => $path_parts['filename'],
@@ -19,12 +19,18 @@
<form action="?" method="post" enctype="multipart/form-data" name="frmEdit" class="form-horizontal">
<div class="form-group">
<label class="col-lg-4 control-label">Cookies:</label>
<div class="col-lg-3">
<div class="col-lg-4">
[#if COOKIES_FILES#]
[#begin COOKIES_FILES#]
<div class="row">
<label class="col-lg-9">[#NAME#] ([#SIZE#]b)</label>

<label class="col-lg-9">
[#if ERROR!=''#]
<i class="glyphicon glyphicon-info-sign" style="color:red;" title='[#ERROR#]'></i>
[#endif ERROR#]
[#NAME#] ([#SIZE#]b)</label>
<a class="btn btn-default" href="?view_mode=delete_cookie&name=[#NAME#]" onClick="return confirm('<#LANG_ARE_YOU_SURE#>')"><i class="glyphicon glyphicon-remove"></i></a>

</div>
[#end COOKIES_FILES#]
[#else COOKIES_FILES#]
@@ -68,9 +74,9 @@
</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>
<tr [#if WARNING=="1"#]class="danger"[#endif WARNING#]>
<td><img src="[#IMAGE#]" title="[#ID_USER#]" height="30px" onerror="this.src='../templates/google_location/none.jpg'"></td>
<td valign="top" title="[#FULLNAME#]">[#NAME#]</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#]

0 comments on commit 942cc8f

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