| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Conference { | 
					
						
							|  |  |  |     private $db; | 
					
						
							| 
									
										
										
										
											2024-07-04 19:14:12 +00:00
										 |  |  |     private $queries; | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public $jitsi_component; | 
					
						
							|  |  |  |     public $start; | 
					
						
							|  |  |  |     public $end; | 
					
						
							|  |  |  |     public $conference_id; | 
					
						
							|  |  |  |     public $conference_name; | 
					
						
							|  |  |  |     public $participants; | 
					
						
							|  |  |  |     public $name_count; | 
					
						
							|  |  |  |     public $conference_host; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function __construct($database) { | 
					
						
							|  |  |  |         $this->db = $database->getConnection(); | 
					
						
							|  |  |  |         $this->queries = include('queries.php'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:23:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:36:03 +00:00
										 |  |  |     // search/list specific conference ID
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:23:31 +00:00
										 |  |  |     public function conferenceById($conference_id, $from_time, $until_time) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // time period drill-down
 | 
					
						
							|  |  |  |         // FIXME make it similar to the bash version
 | 
					
						
							|  |  |  |         if (empty($from_time)) { | 
					
						
							|  |  |  |             $from_time = '0000-01-01'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (empty($until_time)) { | 
					
						
							|  |  |  |             $until_time = '9999-12-31'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // this is needed for compatibility with the bash version, so we use '%s' placeholders
 | 
					
						
							|  |  |  |         $from_time = htmlspecialchars(strip_tags($from_time)); | 
					
						
							|  |  |  |         $until_time = htmlspecialchars(strip_tags($until_time)); | 
					
						
							|  |  |  |         $sql = $this->queries['conference_by_id']; | 
					
						
							|  |  |  |         $sql = sprintf($sql, $conference_id, $from_time, $until_time, $conference_id, $from_time, $until_time); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $query = $this->db->prepare($sql); | 
					
						
							|  |  |  |         $query->execute(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $query->fetchAll(PDO::FETCH_ASSOC); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:36:03 +00:00
										 |  |  |     // search/list specific conference name
 | 
					
						
							|  |  |  |     public function conferenceByName($conference_name, $from_time, $until_time) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // time period drill-down
 | 
					
						
							|  |  |  |         // FIXME make it similar to the bash version
 | 
					
						
							|  |  |  |         if (empty($from_time)) { | 
					
						
							|  |  |  |             $from_time = '0000-01-01'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (empty($until_time)) { | 
					
						
							|  |  |  |             $until_time = '9999-12-31'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // this is needed for compatibility with the bash version, so we use '%s' placeholders
 | 
					
						
							|  |  |  |         $from_time = htmlspecialchars(strip_tags($from_time)); | 
					
						
							|  |  |  |         $until_time = htmlspecialchars(strip_tags($until_time)); | 
					
						
							|  |  |  |         $sql = $this->queries['conference_by_name']; | 
					
						
							|  |  |  |         $sql = sprintf($sql, $conference_name, $from_time, $until_time, $conference_name, $from_time, $until_time); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $query = $this->db->prepare($sql); | 
					
						
							|  |  |  |         $query->execute(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $query->fetchAll(PDO::FETCH_ASSOC); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  |     // list of all conferences
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:23:31 +00:00
										 |  |  |     public function conferencesAllFormatted($from_time, $until_time) { | 
					
						
							| 
									
										
										
										
											2024-07-04 10:57:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // time period drill-down
 | 
					
						
							|  |  |  |         // FIXME make it similar to the bash version
 | 
					
						
							|  |  |  |         if (empty($from_time)) { | 
					
						
							|  |  |  |             $from_time = '0000-01-01'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (empty($until_time)) { | 
					
						
							|  |  |  |             $until_time = '9999-12-31'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // this is needed for compatibility with the bash version, so we use '%s' placeholders
 | 
					
						
							|  |  |  |         $from_time = htmlspecialchars(strip_tags($from_time)); | 
					
						
							|  |  |  |         $until_time = htmlspecialchars(strip_tags($until_time)); | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  |         $sql = $this->queries['conferences_all_formatted']; | 
					
						
							| 
									
										
										
										
											2024-07-04 10:57:18 +00:00
										 |  |  |         $sql = sprintf($sql, $from_time, $until_time); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  |         $query = $this->db->prepare($sql); | 
					
						
							|  |  |  |         $query->execute(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-04 10:57:18 +00:00
										 |  |  |         return $query->fetchAll(PDO::FETCH_ASSOC); | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 08:23:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-04 09:04:27 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ?>
 |