ct
This commit is contained in:
parent
85fc8b461d
commit
47999eff61
1 changed files with 5 additions and 5 deletions
|
@ -83,7 +83,7 @@ def create_app(test_config=None):
|
||||||
users = c.fetchall()
|
users = c.fetchall()
|
||||||
text = ""
|
text = ""
|
||||||
for i in users:
|
for i in users:
|
||||||
text = text + f'<p><a href="list/user?id={i[0]}">{escape(i[1])}</a>: {i[2]}€ <form action="/change" method="post"><input name="id" type="hidden" value="{i[0]}"> <input name="change" type="number" step="0.1" placeholder="add to balance"></form></p> <br style="line-height: 50%;"></br>'
|
text = text + f'<p><a href="list/user?id={i[0]}">{escape(i[1])}</a>: {i[2]/100}€ <form action="/change" method="post"><input name="id" type="hidden" value="{i[0]}"> <input name="change" type="number" step="0.1" placeholder="add to balance"></form></p> <br style="line-height: 50%;"></br>'
|
||||||
return '''<!DOCTYPE html>
|
return '''<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
|
||||||
|
@ -134,7 +134,7 @@ def create_app(test_config=None):
|
||||||
</script>
|
</script>
|
||||||
<title>{escape(user[1])}</title>
|
<title>{escape(user[1])}</title>
|
||||||
<p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
|
<p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
|
||||||
<p> {escape(user[1])} : {escape(user[2])}€ <p>
|
<p> {escape(user[1])} : {escape(user[2]/100)}€ <p>
|
||||||
<form action="/addtag" method="post"><input name="id" type="hidden" value="{user[0]}"><button type="submit">Add Tag</button></form>
|
<form action="/addtag" method="post"><input name="id" type="hidden" value="{user[0]}"><button type="submit">Add Tag</button></form>
|
||||||
<form action="/removetag" method="post"><input name="id" type="hidden" value="{user[0]}"><button type="submit">Remove Tag</button></form>
|
<form action="/removetag" method="post"><input name="id" type="hidden" value="{user[0]}"><button type="submit">Remove Tag</button></form>
|
||||||
</p><form action="/change" method="post"><input name="id" type="hidden" value="{user[0]}"> <input name="change" type="number" step="0.1" placeholder="change balance"></form>
|
</p><form action="/change" method="post"><input name="id" type="hidden" value="{user[0]}"> <input name="change" type="number" step="0.1" placeholder="change balance"></form>
|
||||||
|
@ -213,7 +213,7 @@ def create_app(test_config=None):
|
||||||
users = c.fetchall()
|
users = c.fetchall()
|
||||||
if users != []:
|
if users != []:
|
||||||
balance_old = users[0][2]
|
balance_old = users[0][2]
|
||||||
c.execute(f"UPDATE users SET balance = balance + {change} WHERE id={user_id}")
|
c.execute(f"UPDATE users SET balance = balance + {change*100} WHERE id={user_id}")
|
||||||
db.commit()
|
db.commit()
|
||||||
c.execute(f"SELECT * FROM users WHERE id={user_id}")
|
c.execute(f"SELECT * FROM users WHERE id={user_id}")
|
||||||
user = c.fetchone()
|
user = c.fetchone()
|
||||||
|
@ -319,7 +319,7 @@ def create_app(test_config=None):
|
||||||
change = int(request.args.get("change"))
|
change = int(request.args.get("change"))
|
||||||
except:
|
except:
|
||||||
change = -1
|
change = -1
|
||||||
c.execute(f"UPDATE users SET balance = balance + {change} WHERE id={user[0]}")
|
c.execute(f"UPDATE users SET balance = balance + {change*100} WHERE id={user[0]}")
|
||||||
db.commit()
|
db.commit()
|
||||||
c.execute(f"SELECT * FROM users WHERE id = {userid}")
|
c.execute(f"SELECT * FROM users WHERE id = {userid}")
|
||||||
user_new = c.fetchone()
|
user_new = c.fetchone()
|
||||||
|
@ -387,7 +387,7 @@ def create_app(test_config=None):
|
||||||
if user_list != []:
|
if user_list != []:
|
||||||
balance_old = user_list[0][2]
|
balance_old = user_list[0][2]
|
||||||
if user_queue.qsize() == 0:
|
if user_queue.qsize() == 0:
|
||||||
c.execute(f"UPDATE users SET balance = balance - 1.5 WHERE id={tag[1]}")
|
c.execute(f"UPDATE users SET balance = balance - 150 WHERE id={tag[1]}")
|
||||||
db.commit()
|
db.commit()
|
||||||
c.execute(f"SELECT * FROM users WHERE id={tag[1]}")
|
c.execute(f"SELECT * FROM users WHERE id={tag[1]}")
|
||||||
user = c.fetchone()
|
user = c.fetchone()
|
||||||
|
|
Loading…
Reference in a new issue