aboutsummaryrefslogtreecommitdiff
path: root/www/html/fonctions.py
blob: ef29718e0dc9930218e71b9e1ea398c1171dc0df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import psycopg2

def baseHTML(title,body):
    content=("""<!DOCTYPE html>
<html>
        <head>
                <title>"""+ title +"""</title>
                <meta charset="UTF-8">
                <link rel="stylesheet" type="text/css" href="style.css">
        </head>
        <body>
            <nav>
                <a href="/index.py/">Index</a> |
                <a href="/fitre.py/">Filtre</a>
        """+ body +"""</body>
</html>

            """)
    return content


def connexionBD():
    connexion=psycopg2.connect ("host='localhost' dbname='atsdb' user='atsuser' password='123456'")
    return connexion

def lien(url,texte):
    content=("""<a href=" """ + url + """ ">""" + texte + """</a>""")
    return content