Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Difficultés de réaffichage après une suppression

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
kaas
Smarty Rookie


Joined: 05 Feb 2009
Posts: 13

PostPosted: Thu Feb 05, 2009 11:20 am    Post subject: Difficultés de réaffichage après une suppression Reply with quote

Bonjour,

Je voudrais par ce post demander un coup de main.
Mon problème est le suivant
je dispose de deux fichiers tpl :
main et liste organisés comme suit :
Dans
main.tpl
Code:

{include file='liste.tpl'}

Voici un apreçu de :
liste.tpl
Code:

<thead align="center">
        <tr>
            <th>Exercice</th>
            <th>Debut</th>
            <th>Fin</th>
       <td colspan="2" class="price"><span class="add"><a href="ajout_exercice.php"><span class="">Ajouter</span></a></span></td>
        </tr>
    </thead>
 <tbody>
   {section name=idx loop=$donnees}
        <tr style="background-color:{cycle values="#66CCCC, #cccccc"};">
            <td>
                {$donnees[idx].intitule_exercice}
            </td>
            <td>
                {$donnees[idx].ddebut_exercice|date_format:"%d/%m/%Y"}
            </td>
            <td>
                {$donnees[idx].dfin_exercice|date_format:"%d/%m/%Y"}
            </td>
       <td>
                <a href="modif_exercice.php?num={$donnees[idx].num_exercice}">Modifier</a>
            </td>
       <td>
                <a href="del_exercice.php?num={$donnees[idx].num_exercice}" onclick="return(confirm('Etes-vous sûr de vouloir supprimer cette information ?'))">Supprimer</a>
            </td>
        </tr>
   {/section}
 </tbody>

c'est dire qu'au finish, j'ai une page avec des lignes de données et un lien pour faire des suppressions de lignes.
del_exercice.php

Code:

<?php
require_once('connexion.php');
require_once('MySmarty.php');
//Instanciation de la classe
$smarty = new Smarty();
$numrep = $_GET['num'];
 
$requete = "delete from exercice where num_exercice= ".$numrep."";
$rst_exercice= mysql_query($requete);
 
//Affichage des données
$smarty->display('main.tpl');
?>

Malheureusement le résultat est catastrophique. J'obtiens un tableau avec les titres des colonnes sans les données.
J'attends vos suggestions
merci d'avance
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP