File size: 7,356 Bytes
231c5eb
e3d7d8a
 
23f9dd1
fcd8739
231c5eb
fcd8739
 
 
 
 
231c5eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fcd8739
 
 
 
 
 
 
231c5eb
 
 
 
 
23f9dd1
231c5eb
 
 
 
9c47a78
 
fcd8739
 
 
 
 
 
 
 
 
9c47a78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fcd8739
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
import requests
import streamlit as st
import yfinance as yf

menu=['Home','Sport news','Crypto','Sales','Registeration form','Online register']
ch=st.sidebar.selectbox('Menu',menu)





if ch=='Home':
    st.title('Test python projects')
    st.write('This is a homepage to run and test different python scripts!')
if ch== 'Sport news':
    st.title('Sport news')
    ti=st.text_input('Text input')
    if len(ti)>0:
        r=requests.get('https://search-api.varzesh3.com/v1.0/query?q='+ti)
        x=r.json()
        for i in x['news']:
            st.subheader(i['title'])
            st.success(i['publishedOn'])
            st.write(i['shortDescription'])
            st.image(i['picture'])
            st.write('--------------------------------------------')







if ch== 'Crypto':
    list_asset = ['BTC-USD', 'ETH-USD', 'DOGE-USD']
    ms = st.multiselect('choose asset', list_asset)
    dates1 = st.date_input('from')
    dates2 = st.date_input('to')

    if len(ms) > 0:
        df = yf.download(ms, dates1, dates2)
        st.write(df)
        df2 = yf.download(ms, dates1, dates2)['Close']
        st.line_chart(df2)










if ch == 'Sales':
    st.title('Good deals from stores below:')
    url = requests.get('https://www.cheapshark.com/api/1.0/stores')
    x = url.json()

    for i in x:
        st.write(i['storeName'] )

    url2 = requests.get('https://www.cheapshark.com/api/1.0/deals?storeID=1&upperPrice=15')
    y = url2.json()

    for j in y:
        st.write('------------------------------------------')
        st.write('Game name:   '+j['title'])
        st.write('ID:  '+j['gameID'])
        st.write('New price:  '+j['salePrice'])
        st.write('Old price:  '+j['normalPrice'])
        st.write(j['thumb'])
        st.write('------------------------------------------')










if ch == 'Registeration form':
    st.title('Registration form')


    st.subheader('Customer information')
    ct = ['Private','Business']
    ctype = st.selectbox('Customer type', ct)



    if ctype == 'Private' :

        cemail = st.text_input('Email')

        rcemail = st.text_input('Repeat Email')
        if cemail != rcemail :
            st.warning('Email does not match')
        else:
            st.success('Please note that it is very important that your email is correct, as all communication and invoices will be sent by email.')

        cname = st.text_input('Name and family name')

        caddress = st.text_input('Address')


        cpcode = st.text_input('Postal code')


        ccity = st.text_input('City')


        cphone = st.text_input('Phone')


    else:

        cemail = st.text_input('Email')

        rcemail = st.text_input('Repeat Email')
        if cemail != rcemail :
            st.warning('Email does not match')
        else:
            st.success('Please note that it is very important that your email is correct, as all communication and invoices will be sent by email.')

        ccvr = st.text_input('CVR number')


        company = st.text_input('Company name')


        caddress = st.text_input('Address')


        cpcode = st.text_input('Postal code')


        ccity = st.text_input('City')


        cphone = st.text_input('Phone')


    st.subheader('Subscription')
    pack=st.radio('package', ['Gold','silver','bronz'],horizontal=True)
    if 'Gold' in pack:
        st.success('Kr. 1185.00 årligt inkl. moms')
    if 'silver' in pack:
        st.success('885.00 årligt inkl. moms')
    if 'bronz' in pack:
        st.success('585.00 årligt inkl. moms')

    goog=st.radio('include google map', ['Yes','No'],horizontal=True)
    if 'Yes' in goog:
        st.success('Kr. 75.00 årligt inkl. moms')

    alarm=st.radio('include alarmcentral', ['Yes','No'],horizontal=True)
    if 'Yes' in alarm:
        st.success('Tilvælg alarmcentral + 400.00 årligt inkl. moms')
        ins=['Topdanmark Forsikring A/S','Tryg Forsikring A/S','ALG Europe','Alka Forsikring','Alm. Brand Forsikring A/S','Andet']    
        ins2=st.selectbox('Insurance company',ins)


    st.subheader('Vehicle')

    plate = st.text_input('Registration Plate')

    brand = st.text_input('Brand')

    model = st.text_input('Model')

    year = st.text_input('Year')


    submitted = st.button("Submit")












if ch == 'Online register':
    st.title('Online Bestil forsikringstracker')

    st.subheader('Customer information')

    ct = ['Private','Business']
    ctype = st.selectbox('Customer type', ct)

    cemail = st.text_input('Email')
    if not cemail:
        st.stop()

    rcemail = st.text_input('Repeat Email')
    if not rcemail:
        st.stop()

    if cemail != rcemail :
        st.warning('Email does not match')
        st.stop()
    else:
        st.success('We will send login infomation to this email.')



    if ctype == 'Private' :

        cname = st.text_input('Name and family name')
        if not cname:
            st.stop()

        caddress = st.text_input('Address')
        if not caddress:
            st.stop()

        cpcode = st.text_input('Postal code')
        if not cpcode:
            st.stop()

        ccity = st.text_input('City')
        if not ccity:
            st.stop()

        cphone = st.text_input('Phone')
        if not cphone:
            st.stop()

    else:
        ccvr = st.text_input('CVR number')
        if not ccvr:
            st.stop()

        company = st.text_input('Company name')
        if not company:
            st.stop()

        caddress = st.text_input('Address')
        if not company:
            st.stop()

        cpcode = st.text_input('Postal code')
        if not cpcode:
            st.stop()

        ccity = st.text_input('City')
        if not ccity:
            st.stop()

        cphone = st.text_input('Phone')
        if not cphone:
            st.stop()


    st.subheader('Subscription')
    pack=st.radio('package', ['Gold','silver','bronz','<--- choose'],horizontal=True,index=3)
    if '<--- choose' in pack:
        st.stop()
    if 'Gold' in pack:
        st.success('Kr. 1185.00 årligt inkl. moms')
    if 'silver' in pack:
        st.success('885.00 årligt inkl. moms')
    if 'bronz' in pack:
        st.success('585.00 årligt inkl. moms')

    goog=st.radio('include google map', ['Yes','No','<--- choose'],horizontal=True,index=2)
    if '<--- choose' in goog:
        st.stop()
    if 'Yes' in goog:
        st.success('Kr. 75.00 årligt inkl. moms')

    alarm=st.radio('Include alarmcentral', ['Yes','No','<--- choose'],horizontal=True,index=2)
    if '<--- choose' in alarm:
        st.stop()
    if 'Yes' in alarm:
        st.success('Tilvælg alarmcentral + 400.00 årligt inkl. moms')
        ins=['--Select--','Topdanmark Forsikring A/S','Tryg Forsikring A/S','ALG Europe','Alka Forsikring','Alm. Brand Forsikring A/S','Andet']    

        ins2=st.selectbox('Your car insurance company',ins)
        if ins2 == '--Select--':
            st.stop()

    st.subheader('Vehicle')

    plate = st.text_input('Registration Plate')
    if not plate:
        st.stop()

    brand = st.text_input('Brand')
    if not brand:
        st.stop()

    model = st.text_input('Model')
    if not model:
        st.stop()


    year = st.text_input('Year')
    if not year:
        st.stop()


    subm=st.button('Send')
    if subm:
        st.write('Check your email to continue')