Boutton enregistrer

mriusgbagbo Messages postés 2 Date d'inscription jeudi 12 janvier 2017 Statut Membre Dernière intervention 22 janvier 2017 - 12 janv. 2017 à 13:43
mriusgbagbo Messages postés 2 Date d'inscription jeudi 12 janvier 2017 Statut Membre Dernière intervention 22 janvier 2017 - 22 janv. 2017 à 19:56
Bonjour les amis, j'ai un petit soucis avec mon boutton enregistrer c'est à dire quand je clique rien ne se passe

7 réponses

jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 344
12 janv. 2017 à 14:18
Bonjour,

Pour l'instant je ne peux que te répondre .."C'est balot ...." ^^

Par contre ... si tu nous montres le code de ce "bouton" ... peut-être que nous pourrons t'aider à trouver l'erreur.

0
mariokas Messages postés 1 Date d'inscription lundi 30 juillet 2012 Statut Membre Dernière intervention 14 janvier 2017
Modifié par @karamel le 14/01/2017 à 19:41
voici le code de mon bouton enregistrer


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title> </title>

<link rel="stylesheet" type="text/css" href="conf_tools/css/jquery.dataTables.css" />
<script src=""quot;"quot;conf_tools/js/jquery.dataTables.js" type="text/javascript"></script>
<script src=""quot;"quot;controllers/stock/c_sortie.js" type="text/javascript"></script>
<script src=""quot;"quot;conf_tools/js/bootbox.js" type="text/javascript"></script>
<script src=""quot;"quot;conf_tools/js/dataTables.tableTools.js" type="text/javascript"></script>
<script src=""quot;"quot;conf_tools/js/dataTables.colVis.js" type="text/javascript"></script>

<style type="text/css">

</style>
</head>
<body>  
<div class="page-titre">
  <i class="glyphicon glyphicon-compressed"></i>  Gestion de Stock > Sortie de Stocks
</div>
<div class="panel panel-info" style="margin-top:15px;">
<div class="panel-heading"><h3 class="panel-title">Sortie de Stocks</h3></div>
 <div class="panel-body pbody">
 <form id="fm" name="fm" action="" method="post"  enctype="multipart/form-data" > 
  <div  id="div-pro" style="width:850px; height:200px; padding:10px; margin:0 auto; border:1px solid #DFDFDF; border-radius:5px">  
 <!--Employe-->
 <div  style="width:415px;float:left;  text-align:right">     
      <div class="form-group" style="margin-bottom:5px; margin-top:5px">
         <label  class="lb-text">Produits</label>
           <select id="txtprod" name="txtprod" class="ch-oblig" onchange="LoadPage()" style="width:300px">
           <option value="">-------- Veuillez Choisir  --------</option>
           <?php
     $_SESSION['prod'] = $_POST['txtprod']; 
           $sql="SELECT prod_id, prod_lib, prod_seuil,prod_prix_vte from t_produit order by prod_lib";
           $req=mysql_query($sql);
           while($don=mysql_fetch_array($req))
        {
   ?>
           <option value="<?php echo  MettreApost($don[0]); ?>"<?php if($_SESSION['prod']==$don[0]){echo 'selected';}?>><?php echo MettreApost($don[1]); ?></option>
    <?php }?>
          </select>
        </div>

<div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Quantité</label>
          <input type="number"  id="txtqtesortie" name="txtqtesortie" class="ch-oblig" style="width:300px">
      </div>

<div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Date Sortie</label>
          <input type="date"  id="txtdatesortie" name="txtdatesortie" class="ch-oblig" value="<?php echo date ('Y-m-d');?>" style="width:300px">
      </div>

<div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Motif Sortie</label>
          <input type="text"  id="txtmotifsortie" name="txtmotifsortie" class="ch-oblig" placeholder="Motif de la sortie"  required  style="width:300px">
      </div>
</div> 
<!--fin employé-->


<!--Materiels-->
 <div style="width:390px; float:right; margin:0 10px; text-align:right"> 

<div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Saisie Par</label>
          <input type="text"  id="txtsaisipar" name="txtsaisipar" class="ch-oblig" style="width:300px">
      </div>
   <div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Saisie Le</label>
          <input type="date"  id="txtsaisile" name="txtsaisile" class="ch-oblig" value="<?php echo date('Y-m-d');?>" style="width:300px">
      </div>
   <div class="form-group" style="margin-bottom:5px">
          <label  class="lb-text">Obs</label>
          <input type="text"  id="txtobs" name="txtobs" class="ch-oblig"  style="width:300px">
      </div>
</div> 
</div> 
</form>
<div style="width:150px; margin:20px auto; text-align:center;">
<div class="form-group" style="margin-bottom:5px; text-align:center">
         <span  id="bt-save" class="btn btn-primary" style="width:120px;margin-left:10px"  onclick="SaveInsert()"><span class="glyphicon glyphicon-floppy-disk"></span>  Enregistrer</span>
</div>
</div>
</div>
</div>
<!--PARTIE TABLEAU -->
<div class="panel panel-info">
  <div class="clearfix">
    <div class="pull-right tableTools-container"></div>
  </div>
<div class="panel-heading"><h3 class="panel-title">Liste des Sorties</h3></div>
 <div class="panel-body pbody">
   <table id="example" class="display" cellspacing="0" width="100%" >
<thead  id="table-titile" >
            <tr>
              <th width="15%">Produits</th>
              <th width="15%">Quantité Sortie</th>
              <th width="10%">Date Sortie</th>
     <th width="15%">Motif Sortie</th>
     <th width="15%">Saisie Par</th>
     <th width="15%">Saisie Le</th>
     <th width="15%">Observation</th>
              <th width="10%"></th>
              <th width="0.1%"></th>
              <th width="0.1%"></th>
    </tr>
    </thead>
    <tbody>
    <?php 
 $prod=EnleverApost($_POST['txtprod']);
 $que='';
 if($prod!='')
 {$que="select s.sortie_id, p.prod_lib, s.qte_sortie, s.dte_sortie, s.motif_sortie, s.saisipar, s.saisile, s.obser from t_sortie s, t_produit p where (s.prod_id=p.prod_id && p.prod_id='$prod') order by p.prod_lib, p.saisipar";}
 else
 {$que="select s.sortie_id, p.prod_lib, s.qte_sortie, s.dte_sortie, s.motif_sortie, s.saisipar, s.saisile, s.obser from t_sortie s, t_produit p where (s.prod_id=p.prod_id && p.prod_id='$prod') order by p.prod_lib, p.saisipar";} 
       $res= mysql_query($que);
        while($row= mysql_fetch_array($res))
       {
     echo '
    <td >'.MettreApost($row[1]).'</td>
    <td >'.MettreApost($row[2]).'</td>
    <td  align="center">'.MettreApost($row[3]).'</td>
    <td  align="right">'.MettreApost($row[4]).'</td>
    <td  align="right">'.MettreApost($row[5]).'</td>
    <td  align="right">'.MettreApost($row[6]).'</td>
    <td  align="right">'.MettreApost($row[7]).'</td>
    <td ></td>
    <td align="center"><a href="#?mod='.$row[0].'" rel="nofollow noopener noreferrer" target="_blank" onClick="Update(this.href)"><span style="color:black;" class="glyphicon glyphicon-pencil" title="Modifier"></a></td>
    <td align="center"><a href="#?sup='.$row[0].'" rel="nofollow noopener noreferrer" target="_blank" onClick="Delete(this.href)"><span style="color:black;" class="glyphicon glyphicon-remove" title="Supprimer"></a></td>
  </tr>';
    }
 ?>
    </tbody>
 </table>
</div> 
</div> 


<div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content" style="width:900px" >
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" onclick="LoadPage()" aria-hidden="true">×</button>
            </div>
            <div class="modal-body" style="width:900px; height:300px">
                 <iframe  id="modal-frame" style="width:100%; height:98%; border:0px;"></iframe>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">

$(document).ready(function() 
{
  var oTable1 =  $('#example').dataTable( {
     "scrollY": "100%",
        "footerCallback": function ( row, data, start, end, display ) {
            var api = this.api();
            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\$,]/g, '')*1 :
                    typeof i === 'number' ?
                        i : 0;
            };            

// Total over all pages
            var total = api
                .column( 4 )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                } );

// Total over this page
            var pageTotal = api
                .column( 4, { page: 'current'} )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                } );

// Update footer
            $( api.column( 4 ).footer() ).html(
                '$'+pageTotal +' ( $'+ total +' total)'
            );
        }
    } );
//TableTools settings
        TableTools.classes.container = "btn-group btn-overlap";
        TableTools.classes.print = {
          "body": "DTTT_Print",
          "info": "tableTools-alert gritter-item-wrapper gritter-info gritter-center white",
          "message": "tableTools-print-navbar"
        }

//initiate TableTools extension
        var tableTools_obj = new $.fn.dataTable.TableTools( oTable1, {
          "sSwfPath": "conf_tools/export/copy_csv_xls_pdf.swf", //in Ace demo ../assets will be replaced by correct assets path

"sRowSelector": "td:not(:last-child)",
          "sRowSelect": "multi",
          "fnRowSelected": function(row) {
            //check checkbox when row is selected
            try { $(row).find('input[type=checkbox]').get(0).checked = true }
            catch(e) {}
          },
          "fnRowDeselected": function(row) {
            //uncheck checkbox
            try { $(row).find('input[type=checkbox]').get(0).checked = false }
            catch(e) {}
          },

"sSelectedClass": "success",
              "aButtons": [
            {
              "sExtends": "copy",
              "sToolTip": "Copy to clipboard",
              "sButtonClass": "btn btn-white btn-primary btn-bold",
              "sButtonText": "<i class='fa fa-copy bigger-110 pink'></i>",
              "fnComplete": function() {
                this.fnInfo( '<h3 class="no-margin-top smaller">Table copied</h3>\
                  <p>Copied '+(oTable1.fnSettings().fnRecordsTotal())+' row(s) to the clipboard.</p>',
                  1500
                );
              }
            },

{
              "sExtends": "csv",
              "sToolTip": "Export to CSV",
              "sButtonClass": "btn btn-white btn-primary  btn-bold",
              "sButtonText": "<i class='fa fa-file-excel-o bigger-110 green'></i>"
            },

{
              "sExtends": "pdf",
              "sToolTip": "Export to PDF",
              "sButtonClass": "btn btn-white btn-primary  btn-bold",
              "sButtonText": "<i class='fa fa-file-pdf-o bigger-110 red'></i>"
            },

{
              "sExtends": "print",
              "sToolTip": "Print view",
              "sButtonClass": "btn btn-white btn-primary  btn-bold",
              "sButtonText": "<i class='fa fa-print bigger-110 grey'></i>",

"sMessage": "<div class='navbar navbar-default'><div class='navbar-header pull-left'><a class='navbar-brand' href='#' rel="nofollow noopener noreferrer" target="_blank"><small>Optional Navbar & Text</small></a></div></div>",

"sInfo": "<h3 class='no-margin-top'>Print view</h3>\
                    <p>Please use your browser's print function to\
                    print this table.\
                    <br />Press <b>escape</b> when finished.</p>",
            }
              ]
          } );

//we put a container before our table and append TableTools element to it
          $(tableTools_obj.fnContainer()).appendTo($('.tableTools-container'));

//also add tooltips to table tools buttons
        //addding tooltips directly to "A" buttons results in buttons disappearing (weired! don't know why!)
        //so we add tooltips to the "DIV" child after it becomes inserted
        //flash objects inside table tools buttons are inserted with some delay (100ms) (for some reason)
        setTimeout(function() {
          $(tableTools_obj.fnContainer()).find('a.DTTT_button').each(function() {
            var div = $(this).find('> div');
            if(div.length > 0) div.tooltip({container: 'body'});
            else $(this).tooltip({container: 'body'});
          });
        }, 200);



//ColVis extension
        var colvis = new $.fn.dataTable.ColVis( oTable1, {
          "buttonText": "<i class='fa fa-search'></i>",
          "aiExclude": [0, 6],
          "bShowAll": true,
          //"bRestore": true,
          "sAlign": "right",
          "fnLabel": function(i, title, th) {
            return $(th).text();//remove icons, etc
          }

}); 

//style it
        $(colvis.button()).addClass('btn-group').find('button').addClass('btn btn-white btn-info btn-bold')

//and append it to our table tools btn-group, also add tooltip
        $(colvis.button())
        .prependTo('.tableTools-container .btn-group')
        .attr('title', 'Show/hide columns').tooltip({container: 'body'});




});


</body>
</html>
0
cs_jperre Messages postés 268 Date d'inscription lundi 9 janvier 2006 Statut Membre Dernière intervention 19 janvier 2017 2
19 janv. 2017 à 22:52
A première vue, sans poursuivre l'étude plus en profondeur, j'aperçois du code HTML erroné dans les première lignes:

il y a :
<script src=""quot;"quot;"quot;conf_tools/js/jquery.dataTables.js" type="text/javascript"></script>
<script src=""quot;"quot;"quot;controllers/stock/c_sortie.js" type="text/javascript"></script>
<script src=""quot;"quot;"quot;conf_tools/js/bootbox.js" type="text/javascript"></script>
<script src=""quot;"quot;"quot;conf_tools/js/dataTables.tableTools.js" type="text/javascript"></script>
<script src=""quot;"quot;"quot;conf_tools/js/dataTables.colVis.js" type="text/javascript"></script>

Le caractère spécial (entity) " affiche " dans HTML, cela n'a rien à faire dans l'adresse du fichier source d'un script externe. La règle veut que le nom d'un attribut (ici src) soit immédiatement suivi du signe = et de la valeur de l'attribut placée entre guillemets nom_att="valeur"

--
0
cs_jperre Messages postés 268 Date d'inscription lundi 9 janvier 2006 Statut Membre Dernière intervention 19 janvier 2017 2
19 janv. 2017 à 22:57
Un petit correctif ma réponse: je parle du caractère spécial &quot; et j'aurais du mettre en gras tout ce qui se trouve entre " et conf_tools.

Bon courage.

--
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 344
21 janv. 2017 à 02:02
Bojour,

Ton bouton fait appel à la fonction SaveInsert().
Hors.. je ne trouve cette fonction nul part dans ton code...
Peut être l'as tu placé dans un des fichiers JS que tu inclus dans ta page .....

Peux tu également regarder (via les outils de débugage de ton navigateur) dans la CONSOLE de ton navigateur (je te recommande de passer par le plugin FireBug pour FIREFOX) et nous dire ce qui y apparait ? (voir même nous en faire une capture écran)

Peut-être y a t'il des erreurs Javascript .......




0
mriusgbagbo Messages postés 2 Date d'inscription jeudi 12 janvier 2017 Statut Membre Dernière intervention 22 janvier 2017
22 janv. 2017 à 19:56
effectivement j'ai fait la fonction ds un fichier a part que j'appelle merci pour votre conseil j 'essaie ca marche
0
Sonny04 Messages postés 8 Date d'inscription jeudi 19 janvier 2017 Statut Membre Dernière intervention 19 janvier 2017
19 janv. 2017 à 11:47
Bonjour ,
Onclick c'est pas que pour les boutons normalement ?
Je vois que tu l'as mis sur un <span>

Essaie de changer ça et dis nous
-1
Rejoignez-nous