<!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>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question