File size: 3,804 Bytes
9fec341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# import streamlit as st


# class DataProcessor:
#     def manual_entry_form(self):
#         with st.form("manual_entry_form"):
#             name = st.text_input("Full Name")
#             email = st.text_input("Email Address")
#             phone = st.text_input("Phone Number")
#             experience = st.number_input("Years of Experience", min_value=0, step=1)
#             position = st.text_input("Desired Position")
#             location = st.text_input("Current Location")
#             tech_stack = st.text_area("Tech Stack (comma-separated)").split(",")
#             submit = st.form_submit_button("Submit")
#             if submit:
#                 self.display_submitted_data(
#                 name, email, phone, experience, position, location, tech_stack
#             )
#         return tech_stack


#     @staticmethod
#     def display_submitted_data(name, email, phone, experience, position, location, tech_stack):
#         """Displays the submitted form data."""
#         st.markdown("### Submitted Information")
#         st.write(f"**Full Name:** {name}")
#         st.write(f"**Email Address:** {email}")
#         st.write(f"**Phone Number:** {phone}")
#         st.write(f"**Years of Experience:** {experience}")
#         st.write(f"**Desired Position:** {position}")
#         st.write(f"**Current Location:** {location}")
#         st.write(f"**Tech Stack:** {', '.join(tech_stack)}")

            
    
        

import streamlit as st

class ManualEntry:
    def manual_entry_form(self):
        with st.form("manual_entry_form"):
            name = st.text_input("Full Name")
            email = st.text_input("Email Address")
            phone = st.text_input("Phone Number")
            experience = st.number_input("Years of Experience", min_value=0, step=1)
            position = st.text_input("Desired Position")
            location = st.text_input("Current Location")
            tech_stack = st.text_area("Tech Stack (comma-separated)").split(",")
            submit = st.form_submit_button("Submit")
            
            # Check if any field is empty
            if submit:
                missing_fields = []
                
                # Check for empty fields
                if not name:
                    missing_fields.append("Full Name")
                if not email:
                    missing_fields.append("Email Address")
                if not phone:
                    missing_fields.append("Phone Number")
                if experience == 0:
                    missing_fields.append("Years of Experience")
                if not position:
                    missing_fields.append("Desired Position")
                if not location:
                    missing_fields.append("Current Location")
                if not tech_stack or all(not tech.strip() for tech in tech_stack):
                    missing_fields.append("Tech Stack")
                
                if missing_fields:
                    # Show a message if any fields are missing
                    st.warning(f"Please provide details for the following fields: {', '.join(missing_fields)}")
                else:
                    self.display_submitted_data(name, email, phone, experience, position, location, tech_stack)
                    return tech_stack
        

    def display_submitted_data(self, name, email, phone, experience, position, location, tech_stack):
        st.success("Data Submitted Successfully!")
        st.write(f"**Name:** {name}")
        st.write(f"**Email:** {email}")
        st.write(f"**Phone:** {phone}")
        st.write(f"**Experience:** {experience} years")
        st.write(f"**Position:** {position}")
        st.write(f"**Location:** {location}")
        st.write(f"**Tech Stack:** {', '.join(tech_stack)}")