getMessage(); include 'templates/message.php'; exit(); } // // Participant listings // // search and list specific participant ID if (isset($participant_id)) { try { $participant = new Participant($db); // prepare the result $search = $participant->conferenceByParticipantId($participant_id, $from_time, $until_time, $participant_id, $from_time, $until_time); if (!empty($search)) { $conferences = array(); $conferences['records'] = array(); foreach ($search as $item) { extract($item); $conference_record = array( // assign title to the field in the array record 'time' => $time, 'conference ID' => $conference_id, 'conference name' => $conference_name, 'conference host' => $conference_host, 'loglevel' => $loglevel, 'participant ID' => $participant_id, 'event' => $event_type, 'parameter' => $event_param ); // populate the result array array_push($conferences['records'], $conference_record); } } } catch (Exception $e) { $error = 'Error: ' . $e->getMessage(); include 'templates/message.php'; exit(); } // display the result echo "
\n"; echo "
Conferences with participant ID matching \"$participant_id\""; if ($time_range_specified) { echo "
for the time period $from_time - $until_time"; } echo "
\n\n"; // filters - time selection and sorting dropdowns include 'templates/results-filter.php'; echo "
\n\n"; // results table echo "
\n"; if (!empty($conferences['records'])) { echo "\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; // table headers foreach (array_keys($conferences['records'][0]) as $header) { echo "\t\t\t\t\n"; } echo "\t\t\t\n"; echo "\t\t\n"; echo "\t\t\n"; //table rows foreach ($conferences['records'] as $row) { echo "\t\t\t\n"; $stats_id = false; $participant_ip = false; if ($row['event'] === 'stats_id') $stats_id = true; if ($row['event'] === 'pair selected') $participant_ip = true; // sometimes $column is empty, we make it '' then foreach ($row as $key => $column) { if ($key === 'participant ID' && $column === $participant_id) { echo "\t\t\t\t\n"; } elseif ($key === 'conference ID') { echo "\t\t\t\t\n"; } elseif ($key === 'conference name') { echo "\t\t\t\t\n"; } elseif ($stats_id && $key === 'parameter') { echo "\t\t\t\t\n"; } elseif ($participant_ip && $key === 'parameter') { echo "\t\t\t\t\n"; } else { echo "\t\t\t\t\n"; } } echo "\t\t\t\n"; } echo "\t\t\n"; echo "\t
" . htmlspecialchars($header) . "
" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "
\n"; } else { echo '

No matching conferences found.

'; } echo "\n
\n"; // search and list specific participant name (stats_id) } elseif (isset($participant_name)) { try { $participant = new Participant($db); // prepare the result $search = $participant->conferenceByParticipantName($participant_name, $from_time, $until_time); if (!empty($search)) { $conferences = array(); $conferences['records'] = array(); foreach ($search as $item) { extract($item); $conference_record = array( // assign title to the field in the array record 'time' => $time, 'conference ID' => $conference_id, 'conference name' => $conference_name, 'conference host' => $conference_host, 'loglevel' => $loglevel, 'participant ID' => $participant_id, 'event' => $event_type, 'parameter' => $event_param ); // populate the result array array_push($conferences['records'], $conference_record); } } } catch (Exception $e) { $error = 'Error: ' . $e->getMessage(); include 'templates/message.php'; exit(); } // display the result echo "
\n"; echo "
Conferences with participant name (stats_id) matching \"$participant_name\""; if ($time_range_specified) { echo "
for the time period $from_time - $until_time"; } echo "
\n\n"; // filters - time selection and sorting dropdowns include 'templates/results-filter.php'; echo "
\n\n"; // results table echo "
\n"; if (!empty($conferences['records'])) { echo "\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; // table headers foreach (array_keys($conferences['records'][0]) as $header) { echo "\t\t\t\t\n"; } echo "\t\t\t\n"; echo "\t\t\n"; echo "\t\t\n"; //table rows foreach ($conferences['records'] as $row) { echo "\t\t\t\n"; // sometimes $column is empty, we make it '' then foreach ($row as $key => $column) { if ($key === 'parameter' && $column === $participant_name) { echo "\t\t\t\t\n"; } elseif ($key === 'conference ID') { echo "\t\t\t\t\n"; } elseif ($key === 'conference name') { echo "\t\t\t\t\n"; } elseif ($key === 'participant ID') { echo "\t\t\t\t\n"; } else { echo "\t\t\t\t\n"; } } echo "\t\t\t\n"; } echo "\t\t\n"; echo "\t
" . htmlspecialchars($header) . "
" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "
\n"; } else { echo '

No matching conferences found.

'; } echo "\n
\n"; // search and list specific participant IP } elseif (isset($participant_ip)) { try { $participant = new Participant($db); // prepare the result $search = $participant->conferenceByParticipantIP($participant_ip, $from_time, $until_time); if (!empty($search)) { $conferences = array(); $conferences['records'] = array(); foreach ($search as $item) { extract($item); $conference_record = array( // assign title to the field in the array record 'time' => $time, 'conference ID' => $conference_id, 'conference name' => $conference_name, 'conference host' => $conference_host, 'loglevel' => $loglevel, 'participant ID' => $participant_id, 'event' => $event_type, 'parameter' => $event_param ); // populate the result array array_push($conferences['records'], $conference_record); } } } catch (Exception $e) { $error = 'Error: ' . $e->getMessage(); include 'templates/message.php'; exit(); } // display the result echo "
\n"; echo "
Conferences with participant IP matching \"$participant_ip\""; if ($time_range_specified) { echo "
for the time period $from_time - $until_time"; } echo "
\n\n"; // filters - time selection and sorting dropdowns include 'templates/results-filter.php'; echo "
\n\n"; // results table echo "
\n"; if (!empty($conferences['records'])) { echo "\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; // table headers foreach (array_keys($conferences['records'][0]) as $header) { echo "\t\t\t\t\n"; } echo "\t\t\t\n"; echo "\t\t\n"; echo "\t\t\n"; //table rows foreach ($conferences['records'] as $row) { echo "\t\t\t\n"; // sometimes $column is empty, we make it '' then foreach ($row as $key => $column) { if ($key === 'parameter' && $column === $participant_ip) { echo "\t\t\t\t\n"; } elseif ($key === 'conference ID') { echo "\t\t\t\t\n"; } elseif ($key === 'conference name') { echo "\t\t\t\t\n"; } elseif ($key === 'participant ID') { echo "\t\t\t\t\n"; } else { echo "\t\t\t\t\n"; } } echo "\t\t\t\n"; } echo "\t\t\n"; echo "\t
" . htmlspecialchars($header) . "
" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "
\n"; } else { echo '

No matching conferences found.

'; } echo "\n
\n"; // list of all participants (default) } else { try { $participant = new Participant($db); // prepare the result $search = $participant->participantsAll($from_time, $until_time); if (!empty($search)) { $participants = array(); $participants['records'] = array(); foreach ($search as $item) { extract($item); $participant_record = array( // assign title to the field in the array record 'component' => $jitsi_component, 'participant ID' => $endpoint_id, 'conference ID' => $conference_id, ); // populate the result array array_push($participants['records'], $participant_record); } } } catch (Exception $e) { $error = 'Error: ' . $e->getMessage(); include 'templates/message.php'; exit(); } // display the result echo "
\n"; echo "
All participants"; if ($time_range_specified) { echo "
for the time period $from_time - $until_time"; } echo "
\n\n"; // filters - time selection and sorting dropdowns include 'templates/results-filter.php'; echo "
\n\n"; // results table echo "
\n"; if (!empty($participants['records'])) { echo "\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; // table headers foreach (array_keys($participants['records'][0]) as $header) { echo "\t\t\t\t\n"; } echo "\t\t\t\n"; echo "\t\t\n"; echo "\t\t\n"; //table rows foreach ($participants['records'] as $row) { echo "\t\t\t\n"; // sometimes $column is empty, we make it '' then foreach ($row as $key => $column) { if ($key === 'participant ID') { echo "\t\t\t\t\n"; } elseif ($key === 'conference ID') { echo "\t\t\t\t\n"; } else { echo "\t\t\t\t\n"; } } echo "\t\t\t\n"; } echo "\t\t\n"; echo "\t
" . htmlspecialchars($header) . "
" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "" . htmlspecialchars($column ?? '') . "
\n"; } else { echo '

No matching participants found.

'; } echo "\n
\n"; } ?>