#!/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 {} ORDER BY heure DESC;".format(condition) cur.execute(sql) conn.commit() data=cur.fetchall() conn.close() for i in data : content+=("""""" + """""" + str(i[1]) + """""" + """""" + str(i[2]) + """""" + """""" + lien('ip_source.py?ip=' + str(i[3]), str(i[3])) + """""" + """""" + lien('ip_destination.py?ip=' + str(i[4]), str(i[4])) + """""" + """""" + lien('port_source.py?port=' + str(i[5]), str(i[5])) + """""" + """""" + lien('port_destination.py?port=' + str(i[6]), str(i[6])) + """""" + """""") req.write(""" """ + content + """
HeureProtocoleIP SourceIP DestinationPort SourcePort Destination
""")