| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-12 11:12:24 +00:00
										 |  |  | require '../app/classes/participant.php'; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-10 18:42:44 +00:00
										 |  |  | // connect to database
 | 
					
						
							| 
									
										
										
										
											2024-09-04 09:53:02 +00:00
										 |  |  | $db = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); | 
					
						
							| 
									
										
										
										
											2024-08-10 18:42:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-11 10:13:59 +00:00
										 |  |  | // specify time range
 | 
					
						
							| 
									
										
										
										
											2024-08-12 11:12:24 +00:00
										 |  |  | include '../app/helpers/time_range.php'; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // 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
 | 
					
						
							|  |  |  | // we use $_REQUEST, so that both links and forms work
 | 
					
						
							|  |  |  | if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |     $participantId = $_REQUEST['id']; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  |     unset($_REQUEST['name']); | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |     unset($participantName); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | } elseif (isset($_REQUEST['name']) && $_REQUEST['name'] != '') { | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |     unset($participantId); | 
					
						
							|  |  |  |     $participantName = $_REQUEST['name']; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | } elseif (isset($_REQUEST['ip']) && $_REQUEST['ip'] != '') { | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |     unset($participantId); | 
					
						
							|  |  |  |     $participantIp = $_REQUEST['ip']; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | } else { | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |     unset($participantId); | 
					
						
							|  |  |  |     unset($participantName); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Participant listings
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | $participant = new Participant($db); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // search and list specific participant ID
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | if (isset($participantId)) { | 
					
						
							|  |  |  |     $search = $participant->conferenceByParticipantId($participantId, $from_time, $until_time, $participantId, $from_time, $until_time); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | // search and list specific participant name (stats_id)
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | } elseif (isset($participantName)) { | 
					
						
							|  |  |  |     $search = $participant->conferenceByParticipantName($participantName, $from_time, $until_time); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | // search and list specific participant IP
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | } elseif (isset($participantIp)) { | 
					
						
							|  |  |  |     $search = $participant->conferenceByParticipantIP($participantIp, $from_time, $until_time); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | // list of all participants (default)
 | 
					
						
							|  |  |  | } else { | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | // prepare the result
 | 
					
						
							|  |  |  |     $search = $participant->participantsAll($from_time, $until_time); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | if (!empty($search)) { | 
					
						
							|  |  |  |     $participants = array(); | 
					
						
							|  |  |  |     $participants['records'] = array(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     foreach ($search as $item) { | 
					
						
							|  |  |  |         extract($item); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // search and list specific participant ID
 | 
					
						
							|  |  |  |         if (isset($participantId)) { | 
					
						
							|  |  |  |             $participant_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 | 
					
						
							|  |  |  |             ); | 
					
						
							|  |  |  |         // search and list specific participant name (stats_id)
 | 
					
						
							|  |  |  |         } elseif (isset($participantName)) { | 
					
						
							|  |  |  |             $participant_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 | 
					
						
							|  |  |  |             ); | 
					
						
							|  |  |  |         // search and list specific participant IP
 | 
					
						
							|  |  |  |         } elseif (isset($participantIp)) { | 
					
						
							|  |  |  |             $participant_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 | 
					
						
							|  |  |  |             ); | 
					
						
							|  |  |  |         // list of all participants (default)
 | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $participant_record = array( | 
					
						
							|  |  |  |                 // assign title to the field in the array record
 | 
					
						
							|  |  |  |                 'component'		=> $jitsi_component, | 
					
						
							|  |  |  |                 'participant ID'	=> $endpoint_id, | 
					
						
							|  |  |  |                 'conference ID'		=> $conference_id | 
					
						
							|  |  |  |             ); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  |         // populate the result array
 | 
					
						
							|  |  |  |         array_push($participants['records'], $participant_record); | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | // prepare the widget
 | 
					
						
							|  |  |  | $widget['full'] = false; | 
					
						
							|  |  |  | $widget['name'] = 'Participants'; | 
					
						
							|  |  |  | $widget['collapsible'] = false; | 
					
						
							|  |  |  | $widget['collapsed'] = false; | 
					
						
							|  |  |  | $widget['filter'] = true; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // widget title
 | 
					
						
							|  |  |  | if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') { | 
					
						
							|  |  |  |     $widget['title'] = 'Conferences with participant name (stats_id) matching "<strong>' . $_REQUEST['name'] . '"</strong>'; | 
					
						
							|  |  |  | } elseif (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { | 
					
						
							|  |  |  |     $widget['title'] = 'Conference with participant ID matching "<strong>' . $_REQUEST['id'] . '"</strong>'; | 
					
						
							|  |  |  | } elseif (isset($participantIp)) { | 
					
						
							|  |  |  |     $widget['title'] = 'Conference with participant IP matching "<strong>' . $participantIp . '"</strong>'; | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |     $widget['title'] = 'All participants'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // widget records
 | 
					
						
							|  |  |  | if (!empty($participants['records'])) { | 
					
						
							|  |  |  |     $widget['full'] = true; | 
					
						
							|  |  |  |     $widget['table_headers'] = array_keys($participants['records'][0]); | 
					
						
							|  |  |  |     $widget['table_records'] = $participants['records']; | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | // display the widget
 | 
					
						
							| 
									
										
										
										
											2024-08-12 11:12:24 +00:00
										 |  |  | include('../app/templates/widget.php'); | 
					
						
							| 
									
										
										
										
											2024-07-29 13:38:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-07 09:10:41 +00:00
										 |  |  | ?>
 |