OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
groupchat
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
b_group.php
13.6 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
b_index.php
25.61 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
back_create_group.php
9.22 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
backup
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
broadcast.php
22.48 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
create_broadcast.php
19.39 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
create_group.php
18.06 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📁
dump
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
group.php
21.38 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📁
inc
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
index.php
13.38 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
join_now.php
7.77 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
new2_index.php
17.63 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
new_index.php
17.11 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
sidebar.php
5.07 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
testing.php
3.32 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📁
trash
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
z_index.php
4.83 KB
05/19/2025 10:07:13 AM
rw-r--r--
Editing: join_now.php
Close
<? include '../inc/validate.logged.php'; include 'inc/function.php'; include 'inc/db_connect.php'; $groups = []; // Check if an AJAX request has been made if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'join') { $id = isset($_POST['id']) ? $_POST['id'] : false; $type = isset($_POST['type']) ? $_POST['type'] : false; if (!verify_group_member($conn, $type, $gUserId, $id)) { echo "You are already present in the $type!!!"; exit(); } if (($id != false) || ($type != false)) { add_members_to_the_group($conn, $type, $gUserId, $id); echo "You have successfully joined the $type!"; } exit(); } elseif (!isset($_GET['id']) || !isset($_GET['type']) || !in_array($_GET['type'], ['group', 'broadcast']) || !(verify_group_broadcast_id($conn, $_GET['type'], $_GET['id']))) { die("Error: Wrong request demanded!!"); } ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Group Chat • Knobly Cream</title> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Font Awesome CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" /> <!-- Other CSS Files --> <link rel="stylesheet" href="../inc/fontawesome/css/all.min.css" /> <link rel="stylesheet" href="../inc/magnific-popup.css" /> <link rel="stylesheet" href="../inc/style.css" /> <link rel="stylesheet" href="../inc/genai_style.css" /> <link rel="stylesheet" href="inc/style.css"> <link rel="icon" type="image/x-icon" href="/img/logo.ico"> <!-- Bootstrap JS --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <!-- Other JavaScript Files --> <script src="../inc/jquery.magnific-popup.min.js"></script> <script src="../inc/common.js"></script> <script src="../inc/genai_func.js"></script> <script src="inc/script.js"></script> </head> <body class="sb-nav-fixed"> <? include 'inc/navbar.php' ?> <div id="layoutSidenav"> <? include 'inc/sidebar.php' ?> <div id="layoutSidenav_content"> <main> <div id="panelContent" class="container-fluid"></div> <div class="chat-message"> <div class="container mt-5"> <h2>Are You sure to join the <?= ($_GET['type'] == 'group' ? "Group" : ($_GET['type'] == 'broadcast' ? "Broadcast" : '')) ?> <b><?= ($_GET['type'] == 'group' ? display_group_name($conn, $_GET['id']) : ($_GET['type'] == 'broadcast' ? display_broadcast_name($conn, $_GET['id']) : '')) ?></b>??</h2> <!-- Button to trigger the modal --> <button type="button" class="btn btn-primary" id="openModalBtn"> Join <?= ($_GET['type'] == 'group' ? "Group" : ($_GET['type'] == 'broadcast' ? "Broadcast" : '')) ?> </button> </div> <div id="redirectPage" style="display: none;"> </div> <!-- Bootstrap Modal --> <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="confirmModalLabel">Join <?= ($_GET['type'] == 'group' ? "Group" : ($_GET['type'] == 'broadcast' ? "Broadcast" : '')) ?></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> Are you sure you want to join this <?= ($_GET['type'] == 'group' ? "Group" : ($_GET['type'] == 'broadcast' ? "Broadcast" : '')) ?>? </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-primary" id="confirmBtn">Confirm</button> </div> </div> </div> </div> </div> </main> <footer class="py-2 bg-light"> <div class="container-fluid"> <div class="text-muted text-right small">© <?= date('Y') ?>, Knobly Consulting</div> </div> </footer> </div> </div> <script> $(document).ready(function() { var id = <?= isset($_GET['id']) ? $_GET['id'] : 0 ?>; var type = "<?= isset($_GET['type']) ? $_GET['type'] : '' ?>"; var user_id = <?= $gUserId ?>; var user_name = "<?= $gUserName ?>"; var htmldoc = ''; jQuery.noConflict(); // Show the modal when the "Join Group" button is clicked $(window).on('load', function() { $('#confirmModal').modal('show'); }); $('#openModalBtn').on('click', function() { $('#confirmModal').modal('show'); }); // Handle the confirmation button click $('#confirmBtn').on('click', function() { // Perform an AJAX request to the server $.ajax({ url: '', // URL of the current file type: 'POST', data: { action: 'join', type: type, // type: "group", id: id }, success: function(response) { // Display the server's response alert(response); // Optionally, you can close the modal here $('#confirmModal').modal('hide'); if (response == 'You are already present in the ' + type + '!!!' || response == 'You have successfully joined the ' + type + '!') { $('#redirectPage').show(); if (type == 'group') { htmldoc = `<button class="btn btn-primary" onclick="groupDisplay(${user_id}, ${id})">Go to the Group</button>`; $('#redirectPage').html(htmldoc); } else if (type == 'broadcast') { var htmldoc = `<button class="btn btn-primary" onclick="broadcastDisplay(${user_id}, ${id})">Go to the Broadcast</button>`; $('#redirectPage').html(htmldoc); } } }, error: function() { alert('An error occurred. Please try again.'); } }); }); }); </script> </body> </html>