From b1bb8c3b2643a456b46d2b6e9588ccecce02fcc0 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 10 Mar 2026 08:24:46 +0000 Subject: [PATCH] update rating --- db/migrations/19_add_ratings.sql | 15 +++ includes/header.php | 9 ++ includes/lang.php | 40 ++++++++ ratings.php | 166 +++++++++++++++++++++++++++++++ service_rating.php | 139 ++++++++++++++++++++++++++ staff_rating.php | 139 ++++++++++++++++++++++++++ users.php | 3 +- 7 files changed, 510 insertions(+), 1 deletion(-) create mode 100644 db/migrations/19_add_ratings.sql create mode 100644 ratings.php create mode 100644 service_rating.php create mode 100644 staff_rating.php diff --git a/db/migrations/19_add_ratings.sql b/db/migrations/19_add_ratings.sql new file mode 100644 index 0000000..267555d --- /dev/null +++ b/db/migrations/19_add_ratings.sql @@ -0,0 +1,15 @@ +CREATE TABLE IF NOT EXISTS ratings ( + id INT AUTO_INCREMENT PRIMARY KEY, + branch_id INT NULL, + company_id INT NULL, + rating_type ENUM('staff', 'service') NOT NULL, + rating_value INT NOT NULL, + comment TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (branch_id) REFERENCES branches(id) ON DELETE SET NULL, + FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +INSERT IGNORE INTO user_permissions (user_id, page, can_view, can_add, can_edit, can_delete) +SELECT id, 'ratings.php', 1, 1, 1, 1 +FROM users WHERE role = 'super_admin'; diff --git a/includes/header.php b/includes/header.php index c6a33da..4ce1274 100644 --- a/includes/header.php +++ b/includes/header.php @@ -285,6 +285,15 @@ if ($current_user_id && $current_page !== 'login.php' && $current_page !== 'logo + + + +