main
Yasen Pramatarov 2024-08-22 11:59:48 +03:00
parent d854473a06
commit cd7b78a2e5
1 changed files with 8 additions and 12 deletions

View File

@ -6,7 +6,7 @@ class Component {
public function __construct($database) { public function __construct($database) {
$this->db = $database->getConnection(); $this->db = $database->getConnection();
$this->queries = include('queries.php'); // $this->queries = include('queries.php');
} }
@ -25,25 +25,21 @@ class Component {
$until_time = htmlspecialchars(strip_tags($until_time)); $until_time = htmlspecialchars(strip_tags($until_time));
// list of jitsi component events // list of jitsi component events
$sql = 'SELECT jitsi_component, loglevel, time, component_id, event_type, event_param $sql = "SELECT jitsi_component, loglevel, time, component_id, event_type, event_param
FROM FROM
jitsi_components jitsi_components
WHERE WHERE
jitsi_component = :jitsi_component jitsi_component = %s
AND AND
component_id = :component_id component_id = %s
AND AND
(time >= :from_time AND time <= :until_time) (time >= '%s 00:00:00' AND time <= '%s 23:59:59')
ORDER BY ORDER BY
time'; time";
$sql = sprintf($sql, $jitsi_component, $component_id, $from_time, $until_time);
$query = $this->db->prepare($sql); $query = $this->db->prepare($sql);
$query->execute([ $query->execute();
':jitsi_component' => $jitsi_component,
':component_id' => $component_id,
':from_time' => $from_time . ' 00:00:00',
':until_time' => $until_time . ' 23:59:59',
]);
return $query->fetchAll(PDO::FETCH_ASSOC); return $query->fetchAll(PDO::FETCH_ASSOC);
} }