aboutsummaryrefslogtreecommitdiff
path: root/www/html/fonctions.py
blob: 17c36244dd4e49eb9a8a554845168e411f49abdb (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
#!/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>"""+ body +"""</body>
</html>

            """)
    return content


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

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