aboutsummaryrefslogtreecommitdiff
path: root/www/html/affiche-tab.py
diff options
context:
space:
mode:
Diffstat (limited to 'www/html/affiche-tab.py')
-rw-r--r--www/html/affiche-tab.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/www/html/affiche-tab.py b/www/html/affiche-tab.py
new file mode 100644
index 0000000..2f5a516
--- /dev/null
+++ b/www/html/affiche-tab.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+
+import mod_python
+from fonctions import baseHTML, connexionBD, lien
+
+def index(req):
+ req.content_type="text/html"
+ content=str()
+
+ condition=req.form["condition"]
+
+ conn=connexionBD()
+ cur=conn.cursor()
+ sql="select * from paquet where {}".format(condition)
+ cur.execute(sql)
+ conn.commit()
+ data=cur.fetchall()
+ conn.close()
+
+ for i in data:
+ content+=("""<tr>""" +
+"""<td>""" + str(i[1]) + """</td>""" +
+"""<td>""" + str(i[2]) + """</td>""" +
+"""<td>""" + str(i[3]) + """</td>""" +
+"""<td>""" + lien('destination.py?ip=' + str(i[4]), str(i[4])) + """</td>""" +
+"""<td>""" + str(i[5]) + """</td>""" +
+"""<td>""" + str(i[6]) + """</td>""" +
+"""</tr>""")
+
+ req.write("""
+<center><table>
+<tr><th>Heure</th><th>Protocole</th><th>IP Source</th><th>IP Destination</th><th>Port Source</th><th>Port Destination</th></tr>
+"""
++ content +
+"""
+</table></center>
+"""))
+