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 31 32 33 34 35 36 37 38 39 40 41 42
|
def affichage(lines):
total = len(lines)
if total != 0:
print "<h3>affichage des %d resultats</h3>" %( total )
print ' <fieldset> <legend>Photo(s)</legend> <p> '
for line in lines:
result = '''
<table>
<tr> <th > <strong> INFORMATION </ strong> </ th>
<th> <strong> PHOTO </ strong> </ th> </ tr>
<tr><td >
<strong>ID : %d </strong> <br />
Auteur : %s <br />
titre : %s <br />
theme : %s <br />
date : %s <br />
lieu : %s <br />
mot clé : %s <br />
<a href = "%s"> source : %s (cliquer pour agrandir) </a>
</ td>
<tr><td >
<img style="width: 20em; height: 20em" src="file///%s" />
</ td> </ tr>
</ table>
</ fieldset>
''' %( line[0], line[1], line[2], line[3], line[4], line[5], line[6], line[7], line[7], line[7] )
# la source est sous forme: "G:/theme/date/titre.jpg"
print result
# Recuperation des donnees
print "<br />", SQL, "<br />"
curs.execute( SQL )
rows=curs.fetchall()
affichage(rows)
print "fin" |
Partager