File size: 1,034 Bytes
35bf81f
 
 
a25e70e
0cb4925
a25e70e
d6261d3
 
0cb4925
35bf81f
0cb4925
 
35bf81f
 
0690557
 
ef0e0fe
a25e70e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef0e0fe
 
a25e70e
 
 
35bf81f
 
 
 
 
 
 
 
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
import streamlit as st
import json
import uuid
import os
from pymongo import MongoClient

# uri = os.environ["MONGO_CONNECTION_STRING"]
uri =  "mongodb+srv://cluster0.j2p0gjo.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority"
client = MongoClient(uri,tlsCertificateKeyFile= "cert.pem")

db = client["mydata"]
col = db["Reminders"]

def rem():
    st.title("Reminders")
    st.subheader("Enter reminder details:")
    
        

    remid =str(uuid.uuid4())
    remsg =st.text_input("Enter Reminder Message:")

    remtime = str(st.time_input("Enter Reminder Time:"))

    remdate = str(st.date_input("Enter Reminder Date:")) 

    repeat =st.selectbox(
        " would you like to repeat Reminder:",["No","daily","weekly","yearly"]
    )
    reminder ={
        "id": remid,
        "message": remsg,
        "time": remtime,
        "date": remdate,
        "repeat": repeat,
        "status": False,
    
        }
    if st.button("Save"):
        col.insert_one(reminder)