diff options
author | clyhtsuriva <clyhtsuriva@gmail.com> | 2020-03-29 19:53:38 +0200 |
---|---|---|
committer | clyhtsuriva <clyhtsuriva@gmail.com> | 2020-03-29 19:53:38 +0200 |
commit | dc539fda0108dc724693fbdd7599bd86980f0de0 (patch) | |
tree | 46765165f34ac356cf0ec1aafeef29f9e8a77c66 /www/html/index.py | |
parent | 8e56aac1e0af4c724f2e6d26746217e1f1812909 (diff) |
some web changes
Diffstat (limited to 'www/html/index.py')
-rwxr-xr-x | www/html/index.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/www/html/index.py b/www/html/index.py new file mode 100755 index 0000000..010ed2d --- /dev/null +++ b/www/html/index.py @@ -0,0 +1,39 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import mod_python +from fonctions import baseHTML, connexionBD + +def index(req): + req.content_type="text/html" + + content=str() + +#sql part + conn=connexionBD() + cur=conn.cursor() + sql="select * from trame;" + cur.execute(sql) + conn.commit() + data=cur.fetchall() + conn.close() +#sql part + + for i in data : + content+=("""<tr>""" + +"""<td>""" + str(i[1]) + """</td>""" + +"""<td>""" + str(i[2]) + """</td>""" + +"""<td>""" + str(i[3]) + """</td>""" + +"""<td>""" + str(i[4]) + """</td>""" + +"""</tr>""") + + req.write(baseHTML("ATS-Project",""" +<center><h1>ATS-Project</h1></center> +<table> +<tr><th>Heure</th><th>Protocole</th><th>Source</th><th>Destination</th></tr> +""" ++ content + +""" +</table> +""")) #tableheads to change so it takes the output of the select + |