Adds time range helper function

main
Yasen Pramatarov 2024-08-11 13:13:59 +03:00
parent 8765fe22c0
commit 8e123cf5f2
4 changed files with 23 additions and 42 deletions

View File

@ -0,0 +1,17 @@
<?php
$time_range_specified = false;
if (!isset($_REQUEST['from_time']) || (isset($_REQUEST['from_time']) && $_REQUEST['from_time'] == '')) {
$from_time = '0000-01-01';
} else {
$from_time = $_REQUEST['from_time'];
$time_range_specified = true;
}
if (!isset($_REQUEST['until_time']) || (isset($_REQUEST['until_time']) && $_REQUEST['until_time'] == '')) {
$until_time = '9999-12-31';
} else {
$until_time = $_REQUEST['until_time'];
$time_range_specified = true;
}
?>

View File

@ -7,20 +7,8 @@ require 'classes/component.php';
require 'helpers/database.php'; require 'helpers/database.php';
$db = connectDB($config, 'jilo'); $db = connectDB($config, 'jilo');
// FIXME move thi sto a special function // specify time range
$time_range_specified = false; include 'helpers/time_range.php';
if (!isset($_REQUEST['from_time']) || (isset($_REQUEST['from_time']) && $_REQUEST['from_time'] == '')) {
$from_time = '0000-01-01';
} else {
$from_time = $_REQUEST['from_time'];
$time_range_specified = true;
}
if (!isset($_REQUEST['until_time']) || (isset($_REQUEST['until_time']) && $_REQUEST['until_time'] == '')) {
$until_time = '9999-12-31';
} else {
$until_time = $_REQUEST['until_time'];
$time_range_specified = true;
}
// jitsi component events list // jitsi component events list
// we use $_REQUEST, so that both links and forms work // we use $_REQUEST, so that both links and forms work

View File

@ -7,20 +7,8 @@ require 'classes/conference.php';
require 'helpers/database.php'; require 'helpers/database.php';
$db = connectDB($config, 'jilo'); $db = connectDB($config, 'jilo');
// FIXME move thi sto a special function // specify time range
$time_range_specified = false; include 'helpers/time_range.php';
if (!isset($_REQUEST['from_time']) || (isset($_REQUEST['from_time']) && $_REQUEST['from_time'] == '')) {
$from_time = '0000-01-01';
} else {
$from_time = $_REQUEST['from_time'];
$time_range_specified = true;
}
if (!isset($_REQUEST['until_time']) || (isset($_REQUEST['until_time']) && $_REQUEST['until_time'] == '')) {
$until_time = '9999-12-31';
} else {
$until_time = $_REQUEST['until_time'];
$time_range_specified = true;
}
// conference id/name are specified when searching specific conference(s) // conference id/name are specified when searching specific conference(s)
// either id OR name, id has precedence // either id OR name, id has precedence

View File

@ -7,20 +7,8 @@ require 'classes/participant.php';
require 'helpers/database.php'; require 'helpers/database.php';
$db = connectDB($config, 'jilo'); $db = connectDB($config, 'jilo');
// FIXME move thi sto a special function // specify time range
$time_range_specified = false; include 'helpers/time_range.php';
if (!isset($_REQUEST['from_time']) || (isset($_REQUEST['from_time']) && $_REQUEST['from_time'] == '')) {
$from_time = '0000-01-01';
} else {
$from_time = $_REQUEST['from_time'];
$time_range_specified = true;
}
if (!isset($_REQUEST['until_time']) || (isset($_REQUEST['until_time']) && $_REQUEST['until_time'] == '')) {
$until_time = '9999-12-31';
} else {
$until_time = $_REQUEST['until_time'];
$time_range_specified = true;
}
// participant id/name/IP are specified when searching specific participant(s) // participant id/name/IP are specified when searching specific participant(s)
// participant name - this is 'stats_id' in the db // participant name - this is 'stats_id' in the db