|
mick66 66
| Posté : 04-06-2013 17:07
Bonjour à tous,
J'ai un petit souci je voudrais creer un bouton pour vider lnl envoyé mais ma requete ne fonctionne pas je pense que le pb vient que je suis dans une function .... car je passe pas dans ma function( echo non visible )
voici le bout du code qui peut m'aider svp ...
function lnl_list() {
global $hlpfile;
global $NPDS_Prefix;
!include! ("header.php");
GraphicAdmin($hlpfile);
opentable();
if (isset($_POST['lnl_send'])) {
//Vide la table
$query = "TRUNCATE TABLE `lnl_send`";
$result = sql_query($query);
echo('test');
}
$result = sql_query("select ref, header , body, footer, number_send, type_send, date, status from ".$NPDS_Prefix."lnl_send ORDER BY date");
echo "\n";
echo "
";
echo "";
echo "Num. | ";
echo "".adm_translate("Entête")." | ";
echo "".adm_translate("Corps")." | ";
echo "".adm_translate("Pied")." | ";
echo "".adm_translate("Nbre d'envois effectués")." | ";
/*echo "".adm_translate("Type")." | ";*/
echo "Date | ";
echo "Status | ";
echo " ";
while (list($ref, $header, $body, $footer, $number_send, $type_send, $date, $status) = sql_fetch_row($result)) {
$rowcolor = tablos();
echo "";
echo "$ref | ";
echo "$header | ";
echo "$body | ";
echo "$footer | ";
echo "$number_send | ";
/*echo "$type_send | ";*/
echo "$date | ";
if ($status=="NOK") {
echo "$status | ";
} else {
echo "$status | ";
}
echo " ";
}
echo " ";
echo "[ ".adm_translate("Retour en arrière")." ]";
//Formulaire
echo "
";
closetable();
!include! ("footer.php");
}
|  Profil
|
|
mick66 66
| Posté : 04-06-2013 17:08
function lnl_list() {
global $hlpfile;
global $NPDS_Prefix;
!include! ("header.php");
GraphicAdmin($hlpfile);
opentable();
if (isset($_POST['lnl_send'])) {
//Vide la table 'nom_de_la_table'
$query = "TRUNCATE TABLE `lnl_sen d`";
$result = sql_query($query);
echo('test');
}
$result = sql_query("select ref, header , body, footer, number_send, type_send, date,&nb sp;status from ".$NPDS_Prefix."lnl_send ORDER BY date" );
echo "<table width=\"100%\" cellspacing=\ "2\" cellpadding=\"2\" border=\"0\"><tr><td class=\" header\">\n";
echo adm_translate("Liste des LNL envoy ées");
echo "</td></tr></table>\n";
echo "<br /><table width=\"100%\"&n bsp;cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
echo "<tr>";
echo "<td class=\"ongl\">Num.</td>";
echo "<td class=\"ongl\">".adm_translate("E ntête")."</td>";
echo "<td class=\"ongl\">".adm_translate("C orps")."</td>";
echo "<td class=\"ongl\">".adm_translate("P ied")."</td>";
echo "<td class=\"ongl\">".adm_translate("N bre d'envois effectués")."</td>";
/*echo "<td class=\"ongl\">".adm_translate( "Type")."</td>";*/
echo "<td class=\"ongl\">Date</td>";
echo "<td class=\"ongl\">Status</td>" ;
echo "</tr>";
while (list($ref, $header, $body, $foot er, $number_send, $type_send, $date, $status) = s ql_fetch_row($result)) {
$rowcolor = t ablos();
echo "<tr $rowcolor>";
echo "<td>$r ef</td>";
echo "<td>$h eader</td>";
echo "<td>$b ody</td>";
echo "<td>$f ooter</td>";
echo "<td>$n umber_send</td>";
/*echo "<td> $type_send</td>";*/
echo "<td>$d ate</td>";
if ($status=="NOK" ) {
echo& nbsp;"<td class=\"rouge\">$status</td>";
} else {
echo& nbsp;"<td>$status</td>";
}
echo "</tr>";
}
echo "</table><br />";
echo "[ <a href=\"!javascript!:history.go ('1)\" class=\"noir\">".adm_translate("Retour en arrière")."& lt;/a> ]";
//Formulaire
echo "
<form method=\"post\" action=".$_SERVER['PHP_SELF'].">
<input type=hidden value=\"lnl_send\"> ;
<input type=submit value=\"Vider la table\">
</form>
";
closetable();
!include! ("footer.php");
}
|  Profil
|
|
colonelwog 1949
| Posté : 04-06-2013 20:41
déjà t'as une erreur d'espace dans ton code pour le sql à send
$query = "TRUNCATE TABLE `lnl_sen d`";
|  Profil E-mail www
|
|
mick66 66
| Posté : 04-06-2013 20:52
sur le sql
$query = "TRUNCATE TABLE `lnl_send`"; sans la condition la table se vide bien donc je pense bien à un pb de fonction dans npds ou alors je dois le coder en ajax .... |  Profil
|
|
mick66 66
| Posté : 04-06-2013 20:54
c'est une erreur de copier coller lol ! l'erreur sql ..
J’espère que tout roule pour toi vu qu'on a plus l’occasion de se voir ;) |  Profil
|
|
colonelwog 1949
| Posté : 04-06-2013 22:44
ok lol moi ça va y a pas foule comme client ... |  Profil E-mail www
|
|
mick66 66
| Posté : 05-06-2013 10:39
personne qui à rencontrer le meme pb svp ! |  Profil
|
|
mick66 66
| Posté : 07-06-2013 18:51
pb résolu !
voici le code à mettre si qql veut vider la table
if (isset($_POST['vider']) && $_POST['vider']!="")
{
$requete = mysql_query("TRUNCATE TABLE `lnl_send`");
}
?>
<form method="post" action="" name="vider">
<input type="submit" name="v ider" value="vider">
</form>
|  Profil
|
|