AbeerJadoon commited on
Commit
567844e
·
verified ·
1 Parent(s): 07ab4a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -18
app.py CHANGED
@@ -4,18 +4,19 @@ import datetime
4
  from PIL import Image
5
 
6
  # Title and Description
7
- st.title("Smart Project Tracker")
8
  st.markdown("""
9
- ### Features:
10
- - **Track construction progress** with photo/video updates.
11
- - **Monitor milestones, budgets, and deadlines.**
12
- - **Generate automated reports.**
13
-
14
- Ideal for project managers and clients to stay updated on construction projects.
15
- """)
16
 
17
  # Sidebar for Navigation
18
- st.sidebar.title("Navigation")
 
 
 
 
19
  page = st.sidebar.radio("Go to", ["Track Progress", "Monitor Milestones", "Generate Reports"])
20
 
21
  # Data Containers
@@ -28,7 +29,11 @@ if "budget_data" not in st.session_state:
28
 
29
  # Track Progress
30
  if page == "Track Progress":
31
- st.header("Track Construction Progress")
 
 
 
 
32
 
33
  # Upload Section
34
  uploaded_file = st.file_uploader("Upload a photo or video of the site", type=["jpg", "jpeg", "png", "mp4", "mov"])
@@ -39,7 +44,11 @@ if page == "Track Progress":
39
  st.success("File uploaded successfully!")
40
 
41
  # Display Progress Updates
42
- st.subheader("Progress Updates")
 
 
 
 
43
  for entry in st.session_state.progress_data:
44
  st.write(f"**Date:** {entry['Date']} | **Type:** {entry['Type']}")
45
  if entry['Type'] == "Image":
@@ -50,13 +59,21 @@ if page == "Track Progress":
50
 
51
  # Monitor Milestones
52
  elif page == "Monitor Milestones":
53
- st.header("Monitor Milestones, Budgets, and Deadlines")
 
 
 
 
54
 
55
  # Add Milestones
56
- st.subheader("Add a Milestone")
 
 
 
 
57
  milestone_name = st.text_input("Milestone Name")
58
  milestone_date = st.date_input("Deadline")
59
- milestone_budget = st.number_input("Budget (in USD)", min_value=0.0, step=100.0)
60
 
61
  if st.button("Add Milestone"):
62
  if milestone_name and milestone_date:
@@ -70,7 +87,11 @@ elif page == "Monitor Milestones":
70
  st.error("Please provide all milestone details.")
71
 
72
  # Display Milestones
73
- st.subheader("Upcoming Milestones")
 
 
 
 
74
  milestones_df = pd.DataFrame(st.session_state.milestones_data)
75
  if not milestones_df.empty:
76
  st.table(milestones_df)
@@ -79,11 +100,19 @@ elif page == "Monitor Milestones":
79
 
80
  # Generate Reports
81
  elif page == "Generate Reports":
82
- st.header("Generate Automated Reports")
 
 
 
 
83
 
84
  # Generate Summary Report
85
  if st.button("Generate Report"):
86
- st.subheader("Project Summary Report")
 
 
 
 
87
 
88
  # Milestone Summary
89
  st.markdown("### Milestones")
@@ -95,7 +124,7 @@ elif page == "Generate Reports":
95
 
96
  # Budget Summary
97
  total_budget = milestones_df["Budget"].sum() if not milestones_df.empty else 0
98
- st.markdown(f"### Total Budget: ${total_budget}")
99
 
100
  # Progress Summary
101
  st.markdown("### Progress Updates")
@@ -108,3 +137,4 @@ elif page == "Generate Reports":
108
  st.video(entry['File'])
109
 
110
  st.sidebar.info("Developed for effective project management.")
 
 
4
  from PIL import Image
5
 
6
  # Title and Description
 
7
  st.markdown("""
8
+ <div style="text-align: center; font-family: Arial; padding: 10px; background-color: #4CAF50; color: white;">
9
+ <h1>Smart Project Tracker</h1>
10
+ <p>Keep your construction projects on track with real-time updates and insights.</p>
11
+ </div>
12
+ """, unsafe_allow_html=True)
 
 
13
 
14
  # Sidebar for Navigation
15
+ st.sidebar.markdown("""
16
+ <div style="font-family: Arial; font-size: 16px;">
17
+ <h2>Navigation</h2>
18
+ </div>
19
+ """, unsafe_allow_html=True)
20
  page = st.sidebar.radio("Go to", ["Track Progress", "Monitor Milestones", "Generate Reports"])
21
 
22
  # Data Containers
 
29
 
30
  # Track Progress
31
  if page == "Track Progress":
32
+ st.markdown("""
33
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 5px;">
34
+ <h2>Track Construction Progress</h2>
35
+ </div>
36
+ """, unsafe_allow_html=True)
37
 
38
  # Upload Section
39
  uploaded_file = st.file_uploader("Upload a photo or video of the site", type=["jpg", "jpeg", "png", "mp4", "mov"])
 
44
  st.success("File uploaded successfully!")
45
 
46
  # Display Progress Updates
47
+ st.markdown("""
48
+ <div style="background-color: #e8f5e9; padding: 10px; border-radius: 5px;">
49
+ <h3>Progress Updates</h3>
50
+ </div>
51
+ """, unsafe_allow_html=True)
52
  for entry in st.session_state.progress_data:
53
  st.write(f"**Date:** {entry['Date']} | **Type:** {entry['Type']}")
54
  if entry['Type'] == "Image":
 
59
 
60
  # Monitor Milestones
61
  elif page == "Monitor Milestones":
62
+ st.markdown("""
63
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 5px;">
64
+ <h2>Monitor Milestones, Budgets, and Deadlines</h2>
65
+ </div>
66
+ """, unsafe_allow_html=True)
67
 
68
  # Add Milestones
69
+ st.markdown("""
70
+ <div style="background-color: #e3f2fd; padding: 10px; border-radius: 5px;">
71
+ <h3>Add a Milestone</h3>
72
+ </div>
73
+ """, unsafe_allow_html=True)
74
  milestone_name = st.text_input("Milestone Name")
75
  milestone_date = st.date_input("Deadline")
76
+ milestone_budget = st.number_input("Budget (in PKR)", min_value=0.0, step=100.0)
77
 
78
  if st.button("Add Milestone"):
79
  if milestone_name and milestone_date:
 
87
  st.error("Please provide all milestone details.")
88
 
89
  # Display Milestones
90
+ st.markdown("""
91
+ <div style="background-color: #fffde7; padding: 10px; border-radius: 5px;">
92
+ <h3>Upcoming Milestones</h3>
93
+ </div>
94
+ """, unsafe_allow_html=True)
95
  milestones_df = pd.DataFrame(st.session_state.milestones_data)
96
  if not milestones_df.empty:
97
  st.table(milestones_df)
 
100
 
101
  # Generate Reports
102
  elif page == "Generate Reports":
103
+ st.markdown("""
104
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 5px;">
105
+ <h2>Generate Automated Reports</h2>
106
+ </div>
107
+ """, unsafe_allow_html=True)
108
 
109
  # Generate Summary Report
110
  if st.button("Generate Report"):
111
+ st.markdown("""
112
+ <div style="background-color: #e8f5e9; padding: 10px; border-radius: 5px;">
113
+ <h3>Project Summary Report</h3>
114
+ </div>
115
+ """, unsafe_allow_html=True)
116
 
117
  # Milestone Summary
118
  st.markdown("### Milestones")
 
124
 
125
  # Budget Summary
126
  total_budget = milestones_df["Budget"].sum() if not milestones_df.empty else 0
127
+ st.markdown(f"### Total Budget: PKR {total_budget}")
128
 
129
  # Progress Summary
130
  st.markdown("### Progress Updates")
 
137
  st.video(entry['File'])
138
 
139
  st.sidebar.info("Developed for effective project management.")
140
+