From d64fc5cf56ed4361b3ab3bcab942082c8580a094 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 6 Sep 2024 19:34:03 +0300 Subject: [PATCH] Cleans up style --- app/pages/agents.php | 8 ++++---- app/pages/components.php | 6 +++--- app/pages/conferences.php | 10 +++++----- app/pages/config.php | 18 +++++++++--------- app/pages/front.php | 20 +++++++++----------- app/pages/login.php | 4 ++-- app/pages/participants.php | 12 ++++++------ app/pages/profile.php | 2 +- app/pages/register.php | 4 ++-- app/templates/widget-monthly.php | 2 +- app/templates/widget.php | 2 +- 11 files changed, 43 insertions(+), 45 deletions(-) diff --git a/app/pages/agents.php b/app/pages/agents.php index a9706e7..6a4bb2e 100644 --- a/app/pages/agents.php +++ b/app/pages/agents.php @@ -57,19 +57,19 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { switch ($action) { case 'add': - include('../app/templates/agent-add.php'); + include '../app/templates/agent-add.php'; break; case 'edit': $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); - include('../app/templates/agent-edit.php'); + include '../app/templates/agent-edit.php'; break; case 'delete': $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); - include('../app/templates/agent-delete.php'); + include '../app/templates/agent-delete.php'; break; default: $agentDetails = $agentObject->getAgentDetails($platform_id); - include('../app/templates/agent-list.php'); + include '../app/templates/agent-list.php'; } } diff --git a/app/pages/components.php b/app/pages/components.php index 40b1369..bcad820 100644 --- a/app/pages/components.php +++ b/app/pages/components.php @@ -29,10 +29,10 @@ if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') { // list of all component events (default) -$component = new Component($db); +$componentObject = new Component($db); // prepare the result -$search = $component->jitsiComponents($jitsi_component, $component_id, $from_time, $until_time); +$search = $componentObject->jitsiComponents($jitsi_component, $component_id, $from_time, $until_time); if (!empty($search)) { $components = array(); @@ -77,6 +77,6 @@ if (!empty($components['records'])) { } // display the widget -include('../app/templates/widget.php'); +include '../app/templates/widget.php'; ?> diff --git a/app/pages/conferences.php b/app/pages/conferences.php index 5342d09..6630927 100644 --- a/app/pages/conferences.php +++ b/app/pages/conferences.php @@ -29,17 +29,17 @@ if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { // -$conference = new Conference($db); +$conferenceObject = new Conference($db); // search and list specific conference ID if (isset($conferenceId)) { - $search = $conference->conferenceById($conferenceId, $from_time, $until_time); + $search = $conferenceObject->conferenceById($conferenceId, $from_time, $until_time); // search and list specific conference name } elseif (isset($conferenceName)) { - $search = $conference->conferenceByName($conferenceName, $from_time, $until_time); + $search = $conferenceObject->conferenceByName($conferenceName, $from_time, $until_time); // list of all conferences (default) } else { - $search = $conference->conferencesAllFormatted($from_time, $until_time); + $search = $conferenceObject->conferencesAllFormatted($from_time, $until_time); } if (!empty($search)) { @@ -126,6 +126,6 @@ if (!empty($conferences['records'])) { } // display the widget -include('../app/templates/widget.php'); +include '../app/templates/widget.php'; ?> diff --git a/app/pages/config.php b/app/pages/config.php index 2d2d989..4262924 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -3,7 +3,7 @@ $action = $_REQUEST['action'] ?? ''; require '../app/classes/config.php'; -$configure = new Config(); +$configObject = new Config(); // if a form is submitted, it's from the edit page if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -70,30 +70,30 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { case 'configjs': $mode = $_REQUEST['mode'] ?? ''; $raw = ($mode === 'raw'); - $platformConfigjs = $configure->getPlatformConfigjs($platformDetails[0]['jitsi_url'], $raw); - include('../app/templates/config-list-configjs.php'); + $platformConfigjs = $configObject->getPlatformConfigjs($platformDetails[0]['jitsi_url'], $raw); + include '../app/templates/config-list-configjs.php'; break; case 'interfaceconfigjs': $mode = $_REQUEST['mode'] ?? ''; $raw = ($mode === 'raw'); - $platformInterfaceConfigjs = $configure->getPlatformInterfaceConfigjs($platformDetails[0]['jitsi_url'], $raw); - include('../app/templates/config-list-interfaceconfigjs.php'); + $platformInterfaceConfigjs = $configObject->getPlatformInterfaceConfigjs($platformDetails[0]['jitsi_url'], $raw); + include '../app/templates/config-list-interfaceconfigjs.php'; break; // if there is no $item, we work on the local config file default: switch ($action) { case 'add': - include('../app/templates/config-add-platform.php'); + include '../app/templates/config-add-platform.php'; break; case 'edit': - include('../app/templates/config-edit-platform.php'); + include '../app/templates/config-edit-platform.php'; break; case 'delete': - include('../app/templates/config-delete-platform.php'); + include '../app/templates/config-delete-platform.php'; break; default: - include('../app/templates/config-list.php'); + include '../app/templates/config-list.php'; } } } diff --git a/app/pages/front.php b/app/pages/front.php index 5a4ed8f..f774117 100644 --- a/app/pages/front.php +++ b/app/pages/front.php @@ -14,8 +14,8 @@ $db = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform //// // monthly usage -$conference = new Conference($db); -$participant = new Participant($db); +$conferenceObject = new Conference($db); +$participantObject = new Participant($db); // monthly conferences for the last year $fromMonth = (new DateTime())->sub(new DateInterval('P1Y')); @@ -36,8 +36,8 @@ while ($fromMonth < $thisMonth) { $from_time = $fromMonth->format('Y-m-d'); $until_time = $untilMonth->format('Y-m-d'); - $searchConferenceNumber = $conference->conferenceNumber($from_time, $until_time); - $searchParticipantNumber = $participant->participantNumber($from_time, $until_time); + $searchConferenceNumber = $conferenceObject->conferenceNumber($from_time, $until_time); + $searchParticipantNumber = $participantObject->participantNumber($from_time, $until_time); // pretty format for displaying the month in the widget $month = $fromMonth->format('F Y'); @@ -71,12 +71,11 @@ if (!empty($searchConferenceNumber) && !empty($searchParticipantNumber)) { } // display the widget -include('../app/templates/widget-monthly.php'); +include '../app/templates/widget-monthly.php'; //// // conferences in last 2 days -$conference = new Conference($db); // time range limit $from_time = date('Y-m-d', time() - 60 * 60 * 24 * 2); @@ -84,7 +83,7 @@ $until_time = date('Y-m-d', time()); $time_range_specified = true; // prepare the result -$search = $conference->conferencesAllFormatted($from_time, $until_time); +$search = $conferenceObject->conferencesAllFormatted($from_time, $until_time); if (!empty($search)) { $conferences = array(); @@ -130,12 +129,11 @@ if (!empty($conferences['records'])) { } // display the widget -include('../app/templates/widget.php'); +include '../app/templates/widget.php'; //// // last 10 conferences -$conference = new Conference($db); // all time $from_time = '0000-01-01'; @@ -145,7 +143,7 @@ $time_range_specified = false; $conference_number = 10; // prepare the result -$search = $conference->conferencesAllFormatted($from_time, $until_time); +$search = $conferenceObject->conferencesAllFormatted($from_time, $until_time); if (!empty($search)) { $conferences = array(); @@ -197,6 +195,6 @@ if (!empty($conferences['records'])) { } // display the widget -include('../app/templates/widget.php'); +include '../app/templates/widget.php'; ?> diff --git a/app/pages/login.php b/app/pages/login.php index 618d733..ebb34f0 100644 --- a/app/pages/login.php +++ b/app/pages/login.php @@ -10,14 +10,14 @@ try { // connect to database $dbWeb = connectDB($config); - $user = new User($dbWeb); + $userObject = new User($dbWeb); if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $username = $_POST['username']; $password = $_POST['password']; // login successful - if ( $user->login($username, $password) ) { + if ( $userObject->login($username, $password) ) { // if remember_me is checked, max out the session if (isset($_POST['remember_me'])) { // 30*24*60*60 = 30 days diff --git a/app/pages/participants.php b/app/pages/participants.php index a9495b4..fcc0f5a 100644 --- a/app/pages/participants.php +++ b/app/pages/participants.php @@ -32,21 +32,21 @@ if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { // Participant listings // -$participant = new Participant($db); +$participantObject = new Participant($db); // search and list specific participant ID if (isset($participantId)) { - $search = $participant->conferenceByParticipantId($participantId, $from_time, $until_time, $participantId, $from_time, $until_time); + $search = $participantObject->conferenceByParticipantId($participantId, $from_time, $until_time, $participantId, $from_time, $until_time); // search and list specific participant name (stats_id) } elseif (isset($participantName)) { - $search = $participant->conferenceByParticipantName($participantName, $from_time, $until_time); + $search = $participantObject->conferenceByParticipantName($participantName, $from_time, $until_time); // search and list specific participant IP } elseif (isset($participantIp)) { - $search = $participant->conferenceByParticipantIP($participantIp, $from_time, $until_time); + $search = $participantObject->conferenceByParticipantIP($participantIp, $from_time, $until_time); // list of all participants (default) } else { // prepare the result - $search = $participant->participantsAll($from_time, $until_time); + $search = $participantObject->participantsAll($from_time, $until_time); } if (!empty($search)) { @@ -135,6 +135,6 @@ if (!empty($participants['records'])) { } // display the widget -include('../app/templates/widget.php'); +include '../app/templates/widget.php'; ?> diff --git a/app/pages/profile.php b/app/pages/profile.php index 09a67af..0d6fc33 100644 --- a/app/pages/profile.php +++ b/app/pages/profile.php @@ -1,5 +1,5 @@ diff --git a/app/pages/register.php b/app/pages/register.php index ccd83ab..a07575b 100644 --- a/app/pages/register.php +++ b/app/pages/register.php @@ -11,14 +11,14 @@ if ($config['registration_enabled'] === true) { // connect to database $dbWeb = connectDB($config); - $user = new User($dbWeb); + $userObject = new User($dbWeb); if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $username = $_POST['username']; $password = $_POST['password']; // redirect to login - if ( $user->register($username, $password) ) { + if ( $userObject->register($username, $password) ) { $_SESSION['notice'] = "Registration successful.
You can log in now."; header('Location: index.php'); exit(); diff --git a/app/templates/widget-monthly.php b/app/templates/widget-monthly.php index c105046..624941e 100644 --- a/app/templates/widget-monthly.php +++ b/app/templates/widget-monthly.php @@ -8,7 +8,7 @@
+ include '../app/templates/block-results-filter.php'; } ?> diff --git a/app/templates/widget.php b/app/templates/widget.php index 2c748a0..8e2fe8f 100644 --- a/app/templates/widget.php +++ b/app/templates/widget.php @@ -7,7 +7,7 @@
+ include '../app/templates/block-results-filter.php'; } ?>