Skip to main content

admin

Glamour Beauty Salon - Admin Panel

Dashboard

Welcome to Glamour Beauty Salon Admin Panel

0, 'team_members' => 0, 'services_count' => 0, 'today_revenue' => 0 ]; // Get today's date $today = date('Y-m-d'); try { // Query 1: Count today's appointments $query1 = "SELECT COUNT(*) as count FROM appointments WHERE appointment_date = ? AND status != 'cancelled'"; $stmt1 = mysqli_prepare($conn, $query1); mysqli_stmt_bind_param($stmt1, "s", $today); mysqli_stmt_execute($stmt1); $result1 = mysqli_stmt_get_result($stmt1); if ($row1 = mysqli_fetch_assoc($result1)) { $stats['today_appointments'] = $row1['count']; } mysqli_stmt_close($stmt1); // Query 2: Count active team members $query2 = "SELECT COUNT(*) as count FROM team_members WHERE is_active = 1"; $result2 = mysqli_query($conn, $query2); if ($result2 && $row2 = mysqli_fetch_assoc($result2)) { $stats['team_members'] = $row2['count']; } // Query 3: Count active services $query3 = "SELECT COUNT(*) as count FROM services WHERE is_active = 1"; $result3 = mysqli_query($conn, $query3); if ($result3 && $row3 = mysqli_fetch_assoc($result3)) { $stats['services_count'] = $row3['count']; } // Query 4: Calculate today's revenue $query4 = "SELECT COALESCE(SUM(s.price_from), 0) as revenue FROM appointments a JOIN services s ON a.service = s.name WHERE a.appointment_date = ? AND a.status != 'cancelled'"; $stmt4 = mysqli_prepare($conn, $query4); mysqli_stmt_bind_param($stmt4, "s", $today); mysqli_stmt_execute($stmt4); $result4 = mysqli_stmt_get_result($stmt4); if ($row4 = mysqli_fetch_assoc($result4)) { $stats['today_revenue'] = number_format($row4['revenue']); } mysqli_stmt_close($stmt4); } catch (Exception $e) { error_log("Dashboard stats error: " . $e->getMessage()); } ?>

Today's Appointments

Team Members

Services

$

Revenue (Today)

Recent Appointments
0) { while ($appointment = mysqli_fetch_assoc($appointments_result)) { // Format date and time $appointment_date = date('M j, Y', strtotime($appointment['appointment_date'])); $appointment_time = date('g:i A', strtotime($appointment['appointment_time'])); // Determine badge class based on status $badge_class = ''; switch ($appointment['status']) { case 'confirmed': $badge_class = 'badge-confirmed'; break; case 'cancelled': $badge_class = 'badge-cancelled'; break; default: $badge_class = 'badge-pending'; } ?>
Client Service Date & Time Status Actions
No appointments found
Quick Actions
Service Popularity
0) { while ($stat = mysqli_fetch_assoc($service_stats_result)) { $services[] = $stat['service']; $counts[] = $stat['count']; } } ?>

Appointments

All Appointments
0) { ?>
ID Client Name Email Phone Service Date & Time Status Actions
No appointments found.
'; } ?>

Services

0) { echo '
'; while ($service = mysqli_fetch_assoc($result)) { echo '
' . htmlspecialchars($service['name']) . '

' . htmlspecialchars($service['description']) . '

Starting from: $' . number_format($service['price_from'], 2) . '

'; } echo '
'; } else { echo '
No services found.
'; } ?>

Team Members

Sarah Johnson
Sarah Johnson

Head Stylist

Testimonials

Jennifer Lopez
Jennifer Lopez
Regular Client

"I've been coming to Glamour Beauty for over two years now, and I'm always impressed with the quality of service. Sarah always knows exactly what I want and delivers beyond my expectations!"

Comments

Popular Posts

The Best Mini Smart Phone in 2025: A Pakistan-Focused Buyer's Guide

Samsung Galaxy S24 in 2025: The Definitive Review – Is It Still Worth Buying?

gigousource