X7ROOT File Manager
Current Path:
/home/u126090504/domains/oceanicabeachresort.com/public_html/admin
home
/
u126090504
/
domains
/
oceanicabeachresort.com
/
public_html
/
admin
/
📁
..
📁
assets
📄
banners.php
(9.78 KB)
📄
booking-dashboard.php
(4.93 KB)
📄
booking_status_update.php
(6.14 KB)
📄
booking_view.php
(4.04 KB)
📄
branding_settings.php
(5.93 KB)
📄
change_password.php
(3.01 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(5.64 KB)
📁
dompdf
📄
downloads.php
(4.91 KB)
📄
forgot_password.php
(5.76 KB)
📄
gallery.php
(3.08 KB)
📁
img
📁
includes
📄
index.php
(82 B)
📁
invoices
📄
login.php
(13.47 KB)
📄
logo.png
(19.29 KB)
📄
logout.php
(102 B)
📄
manage_albums.php
(10.82 KB)
📄
manage_media.php
(11.77 KB)
📄
manage_photos.php
(6.35 KB)
📄
manage_videos.php
(18.38 KB)
📄
new_password.php
(3.9 KB)
📄
notice.php
(15.52 KB)
📄
notice_error.log
(38.45 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(14.96 KB)
📄
pdf_bill_template.php
(30.69 KB)
📁
phpmailer
📄
popup.php
(14.07 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(8.34 KB)
📄
test.php
(239 B)
📄
test_pdf.php
(1.58 KB)
📄
testimonials.php
(15.15 KB)
📁
tmp
📄
update_status.php
(1.66 KB)
📄
upi_settings.php
(1.52 KB)
Editing: dashboard.php
<?php require_once '../config.php'; include 'secure_session.php'; include 'includes/auth.php'; date_default_timezone_set('Asia/Kolkata'); /* ===== DATE HELPERS ===== */ $today = date('Y-m-d'); $month = date('Y-m'); /* ===== DATE RANGE FILTER ===== */ $from = $_GET['from'] ?? ''; $to = $_GET['to'] ?? ''; $whereRange = ''; if($from && $to){ $from = mysqli_real_escape_string($conn,$from); $to = mysqli_real_escape_string($conn,$to); $whereRange = " AND DATE(created_at) BETWEEN '$from' AND '$to' "; } /* ===== BASIC REVENUE ===== */ $todayRevenue = mysqli_fetch_assoc(mysqli_query($conn," SELECT IFNULL(SUM(amount),0) total FROM bookings WHERE payment_status='Paid' AND DATE(created_at)='$today' ")); $monthRevenue = mysqli_fetch_assoc(mysqli_query($conn," SELECT IFNULL(SUM(amount),0) total FROM bookings WHERE payment_status='Paid' AND DATE_FORMAT(created_at,'%Y-%m')='$month' ")); $totalRevenue = mysqli_fetch_assoc(mysqli_query($conn," SELECT IFNULL(SUM(amount),0) total FROM bookings WHERE payment_status='Paid' ")); $paidCount = mysqli_fetch_assoc(mysqli_query($conn," SELECT COUNT(*) total FROM bookings WHERE payment_status='Paid' ")); $pendingCount = mysqli_fetch_assoc(mysqli_query($conn," SELECT COUNT(*) total FROM bookings WHERE payment_status='Pending' ")); /* ===== RANGE REVENUE ===== */ $rangeRevenue = mysqli_fetch_assoc(mysqli_query($conn," SELECT IFNULL(SUM(amount),0) total FROM bookings WHERE payment_status='Paid' $whereRange ")); /* ===== MONTHLY CHART DATA ===== */ $labels = []; $values = []; $q = mysqli_query($conn," SELECT DATE_FORMAT(created_at,'%b') m, SUM(amount) s FROM bookings WHERE payment_status='Paid' GROUP BY MONTH(created_at) ORDER BY MONTH(created_at) "); while($r=mysqli_fetch_assoc($q)){ $labels[] = $r['m']; $values[] = (float)$r['s']; } /* ===== RECENT BOOKINGS ===== */ $recentBookings = mysqli_query($conn," SELECT booking_id,name,room_type,amount,created_at FROM bookings WHERE payment_status='Paid' ORDER BY created_at DESC LIMIT 5 "); /* ===== ROOM WISE ===== */ $roomWise = mysqli_query($conn," SELECT room_type, SUM(amount) total FROM bookings WHERE payment_status='Paid' GROUP BY room_type "); include 'includes/header.php'; ?> <style> .dashboard{padding:25px} .cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; } .card{ background:#fff; padding:22px; border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.08); } .card h4{font-size:14px;color:#777;margin-bottom:6px} .card h2{font-size:26px;margin:0} .green{color:#198754} .blue{color:#0d6efd} .orange{color:#fd7e14} .red{color:#dc3545} </style> <div class="dashboard"> <h2 class="mb-3">📊 Booking Revenue Dashboard</h2> <!-- DATE FILTER --> <form method="get" class="mb-4 d-flex gap-2 flex-wrap"> <input type="date" name="from" class="form-control" style="max-width:180px" value="<?= htmlspecialchars($from) ?>"> <input type="date" name="to" class="form-control" style="max-width:180px" value="<?= htmlspecialchars($to) ?>"> <button class="btn btn-danger">Apply</button> </form> <div class="cards"> <div class="card"> <h4>Today Revenue</h4> <h2 class="green">₹<?= number_format($todayRevenue['total'],2) ?></h2> </div> <div class="card"> <h4>This Month Revenue</h4> <h2 class="blue">₹<?= number_format($monthRevenue['total'],2) ?></h2> </div> <div class="card"> <h4>Total Revenue</h4> <h2 class="orange">₹<?= number_format($totalRevenue['total'],2) ?></h2> </div> <div class="card"> <h4>Booking Status</h4> <h2 class="green"><?= (int)$paidCount['total'] ?> Paid</h2> <small class="red"><?= (int)$pendingCount['total'] ?> Pending</small> </div> <div class="card"> <h4>Selected Date Revenue</h4> <h2 class="blue">₹<?= number_format($rangeRevenue['total'],2) ?></h2> </div> </div> <!-- MONTHLY CHART --> <div class="card mt-4"> <h4>Monthly Revenue</h4> <canvas id="monthlyChart" height="90"></canvas> </div> <!-- RECENT BOOKINGS --> <div class="card mt-4"> <h4>Recent Paid Bookings</h4> <table class="table table-sm"> <tr><th>ID</th><th>Name</th><th>Room</th><th>Amount</th><th>Date</th></tr> <?php while($r=mysqli_fetch_assoc($recentBookings)){ ?> <tr> <td><?= $r['booking_id'] ?></td> <td><?= htmlspecialchars($r['name']) ?></td> <td><?= htmlspecialchars($r['room_type']) ?></td> <td>₹<?= number_format($r['amount'],2) ?></td> <td><?= date('d M Y',strtotime($r['created_at'])) ?></td> </tr> <?php } ?> </table> </div> <!-- ROOM WISE --> <div class="card mt-4"> <h4>Room-wise Revenue</h4> <?php while($r=mysqli_fetch_assoc($roomWise)){ ?> <div class="d-flex justify-content-between border-bottom py-1"> <span><?= htmlspecialchars($r['room_type']) ?></span> <strong>₹<?= number_format($r['total'],2) ?></strong> </div> <?php } ?> </div> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> new Chart(document.getElementById('monthlyChart'), { type: 'bar', data: { labels: <?= json_encode($labels) ?>, datasets: [{ data: <?= json_encode($values) ?>, backgroundColor: '#E60000', borderRadius: 8 }] }, options: { plugins:{legend:{display:false}}, scales:{y:{beginAtZero:true}} } }); </script> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder