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: analytics.php
Close
<!doctype html> <? require_once 'assets/php/validate.logged.php'; require_once 'assets/php/function.php'; include 'inc/config.php'; include 'inc/function.php'; $location = json_decode(find_ipgeo_location(), true); $res = trim($location['City'] . ($location['City'] && $location['Country'] ? ", " : "") . $location['Country']); $act = ''; if (!empty($_POST)) $act = isset($_POST["act"]) ? $_POST["act"] : ''; // Show Blast Details if ($act == 'showBlastDetails') { $blastId = isset($_POST['id']) ? $_POST['id'] : ''; $sql = "SELECT send_grid_key FROM user WHERE id=$gUserId"; $result = mysqli_query($db, $sql); $row = mysqli_fetch_assoc($result); $userSendGridKey = $row['send_grid_key']; $apiURL = "https://api.sendgrid.com/v3/marketing/stats/singlesends/$blastId?group_by=ab_variation&aggregated_by=total"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $apiURL, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HTTPHEADER => array( "authorization: Bearer $userSendGridKey" ), )); $response = curl_exec($curl); curl_close($curl); $arrStats = json_decode($response, true); $arrStatsClicks = $arrStats['results'][0]['stats']['clicks']; $arrStatsUniqueClicks = $arrStats['results'][0]['stats']['unique_clicks']; $arrStatsDelivered = $arrStats['results'][0]['stats']['delivered']; $arrStatsInvalidEmails = $arrStats['results'][0]['stats']['invalid_emails']; $arrStatsOpens = $arrStats['results'][0]['stats']['opens']; $arrStatsUniqueOpens = $arrStats['results'][0]['stats']['unique_opens']; $arrStatsUnsubscribes = $arrStats['results'][0]['stats']['unsubscribes']; ?> <div class="popup" style="max-width:600px"> <div class="widget"> <div class="card"> <div class="card-header bg-dark"> <h5 class="mb-0 text-light">Newsletter Details</h5> <span class="close">×</span> </div> </div> <div id="widget_B" style="padding:15px 25px; max-height:calc(100vh - 200px);overflow-y:auto;"> <table class="table table-striped"> <tr> <td>Delivered</td> <td><?= $arrStatsDelivered ?></td> </tr> <tr> <td>Unique Opens</td> <td><?= $arrStatsUniqueOpens ?></td> </tr> <tr> <td>Unique Clicks</td> <td><?= $arrStatsUniqueClicks ?></td> </tr> <tr> <td>Unsubscribes</td> <td><?= $arrStatsUnsubscribes ?></td> </tr> </table> </div> </div> </div> <? } // Show Article Details if ($act == 'showArticleDetails') { $postId = isset($_POST['id']) ? $_POST['id'] : ''; ?> <div class="popup" style="max-width:600px"> <div class="widget"> <div class="card"> <div class="card-header bg-dark"> <h5 class="mb-0 text-light">Article Details</h5> <span class="close">×</span> </div> </div> <div id="widget_B" style="padding:15px 25px; max-height:calc(100vh - 200px);overflow-y:auto;"> <? if ($gUserPlan == 0) { echo '<div class="alert alert-success" role="alert">This feature is only available in <b>Pro</b> plan! Go to My Account to upgrade.</div>'; } else { ?> <table class="table table-striped"> <thead> <tr> <th>Country</th> <th class="text-center">Total Views</th> <th>View Breakdown</th> </tr> </thead> <tbody> <? $sql = "SELECT count(article_id) AS totalVisits,visit_country FROM metrics WHERE article_id=$postId GROUP BY visit_country ORDER BY visit_country"; $result = mysqli_query($db, $sql); while ($row = mysqli_fetch_assoc($result)) { $visitCountry = $row['visit_country']; $visitCountryCount = $row['totalVisits']; ?> <tr> <td><?= $visitCountry ?></td> <td align="center"><?= $visitCountryCount ?></td> <td> <? $sql = "SELECT count(article_id) AS totalVisits,visit_city FROM metrics WHERE article_id=$postId AND visit_country='$visitCountry' GROUP BY visit_city ORDER BY visit_city"; $resultInner = mysqli_query($db, $sql); while ($rowInner = mysqli_fetch_assoc($resultInner)) { $visitCity = $rowInner['visit_city']; $visitCityCount = $rowInner['totalVisits']; if ($visitCity == '') $visitCity = 'Unknown'; ?> <?= $visitCity ?> - <?= $visitCityCount ?><br> <? } ?> </td> </tr> <? } ?> </tbody> </table> <? } ?> </div> </div> </div> <? } // Show Article Leads if ($act == 'showArticleLeads') { $postId = isset($_POST['id']) ? $_POST['id'] : ''; ?> <div class="popup" style="max-width:900px"> <div class="widget"> <div class="card"> <div class="card-header bg-dark"> <h5 class="mb-0 text-light">Article Lead Details</h5> <span class="close">×</span> </div> </div> <div id="widget_B" style="padding:15px 25px; max-height:calc(100vh - 200px);overflow-y:auto;"> <table class="table table-striped"> <thead> <tr> <th width="20">#</th> <th>Name</th> <th>Company</th> <th>Email</th> <th>Mobile</th> <th>Date</th> </tr> </thead> <tbody> <? $sql = "SELECT * FROM user_collection_lead WHERE article_id=$postId ORDER BY date_created DESC"; $result = mysqli_query($db, $sql); $i = 1; while ($row = mysqli_fetch_assoc($result)) { $leadName = $row['full_name']; $leadCompany = $row['company']; $leadEmail = $row['email']; $leadMobile = $row['mobile']; $leadDate = $row['date_created']; $leadDate = date('M d, Y', strtotime($leadDate)); ?> <tr> <td><?= $i ?>.</td> <td><?= $leadName ?></td> <td><?= $leadCompany ?></td> <td><?= $leadEmail ?></td> <td><?= $leadMobile ?></td> <td><?= $leadDate ?></td> </tr> <? $i += 1; } ?> </tbody> </table> </div> </div> </div> <? } // Cream: Analytics if ($act == '') { ?> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Analytics | Knobly Reader</title> <!-- jQuery --> <script src="assets/js/jquery-3.6.0.min.js"></script> <!-- Magnific Popup --> <script src="assets/js/jquery.magnific-popup.min.js"></script> <!-- Bootstrap, Font Awesome, etc. --> <link rel="stylesheet" href="assets/css/all.min.6.6.css"> <link rel="stylesheet" href="assets/css/all.min.5.15.css"> <link rel="stylesheet" href="assets/css/bootstrap.min.4.5.0.css" > <!-- <link rel="stylesheet" href="inc/magnific-popup.css" /> --> <!-- Custom CSS --> <link rel="stylesheet" href="assets/css/styles.css" /> <!-- <link rel="stylesheet" href="inc/genai_style.css" /> --> <!-- Scripts --> <script src="assets/js/bootstrap.min.4.5.js" ></script> <script src="assets/js/Chart.min.2.8.js" crossorigin="anonymous"></script> <!-- <script src="inc/common.js"></script> --> <!-- <script src="inc/genai_func.js"></script> --> <style> tbody td { color: var(--text-color-light); text-decoration: none; background-color: transparent; } thead th { color: var(--text-color-light); text-decoration: none; background-color: transparent; } a { color: var(--text-color-light); text-decoration: none; background-color: transparent; } .newsroll-dropdown { border: none; outline: none; position: relative; display: inline-block; /* display: flex; */ align-items: center; padding-left: 8px; /* border: none; */ padding-bottom: 8px; } .newsroll-dropbtn { border: none; color: rgba(255, 255, 255, 0.5); background-color: #212529; } .newsroll-dropbtn:focus { border: none; outline: none; } .newsroll-dropdown-content { display: none; outline: none; position: relative; background-color: #212529; min-width: 160px; /* box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); */ /* z-index: 1; */ } .newsroll-dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; } .show { display: block; } /* .light-mode .footer { background-color: var(--footer-bg-light) !important; color: #333; } */ /* .nav-item .nav-link{ background-color: #fff; color: #212529; } */ .footer { text-align: center; padding: 20px; background-color: var(--footer-bg-dark) !important; color: #777; position: fixed; bottom: 0; width: 100%; } .breadcrumb { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; padding: .75rem 1rem; margin-bottom: 1rem; list-style: none; background-color: transparent !important; border-radius: .25rem; } @media screen and (min-width:768px) { .container-fluid, .container-lg, .container-md, .container-sm, .container-xl { width: 85% !important; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } } #panelContent { margin-bottom: 60px; } /* Fullscreen blurred background */ .blur-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); /* Dark overlay */ backdrop-filter: blur(8px); /* Blur effect */ z-index: 998; } /* Centered popup card */ .popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Shadow for a card-like look */ max-width: 600px; width: 90%; /* Responsive width */ z-index: 999; overflow: hidden; } /* Card styling */ .card-header { background-color: #343a40; /* Dark header */ color: #fff; padding: 15px; font-size: 18px; border-top-left-radius: 10px; border-top-right-radius: 10px; justify-content: space-between; display: flex; } .card { margin: 0; padding: 0; border: none; } /* Content area styling */ #widget_B { padding: 15px 20px; max-height: calc(100vh - 200px); overflow-y: auto; font-size: 14px; background: #f8f9fa; /* Light background */ } /* Table styling */ table.table { margin: 0; width: 100%; border-collapse: collapse; } /* table.table th, table.table td { padding: 10px; border: 1px solid #dee2e6; text-align: left; vertical-align: top; color: black; } */ table.table th { background-color: #e9ecef; font-weight: bold; } .close { float: right; font-size: 1.5rem; font-weight: 700; line-height: 1; text-shadow: 0 1px 0 #000; opacity: .5; color: #fff !important; cursor: pointer; } .close:hover { color: #fff !important; } @media screen and (max-width:540px) { .tab-content { overflow-x: scroll; } } /* Container Padding */ @media screen and (max-width: 768px) { .container-fluid { padding: 40px 0 !important; max-width: 1400px; margin: 0 auto; } } </style> </head> <style> .sideWithMainContainer { display: flex; flex-direction: row; gap: 10px; overflow-x: hidden; } .sideMaincontent { height: 85vh; overflow-y: scroll; padding: 30px 0; } @media (min-width: 768px) { .col-md-2 { padding: 0px !important; } } @media (max-width: 768px) { .col-md-2 { display: none !important; } } </style> <body class="sb-nav-fixed"> <?php include 'assets/php/social_navbar.php' ?> <div class="sideWithMainContainer"> <div class="col-md-2"> <? include 'assets/php/sidebar.php' ?> </div> <main class="col-sm-12 col-md-10 sideMaincontent"> <div id="panelContent" class="container-fluid"> <ol class="breadcrumb my-3"> <li class="breadcrumb-item"> <h4 class="m-0">Month-wise Analytics</h4> </li> </ol> <!-- Include Chart.js --> <script src="assets/js/Chart.js"></script> <?php $sql = "SELECT DATE_FORMAT(A.date_visited, '%Y-%m') AS month, COUNT(A.article_id) AS totalVisits FROM metrics A INNER JOIN user_collection B ON A.article_id = B.id AND B.user_id = $gUserId WHERE A.date_visited >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY DATE_FORMAT(A.date_visited, '%Y-%m') ORDER BY month ASC;"; $result = $db->query($sql); $labels = []; $data = []; while ($row = $result->fetch_assoc()) { $labels[] = $row['month']; $data[] = $row['totalVisits']; } ?> <!-- Canvas for Chart --> <canvas id="visitsChart"></canvas> <script> // PHP data to JavaScript const labels = <?php echo json_encode($labels); ?>; const data = <?php echo json_encode($data, JSON_NUMERIC_CHECK); ?>; // Ensures numeric values are correctly parsed // Chart.js Line Graph const ctx = document.getElementById('visitsChart').getContext('2d'); new Chart(ctx, { type: 'line', data: { labels: labels, // X-axis: Months datasets: [{ label: 'Total Visits', data: data, // Y-axis: No. of Visits borderColor: 'blue', borderWidth: 2, fill: false, tension: 0.4 // Smooth curve effect }] }, options: { responsive: true, scales: { x: { title: { display: true, text: 'Month' } }, y: { title: { display: true, text: 'Total Visits' }, beginAtZero: true } } } }); </script> <ol class="breadcrumb my-3"> <li class="breadcrumb-item"> <h4 class="m-0">Analytics</h4> </li> </ol> <div class="row mb-4"> <div class="col"> <ul class="nav nav-tabs mb-4"> <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#articles" role="tab">Top Visited Articles</a></li> <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#lead" role="tab">Article Leads</a></li> <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#newsletter" role="tab">Sent Newsletters</a></li> </ul> <div class="tab-content my-3"> <div class="tab-pane fade show active" id="articles" role="tabpanel"> <? $sql = "SELECT B.id,B.title,count(A.article_id) AS totalVisits FROM metrics A INNER JOIN user_collection B ON (A.article_id=B.id AND B.user_id=$gUserId) GROUP BY B.url,B.id ORDER BY totalVisits DESC"; $result = mysqli_query($db, $sql); $numRows = mysqli_num_rows($result); if ($numRows == 0) { echo '<div class="px-3">No articles to show!</div>'; } else { ?> <table class="table table-striped"> <thead> <tr> <th width="20">#</th> <th>Title</th> <th>Views</th> <th></th> </tr> </thead> <tbody> <? $i = 1; while ($row = mysqli_fetch_assoc($result)) { $topArticleId = $row['id']; $topArticleTitle = $row['title']; $topArticleVisit = $row['totalVisits']; ?> <tr> <td><?= $i ?>.</td> <td><a href="view/<?= $topArticleId ?>/<?= createArticleURL($topArticleTitle) ?>" target="_blank"><?= $topArticleTitle ?></a></td> <td><?= $topArticleVisit ?></td> <td align="right"><a href="#" title="View Details"><i data-id="<?= $topArticleId ?>" class="viewRowA far fa-chart-bar fa-lg text-muted"></i></a></td> </tr> <? $i += 1; } ?> </tbody> </table> <? } ?> </div> <div class="tab-pane fade" id="lead" role="tabpanel"> <? if ($gUserPlan == 0) { echo '<div class="alert alert-success" role="alert">This feature is only available in <b>Pro</b> plan! Go to My Account to upgrade.</div>'; } else { $sql = "SELECT B.id,B.title,count(A.article_id) AS totalLeads FROM user_collection_lead A INNER JOIN user_collection B ON (A.article_id=B.id AND B.user_id=$gUserId) GROUP BY B.url,B.id ORDER BY totalLeads DESC LIMIT 25"; $result = mysqli_query($db, $sql); $numRows = mysqli_num_rows($result); if ($numRows == 0) { echo '<div class="px-3">No article leads to show!</div>'; } else { ?> <table class="table table-striped"> <thead> <tr> <th width="20">#</th> <th>Title</th> <th>Leads</th> <th></th> </tr> </thead> <tbody> <? $i = 1; while ($row = mysqli_fetch_assoc($result)) { $topArticleId = $row['id']; $topArticleTitle = $row['title']; $topArticleLead = $row['totalLeads']; ?> <tr> <td><?= $i ?>.</td> <td><a href="view/<?= $topArticleId ?>/<?= createArticleURL($topArticleTitle) ?>" target="_blank"><?= $topArticleTitle ?></a></td> <td><?= $topArticleLead ?></td> <td align="right"><a href="#" title="View Details"><i data-id="<?= $topArticleId ?>" class="viewRowL far fa-chart-bar fa-lg text-muted"></i></a></td> </tr> <? $i += 1; } ?> </tbody> </table> <? } } ?> </div> <div class="tab-pane fade" id="newsletter" role="tabpanel"> <? if ($gUserPlan == 0) { echo '<div class="alert alert-success" role="alert">This feature is only available in <b>Pro</b> plan! Go to My Account to upgrade.</div>'; } else { $sql = "SELECT A.newsletter_id,A.blast_provider,A.blast_subject,A.blast_id,A.date_created FROM user_blast A INNER JOIN user_newsletter B ON A.newsletter_id=B.id AND B.user_id=$gUserId"; $result = mysqli_query($db, $sql); $numRows = mysqli_num_rows($result); if ($numRows == 0) { echo '<div class="px-3">No newsletters sent!</div>'; } else { ?> <table class="table table-striped"> <thead> <tr> <th width="20">#</th> <th>Provider</th> <th>Subject</th> <th>Date Sent</th> <th></th> </tr> </thead> <tbody> <? $i = 1; while ($row = mysqli_fetch_assoc($result)) { $newsletterId = $row['newsletter_id']; $blastId = $row['blast_id']; $blastProvider = $row['blast_provider']; $blastSubject = $row['blast_subject']; $blastDate = $row['date_created']; $blastDate = date('M d, Y', strtotime($blastDate)); ?> <tr> <td><?= $i ?>.</td> <td><?= $blastProvider ?></td> <td><a href="newsletter.php?id=<?= $newsletterId ?>" target="_blank"><?= $blastSubject ?></a></td> <td><?= $blastDate ?></td> <td align="right"><a href="#" title="View Details"><i data-id="<?= $blastId ?>" class="viewRowN far fa-chart-bar fa-lg text-muted"></i></a></td> </tr> <? $i += 1; } ?> </tbody> </table> <? } } ?> </div> </div> </div> </div> <div id="analyticsModal" class="modal"> <div class="modal-content"> <!-- AJAX content will be injected here --> </div> </div> <script type="text/javascript"> $(function() { // Function to open the modal and load content via AJAX function openModal(content) { var modal = $('#analyticsModal'); // Assuming you have a modal with the ID 'analyticsModal' modal.find('.modal-content').html(content); // Place the content in the modal modal.show(); // Show the modal } // Function to close the modal function closeModal() { $('#analyticsModal').hide(); // Hide the modal } // Handler for 'viewRowA' elements $('.viewRowA').on('click', function() { var postData = { act: 'showArticleDetails', id: $(this).data('id') // Get the ID from the data attribute }; $.ajax({ type: 'POST', url: '', data: postData, success: function(response) { openModal(response); // Open the modal with the AJAX response content }, error: function() { alert('Error loading content'); } }); }); // Handler for 'viewRowL' elements $('.viewRowL').on('click', function() { var postData = { act: 'showArticleLeads', id: $(this).data('id') // Get the ID from the data attribute }; $.ajax({ type: 'POST', url: '', data: postData, success: function(response) { openModal(response); // Open the modal with the AJAX response content }, error: function() { alert('Error loading content'); } }); }); // Handler for 'viewRowN' elements $('.viewRowN').on('click', function() { var postData = { act: 'showBlastDetails', id: $(this).data('id') // Get the ID from the data attribute }; $.ajax({ type: 'POST', url: '', data: postData, success: function(response) { openModal(response); // Open the modal with the AJAX response content }, error: function() { alert('Error loading content'); } }); }); // Close modal when clicking outside the modal content (optional) $(document).on('click', function(e) { if ($(e.target).closest('.modal-content').length === 0) { closeModal(); } }); // Close modal when clicking the close button inside modal (optional) $('#analyticsModal .close').on('click', function() { console.log('Closing modal...'); closeModal(); }); $(document).on('click', '#analyticsModal .close', function() { console.log('Modal close button clicked.'); closeModal(); }); }); </script> </div> </main> </div> <? include 'assets/php/bottom_navbar.php' ?> </body> <script> function newsrollToggleDropdown() { var dropdownContent = document.getElementById("newsrollDropdown"); dropdownContent.classList.toggle("show"); } // Close the dropdown if the user clicks outside of it window.onclick = function(event) { if (!event.target.matches('.newsroll-dropbtn')) { var dropdowns = document.getElementsByClassName("newsroll-dropdown-content"); for (var i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains('show')) { openDropdown.classList.remove('show'); } } } } </script> </html> <? } ?>