[PR #8] [MERGED] Feat/my account #7

Closed
opened 2026-05-06 16:09:07 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/BreizhHardware/projet-web-cipa4/pull/8
Author: @BreizhHardware
Created: 2/11/2026
Status: Merged
Merged: 2/11/2026
Merged by: @BreizhHardware

Base: feat/homeHead: feat/my-account


📝 Commits (3)

  • 4df307b feat(user): implement user profile update and trips retrieval; remove vehicle management
  • 0725ca9 feat(trip): update trip creation flow and redirect to profile on success
  • cc0a62f Merge branch 'feat/home' into feat/my-account

📊 Changes

16 files changed (+496 additions, -237 deletions)

View changed files

📝 README.MD (+0 -5)
bruno/Vehicles/Add Vehicle.bru (+0 -22)
css/profile.css (+97 -0)
📝 index.php (+8 -4)
js/profile.js (+155 -0)
📝 php/controllers/TripController.php (+39 -0)
📝 php/controllers/UserController.php (+72 -4)
php/controllers/VehicleController.php (+0 -53)
📝 php/models/Booking.php (+2 -1)
📝 php/models/Trip.php (+11 -0)
📝 php/models/User.php (+30 -1)
php/models/Vehicle.php (+0 -34)
📝 php/utils/init_db.php (+1 -10)
php/utils/migrations/2026_02_03_17_51_49_remove_vehicles.php (+14 -0)
📝 views/trip/create.html (+4 -4)
📝 views/user/profile.html (+63 -99)

📄 Description

This pull request introduces a significant refactor of how vehicle information is managed for users, as well as major improvements to the user profile and trips management features. The most important changes include removing the separate vehicles system in favor of a single vehicle field on the users table, adding endpoints and logic for updating user profiles and retrieving user-specific trips, and enhancing the frontend profile page with new styling and interactivity.

Backend data model and API changes:

  • Removed the vehicles table and all related code, replacing it with a single vehicle field on the users table. This simplifies vehicle management by storing vehicle info directly with the user, and removes the need for the Vehicle model, controller, and related endpoints. [1] [2] [3] [4] [5] [6]
  • Updated the user profile API to support profile updates (including vehicle info), with CSRF protection, input validation, and email uniqueness checks. Added the /api/user/update endpoint and implemented the corresponding controller logic. [1] [2] [3]
  • Added /api/user/trips endpoint and logic to fetch all trips associated with the user, both as driver and passenger, merging and sorting them by date. [1] [2] [3]
  • Enhanced user-related SQL queries to include vehicle information and average rating, and added logic for updating user records. [1] [2] [3] [4]

Frontend and UI improvements:

  • Added a new profile.js to handle profile data fetching, updating, CSRF token management, and dynamic display of user trips (upcoming and past), as well as user ratings.
  • Introduced a new profile.css file for improved layout and responsive design of the profile page, including clear separation of personal info and trips sections, and enhanced form styling.

Security improvements:

  • Updated the Content Security Policy to allow loading icons from Iconify, necessary for the new UI elements.

These changes collectively streamline user and vehicle management, improve the user experience on the profile page, and enhance security for new frontend features.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BreizhHardware/projet-web-cipa4/pull/8 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 2/11/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@BreizhHardware](https://github.com/BreizhHardware) **Base:** `feat/home` ← **Head:** `feat/my-account` --- ### 📝 Commits (3) - [`4df307b`](https://github.com/BreizhHardware/projet-web-cipa4/commit/4df307b24af2d7cbb5ae8172eee3d104ba7a6efc) feat(user): implement user profile update and trips retrieval; remove vehicle management - [`0725ca9`](https://github.com/BreizhHardware/projet-web-cipa4/commit/0725ca957dbafbf6bd7d4b4d65a154a38ac5928f) feat(trip): update trip creation flow and redirect to profile on success - [`cc0a62f`](https://github.com/BreizhHardware/projet-web-cipa4/commit/cc0a62fc3ad5a73677d8090c6ce483f1e61754a7) Merge branch 'feat/home' into feat/my-account ### 📊 Changes **16 files changed** (+496 additions, -237 deletions) <details> <summary>View changed files</summary> 📝 `README.MD` (+0 -5) ➖ `bruno/Vehicles/Add Vehicle.bru` (+0 -22) ➕ `css/profile.css` (+97 -0) 📝 `index.php` (+8 -4) ➕ `js/profile.js` (+155 -0) 📝 `php/controllers/TripController.php` (+39 -0) 📝 `php/controllers/UserController.php` (+72 -4) ➖ `php/controllers/VehicleController.php` (+0 -53) 📝 `php/models/Booking.php` (+2 -1) 📝 `php/models/Trip.php` (+11 -0) 📝 `php/models/User.php` (+30 -1) ➖ `php/models/Vehicle.php` (+0 -34) 📝 `php/utils/init_db.php` (+1 -10) ➕ `php/utils/migrations/2026_02_03_17_51_49_remove_vehicles.php` (+14 -0) 📝 `views/trip/create.html` (+4 -4) 📝 `views/user/profile.html` (+63 -99) </details> ### 📄 Description This pull request introduces a significant refactor of how vehicle information is managed for users, as well as major improvements to the user profile and trips management features. The most important changes include removing the separate vehicles system in favor of a single `vehicle` field on the `users` table, adding endpoints and logic for updating user profiles and retrieving user-specific trips, and enhancing the frontend profile page with new styling and interactivity. **Backend data model and API changes:** * Removed the `vehicles` table and all related code, replacing it with a single `vehicle` field on the `users` table. This simplifies vehicle management by storing vehicle info directly with the user, and removes the need for the `Vehicle` model, controller, and related endpoints. [[1]](diffhunk://#diff-2baef8e34f3d3c0682126ceb14c63aec1801e35934fc7de3466cbaa1c55cf13cR21-L33) [[2]](diffhunk://#diff-00343fe7f104af8c9726d362f46ac348101068e21c9a0cc186e8221e2afad742L1-L34) [[3]](diffhunk://#diff-44ab4e472e3dafdf649f1ca0c115d048bd37e53692dd5a3bbc4d067c6341f641L1-L22) [[4]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaL68-L72) [[5]](diffhunk://#diff-7413d6453f901e939bbd840c8f0d1c7b20c2ca0e7f71741e4e07c6cf036f16c0L88-L91) [[6]](diffhunk://#diff-b38755a2c2eae2184975780693824b3ed403fb0ed1832499bb1246448c226d49L1-L53) * Updated the user profile API to support profile updates (including vehicle info), with CSRF protection, input validation, and email uniqueness checks. Added the `/api/user/update` endpoint and implemented the corresponding controller logic. [[1]](diffhunk://#diff-584e3514bcb2724dbb75a6ed74b758268b69969828610734c1fab9ba02937c1dR25-R105) [[2]](diffhunk://#diff-584e3514bcb2724dbb75a6ed74b758268b69969828610734c1fab9ba02937c1dR9) [[3]](diffhunk://#diff-7413d6453f901e939bbd840c8f0d1c7b20c2ca0e7f71741e4e07c6cf036f16c0R76-R83) * Added `/api/user/trips` endpoint and logic to fetch all trips associated with the user, both as driver and passenger, merging and sorting them by date. [[1]](diffhunk://#diff-e602ea240799e19a121108871e85fe8666783c5bcd826a40c9e216fe1dd88d96R63-R100) [[2]](diffhunk://#diff-51f6bbfd7bb703838f881ed5fa67902dff71b63c4a344826672160245c5c7bd6R80-R90) [[3]](diffhunk://#diff-7413d6453f901e939bbd840c8f0d1c7b20c2ca0e7f71741e4e07c6cf036f16c0R76-R83) * Enhanced user-related SQL queries to include vehicle information and average rating, and added logic for updating user records. [[1]](diffhunk://#diff-c7b4307453ab18abb31d3b0f062889ab6c2770455f2a71f74d7fb0c8b0c07027L41-R41) [[2]](diffhunk://#diff-c7b4307453ab18abb31d3b0f062889ab6c2770455f2a71f74d7fb0c8b0c07027R52-R80) [[3]](diffhunk://#diff-584e3514bcb2724dbb75a6ed74b758268b69969828610734c1fab9ba02937c1dR25-R105) [[4]](diffhunk://#diff-b34f043677740bba555b1ff3d733a844a52fe5e7fec4e0181518b9a6ae2ff056L31-R34) **Frontend and UI improvements:** * Added a new `profile.js` to handle profile data fetching, updating, CSRF token management, and dynamic display of user trips (upcoming and past), as well as user ratings. * Introduced a new `profile.css` file for improved layout and responsive design of the profile page, including clear separation of personal info and trips sections, and enhanced form styling. **Security improvements:** * Updated the Content Security Policy to allow loading icons from Iconify, necessary for the new UI elements. These changes collectively streamline user and vehicle management, improve the user experience on the profile page, and enhance security for new frontend features. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 16:09:07 +02:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BreizhHardware/projet-web-cipa4#7
No description provided.