-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (36 loc) · 1.33 KB
/
Copy pathmain.py
File metadata and controls
43 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import sys
from database.connection import initialize_pool
from database.setup_db import build_tables
from views.admin_view import run_admin_panel
from views.student_view import run_student_portal
from views.teacher_view import run_teacher_portal
def start_system():
print("="*60)
print(" INITIALIZING ADVANCED SCHOOL MANAGEMENT SYSTEM")
print("="*60)
initialize_pool()
build_tables()
while True:
print("\n" + "#"*50)
print(" MAIN SYSTEM GATEWAY")
print("#"*50)
print("1. Admin Panel (Register Users/Staff)")
print("2. Staff Portal (Teachers Login)")
print("3. Student Portal (Students Login)")
print("4. System Shutdown (Exit)")
print("#"*50)
main_choice = input("Select a portal to access (1-4): ").strip()
if main_choice == '1':
run_admin_panel()
elif main_choice == '2':
run_teacher_portal()
elif main_choice == '3':
run_student_portal()
elif main_choice == '4':
print("\nClosing all database connections...")
print("System securely shut down. Goodbye!")
sys.exit()
else:
print("\n>> Invalid input. Please select a valid module.")
if __name__ == "__main__":
start_system()