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 + +
| = __('date') ?> | += __('rating_type') ?> | += __('rating') ?> | += __('comment') ?> | +
|---|---|---|---|
| = __('no_data_available') ?> | +|||
| = date('Y-m-d H:i', strtotime($r['created_at'])) ?> | ++ + = __('staff') ?> + + = __('service') ?> + + | ++ + + + | += htmlspecialchars($r['comment']) ?> | +