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