Première version publique
[auf_paf.git] / excel.php
CommitLineData
98ff4c8e 1<?php\r
2 error_reporting (E_ALL ^ E_NOTICE); //------pour &eacute;viter les notices sur les variables---------------\r
3 session_start();\r
4 $admin=$_SESSION["adminAUFPPKH"];\r
5 $UserName=$_SESSION["UserNamePAF"];\r
6 $Password=$_SESSION["PasswordPAF"];\r
7 include("includes/redirect.php");\r
8 if(!($admin == "y")){\r
9 redirect("index.php");\r
10 }\r
11\r
12$cdate = date("Y-m-d");\r
13\r
14header("Content-type: application/vnd.ms-excel");\r
15header("Content-Disposition: attachment; filename=tableau_on_$cdate.xls");\r
16\r
17\r
18// selectionner la base de donn&eacute;es\r
19include("includes/connection.php");\r
20include("includes/functions.php");\r
21/*$mysql_host = 'localhost';\r
22$mysql_user = 'root';\r
23$mysql_pass = 'root';\r
24$mysql_db = 'pafauf_bdd';\r
25$query_string = "select * from v_excel";\r
26$mysql_link = mysql_connect($mysql_host,$mysql_user,$mysql_pass);\r
27\r
28mysql_select_db($mysql_db, $mysql_link);*/\r
29$sql = "SELECT * FROM v_excel";\r
30$sql = mysql_query($sql);\r
31\r
32$tbl= " <table border='100px' cellpadding='0' cellspacing='0'>\r
33<tr bgcolor='#CCCCCC' height='30px'>\r
34<td width='30px'><b>No.</b></td>\r
35<td width='100px'><b>Nom</b></td>\r
36<td width='150px'><b>Pr&eacute;nom</b></td>\r
37<td width='50px'><b>Genre</b></td>\r
38<td width='150px'><b>Date de Naissance</b></td>\r
39<td width='100px'><b>Nationalit&eacute;</b></td>\r
40<td width='100px'><b>Universit&eacute;</b></td>\r
41<td width='100px'><b>Facult&eacute;</b></td>\r
42<td width='50px'><b>Promotion</b></td>\r
43<td width='100px'><b>Ann&eacute;e Dimpl&ocirc;me</b></td>\r
44<td width='50px'><b>DELF / DALF</td>\r
45<td width='100px'><b>Ann&eacute;e DELF / DALF</b></td>\r
46<td width='100px'><b>Autres Langues</b></td>\r
47<td width='100px'><b>E-mail</b></td>\r
48<td width='100px'><b>T&eacute;l&eacute;phone Personnel</b></td>\r
49<td width='200px'><b>Adresse Personnelle</b></td>\r
50<td width='100px'><b>T&eacute;l&eacute;phone Parents</b></td>\r
51<td width='200px'><b>Adresse Parents</b></td>\r
52<td width='100px'><b>Titre du Travail ou Stage</b></td>\r
53<td width='200px'><b>Adresse du Travail ou Stage Actuel</b></td>\r
54</tr>";\r
55$i=1;\r
56while ($data = mysql_fetch_array($sql))\r
57{\r
58$tbl = $tbl . "<tr>";\r
59$tbl = $tbl . "<td>" . $i . "</td>";\r
60$tbl = $tbl . "<td>" . $data['1'] . "</td>";\r
61$tbl = $tbl . "<td>" . $data['2'] . "</td>";\r
62$tbl = $tbl . "<td>" . $data['3'] . "</td>";\r
63$tbl = $tbl . "<td>" . ChangeDateValueSelect($data['4']) . "</td>";\r
64$tbl = $tbl . "<td>" . $data['5'] . "</td>";\r
65$tbl = $tbl . "<td>" . $data['6'] . "</td>";\r
66$tbl = $tbl . "<td>" . $data['7'] . "</td>";\r
67$tbl = $tbl . "<td>" . $data['8'] . "</td>";\r
68$tbl = $tbl . "<td>" . $data['9'] . "</td>";\r
69$tbl = $tbl . "<td>" . $data['10'] . "</td>";\r
70$tbl = $tbl . "<td>" . $data['11'] . "</td>";\r
71$tbl = $tbl . "<td>" . $data['12'] . "</td>";\r
72$tbl = $tbl . "<td>" . $data['13'] . "</td>";\r
73$tbl = $tbl . "<td>" . $data['14'] . "</td>";\r
74$tbl = $tbl . "<td>" . $data['15'] . "</td>";\r
75$tbl = $tbl . "<td>" . $data['16'] . "</td>";\r
76$tbl = $tbl . "<td>" . $data['17'] . "</td>";\r
77$tbl = $tbl . "<td>" . $data['18'] . "</td>";\r
78$tbl = $tbl . "<td>" . $data['19'] . "</td>";\r
79$i++;\r
80$tbl = $tbl . "</tr>";\r
81}\r
82$tbl = $tbl . "</table>";\r
83\r
84print $tbl ; \r
85\r
86?>\r