Please guide me if there is a problem with these codes
import streamlit as st
import sqlite3
from streamlit_option_menu import option_menu
con=sqlite3.connect(‘picscols.db’,check_same_thread=False)
cur=con.cursor()
cur.execute(‘CREATE TABLE IF NOT EXISTS pics(id TEXT, img BLOB, note TEXT)’)
st.set_page_config(page_title=“خدمات PVC - رمکان”, page_icon=“https://namapoush.ir/wp-content/uploads/2021/06/WhatsApp-Image-2021-06-05-at-12.42.50.jpeg”)
selected = option_menu (
menu_title=None,
options=[“تماس با ما”,“ورود ادمین”,“صفحه اصلی”],
icons=[“house”,“book”, “envelope”],
menu_icon=“cast”,
default_index=2,
orientation=“horizontal”,
styles={
"nav-link":{
'font-family': 'Courier New' 'Courier' 'monospace'
},
}
)
with st.expander(“خدمات PVC - رمکان”,expanded=True):
col1,col2=st.columns(2)
with col1:
st.write("خدمات و اجرای نصب pvc با طرح های مختلف - در سر تا سر جزیره قشم")
with col2:
st.image("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQgD3vXk45UtxrEbUektF9sAtgXPr8XPKk_7w&usqp=CAU")
with open(‘c.css’) as f:
st.markdown(f’{f.read()}’ ,unsafe_allow_html=True)
st.markdown(“”"
@import url(‘https://fonts.googleapis.com/css2?family=Lalezar&display=swap’);
.css-10trblm.e16nr0p30{
font-family: ‘Lalezar’, cursive;
padding: 3px;
text-align: center;
text-shadow: black 2px 2px 17px;
color: rgb(57, 60, 100);
}
.block-container{
direction: rtl;
}
/* BTN BALA */
.e1fb0mya1.css-fblp2m.ex0cdmw0{
border-style: groove;
border-color: black;
background: linear-gradient(rgb(40, 110, 114),rgb(77, 77, 192),rgb(75, 25, 25));
}
.e1fb0mya1.css-fblp2m.ex0cdmw0:hover{
background: linear-gradient(rgb(10, 243, 255),rgb(37, 37, 252),rgb(255, 34, 34));
}
/* صفحه بالا /
.css-1avcm0n.e8zbici2{
background: linear-gradient(rgb(7, 17, 9),rgb(44, 44, 83),rgb(5, 58, 59));
}
/ PVC /
.css-10trblm.e16nr0p30{
color: aliceblue;
background: linear-gradient(rgb(4, 48, 61),rgb(10, 10, 58),rgb(55, 212, 214));
border-radius: 5px;
width: 100%;
}
/ Home */
.main.css-k1vhr4.egzxvld3{
background: linear-gradient(rgb(5, 42, 44),rgb(5, 5, 19),rgb(14, 8, 8));
}
.css-8ojfln.e1wqxbhn1{
font-family: ‘Lalezar’, cursive;
}
/* cALL */
.css-183lzff.eyqtai90{
font-family: ‘Lalezar’, cursive;
text-shadow: rgb(87, 61, 7) 1px 1px 9px;
color: rgb(238, 209, 45);
}
.css-1fv8s86.e16nr0p34 p{
font-family: ‘Lalezar’, cursive;
color: rgb(57, 194, 123);
text-shadow: rgb(41, 194, 21) 1px 1px 9px;
}
.css-5uatcg.edgvbvh5{
font-family: ‘Lalezar’, cursive;
}
.css-1v0mbdj.etr89bj1 img{
border-style: groove;
border-color: rgb(8, 55, 99);
width: 200px;
height: 150px;
border-radius: 13px;
box-shadow: rgb(0, 0, 0) 1px 1px 7px;
}
.css-1fv8s86.e16nr0p34 a{
font-family: ‘Lalezar’, cursive;
text-align: center;
text-decoration: none;
padding: 5px;
border-radius: 11px;
background: linear-gradient(rgb(14, 47, 49),rgb(5, 43, 75),rgb(10, 8, 14));
}
.css-1fv8s86.e16nr0p34 a:hover{
color: aliceblue;
border-style: groove;
border-color: rgb(22, 22, 43);
background: linear-gradient(rgb(47, 146, 151),rgb(57, 110, 153),rgb(10, 8, 14));
}
/* Label /
.css-1yy6isu.e16nr0p34 p{
font-family: ‘Lalezar’, cursive;
color: rgb(51, 206, 46);
text-shadow: rgb(161, 245, 65) 1px 1px 9px;
}
/ Navbar */
.css-6qob1r.e1fqkh3o3{
background: linear-gradient(rgb(5, 5, 19),rgb(5, 42, 44),rgb(14, 8, 8));
}
“”" ,unsafe_allow_html=True)
if selected == “ورود ادمین”:
username = st.text_input(label="نام کاربری",placeholder="Username")
password = st.text_input(label="پسورد",placeholder="password",type="password")
btnLogin = st.button("ورود")
if username == "admin" and password == "admin":
st.success("خوش آمدی ادمین")
selected = option_menu(options=["پست های ادمین"],
menu_title=""
)
elif username or password == "admin":
st.error("لطفا درست وارد کنید")
if selected == “پست های ادمین”:
if st.button('اضافه کردن محصول'):
cur.execute('INSERT INTO pics(id, img, note) VALUES(?,?,?)', ('', '', ''))
con.commit()
for row in cur.execute('SELECT rowid, id, img, note FROM pics ORDER BY id'):
with st.form(f'ID-{row[0]}', clear_on_submit=True):
imgcol, notecol = st.columns([3, 2])
id=notecol.text_input('کد محصول', row[1])
note=notecol.text_area('نام محصول', row[3])
if row[2]:
img=row[2]
imgcol.image(row[2])
file=imgcol.file_uploader('تصاویر', ['png', 'jpg', 'gif', 'bmp'])
if file:
img=file.read()
if notecol.form_submit_button('ذخیره محصول'):
cur.execute(
'UPDATE pics SET id=?, img=?, note=? WHERE id=?;',
(id, img, note, str(row[1]))
)
con.commit()
st.experimental_rerun()
if notecol.form_submit_button("حذف محصول"):
cur.execute(f'''DELETE FROM pics WHERE rowid="{row[0]}";''')
con.commit()
st.experimental_rerun()
if selected == “صفحه اصلی”:
for row in cur.execute('SELECT rowid, id, img, note FROM pics ORDER BY id'):
# with st.form(f'ID-{row[0]}', clear_on_submit=True):
st.write("---")
imgcol, notecol = st.columns([3, 2])
# id=notecol.text_input('id', row[1])
id=notecol.text_input('کد محصول', row[1])
note=notecol.text_area('اسم محصول', row[3])
if row[2]:
img=row[2]
imgcol.image(row[2])
if selected == “تماس با ما”:
col1,col2 = st.columns(2)
with col1:
st.image(“https://pvcahmad.vercel.app/ahmad.jpg”)
with col2:
st.write(“احمد ژرف”)
st.text(" شماره تماس : 09172114362 ")
st.write(“من از سال 1374 شروع به فعالیت کردم و سابقه کار تو حوزه طراحی و اجرای نصب پی وی سی با طرح های مختلف در سر تا سر جزیره قشم فعالیت میکنم و در خدمت شما مردم هستم برای اجرای نصب پی وی سی با من تماس بگیرید .”)
st.write(“—”)
st.markdown(" طراح و برنامه نویس : عبدالله چلاسی ")
st.markdown(“”"
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
“”",unsafe_allow_html=True)Preformatted text