Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1381 → Rev 1382

/asterisk-stats/trunk/includes/functions.php
2,25 → 2,7
 
$PHP_SELF = $_SERVER['PHP_SELF'];
 
function GetGet($var) {
$val = "";
 
if(array_key_exists($var, $_GET)) {
$val = $_GET[$var];
} elseif(array_key_exists($var, $_POST)) {
$val = $_POST[$var];
} else {
$val = "";
}
 
$val = str_replace("'", "\\'", $val);
$val = str_replace('\\', '\\\\', $val);
 
return $val;
}
 
 
function Duration($seconds) {
function FormatDuration($seconds) {
$minutes = $seconds / 60;
$seconds = $seconds % 60;
$hours = $minutes / 60;
41,4 → 23,10
return (' ('.$hrsdiff.'h '.$minsdiff.'m '.$secsdiff.'s)');
}
 
function FormatDateTime($date_str) {
$date_obj = date_create($date_str);
 
return date_format($date_obj, "D, j M Y G:i:s");
}
 
?>