website logo
Auteur
avatar
mick66

Forum » » Questions » » [Résolu] - Pb requete sql dans function


Posté : 04-06-2013 17:08 icone du post


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")." </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");
}


Cet article provient de NPDS REvolution 16
https://lab.grottes-et-karsts-de-chine.org/viewtopic.php?topic=25864&forum=9