File size: 1,855 Bytes
6900c43
 
 
 
 
6c6fe1d
6900c43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167aade
 
 
6900c43
6c6fe1d
6900c43
 
 
167aade
 
6900c43
 
 
6c6fe1d
 
 
 
 
 
6900c43
6c6fe1d
6900c43
 
 
 
 
 
 
 
 
5830c82
6900c43
 
 
 
 
 
6c6fe1d
 
 
 
6900c43
 
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
import streamlit as st 
from streamlit_option_menu import option_menu
from pymongo import MongoClient
import os 
import pandas as pd
import numpy as np


# Connecting to MongoDB
uri = os.environ["MONGO_CONNECTION_STRING"]

client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")

db = client["myapp"]

col = db["reminders"]


def Create_Reminder():
    st.title("Create Reminder")
    message = st.text_input("What are you planning to do?")
    time = str(st.time_input("Time"))
    date = str(st.date_input("Date"))

    
    if st.button("Create Reminder"):
        col.insert_one({"message": message, "time": time, "date": date, "status": False})
        st.success("Reminder Created Successfully!")



def View_Reminders():
    allrem = list(col.find())
    df = pd.DataFrame(allrem)
    df = df.drop(columns=["_id"])
    # Reorder the columns
    df = df.reset_index(drop=True)
    df.index += 1
    ff = pd.DataFrame(
    np.random.randn(20, 3),
    columns=['a', 'b', 'c'])
    df = st.data_editor(
    df, 
    column_config={
        "Status": st.column_config.CheckboxColumn(
            "Status", help="Check to mark as done"
        ),
        "Chart": st.column_config.LineChartColumn(ff),
    },
)

def Reports():
    st.title("Reports")
    
    df = pd.DataFrame(
    np.random.randn(20, 3),
    columns=['a', 'b', 'c'])

    st.line_chart(df) 



    


def dashboard():
    st.title("Welcome to the Dashboard")
    with st.sidebar:
        selected = option_menu(None, ["Create Reminder", "View Reminders", "Reports"], icons=["plus", "eye", "sun"])
    
    if selected == "Create Reminder":
        Create_Reminder()
    elif selected == "View Reminders":
        st.subheader("View Reminders")
        View_Reminders()
    elif selected == "Reports":
        st.subheader("Reports")
        Reports()

        
dashboard()