tnx to m1geo
This commit is contained in:
Kim Huebel 2018-04-04 19:06:19 +00:00
parent 9cb475cadd
commit 177d66f811
2 changed files with 22 additions and 20 deletions

View file

@ -89,37 +89,39 @@ function checkSetup() {
} }
function startStopwatch() { function startStopwatch() {
$time = microtime(); $time = microtime();
$time = explode(' ', $time); $time = explode(' ', $time);
$time = $time[1] + $time[0]; $time = $time[1] + $time[0];
$_SESSION['starttime'] = $time; $_SESSION['starttime'] = $time;
return $time; return $time;
} }
function getLapTime() { function getLapTime() {
$start = $_SESSION['starttime']; $start = $_SESSION['starttime'];
$time = microtime(); $time = microtime();
$time = explode(' ', $time); $time = explode(' ', $time);
$time = $time[1] + $time[0]; $time = $time[1] + $time[0];
$finish = $time; $finish = $time;
$lap_time = round(($finish - $start), 4); $lap_time = round(($finish - $start), 4);
return $lap_time; return $lap_time;
} }
function showLapTime($func) { function showLapTime($func) {
if( defined("DEBUG") ) { if( defined("DEBUG") ) {
?><script>console.log('<?php echo $func . ": ". getLapTime(); ?> sec.');</script><?php ?><script>console.log('<?php echo $func . ": ". getLapTime(); ?> sec.');</script><?php
} }
} }
function convertTimezone($timestamp) { function convertTimezone($timestamp) {
$date = new DateTime($timestamp); try {
$date->setTimezone(new DateTimeZone(TIMEZONE)); $date = new DateTime($timestamp);
return $date->format('Y-m-d H:i:s'); $date->setTimezone(new DateTimeZone(TIMEZONE));
return $date->format('Y-m-d H:i:s');
} catch (Exception $err) {}
} }
function encode($hex) { function encode($hex) {
$validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789"; $validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789";
$str = ''; $str = '';
$chrval = hexdec($hex); $chrval = hexdec($hex);
$str = chr($chrval); $str = chr($chrval);

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20180404-1 (".getGitVersion().")"); define("VERSION", "20180404-2 (".getGitVersion().")");
?> ?>