OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
.htaccess
860 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
.vscode
-
03/26/2025 03:47:57 AM
rwxr-xr-x
📁
CreateLeadPage
-
03/26/2025 04:16:47 AM
rwxr-xr-x
📄
ImageMagick-7.1.1-45-Q16-HDRI-x64-dll.exe
22.2 MB
03/26/2025 03:47:54 AM
rw-r--r--
📁
Xpress
-
03/26/2025 04:21:24 AM
rwxr-xr-x
📄
XpressPage.php
47.13 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
about.html
3.26 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
account.php
47.77 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
activate.php
2.19 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
add_channel.php
9.7 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
add_to_channel.php
980 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
admin
-
03/26/2025 04:16:40 AM
rwxr-xr-x
📄
analytics.php
37.71 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
assets
-
03/26/2025 04:16:41 AM
rwxr-xr-x
📁
audio
-
03/26/2025 03:48:03 AM
rwxr-xr-x
📄
businessLp.php
46.33 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
bussLp.php
57.87 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
card-news.php
6.2 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
channel.php
36.21 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
chattest.php
8.66 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
clients
-
03/26/2025 03:48:03 AM
rwxr-xr-x
📄
collections.php
94.62 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
comments.php
1.67 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
composer.json
65 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📄
composer.lock
4.03 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
contact.html
3.01 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
cookie.php
750 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📄
copytest.html
4.04 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
creamAdmin
-
03/26/2025 04:07:42 AM
rwxr-xr-x
📄
cream_dashboard.php
25.87 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
creamapi
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
create.php
42.93 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
created_magazine.html
11.96 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
dashboard.php
55.52 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
data
-
03/26/2025 04:16:48 AM
rwxr-xr-x
📄
down.html
829 bytes
03/26/2025 03:47:46 AM
rw-r--r--
📁
education-podcasts
-
03/31/2025 06:36:42 AM
rwxr-xr-x
📁
featured_channels
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
featured_channels.php
32.48 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
featured_topics.php
26.59 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
fetch_articles.php
1.83 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
fetch_liked_users.php
1.55 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
filter.php
4.91 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
follow_action.php
1.75 KB
03/26/2025 03:47:46 AM
rw-r--r--
📄
follow_dash.php
33.76 KB
03/26/2025 03:47:46 AM
rw-r--r--
📁
form-builder
-
03/26/2025 03:48:04 AM
rwxr-xr-x
📄
function.php
20.61 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
genai
-
03/26/2025 04:20:06 AM
rwxr-xr-x
📄
generated_article.php
11.86 KB
03/26/2025 03:47:47 AM
rw-r--r--
📄
get_recent_items.php
1.37 KB
03/26/2025 03:47:47 AM
rw-r--r--
📄
handle_channel.php
856 bytes
03/26/2025 03:47:47 AM
rw-r--r--
📁
hindiConverter
-
03/26/2025 04:15:50 AM
rwxr-xr-x
📄
homePin.php
68.38 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
hps
-
03/26/2025 03:48:05 AM
rwxr-xr-x
📄
impmy_collection.php
124.17 KB
03/26/2025 03:47:47 AM
rw-r--r--
📁
inc
-
03/26/2025 04:15:50 AM
rwxr-xr-x
📄
index.php
30.55 KB
03/26/2025 03:47:48 AM
rw-r--r--
📄
index1.php
61.34 KB
03/26/2025 03:47:50 AM
rw-r--r--
📄
influencer.php
11.72 KB
03/26/2025 03:47:54 AM
rw-r--r--
📁
interface
-
03/26/2025 03:48:05 AM
rwxr-xr-x
📁
kannada
-
03/26/2025 04:20:06 AM
rwxr-xr-x
📄
knobly_logo.png
9.45 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
landing_page.php
17.27 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
landing_signin.php
5.11 KB
03/26/2025 03:47:54 AM
rw-r--r--
📁
leadpage
-
03/26/2025 04:15:53 AM
rwxr-xr-x
📄
link.php
5.63 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
logInCheck.php
4.41 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
loggedInCheck.php
1.15 KB
03/26/2025 03:47:54 AM
rw-r--r--
📄
logo (1).svg
814 bytes
03/26/2025 03:47:55 AM
rw-r--r--
📄
logout.php
503 bytes
03/26/2025 03:47:55 AM
rw-r--r--
📄
magazine.html
4.46 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
magazine.php
23.57 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
more.php
9.21 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
my_collection.php
153.03 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
my_settings.php
17.44 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
navbar.php
3.36 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
new-page.php
10.46 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
newEditor.php
17.04 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
newsletter.php
24.31 KB
03/26/2025 03:47:55 AM
rw-r--r--
📁
pageLanding
-
03/26/2025 04:20:07 AM
rwxr-xr-x
📁
pages
-
03/26/2025 04:15:53 AM
rwxr-xr-x
📄
payment.php
29.86 KB
03/26/2025 03:47:55 AM
rw-r--r--
📁
pdf
-
03/26/2025 03:48:06 AM
rwxr-xr-x
📄
pdftk_server-2.02-win-setup.exe
2.91 MB
03/26/2025 03:47:56 AM
rw-r--r--
📄
post-details.php
37.75 KB
03/26/2025 03:47:55 AM
rw-r--r--
📄
premium.php
21.79 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
privacy.html
12.1 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
process
-
03/26/2025 03:48:11 AM
rwxr-xr-x
📄
process-plan.php
1.44 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
process.php
1.52 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
process_data.php
5.02 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile.php
37.8 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile_pic_upload.php
4.83 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
profile_test.php
19.78 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
reels
-
03/26/2025 04:20:08 AM
rwxr-xr-x
📄
refund.html
9.04 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
replyPost.php
3.93 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
report
-
03/26/2025 03:48:11 AM
rwxr-xr-x
📄
request_article.php
22.76 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
reset.html
4.7 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
save_profile.php
2.78 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
saved.php
34.28 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
saved_posts.php
49.25 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
search_bar.php
16.95 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
sendy
-
03/26/2025 04:21:20 AM
rwxr-xr-x
📄
settings.php
81.93 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
sharemarket.php
3.88 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
showcase.php
10.34 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
signInProcess.php
13.83 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
signInProcess_backup.php
11.18 KB
03/26/2025 03:47:56 AM
rw-r--r--
📁
social_media
-
03/26/2025 04:16:12 AM
rwxr-xr-x
📄
start.html
3.99 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
store_articles.php
1.04 KB
03/26/2025 03:47:56 AM
rw-r--r--
📄
stream.php
62.31 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streamPush.php
29.82 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streamb.php
40.75 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
streambb.php
47.34 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
texttovoice
-
03/26/2025 03:48:13 AM
rwxr-xr-x
📁
thumbsUp
-
03/26/2025 03:48:13 AM
rwxr-xr-x
📄
toggle_channel.php
2.28 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
udupi_sign_up.php
34.5 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
uploads
-
03/26/2025 04:06:46 AM
rwxr-xr-x
📄
usage.html
37.76 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
userActivity.php
9.79 KB
03/26/2025 03:47:57 AM
rw-r--r--
📁
vendor
-
03/26/2025 04:20:23 AM
rwxr-xr-x
📄
verify.php
744 bytes
03/26/2025 03:47:57 AM
rw-r--r--
📄
view.php
13.36 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
view_newsletter.php
1.58 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
xpress_landing_page.php
78.63 KB
03/26/2025 03:47:57 AM
rw-r--r--
📄
xpress_landingpage.html
11.15 KB
03/26/2025 03:47:57 AM
rw-r--r--
Editing: userActivity.php
Close
<?php include 'assets/php/db_config.php'; // Include your DB configuration // Step 2: Handle form submission and get the selected date $date = isset($_POST['date']) ? $_POST['date'] : date('Y-m-d'); // Default to today's date if no date is selected // Define SQL queries first so they're available throughout the script // SQL query to fetch the social posts data $sql = "SELECT u.id, u.full_name, DATE(r.postedOn) AS post_date, COUNT(*) AS number_of_posts FROM reader.reader_stream r JOIN cream.user u ON r.userId = u.id WHERE DATE(r.postedOn) = ? AND r.deleteFlag=0 GROUP BY u.id, u.full_name, DATE(r.postedOn) ORDER BY number_of_posts DESC; "; // Query to fetch articles count from user_collection table $articles_sql = "SELECT u.id, COUNT(*) AS number_of_articles FROM cream.user_collection uc JOIN cream.user u ON uc.user_id = u.id WHERE DATE(uc.date_added) = ? GROUP BY u.id "; // Function to get user data - reused in both PDF and HTML sections function getUsersData($readerdb, $date, $sql, $articles_sql) { try { // Prepare the query for social posts $stmt = $readerdb->prepare($sql); $stmt->bind_param('s', $date); $stmt->execute(); $result = $stmt->get_result(); // Store results in an associative array for easy access $users_data = []; while ($row = $result->fetch_assoc()) { $users_data[$row['id']] = [ 'id' => $row['id'], 'full_name' => $row['full_name'], 'number_of_posts' => $row['number_of_posts'], 'number_of_articles' => 0 // Default to 0 ]; } // Prepare the query for articles count $articles_stmt = $readerdb->prepare($articles_sql); $articles_stmt->bind_param('s', $date); $articles_stmt->execute(); $articles_result = $articles_stmt->get_result(); // Update the users_data array with article counts while ($article_row = $articles_result->fetch_assoc()) { $user_id = $article_row['id']; // If user exists in our array, update article count if (isset($users_data[$user_id])) { $users_data[$user_id]['number_of_articles'] = $article_row['number_of_articles']; } else { // User has articles but no social posts, add them to the array $user_stmt = $readerdb->prepare("SELECT full_name FROM cream.user WHERE id = ?"); $user_stmt->bind_param('i', $user_id); $user_stmt->execute(); $user_result = $user_stmt->get_result(); $user_data = $user_result->fetch_assoc(); $users_data[$user_id] = [ 'id' => $user_id, 'full_name' => $user_data['full_name'], 'number_of_posts' => 0, // No social posts 'number_of_articles' => $article_row['number_of_articles'] ]; } } // Sort by number of posts DESC usort($users_data, function($a, $b) { return $b['number_of_posts'] - $a['number_of_posts']; }); return $users_data; } catch (mysqli_sql_exception $e) { echo "Error in SQL query: " . $e->getMessage(); exit; } } // Check if PDF download is requested if(isset($_POST['download_pdf'])) { // Alternative approach: Use TCPDF instead of FPDF for better Unicode support require_once('tcpdf/tcpdf.php'); // Get the data for PDF $users_data = getUsersData($readerdb, $date, $sql, $articles_sql); // Create new TCPDF object $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // Set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('User Analytics'); $pdf->SetTitle('User Activity Report'); $pdf->SetSubject('User Analytics Report'); // Set default header data $pdf->SetHeaderData('', 0, 'User Activity Analytics', 'Date: ' . $date); // Set header and footer fonts $pdf->setHeaderFont(Array('dejavusans', '', 12)); $pdf->setFooterFont(Array('dejavusans', '', 10)); // Set default monospaced font $pdf->SetDefaultMonospacedFont('courier'); // Set margins $pdf->SetMargins(15, 27, 15); $pdf->SetHeaderMargin(5); $pdf->SetFooterMargin(10); // Set auto page breaks $pdf->SetAutoPageBreak(TRUE, 25); // Set image scale factor $pdf->setImageScale(1.25); // Set font $pdf->SetFont('dejavusans', '', 10); // Add a page $pdf->AddPage(); // Create the table content $html = '<table border="1" cellpadding="5"> <thead> <tr style="background-color:#f2f2f2;"> <th><b>User ID</b></th> <th><b>Full Name</b></th> <th><b>Social Posts</b></th> <th><b>Articles</b></th> </tr> </thead> <tbody>'; foreach($users_data as $user) { $html .= '<tr> <td style="text-align:center;">' . $user['id'] . '</td> <td>' . $user['full_name'] . '</td> <td style="text-align:center;">' . $user['number_of_posts'] . '</td> <td style="text-align:center;">' . $user['number_of_articles'] . '</td> </tr>'; } $html .= '</tbody></table>'; // Print the HTML table $pdf->writeHTML($html, true, false, true, false, ''); // Close and output PDF document $pdf_filename = 'user_activity_' . $date . '.pdf'; $pdf->Output($pdf_filename, 'D'); exit; } // Get data for HTML display $users_data = getUsersData($readerdb, $date, $sql, $articles_sql); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>User Activity Analytics</title> <style> body { font-family: Arial, sans-serif; margin: 20px; } .container { max-width: 1200px; margin: 0 auto; } .header { text-align: center; margin-bottom: 20px; } .form-container { display: flex; justify-content: center; margin-bottom: 20px; gap: 10px; } .date-form { display: inline-block; margin-right: 10px; } .pdf-form { display: inline-block; } .btn { padding: 8px 15px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; } .btn:hover { background-color: #45a049; } .btn-pdf { background-color: #f44336; } .btn-pdf:hover { background-color: #d32f2f; } table { width: 100%; margin: 20px auto; border-collapse: collapse; } th, td { padding: 10px; text-align: center; border: 1px solid #ddd; } th { background-color: #f2f2f2; } tr:nth-child(even) { background-color: #f9f9f9; } </style> </head> <body> <div class="container"> <div class="header"> <h1>User Activity Analytics</h1> </div> <div class="form-container"> <!-- Form to select the date --> <form class="date-form" method="POST" action="userActivity.php"> <label for="date">Select Date: </label> <input type="date" id="date" name="date" value="<?php echo htmlspecialchars($date); ?>" required> <input type="submit" value="Submit" class="btn"> </form> <!-- Form to download PDF --> <!-- <form class="pdf-form" method="POST" action="daysanalytics.php"> <input type="hidden" name="date" value="<?php echo htmlspecialchars($date); ?>"> <input type="hidden" name="download_pdf" value="1"> <input type="submit" value="Download PDF" class="btn btn-pdf"> </form> --> </div> <h2 style="text-align: center;">Date: <?=htmlspecialchars($date)?></h2> <table> <thead> <tr> <th>User ID</th> <th>Full Name</th> <th>Social Posts</th> <th>Collections</th> </tr> </thead> <tbody> <?php // Loop through the results and display them foreach ($users_data as $user) { echo "<tr>"; echo "<td>" . htmlspecialchars($user['id']) . "</td>"; echo "<td>" . htmlspecialchars($user['full_name']) . "</td>"; echo "<td>" . htmlspecialchars($user['number_of_posts']) . "</td>"; echo "<td>" . htmlspecialchars($user['number_of_articles']) . "</td>"; echo "</tr>"; } ?> </tbody> </table> </div> </body> </html>