Exportation excel

Fermé
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 - 31 août 2015 à 17:48
bonjour,

voici mon code qui affiche la liste des élèves d'une école.
je souhaiterai au bas de la liste mettre un lien d'exportation vers excel
comment faire svp?? suis pas encore pro en php


<?php
session_start();
if (!(isset($_SESSION['NIV']))){
    header("location:index.html");
}

require_once("connection.php");
$order = isset($_GET['order'])?$_GET['order']:'ASC';
$req = "select * from ELEVES
           ORDER BY CLASSE $order ";
$rs = mysql_query($req) or die(mysql_error());

$thOrder = $order == 'ASC'? 'DESC' : 'ASC';

?>


<html>
<head>
    <meta charset="utf-8">
<title>Affichage des élèves</title>
<link href="stle.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function imprimer(url){
  options = "Width=700,Height=700" ;
  window.open( url, "Impression", options ) ;
 }
</script>
</head>
<body>
<table width="500" border="0">
    <tr>
        <td><a href="saisieEleve.html"><br>Inscrire un élève</a></td>
        <td><a href="ChercherEleves.php"><br>Rechercher un élève</a></td>
        <td><a href="index.html"><br>Accueil</a></td>
    </tr>
</table>
<br>
<table border="1" width="50%">
    <tr>
        <th></th>
        <th>PHOTO</th>
        <th><a href="?order=<?php echo $thOrder; ?>" >CLASSE </a></th>
        <th>SECTION</th>
        <th>GROUPEMENT</th>
        <th>INSCRIPTION</th>
        <th>NOM</th>
        <th>PRENOM</th>
        <th>POSTNOM</th>
        <th>NAISSANCE</th>
        <th>SEXE</th>
        <th>NATIONALITE</th>
        <th>ADRESSE</th>
        <th>PERE</th>
        <th>TEL PERE</th>
        <th>ADRESSE DOMICILE</th>
    </tr>
    <?php while ($ET = mysql_fetch_assoc($rs)) { ?>
        <tr>
            <td><a href="detailEleve.php?code=<?php echo $ET['CODE'] ;?>" class="bouton" 
onclick="imprimer('detailEleve.php?code=<?php echo $ET['CODE'];?>') ;return false;">Imprimer</a></td>
            <td><img src="images/<?php echo($ET['PHOTO']) ?>" width="90" height="113"</td>
            <td><?php echo($ET['CLASSE']) ?></td>
            <td><?php echo($ET['SECTION']) ?></td>
            <td><?php echo($ET['GROUPEMENT']) ?></td>
            <td><?php echo($ET['INSCRIPTION']) ?></td>
            <td><?php echo($ET['NOM']) ?></td>
            <td><?php echo($ET['PRENOM']) ?></td>
            <td><?php echo($ET['POSTNOM']) ?></td>
            <td><?php echo($ET['NAISSANCE']) ?></td>
            <td><?php echo($ET['SEXE']) ?></td>
            <td><?php echo($ET['NATIONALITE']) ?></td>
            <td><?php echo($ET['ADRESSE']) ?></td>
            <td><?php echo($ET['PERE']) ?></td>
            <td><?php echo($ET['TELPERE']) ?></td>
            <td><?php echo($ET['ADRESSE1']) ?></td>
            <?php if ($_SESSION['NIV'] == 0) { ?>
                <td><a href="supprimerEleve.php?code=<?php echo($ET['CODE']) ?>" class="bouton">Supprimer</a></td>
                <td><a href="editEleve.php?code=<?php echo($ET['CODE']) ?>" class="bouton">Editer</a></td>
            <?php } ?>
        </tr>
    <?php } ?>
</table>
</body>
</html>