File size: 3,659 Bytes
b942f0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import streamlit as st
import pandas as pd

st.set_page_config(page_title="Green Valley School", layout="wide")

# Sidebar navigation
menu = st.sidebar.radio("Navigate", [
    "Home", "About Us", "Admissions", "Academics", "Faculty", 
    "Student Portal", "Admin", "Events", "Contact Us"
])

# Home Page
if menu == "Home":
    st.title("Welcome to Green Valley School")
    st.image("https://via.placeholder.com/800x300.png?text=Green+Valley+School", use_column_width=True)
    st.markdown("""
    **Empowering the Future Generation.**  
    A place where knowledge meets passion, and students grow into leaders.
    """)

# About Us
elif menu == "About Us":
    st.header("About Green Valley School")
    st.write("""
    Established in 1998, Green Valley School has been a beacon of excellence in education.
    Our mission is to nurture and inspire young minds to achieve academic and personal success.
    """)

# Admissions
elif menu == "Admissions":
    st.header("Admission Inquiry Form")
    with st.form("admission_form"):
        name = st.text_input("Full Name")
        grade = st.selectbox("Applying for Grade", list(range(1, 13)))
        email = st.text_input("Email Address")
        message = st.text_area("Why do you want to join?")
        submitted = st.form_submit_button("Submit")
        if submitted:
            # Save to CSV or DB
            df = pd.DataFrame([[name, grade, email, message]], columns=["Name", "Grade", "Email", "Message"])
            df.to_csv("admissions.csv", mode='a', index=False, header=False)
            st.success("Your inquiry has been submitted!")

# Academics
elif menu == "Academics":
    st.header("Academic Programs")
    st.write("""
    - **Primary School (Grades 1–5)**  
    - **Middle School (Grades 6–8)**  
    - **High School (Grades 9–12)**  
    - Specialized programs in STEM, Arts, Sports and more.
    """)

# Faculty
elif menu == "Faculty":
    st.header("Our Faculty")
    st.write("Meet our dedicated teachers and staff.")
    faculty_data = pd.DataFrame({
        "Name": ["Mr. Ali", "Ms. Sana", "Dr. Khalid"],
        "Subject": ["Mathematics", "Science", "English"],
        "Experience (Years)": [10, 7, 12]
    })
    st.table(faculty_data)

# Student Portal
elif menu == "Student Portal":
    st.header("Student Login")
    st.warning("This is a demo login.")
    username = st.text_input("Username")
    password = st.text_input("Password", type="password")
    if st.button("Login"):
        if username == "student" and password == "123":
            st.success("Login successful!")
            st.info("View your grades, timetable, and more (under development).")
        else:
            st.error("Invalid credentials.")

# Admin
elif menu == "Admin":
    st.header("Admin Portal")
    admin_pass = st.text_input("Enter Admin Password", type="password")
    if admin_pass == "admin123":
        st.success("Access granted!")
        st.subheader("Submitted Admission Forms")
        try:
            data = pd.read_csv("admissions.csv", header=None, names=["Name", "Grade", "Email", "Message"])
            st.dataframe(data)
        except:
            st.warning("No admission data yet.")
    else:
        st.info("Enter password to access.")

# Events
elif menu == "Events":
    st.header("Upcoming Events")
    st.markdown("""
    - **Science Fair** – 15th April  
    - **Annual Sports Day** – 25th May  
    - **PTM** – 5th June
    """)

# Contact Us
elif menu == "Contact Us":
    st.header("Get in Touch")
    st.write("Email: [email protected]")  
    st.write("Phone: +92-300-0000000")  
    st.write("Address: Street 123, Swabi, KPK")