Index du Forum » » Le coin des codeurs

Auteur

Changer l'id de la base ...
colonelwog
1947       
 

  Posté : 19-05-2015 08:22

bon apparemment personne ?
voici le code complet en espérant qu'un oeil averti voit le problème !

<?php

/********************************************************************* ***/ 
/* NPDS : Net Portal Dynamic System                & nbsp;            &n bsp;        */ 
/* ===========================                     & nbsp;            &n bsp;        */ 
/*            &nb sp;            &nbs p;              ;                           & nbsp;    */ 
/*    Module Universel  Copyright (c)  2003 by Hotfirenet       &nb sp;        */ 
/*            &nb sp;            &nbs p;              ;                           & nbsp;    */ 
/************************************************************************/&nb sp;
/*            &nb sp;            &nbs p;              ;                           & nbsp;    */ 
/* 08/01/04 Modifications par Tribal-Dolphin :               & nbsp;           */ 
/* Suppression de la connexion à la BDD&nb sp;car déjà établie par NPDS     & nbsp; */ 
/* Suppression de la CSS et utilisation de  celle de NPDS        &n bsp;       */ 
/* 23/05/2011 Modification colonelwog    & nbsp;            &n bsp;            &nb sp;    */ 
/* rajout universalisation du module + édition& nbsp;suppression          &nb sp;   */ 
/************************************************************************/&nb sp;

/**************************************************************************** **********************/ 
/* Administration du MODULE       ;                           & nbsp;            &n bsp;            &nb sp;            */&n bsp;
/**************************************************************************** **********************/ 
!include!("header.php");

if (
$user) { 
   global 
$nuked$user$language$pdst$NPDS_Prefix$ModPath
   !include!_once("modules/
$ModPath/lang/adm-$language.php"); 
   !include!_once ("modules/
$ModPath/connect.inc.php"); 
   
$pdst=0; 


function edit_annu(
$id) {
   global 
$nuked$language$ModPath$ModStart$NPDS_Prefix;
   require ("modules/
$ModPath/connect.inc.php");
   
$res = sql_query("select annu_champ1,annu_champ2,annu_champ 3,annu_champ4 from  ".$NPDS_Prefix."".$ModPath." where  annu_ind ='$id'");
   list(
$annu_champ1,$annu_champ2,$annu_champ3,$annu_champ4) = sql_fetch_row($res);


   echo "<table width=\"100%\" cellpadding=\ "5\" cellspacing=\"0\" border=\"0\" align=\"center\">

       <div style=\"text-align:&nb sp;center;\"><br /><b>[ <a href=\"!javascript! :history.back()\">retour</a> ]</b></div></form> <br />
        <form  method=\" post\" action=\"modules.php?ModPath=budget&ModStart=editertravaux& subop=modif_annu\">
        <tr>
          <td colsp an=\"2\" align=\"center\" class=\"header\"><h2>".adm_anu_tra ns("Modifier une entrée")."</h2></td>
        </tr>
        <tr>
          <td align =\"right\" class=\"header\">ID</td>
          <td class =\"header\"><input id=\"form_id\" type=\"text\" name=\"ann u_ind\" size='10' value=\"".
$id."\"></td>
        </tr>
        <tr>
          <td align =\"right\" class=\"header\">
$formulaire1</td>
          <td class =\"header\"><input id=\"form_champ1\" type=\"text\" name=\ "champ1\" size='
$formulaire1a' value=\"".$annu_champ1."\"></td>
        </tr>
        <tr>
          <td align =\"right\" class=\"header\">
$formulaire2</td>
          <td class =\"header\"><input id=\"form_champ2\" type=\"text\" name=\ "champ2\"  size='
$formulaire2a' value=\"".$annu_champ2."\"></td>
        </tr>
              ; <tr>
          <td align =\"right\" class=\"header\">
$formulaire3</td>
          <td class =\"header\"><input id=\"form_champ3\" type=\"text\" name=\ "champ3\"  size='
$formulaire3a' value=\"".$annu_champ3."\"></td>
        </tr>
        <tr>
          <td align =\"right\" class=\"header\">
$formulaire4</td>
          <td class =\"header\"><input id=\"form_champ4\" type=\"text\" name=\ "champ4\" size='
$formulaire4a' value=\"".$annu_champ4."\"></td>
        </tr>
            
        <tr>
          <td class =\"header\">&nbsp;</td>
          <td class =\"header\"><input type=\"submit\" value=\"".adm_anu_trans("Mod ifier")."\"></td>
        </tr>
        </form>
        </table>";
}

function modif_annu(
$id,$champ1,$champ2,$champ3,$champ4) {
   global 
$nuked,$NPDS_Prefix,$ModPath;
   
$sql = sql_query("update ".$NPDS_Prefix."$ModPath set annu_ind='".$id."',annu_champ1='".$champ1."',annu_champ2='".$champ2."',annu_champ3='".$champ3."',annu_champ4='".$champ4."' where annu_ind ='$id'");
   echo"<script type=\"text/!javascript!\"> hi story.go(-2); </script> ";
 
}

 switch (
$subop) { 
   case "edit_annu": 
      opentable(); 
      edit_annu(
$id); 
      closetable(); 
      break; 

   case "modif_annu": 
      opentable(); 
      modif_annu(
$id,$champ1,$champ2,$champ3,$champ4); 
      closetable(); 
      break; 




  } 


}
!include!("footer.php");

?>





Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=26306&forum=5