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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| <?php
session_start();
include ('connect.php');
$query = $_SESSION['queryExport'];
$result = mysql_query($query, $connexion) or die(mysql_error());
ini_set('max_execution_time', 0);
header("content-type: application/octet-stream");
header("Content-Type: application/vnd.ms-excel");
//include("../configuration.inc.php");
if ($_SESSION['NumRep'] == 1)
{
$row_affichageDate = mysql_fetch_array($result);
$file_name = "liste des adherents";
$extension = ".xls";
$fichier = $file_name.$extension;
header("Content-Disposition: attachment; filename=".$fichier);
echo "<table cellpadding=\"4\">
<tr bgcolor=\"#cccccc\">
<td><strong>num inscription</strong></td>
<td><strong>nom </strong></td>
<td><strong>adress</strong></td>
<td><strong>num portable</strong></td>
</tr>";
$couleur = 0;
while($row_affichage = mysql_fetch_array($result))
{
if($couleur%2 == 0)
{
echo "<tr bgcolor=\"#ffffff\">";
}
else
{
echo "<tr bgcolor=\"#D7F1B4\">";
}
?>
<td><?php echo ($row_affichage['num_inscp_ben']); ?></td>
<td><?php echo ($row_affichage['nom_adh']); ?></td>
<td><?php echo ($row_affichage['adresse_adh']); ?></td>
<td><?php echo ($row_affichage['tel_portabl_adh']); ?></td>
</tr>
<?php
$couleur++;
}
echo "</table>";
}
?> |