Cleans up style

main
Yasen Pramatarov 2024-09-06 19:34:03 +03:00
parent 2d4205916b
commit d64fc5cf56
11 changed files with 43 additions and 45 deletions

View File

@ -57,19 +57,19 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
switch ($action) { switch ($action) {
case 'add': case 'add':
include('../app/templates/agent-add.php'); include '../app/templates/agent-add.php';
break; break;
case 'edit': case 'edit':
$agentDetails = $agentObject->getAgentDetails($platform_id, $agent); $agentDetails = $agentObject->getAgentDetails($platform_id, $agent);
include('../app/templates/agent-edit.php'); include '../app/templates/agent-edit.php';
break; break;
case 'delete': case 'delete':
$agentDetails = $agentObject->getAgentDetails($platform_id, $agent); $agentDetails = $agentObject->getAgentDetails($platform_id, $agent);
include('../app/templates/agent-delete.php'); include '../app/templates/agent-delete.php';
break; break;
default: default:
$agentDetails = $agentObject->getAgentDetails($platform_id); $agentDetails = $agentObject->getAgentDetails($platform_id);
include('../app/templates/agent-list.php'); include '../app/templates/agent-list.php';
} }
} }

View File

@ -29,10 +29,10 @@ if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') {
// list of all component events (default) // list of all component events (default)
$component = new Component($db); $componentObject = new Component($db);
// prepare the result // 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)) { if (!empty($search)) {
$components = array(); $components = array();
@ -77,6 +77,6 @@ if (!empty($components['records'])) {
} }
// display the widget // display the widget
include('../app/templates/widget.php'); include '../app/templates/widget.php';
?> ?>

View File

@ -29,17 +29,17 @@ if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') {
// //
$conference = new Conference($db); $conferenceObject = new Conference($db);
// search and list specific conference ID // search and list specific conference ID
if (isset($conferenceId)) { 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 // search and list specific conference name
} elseif (isset($conferenceName)) { } elseif (isset($conferenceName)) {
$search = $conference->conferenceByName($conferenceName, $from_time, $until_time); $search = $conferenceObject->conferenceByName($conferenceName, $from_time, $until_time);
// list of all conferences (default) // list of all conferences (default)
} else { } else {
$search = $conference->conferencesAllFormatted($from_time, $until_time); $search = $conferenceObject->conferencesAllFormatted($from_time, $until_time);
} }
if (!empty($search)) { if (!empty($search)) {
@ -126,6 +126,6 @@ if (!empty($conferences['records'])) {
} }
// display the widget // display the widget
include('../app/templates/widget.php'); include '../app/templates/widget.php';
?> ?>

View File

@ -3,7 +3,7 @@
$action = $_REQUEST['action'] ?? ''; $action = $_REQUEST['action'] ?? '';
require '../app/classes/config.php'; require '../app/classes/config.php';
$configure = new Config(); $configObject = new Config();
// if a form is submitted, it's from the edit page // if a form is submitted, it's from the edit page
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['REQUEST_METHOD'] == 'POST') {
@ -70,30 +70,30 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
case 'configjs': case 'configjs':
$mode = $_REQUEST['mode'] ?? ''; $mode = $_REQUEST['mode'] ?? '';
$raw = ($mode === 'raw'); $raw = ($mode === 'raw');
$platformConfigjs = $configure->getPlatformConfigjs($platformDetails[0]['jitsi_url'], $raw); $platformConfigjs = $configObject->getPlatformConfigjs($platformDetails[0]['jitsi_url'], $raw);
include('../app/templates/config-list-configjs.php'); include '../app/templates/config-list-configjs.php';
break; break;
case 'interfaceconfigjs': case 'interfaceconfigjs':
$mode = $_REQUEST['mode'] ?? ''; $mode = $_REQUEST['mode'] ?? '';
$raw = ($mode === 'raw'); $raw = ($mode === 'raw');
$platformInterfaceConfigjs = $configure->getPlatformInterfaceConfigjs($platformDetails[0]['jitsi_url'], $raw); $platformInterfaceConfigjs = $configObject->getPlatformInterfaceConfigjs($platformDetails[0]['jitsi_url'], $raw);
include('../app/templates/config-list-interfaceconfigjs.php'); include '../app/templates/config-list-interfaceconfigjs.php';
break; break;
// if there is no $item, we work on the local config file // if there is no $item, we work on the local config file
default: default:
switch ($action) { switch ($action) {
case 'add': case 'add':
include('../app/templates/config-add-platform.php'); include '../app/templates/config-add-platform.php';
break; break;
case 'edit': case 'edit':
include('../app/templates/config-edit-platform.php'); include '../app/templates/config-edit-platform.php';
break; break;
case 'delete': case 'delete':
include('../app/templates/config-delete-platform.php'); include '../app/templates/config-delete-platform.php';
break; break;
default: default:
include('../app/templates/config-list.php'); include '../app/templates/config-list.php';
} }
} }
} }

View File

@ -14,8 +14,8 @@ $db = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform
//// ////
// monthly usage // monthly usage
$conference = new Conference($db); $conferenceObject = new Conference($db);
$participant = new Participant($db); $participantObject = new Participant($db);
// monthly conferences for the last year // monthly conferences for the last year
$fromMonth = (new DateTime())->sub(new DateInterval('P1Y')); $fromMonth = (new DateTime())->sub(new DateInterval('P1Y'));
@ -36,8 +36,8 @@ while ($fromMonth < $thisMonth) {
$from_time = $fromMonth->format('Y-m-d'); $from_time = $fromMonth->format('Y-m-d');
$until_time = $untilMonth->format('Y-m-d'); $until_time = $untilMonth->format('Y-m-d');
$searchConferenceNumber = $conference->conferenceNumber($from_time, $until_time); $searchConferenceNumber = $conferenceObject->conferenceNumber($from_time, $until_time);
$searchParticipantNumber = $participant->participantNumber($from_time, $until_time); $searchParticipantNumber = $participantObject->participantNumber($from_time, $until_time);
// pretty format for displaying the month in the widget // pretty format for displaying the month in the widget
$month = $fromMonth->format('F Y'); $month = $fromMonth->format('F Y');
@ -71,12 +71,11 @@ if (!empty($searchConferenceNumber) && !empty($searchParticipantNumber)) {
} }
// display the widget // display the widget
include('../app/templates/widget-monthly.php'); include '../app/templates/widget-monthly.php';
//// ////
// conferences in last 2 days // conferences in last 2 days
$conference = new Conference($db);
// time range limit // time range limit
$from_time = date('Y-m-d', time() - 60 * 60 * 24 * 2); $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; $time_range_specified = true;
// prepare the result // prepare the result
$search = $conference->conferencesAllFormatted($from_time, $until_time); $search = $conferenceObject->conferencesAllFormatted($from_time, $until_time);
if (!empty($search)) { if (!empty($search)) {
$conferences = array(); $conferences = array();
@ -130,12 +129,11 @@ if (!empty($conferences['records'])) {
} }
// display the widget // display the widget
include('../app/templates/widget.php'); include '../app/templates/widget.php';
//// ////
// last 10 conferences // last 10 conferences
$conference = new Conference($db);
// all time // all time
$from_time = '0000-01-01'; $from_time = '0000-01-01';
@ -145,7 +143,7 @@ $time_range_specified = false;
$conference_number = 10; $conference_number = 10;
// prepare the result // prepare the result
$search = $conference->conferencesAllFormatted($from_time, $until_time); $search = $conferenceObject->conferencesAllFormatted($from_time, $until_time);
if (!empty($search)) { if (!empty($search)) {
$conferences = array(); $conferences = array();
@ -197,6 +195,6 @@ if (!empty($conferences['records'])) {
} }
// display the widget // display the widget
include('../app/templates/widget.php'); include '../app/templates/widget.php';
?> ?>

View File

@ -10,14 +10,14 @@ try {
// connect to database // connect to database
$dbWeb = connectDB($config); $dbWeb = connectDB($config);
$user = new User($dbWeb); $userObject = new User($dbWeb);
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
$username = $_POST['username']; $username = $_POST['username'];
$password = $_POST['password']; $password = $_POST['password'];
// login successful // login successful
if ( $user->login($username, $password) ) { if ( $userObject->login($username, $password) ) {
// if remember_me is checked, max out the session // if remember_me is checked, max out the session
if (isset($_POST['remember_me'])) { if (isset($_POST['remember_me'])) {
// 30*24*60*60 = 30 days // 30*24*60*60 = 30 days

View File

@ -32,21 +32,21 @@ if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') {
// Participant listings // Participant listings
// //
$participant = new Participant($db); $participantObject = new Participant($db);
// search and list specific participant ID // search and list specific participant ID
if (isset($participantId)) { 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) // search and list specific participant name (stats_id)
} elseif (isset($participantName)) { } 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 // search and list specific participant IP
} elseif (isset($participantIp)) { } elseif (isset($participantIp)) {
$search = $participant->conferenceByParticipantIP($participantIp, $from_time, $until_time); $search = $participantObject->conferenceByParticipantIP($participantIp, $from_time, $until_time);
// list of all participants (default) // list of all participants (default)
} else { } else {
// prepare the result // prepare the result
$search = $participant->participantsAll($from_time, $until_time); $search = $participantObject->participantsAll($from_time, $until_time);
} }
if (!empty($search)) { if (!empty($search)) {
@ -135,6 +135,6 @@ if (!empty($participants['records'])) {
} }
// display the widget // display the widget
include('../app/templates/widget.php'); include '../app/templates/widget.php';
?> ?>

View File

@ -1,5 +1,5 @@
<?php <?php
include('../app/templates/widget-profile.php'); include '../app/templates/widget-profile.php';
?> ?>

View File

@ -11,14 +11,14 @@ if ($config['registration_enabled'] === true) {
// connect to database // connect to database
$dbWeb = connectDB($config); $dbWeb = connectDB($config);
$user = new User($dbWeb); $userObject = new User($dbWeb);
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
$username = $_POST['username']; $username = $_POST['username'];
$password = $_POST['password']; $password = $_POST['password'];
// redirect to login // redirect to login
if ( $user->register($username, $password) ) { if ( $userObject->register($username, $password) ) {
$_SESSION['notice'] = "Registration successful.<br />You can log in now."; $_SESSION['notice'] = "Registration successful.<br />You can log in now.";
header('Location: index.php'); header('Location: index.php');
exit(); exit();

View File

@ -8,7 +8,7 @@
<div class="card w-auto bg-light border-light card-body" style="flex-direction: row;"><?= $widget['title'] ?></div> <div class="card w-auto bg-light border-light card-body" style="flex-direction: row;"><?= $widget['title'] ?></div>
<?php } ?> <?php } ?>
<?php if ($widget['filter'] === true) { <?php if ($widget['filter'] === true) {
include('../app/templates/block-results-filter.php'); } ?> include '../app/templates/block-results-filter.php'; } ?>
<?php if ($widget['collapsible'] === true) { ?> <?php if ($widget['collapsible'] === true) { ?>
</a> </a>
<?php } ?> <?php } ?>

View File

@ -7,7 +7,7 @@
<div class="card w-auto bg-light border-light card-body" style="flex-direction: row;"><?= $widget['title'] ?></div> <div class="card w-auto bg-light border-light card-body" style="flex-direction: row;"><?= $widget['title'] ?></div>
<?php } ?> <?php } ?>
<?php if ($widget['filter'] === true) { <?php if ($widget['filter'] === true) {
include('../app/templates/block-results-filter.php'); } ?> include '../app/templates/block-results-filter.php'; } ?>
<?php if ($widget['collapsible'] === true) { ?> <?php if ($widget['collapsible'] === true) { ?>
</a> </a>
<?php } ?> <?php } ?>