diff --git a/app/pages/conferences.php b/app/pages/conferences.php index 60fa75d..9108bc0 100644 --- a/app/pages/conferences.php +++ b/app/pages/conferences.php @@ -8,12 +8,6 @@ * Supports pagination. */ -// Get any new messages -include '../app/includes/messages.php'; -include '../app/includes/messages-show.php'; - -require '../app/classes/conference.php'; - // connect to database $response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); @@ -52,13 +46,31 @@ if ($response['db'] === null) { // Conference listings // + require '../app/classes/conference.php'; $conferenceObject = new Conference($db); + // get current page for pagination + $currentPage = $_REQUEST['page_num'] ?? 1; + $currentPage = (int)$currentPage; + // pagination variables - $items_per_page = 15; - $browse_page = $_REQUEST['p'] ?? 1; - $browse_page = (int)$browse_page; - $offset = ($browse_page -1) * $items_per_page; + $items_per_page = 20; + $offset = ($currentPage -1) * $items_per_page; + + // Build params for pagination + $params = ''; + if (!empty($_REQUEST['from_time'])) { + $params .= '&from_time=' . urlencode($_REQUEST['from_time']); + } + if (!empty($_REQUEST['until_time'])) { + $params .= '&until_time=' . urlencode($_REQUEST['until_time']); + } + if (!empty($_REQUEST['name'])) { + $params .= '&name=' . urlencode($_REQUEST['name']); + } + if (!empty($_REQUEST['id'])) { + $params .= '&id=' . urlencode($_REQUEST['id']); + } // search and list specific conference ID if (isset($conferenceId)) { @@ -77,7 +89,7 @@ if ($response['db'] === null) { if (!empty($search)) { // we get total items and number of pages $item_count = count($search_all); - $page_count = ceil($item_count / $items_per_page); + $totalPages = ceil($item_count / $items_per_page); $conferences = array(); $conferences['records'] = array(); @@ -139,31 +151,20 @@ if ($response['db'] === null) { } } - // prepare the widget - $widget['full'] = false; - $widget['name'] = 'Conferences'; - $widget['collapsible'] = false; - $widget['collapsed'] = false; - $widget['filter'] = true; - $widget['pagination'] = true; - - // widget title + // filter message + $filterMessage = array(); if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') { - $widget['title'] = 'Conferences with name matching "' . $_REQUEST['name'] . '"'; + array_push($filterMessage, 'Conferences with name matching "' . $_REQUEST['name'] . '"'); } elseif (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { - $widget['title'] = 'Conference with ID "' . $_REQUEST['id'] . '"'; - } else { - $widget['title'] = 'All conferences'; - } - // widget records - if (!empty($conferences['records'])) { - $widget['full'] = true; - $widget['table_headers'] = array_keys($conferences['records'][0]); - $widget['table_records'] = $conferences['records']; + array_push($filterMessage, 'Conferences with ID "' . $_REQUEST['id'] . '"'); } + // Get any new messages + include '../app/includes/messages.php'; + include '../app/includes/messages-show.php'; + // display the widget - include '../app/templates/event-list-conferences.php'; + include '../app/templates/conferences.php'; } diff --git a/app/pages/participants.php b/app/pages/participants.php index f505e2c..fa89401 100644 --- a/app/pages/participants.php +++ b/app/pages/participants.php @@ -19,31 +19,9 @@ if ($response['db'] === null) { } else { $db = $response['db']; - // Get current page for pagination - $currentPage = $_REQUEST['page_num'] ?? 1; - $currentPage = (int)$currentPage; - // specify time range include '../app/helpers/time_range.php'; - // Build params for pagination - $params = ''; - if (!empty($_REQUEST['from_time'])) { - $params .= '&from_time=' . urlencode($_REQUEST['from_time']); - } - if (!empty($_REQUEST['until_time'])) { - $params .= '&until_time=' . urlencode($_REQUEST['until_time']); - } - if (!empty($_REQUEST['name'])) { - $params .= '&name=' . urlencode($_REQUEST['name']); - } - if (!empty($_REQUEST['id'])) { - $params .= '&id=' . urlencode($_REQUEST['id']); - } - if (isset($_REQUEST['event'])) { - $params .= '&ip=' . urlencode($_REQUEST['ip']); - } - // participant id/name/IP are specified when searching specific participant(s) // participant name - this is 'stats_id' in the db // either id, name, OR IP - in that order @@ -71,10 +49,32 @@ if ($response['db'] === null) { require '../app/classes/participant.php'; $participantObject = new Participant($db); + // get current page for pagination + $currentPage = $_REQUEST['page_num'] ?? 1; + $currentPage = (int)$currentPage; + // pagination variables $items_per_page = 20; $offset = ($currentPage -1) * $items_per_page; + // Build params for pagination + $params = ''; + if (!empty($_REQUEST['from_time'])) { + $params .= '&from_time=' . urlencode($_REQUEST['from_time']); + } + if (!empty($_REQUEST['until_time'])) { + $params .= '&until_time=' . urlencode($_REQUEST['until_time']); + } + if (!empty($_REQUEST['name'])) { + $params .= '&name=' . urlencode($_REQUEST['name']); + } + if (!empty($_REQUEST['id'])) { + $params .= '&id=' . urlencode($_REQUEST['id']); + } + if (isset($_REQUEST['event'])) { + $params .= '&ip=' . urlencode($_REQUEST['ip']); + } + // search and list specific participant ID if (isset($participantId)) { $search = $participantObject->conferenceByParticipantId($participantId, $from_time, $until_time, $offset, $items_per_page); diff --git a/app/templates/conferences.php b/app/templates/conferences.php new file mode 100644 index 0000000..1f2c954 --- /dev/null +++ b/app/templates/conferences.php @@ -0,0 +1,131 @@ + + +
+
+
+

Jitsi conferences events

+ log events related to conferences in Jitsi Meet +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + Clear + +
+
+
+
+ + + + +
+ +

Time period: -

+ + +

+ + +
+ + +
+ +
+ + + + + + + + + + + + $column) { + if ($key === 'conference ID' && isset($conferenceId) && $conferenceId === $column) { ?> + + + + + + + + + + + + + + + + + +
+ 20) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 20 ? substr($column, 0, 20) . '...' : $column ?? '') ?> + + + 16) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 16 ? substr($column, 0, 16) . '...' : $column ?? '') ?> + + + 20) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 20 ? substr($column, 0, 20) . '...' : $column ?? '') ?> + + + 16) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 16 ? substr($column, 0, 16) . '...' : $column ?? '') ?> + + + 30) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 30 ? substr($column, 0, 30) . '...' : $column ?? '') ?> + +
+
+ + +
+ No conference events found for the specified criteria. +
+ +
+
+
+
+ diff --git a/app/templates/event-list-conferences.php b/app/templates/event-list-conferences.php deleted file mode 100644 index 13368ef..0000000 --- a/app/templates/event-list-conferences.php +++ /dev/null @@ -1,94 +0,0 @@ - -
-
- - -
-
- - /> - - /> - /> - /> - - -
- -
- - -
- - -
- -

time period: -

- -
- - - - - - - - - - - - - $column) { - if ($key === 'conference ID' && isset($conferenceId) && $conferenceId === $column) { ?> - - - - - - - - - - - - - - - - - - - - - -
- $items_per_page) { - $url = "$app_root?platform=$platform_id&page=$page"; - include '../app/helpers/pagination.php'; -} -?> - -

No matching records found.

- -
-
- diff --git a/app/templates/participants.php b/app/templates/participants.php index 24bee31..c5c55e2 100644 --- a/app/templates/participants.php +++ b/app/templates/participants.php @@ -40,7 +40,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -75,14 +75,20 @@ if (isset($row['event']) && $row['event'] === 'stats_id') $stats_id = true; if (isset($row['event']) && $row['event'] === 'pair selected') $participant_ip = true; foreach ($row as $key => $column) { - if ($key === 'conference ID' && isset($conferenceId) && $conferenceId === $column) { ?> - - - - - + if ($key === 'conference ID') { ?> + + 16) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 16 ? substr($column, 0, 16) . '...' : $column ?? '') ?> + + - + + 16) ? 'data-toggle="tooltip" title="' . htmlspecialchars($column) . '"' : '' ?>> + 16 ? substr($column, 0, 16) . '...' : $column ?? '') ?> + + @@ -100,8 +106,8 @@ - + } elseif ($key === 'time') { ?> +