prepare("INSERT INTO service_ratings (rating, comment) VALUES (?, ?)"); $stmt->execute([$rating, $comment]); $success = true; } else if ($userId) { $stmt = $pdo->prepare("INSERT INTO staff_ratings (user_id, rating, comment) VALUES (?, ?, ?)"); $stmt->execute([$userId, $rating, $comment]); $success = true; } else { $error = "Please select a staff member."; } } catch (Exception $e) { $error = "Error saving rating: " . $e->getMessage(); } } else { $error = "Please provide a rating."; } } // Fetch active and ratable users with pictures $pdo = db(); $stmt = $pdo->query("SELECT id, full_name, full_name_ar, username, profile_pic FROM users WHERE is_active = 1 AND is_ratable = 1 ORDER BY full_name ASC"); $users = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> Rate Our Service - <?= htmlspecialchars($companyName) ?>

We value your feedback! What would you like to rate?

Thank You!

Your rating has been submitted successfully.

Rate Again
Rate Our Services

How was your overall experience with us?

OR RATE OUR STAFF

No staff members are currently available for rating.

<?= htmlspecialchars($user['full_name']) ?>

Rate