Tento rezervační systém na konzultace vznikl jako můj maturitní projekt na střední škole se zaměřením na IT. Cílem je usnadnit školám dohadování konzultací mezi učiteli a studenty pomocí přehledného webového rozhraní.
Systém je připraven k nasazení ve školním prostředí s podporou autentizace přes Microsoft účty a databází MariaDB/PostgreSQL. Díky rozdělení rolí mezi studenty, učitele a administrátory je možné systém snadno rozšířit i pro větší školní zařízení.
- Přihlášení pomocí Microsoft účtu (OAuth 2.0)
- Rezervace a rušení konzultací (student)
- Vytváření a správa konzultací (učitel)
- Administrace uživatelů a impersonifikace (admin)
- Přehled rezervací a historie konzultací
- Emailové notifikace pomocí PHPMaileru
| Přihlašovací obrazovka | Studenti - výběr konzultace |
|---|---|
![]() |
![]() |
| Učitel - tvorba konzultace | Admin - seznam studentů |
|---|---|
![]() |
![]() |
PHP 8.1 nebo novější
Apache / Nginx
MariaDB nebo PostgreSQL
Git
Composer (pro PHPMailer)
Microsoft Entra ID (pro OAuth 2.0)
- Klonuj repozitář:
git clone https://github.com/DxProline/Reservation_System-ForConsultation.git cd Reservation_System-ForConsultation
Vytvoř databázi (např. consultation_system)
Importuj SQL strukturu a demo data, pokud je poskytne autor
V souboru Configs/secret.php uprav připojení k databázi:
define("DB_HOST", "localhost");
define("DB_NAME", "consultation_system");
define("DB_USER", "root");
define("DB_PASS", "heslo");
Přihlas se do Microsoft Entra
Získej TenantID tvé domény se kterou Microsoft komunikuje.
Zaregistruj novou aplikaci pro CLIENTID
Nastav callback URL:
http://tvujWEB/Reservation_System-ForConsultation/Actions/callback.php
Nastav oprávnění:
openid
User.Read
email
Vlož klientský ID a tajný klíč do Configs/secret.php:
define("CLIENT_ID", "xxxx");
define("CLIENT_SECRET", "xxxx");
define("REDIRECT_URI", "http://tvujWEB/Reservation_System-ForConsultation/Actions/callback.php");
Otevři stránku systému ve webovém prohlížeči
Klikni na tlačítko „Přihlásit se pomocí Microsoft účtu“
Po úspěšném přihlášení budeš automaticky zařazen jako student (výchozí role)
👤 Student
Po přihlášení klikni na „Volné konzultace“
Vyber konzultaci a klikni na „Rezervovat“
Vyplň předmět a popis problému (nepovinné)
Potvrď rezervaci → obdržíš e-mail
Konzultaci lze zrušit v sekci „Rezervované konzultace“
👨🏫 Učitel
Klikni na „Vytvořit konzultaci“
Vyplň datum, čas, délku, předmět a popis
Systém automaticky zabrání konfliktům v čase
Sleduj přihlášené studenty v sekci „Rezervované konzultace“
V případě nutnosti zruš konzultaci → student dostane e-mail
👨💼 Administrátor
Otevři „Seznam uživatelů“
Můžeš měnit role student/učitel/admin
Funkce „Impersonifikace“ ti umožní přihlásit se jako jiný uživatel
Sleduj historii konzultací nebo zakládej konzultace za ostatní
Otevři terminál v root adresáři projektu
Spusť:
composer require phpmailer/phpmailer
Uprav SMTP konfiguraci v Utils/mailer.php
Diagram se využívá k definici hlavních funkcí a rolí jednotlivých uživatelů systému – učitel, student, administrátor – a jejich interakcí s aplikací.
Znázorňuje strukturu systému pomocí tříd, jejich atributů, metod a vztahů. Např. student si může zarezervovat konzultaci, učitel konzultaci vytvoří.
Zobrazuje logiku systému při vytváření konzultace učitelem. Obsahuje rozhodovací větve (např. zda má učitel konzultaci ve stejný čas).
Ukazuje, jak student rezervuje konzultaci. Systém ověřuje kolize v čase, dostupnost a zajišťuje hladký průběh rezervace.
Znázorňuje posloupnost zpráv mezi objekty při vytváření konzultace – např. interakce mezi formulářem, serverem a databází.
Sekvenčně popisuje, jak student zadává požadavek, jak server kontroluje pravidla a vrací odpověď.
Znázorňuje životní cyklus konzultace – od jejího vytvoření přes rezervaci a případné zrušení až po proběhlý stav.
Zachycuje organizaci kódu a rozložení složek v projektu. Napomáhá k rychlé orientaci v systému a oddělení zodpovědností.
Soubory jako secret.php, database.php a jiné citlivé konfigurace jsou chráněny .gitignore a nejsou součástí tohoto veřejného repozitáře.
🔧 Dokumentace kódu (vybrané akce)
createConsultation.php
Slouží k přidání nové konzultace učitelem
Validuje datum/čas, vkládá do tabulky consultations
reserveConsultation.php
Rezervace konzultace studentem
Odesílá notifikaci pomocí PHPMaileru studentovi i učiteli
cancelConsultation.php
Učitel nebo admin ruší konzultaci
Notifikace se odesílá studentům (pokud byli přihlášeni)
cancelReservation.php
Student ruší svou rezervaci
Učitel je o zrušení informován
updateUserType.php
Admin mění roli uživatele (0=student, 1=učitel, 2=admin)
callback.php
Ošetřuje navrácení uživatele z Microsoft OAuth loginu
Zaznamená uživatele do databáze, pokud je nový
Verze
1.0
První stabilní verze s plnou funkcionalitou
2025
💼 Licence
Projekt je tvořen DxProlinem (mnou) je tedy sice OpenSource ale při zavedení ve školních systémech si autor vyhrazuje právo na budoucí zpoplatnění podle jeho uvážení.
🙏 Poděkování
Velké díky patří panu učiteli na Programování na mé škole, @kubavojak za podněty k zabezpečení a jeho přítelkyni za grafický vizuál.
This consultation reservation system was developed as my graduation project at a high school specializing in IT. The goal is to simplify the scheduling of consultations between teachers and students through a clear and user-friendly web interface.
The system is ready for deployment in a school environment, supporting Microsoft account authentication and MariaDB/PostgreSQL database integration. Thanks to role separation between students, teachers, and administrators, the system can easily scale for larger institutions.
- Login via Microsoft account (OAuth 2.0)
- Students can book and cancel consultations
- Teachers can create and manage consultations
- Admins can manage users and impersonate roles
- Overview of reservations and history
- Email notifications via PHPMailer
| Login Screen | Students – Select Consultation |
|---|---|
![]() |
![]() |
| Teacher – Create Consultation | Admin – User List |
|---|---|
![]() |
![]() |
- PHP 8.1 or newer
- Apache / Nginx
- MariaDB or PostgreSQL
- Git
- Composer (for PHPMailer)
- Microsoft Entra ID (for OAuth 2.0)
git clone https://github.com/DxProline/Reservation_System-ForConsultation.git
cd Reservation_System-ForConsultation- Create a database (e.g.
consultation_system) - Import SQL schema and demo data if provided by the author
- In
Configs/secret.php, set your database credentials:
define("DB_HOST", "localhost");
define("DB_NAME", "consultation_system");
define("DB_USER", "root");
define("DB_PASS", "your_password");- Login to Microsoft Entra
- Register a new application to obtain your CLIENT_ID
- Retrieve your domain's TenantID
- Set the callback URL:
http://yourWEB/Reservation_System-ForConsultation/Actions/callback.php
-
Grant permissions:
openidUser.Reademail
-
Fill in the credentials in
Configs/secret.php:
define("CLIENT_ID", "xxxx");
define("CLIENT_SECRET", "xxxx");
define("REDIRECT_URI", "http://yourWEB/Reservation_System-ForConsultation/Actions/callback.php");- Open terminal in project root
- Run:
composer require phpmailer/phpmailer- Edit SMTP settings in
Utils/mailer.php
- Open the system website in your browser
- Click on "Sign in with Microsoft account"
- Upon successful login, you are automatically assigned the default role: student
👤 Student
- After login, go to "Available Consultations"
- Select a consultation and click "Reserve"
- Fill in the subject and problem description (optional)
- Confirm the reservation → you will receive an email
- You can cancel your booking in the "Reserved Consultations" section
👨🏫 Teacher
- Click on "Create Consultation"
- Enter date, time, duration, subject, and description
- The system prevents time conflicts
- Monitor registered students in the "Reserved Consultations" section
- If needed, cancel a consultation → the student is notified via email
👨💼 Administrator
- Open the "User List"
- Change user roles (student/teacher/admin)
- Use the "Impersonate" feature to log in as another user
- Monitor consultation history or create bookings on behalf of others
This diagram defines the main system functions and the roles of individual users – teacher, student, and administrator – and their interactions with the application.
This diagram illustrates the system's structure through classes, their attributes, methods, and relationships. For example, a student can reserve a consultation, and a teacher can create it.
Describes the system logic when a teacher creates a consultation. Includes decision branches (e.g., whether the teacher already has a consultation at the same time).
Shows how a student reserves a consultation. The system checks for scheduling conflicts and availability to ensure a smooth booking process.
Illustrates the sequence of messages exchanged between components during consultation creation – e.g., interaction between form, server, and database.
Describes the time-ordered communication as a student submits a booking request, and the server performs checks and returns responses.
Shows the lifecycle of a consultation – from creation, through booking and possible cancellation, to completion.
Illustrates the code structure and organization of folders in the project. Helps with quick orientation and responsibility separation across components.
Files like secret.php, database.php, and other sensitive configurations are protected by .gitignore and are not included in this public repository.
createConsultation.php
- Used by teachers to create a new consultation
- Validates date/time, inserts into
consultationstable
reserveConsultation.php
- Student books a consultation
- Sends email notification to student and teacher via PHPMailer
cancelConsultation.php
- Consultation is cancelled by a teacher or admin
- Students (if booked) are notified
cancelReservation.php
- Student cancels their reservation
- Teacher is notified of the cancellation
updateUserType.php
- Admin changes user role (0 = student, 1 = teacher, 2 = admin)
callback.php
- Handles Microsoft OAuth login return
- Adds the user to the database if not present
1.0 Initial stable version with full functionality 2025
This project was developed by DxProline (myself). While it is open-source, the author reserves the right to charge for future usage in institutional school systems.
Special thanks to my programming teacher at school, @kubavojak, for his security insights, and to his partner for the visual design.











