From ac29bde1938e9692d3d98ebc66416a07e5fbf3a0 Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Fri, 3 Dec 2021 06:42:13 +0100 Subject: [PATCH] Formulaire de suggestion fonctionnel --- app.py | 19 ++++++++++++++----- pages.py | 3 +++ site.db | Bin 45056 -> 45056 bytes 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 4cfb380..80a6a25 100644 --- a/app.py +++ b/app.py @@ -25,12 +25,21 @@ def sauveteur(idsauveteur): def bateau(idbateau): return pages.bateau(idbateau) -@app.route('/modifications') -@app.route('/modifications/') -@app.route('/modification') -@app.route('/modification/') +@app.route('/modifications', methods=['GET', 'POST']) +@app.route('/modifications/', methods=['GET', 'POST']) +@app.route('/modification', methods=['GET', 'POST']) +@app.route('/modification/', methods=['GET', 'POST']) def modifs(): - return pages.modifs() + if request.method == 'POST': + nom = request.form["nom"] + prenom = request.form["prenom"] + mail = request.form["email"] + article = request.form["article"] + modif = request.form["modif"] + pages.suggestion(nom,prenom,mail,article,modif) + return pages.main() + else: + return pages.modifs() @app.route('/expeditions/') @app.route('/expedition/') diff --git a/pages.py b/pages.py index 3b826d9..7115cab 100644 --- a/pages.py +++ b/pages.py @@ -116,3 +116,6 @@ def search(texte): results.append(r) return render_template("searchresults.html",liste=results) + +def suggestion(nom,prenom,mail,article,modif): + lib.ex_sql(dbname,"INSERT INTO suggestion(prenom, nom, mail, nomarticle, suggestion) VALUES (?, ?, ?, ?, ?);",(nom,prenom,mail,article,modif)) diff --git a/site.db b/site.db index 3f6fb5d2835c24fad34a639d548deeebc82ece71..891aa9db1ff9c61fb1792332ce8ebb0405f2548c 100644 GIT binary patch delta 404 zcmZp8z|`=7X@az%1Oo#DHxP3GF(U&5Q|Lq;V?_xDz2F314iN@Ub}a^eBiTEiCtV#k+GS( zBrz!`wYW4rJ+-(bGd~Z(VsQ>~bqsM;2yt}saaB-4NGK_2aB(8><1ThB@8f5*p4e!<$e{oL D_c?NA delta 146 zcmZp8z|`=7X@az%2m=EHHxRP`F%u94Ow=(}6k*Vl*}%&o!ob0<#lUaG+rxc?ZzktF zZa;P{jyTq7tnW7m3W%{zp2j+R;)I`@wb*~KFfrzAY|LQX+{0TTB*4PIgMt49{|)|6 s{5$v?_!~A08szX#ZqQepI6-{!4t)