Transmettre des données d'une page a l'autre

Résolu/Fermé
karango Messages postés 80 Date d'inscription vendredi 29 juillet 2016 Statut Membre Dernière intervention 10 janvier 2023 - Modifié le 28 avril 2018 à 08:31
karango Messages postés 80 Date d'inscription vendredi 29 juillet 2016 Statut Membre Dernière intervention 10 janvier 2023 - 29 avril 2018 à 02:19
Bonjour,

j'ai 3 fichiers qui gere la commande client:
- index.php pour lister les commandes.
- retrieve.php pour la requete select.
- commands.js pour les fonction js.

Je souhaite transmettre la valeur d'une variable nome $mois de page index.php a retrieve.php pour faire ma requete sql dans la page retrieve.php.

pour cela, j'ai cree une function php dans index qui affiche toutes les mois de l'annee, et en suite j'ai cree un lien avec les mois.
donc l'idee est de recuperer la valeur de mois cliquer par l'utilisateur et afficher les enregistrement de ce mois. mais galere les deux pages php sont lie par une page js, je ne sais pas comment passer le variable.
NB: je utilise plugins datatables de jquery en php procedural. la voici les fichers


index.php
<?php
 include '../../layout/layout.php';
 function f_mois($m)
 {
  switch ($m) {
   case 1:
    return 'Janvier';
    break;
   case 2:
    return 'Fevrier';
    break;
   case 3:
    return 'Mars';
    break;
   case 4:
    return 'Avril';
    break;
   case 5:
    return 'Mai';
    break;
   case 6:
    return 'Juin';
    break;
   case 7:
    return 'Juillet';
    break;
   case 8:
    return 'Aout';
    break;
   case 9:
    return 'Septembre';
    break;
   case 10:
    return 'Octobre';
    break;
   case 11:
    return 'Novembre';
    break;

   default:
    return 'Decembre';
    break;
  }
 }
?>

 <div class="container-flued">
  <div class="row">
   <div class="col-md-2">
    <?php
     echo  '<div class="panel panel-default">';
     echo   '<div class="panel-heading">';
     echo    '<h3 class="panel-title text-center">Mounth</h3>';
     echo   '</div>';
     //echo      '<div class="panel-body">';
     echo   '<ul class="nav nav-stacked">';
      for ($i=1; $i <= 12; $i++) {
       echo  '<li class="text-center">';
       echo   '<a href="/public/src/commands/index.php?mois='.$i.'">'.f_mois($i).'</a>';
       echo  '</li>';
      }
     echo   '</ul>';
     echo  '</div>';
     // include 'retrieve.php';
     ?>
   </div>
   <div class="col-md-10">
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="../../dashboard.php">Home</a></li>
      <li class="breadcrumb-item active" aria-current="page">Commands</li>
      </ol>
   </nav>
    <center><h1 class="page-header">Manage Commands </h1> </center>

    <div class="removeMessages"></div>

    <div style="padding-bottom:20px;">
     <button class="btn btn-default pull pull-right" data-toggle="modal" data-target="#addCommandModal" id="addCommandModalBtn">
      <span class="glyphicon glyphicon-plus-sign"></span> Add Command
     </button><br />
    </div>

    <table class="table" id="manageCommandTable">
     <thead>
      <tr>
       <th>S.no</th>
       <th>Date</th>
       <th>Clients</th>
       <th>Montant Revients</th>
       <th>montant Ventes</th>
       <th>MARGE</th>
       <th>MARGE Ventes</th>
       <th>MARGE Revients</th>
       <th>Option</th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
 </div>

 <!-- add modal -->
 <div class="modal fade" tabindex="-1" role="dialog" id="addCommandModal">
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
         <h4 class="modal-title"><span class="glyphicon glyphicon-plus-sign"></span> Add Command</h4>
       </div>

       <form class="form-horizontal" action="create.php" method="POST" id="createCommandForm" enctype="multipart/form-data">

       <div class="modal-body">
        <div class="messages"></div>

     <div class="form-group">
      <label for="addClient_id" class="col-md-4 control-label">Client</label>
      <div class="col-md-8">
       <select class="form-control" name="addClient_id" id="addClient_id">
        <option value="">~~SELECT~~</option>
        <!-- <option value="1">Activate</option> -->
        <?php
         require_once '../../layout/db_connect.php';
          $sql = "SELECT * FROM clients ORDER BY nom_cl";
         $query = $conn->query($sql);
          while ($line = $query->fetch_assoc()) {
           echo '<option value="'.$line['cl_id'].'">'.$line['nom_cl'].'</option>';
          }
        ?>
       </select>
      </div>
     </div>

     <div class="form-group"> <!--/here teh addclass has-error will appear -->
      <label for="addMontantVente" class="col-md-4 control-label">Montant Vente</label>
      <div class="col-md-8">
       <input type="text" class="form-control" id="addMontantVente" name="addMontantVente" placeholder="Montant Vente">
     <!-- here the text will apper  -->
      </div>
     </div>

     <div class="form-group"> <!--/here teh addclass has-error will appear -->
      <label for="addMontantRevient" class="col-md-4 control-label">Montant Revient</label>
      <div class="col-md-8">
       <input type="text" class="form-control" id="addMontantRevient" name="addMontantRevient" placeholder="Montant Revient">
     <!-- here the text will apper  -->
      </div>
     </div>

     <div class="form-group"> <!--/here teh addclass has-error will appear -->
      <label for="addDateCommand" class="col-md-4 control-label">Date</label>
      <div class="col-md-8">
       <input type="text" class="form-control" id="addDateCommand" name="addDateCommand" placeholder="">
     <!-- here the text will apper  -->
      </div>
     </div>

       </div>
       <div class="modal-footer">
         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
         <button type="submit" class="btn btn-primary">Save changes</button>
       </div>
       </form>
     </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
 </div><!-- /.modal -->
 <!-- /add modal -->

 <!-- remove modal -->
 <div class="modal fade" tabindex="-1" role="dialog" id="removeCommandModal">
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
         <h4 class="modal-title"><span class="glyphicon glyphicon-trash"></span> Remove Command</h4>
       </div>
       <div class="modal-body">
         <p>Do you really want to remove ?</p>
       </div>
       <div class="modal-footer">
         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
         <button type="button" class="btn btn-primary" id="removeBtn">Save changes</button>
       </div>
     </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
 </div><!-- /.modal -->
 <!-- /remove modal -->

 <!-- edit modal -->
 <div class="modal fade" tabindex="-1" role="dialog" id="editCommandModal">
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
         <h4 class="modal-title"><span class="glyphicon glyphicon-edit"></span> Edit Command</h4>
       </div>

  <form class="form-horizontal" action="update.php" method="POST" id="updateCommandForm">

       <div class="modal-body">

         <div class="edit-messages"></div>

     <div class="form-group">
      <label for="editClient_id" class="col-md-4 control-label">Client</label>
      <div class="col-md-8">
       <select class="form-control" name="editClient_id" id="editClient_id">
        <option value="">~~SELECT~~</option>
        <!-- <option value="1">Activate</option> -->
        <?php
         //require_once '../../layout/db_connect.php';
          $sql = "SELECT * FROM clients ORDER BY nom_cl";
         $query = $conn->query($sql);
          while ($line = $query->fetch_assoc()) {
           echo '<option value="'.$line['cl_id'].'">'.$line['nom_cl'].'</option>';
          }
        ?>
       </select>
      </div>
     </div>


     <div class="form-group"> <!--/here teh addclass has-error will appear -->
       <label for="editMontantVente" class="col-md-4 control-label">Montant Vente</label>
       <div class="col-md-8">
         <input type="text" class="form-control" id="editMontantVente" name="editMontantVente" placeholder="Montant Vente">
    <!-- here the text will apper  -->
       </div>
     </div>

    <div class="form-group"> <!--/here teh addclass has-error will appear -->
     <label for="editMontantRevient" class="col-md-4 control-label">Montant Revient</label>
     <div class="col-md-8">
      <input type="text" class="form-control" id="editMontantRevient" name="editMontantRevient" placeholder="Montant Revient">
    <!-- here the text will apper  -->
     </div>
    </div>

    <div class="form-group"> <!--/here teh addclass has-error will appear -->
     <label for="editDateCommand" class="col-md-4 control-label">Date</label>
     <div class="col-md-8">
      <input type="text" class="form-control" id="editDateCommand" name="editDateCommand" placeholder="Date de Commande">
    <!-- here the text will apper  -->
     </div>
    </div>

       </div>
       <div class="modal-footer editCommandModal">
         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
         <button type="submit" class="btn btn-primary">Save changes</button>
       </div>
       </form>
     </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
 </div><!-- /.modal -->
 <!-- /edit modal -->

 <!-- include custom index.js -->
 <script type="text/javascript" src="/assests/custom/js/commands.js"></script>

 <?php
include '../../layout/footer.php';
?>



screenshot





retrieve.php


<?php

require_once '../../layout/core.php';
// require_once 'index.php';
//$mois = $_GET['mois'];
$output = array('data' => array());

$sql = "SELECT * FROM commandes join clients using(cl_id) where EXTRACT(MONTH FROM co_date)=4";
$query = $conn->query($sql);

$x = 1;
while ($row = $query->fetch_assoc()) {
 /*$active = '';
 if($row['active'] == 1) {
  $active = '<label class="label label-success">Active</label>';
 } else {
  $active = '<label class="label label-danger">Deactive</label>';
 }*/

 $actionButton = '
 <div class="btn-group">
   <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
     Action <span class="caret"></span>
   </button>
   <ul class="dropdown-menu">
     <li><a type="button" data-toggle="modal" data-target="#editCommandModal" onclick="editCommand('.$row['co_id'].')"> <span class="glyphicon glyphicon-edit"></span> Edit</a></li>
     <li><a type="button" data-toggle="modal" data-target="#removeCommandModal" onclick="removeCommand('.$row['co_id'].')"> <span class="glyphicon glyphicon-trash"></span> Remove</a></li>
   </ul>
 </div>
  ';

 $output['data'][] = array(
  $x,
  $row['co_date'],
  $row['nom_cl'],
  (number_format($row['montant_revient'],0,' ',' ')).' FCFA',
  (number_format($row['montant_vente'],0,' ',' ')).' FCFA',
  (number_format(($row['montant_vente']-$row['montant_revient']),0,' ',' ')).' FCFA',
  (($row['montant_vente']-$row['montant_revient'])/($row['montant_vente'])).'%',
  (($row['montant_vente']-$row['montant_revient'])/($row['montant_revient'])).'%',

  //$active,
  $actionButton
 );

 $x++;
}

// database connection close
$conn->close();

echo json_encode($output);




// global the manage memeber table
var manageCommandTable;

$(document).ready(function() {
 manageCommandTable = $("#manageCommandTable").DataTable({
   "ajax": "/public/src/commands/retrieve.php",
   "order": []
   
 });

 $("#addCommandModalBtn").on('click', function() {
  // reset the form
  $("#createCommandForm")[0].reset();
  // remove the error
  $(".form-group").removeClass('has-error').removeClass('has-success');
  $(".text-danger").remove();
  // empty the message div
  $(".messages").html("");

  // submit form
  $("#createCommandForm").unbind('submit').bind('submit', function() {

   $(".text-danger").remove();

   var form = $(this);

   // validation
   var addClient_id = $("#addClient_id").val();
   var addMontantVente = $("#addMontantVente").val();
   var addMontantRevient = $("#addMontantRevient").val();
   var addDateCommand = $("#addDateCommand").val();

   if(addClient_id == "") {
    $("#addClient_id").closest('.form-group').addClass('has-error');
    $("#addClient_id").after('<p class="text-danger">The name field is required</p>');
   } else {
    $("#addClient_id").closest('.form-group').removeClass('has-error');
    $("#addClient_id").closest('.form-group').addClass('has-success');
   }

   if(addMontantVente == "") {
    $("#addMontantVente").closest('.form-group').addClass('has-error');
    $("#addMontantVente").after('<p class="text-danger">The addMontantVente field is required</p>');
   } else {
    $("#addMontantVente").closest('.form-group').removeClass('has-error');
    $("#addMontantVente").closest('.form-group').addClass('has-success');
   }

   if(addMontantRevient == "") {
    $("#addMontantRevient").closest('.form-group').addClass('has-error');
    $("#addMontantRevient").after('<p class="text-danger">The addMontantRevient field is required</p>');
   } else {
    $("#addMontantRevient").closest('.form-group').removeClass('has-error');
    $("#addMontantRevient").closest('.form-group').addClass('has-success');
   }

   if(addDateCommand == "") {
    $("#addDateCommand").closest('.form-group').addClass('has-error');
    $("#addDateCommand").after('<p class="text-danger">The addDateCommand field is required</p>');
   } else {
    $("#addDateCommand").closest('.form-group').removeClass('has-error');
    $("#addDateCommand").closest('.form-group').addClass('has-success');
   }

   if(addClient_id && addMontantVente && addMontantRevient && addDateCommand) {
    //submi the form to server
    $.ajax({
     url : form.attr('action'),
     type : form.attr('method'),
     data : form.serialize(),
     dataType : 'json',
     success:function(response) {

      // remove the error
      $(".form-group").removeClass('has-error').removeClass('has-success');

      if(response.success == true) {
       $(".messages").html('<div class="alert alert-success alert-dismissible" role="alert">'+
         '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
         '<strong> <span class="glyphicon glyphicon-ok-sign"></span> </strong>'+response.messages+
       '</div>');

       // reset the form
       $("#createCommandForm")[0].reset();

       // reload the datatables
       manageCommandTable.ajax.reload(null, false);
       // this function is built in function of datatables;

      } else {
       $(".messages").html('<div class="alert alert-warning alert-dismissible" role="alert">'+
         '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
         '<strong> <span class="glyphicon glyphicon-exclamation-sign"></span> </strong>'+response.messages+
       '</div>');
      }  // /else
     } // success
    }); // ajax subit
   } /// if


   return false;
  }); // /submit form for create Command
 }); // /add modal

});

function removeCommand(co_id = null) {
 if(co_id) {
  // click on remove button
  $("#removeBtn").unbind('click').bind('click', function() {
   $.ajax({
    url: '/public/src/commands/remove.php',
    type: 'post',
    data: {command_id : co_id},
    dataType: 'json',
    success:function(response) {
     if(response.success == true) {
      $(".removeMessages").html('<div class="alert alert-success alert-dismissible" role="alert">'+
         '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
         '<strong> <span class="glyphicon glyphicon-ok-sign"></span> </strong>'+response.messages+
       '</div>');

      // refresh the table
      manageCommandTable.ajax.reload(null, false);

      // close the modal
      $("#removeCommandModal").modal('hide');

     } else {
      $(".removeMessages").html('<div class="alert alert-warning alert-dismissible" role="alert">'+
         '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
         '<strong> <span class="glyphicon glyphicon-exclamation-sign"></span> </strong>'+response.messages+
       '</div>');
     }
    }
   });
  }); // click remove btn
 } else {
  alert('Error: Refresh the page again');
 }
}

function editCommand(co_id = null) {
 if(co_id) {

  // remove the error
  $(".form-group").removeClass('has-error').removeClass('has-success');
  $(".text-danger").remove();
  // empty the message div
  $(".edit-messages").html("");

  // remove the id
  $("#editCommand_id").remove();

  // fetch the Command data
  $.ajax({
   url: '/public/src/commands/getSelectedCommand.php',
   type: 'post',
   data: {editCommand_id : co_id},
   dataType: 'json',
   success:function(response) {
    $("#editClient_id").val(response.cl_id);

     $("#editMontantVente").val(response.montant_vente);

     $("#editMontantRevient").val(response.montant_revient);

    $("#editDateCommand").val(response.co_date);

    // mmeber id
    $(".editCommandModal").append('<input type="hidden" name="editCommand_id" id="editCommand_id" value="'+response.co_id+'"/>');

    // here update the Command data
    $("#updateCommandForm").unbind('submit').bind('submit', function() {
     // remove error messages
     $(".text-danger").remove();

     var form = $(this);

     // validation
     var editClient_id = $("#editClient_id").val();
     var editMontantVente = $("#editMontantVente").val();
     var editMontantRevient = $("#editMontantRevient").val();
     var editDateCommand = $("#editDateCommand").val();

     if(editClient_id == "") {
      $("#editClient_id").closest('.form-group').addClass('has-error');
      $("#editClient_id").after('<p class="text-danger">The addClient_id field is required</p>');
     } else {
      $("#editClient_id").closest('.form-group').removeClass('has-error');
      $("#editClient_id").closest('.form-group').addClass('has-success');
     }

     if(editMontantVente == "") {
      $("#editMontantVente").closest('.form-group').addClass('has-error');
      $("#editMontantVente").after('<p class="text-danger">The addMontantVente field is required</p>');
     } else {
      $("#editMontantVente").closest('.form-group').removeClass('has-error');
      $("#editMontantVente").closest('.form-group').addClass('has-success');
     }

     if(editMontantRevient == "") {
      $("#editMontantRevient").closest('.form-group').addClass('has-error');
      $("#editMontantRevient").after('<p class="text-danger">The addMontantRevient field is required</p>');
     } else {
      $("#editMontantRevient").closest('.form-group').removeClass('has-error');
      $("#editMontantRevient").closest('.form-group').addClass('has-success');
     }

     if(editDateCommand == "") {
      $("#editDateCommand").closest('.form-group').addClass('has-error');
      $("#editDateCommand").after('<p class="text-danger">The addDateCommand field is required</p>');
     } else {
      $("#editDateCommand").closest('.form-group').removeClass('has-error');
      $("#editDateCommand").closest('.form-group').addClass('has-success');
     }

     if(editClient_id && editMontantVente && editMontantRevient && editDateCommand) {
      $.ajax({
       url: form.attr('action'),
       type: form.attr('method'),
       data: form.serialize(),
       dataType: 'json',
       success:function(response) {
        if(response.success == true) {
         $(".edit-messages").html('<div class="alert alert-success alert-dismissible" role="alert">'+
           '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
           '<strong> <span class="glyphicon glyphicon-ok-sign"></span> </strong>'+response.messages+
         '</div>');

         // reload the datatables
         manageCommandTable.ajax.reload(null, false);
         // this function is built in function of datatables;

         // remove the error
         $(".form-group").removeClass('has-success').removeClass('has-error');
         $(".text-danger").remove();
        } else {
         $(".edit-messages").html('<div class="alert alert-warning alert-dismissible" role="alert">'+
           '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+
           '<strong> <span class="glyphicon glyphicon-exclamation-sign"></span> </strong>'+response.messages+
         '</div>')
        }
       } // /success
      }); // /ajax
     } // /if

     return false;
    });

   } // /success
  }); // /fetch selected Command info

 } else {
  alert("Error : Refresh the page again");
 }
}



aider SVP!


EDIT : Ajout du la coloration syntaxique dans les balises de code (jordane)

A voir également:

2 réponses

ice_handler Messages postés 27 Date d'inscription mardi 24 mars 2015 Statut Membre Dernière intervention 2 mai 2019
28 avril 2018 à 08:36
Tu pourrais utiliser les variables de session.
Tu fais
session_start();
Et ensuite tu utilise
$_SESSION[`variable`] = $tavariablemois

Et quand tu changera de page tu pourra réutiliser la variable de session tel quel
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
28 avril 2018 à 08:44
Bonjour,


mais galere les deux pages php sont lie par une page js

Donc.. le "lien" dont tu parles... c'est de l'AJAX.

Il faudrait donc, pouvoir disposer du "mois" à afficher dans un champ masqué de ta page index.php
Récupérer cette valeur dans le script JS, l'envoyer (en ajax) à ton fichie retrieve.php.

Dans index.php, en haut juste en dessous de la fonction f_mois
$mois_select = !empty($_GET['mois']) ? $_GET['mois'] : 1; //par défaut, si aucun mois choisi, on prend le 1

Dans index.php juste avant ton tableau
<input type="hidden" id="mois_select" value="<?php echo $mois_select; ?>">


Dans le fichier JS:
$(document).ready(function() {
 manageCommandTable = $("#manageCommandTable").DataTable({
  "ajax": {
    "url": "/public/src/commands/retrieve.php",
   "type": "POST",
   "order": [],
    "data": {
        "mois": $("#mois_select").val();
    }   
 });


Dans le fichier retrieve.php
$mois = !empty($_POST['mois']) ? $_POST['mois'] : NULL;

$sql = "SELECT * FROM commandes join clients using(cl_id) where EXTRACT(MONTH FROM co_date)=".$mois;


Enfin... j'ai écrit de tête.
Tu devrais trouver d'autres infos sur la documentation officielle de datatable....
par exemple : https://datatables.net/reference/option/ajax.data


Au passage, ta fonction f_mois, au lieu d'utiliser des switch case, pourrait simplement utiliser un array
function f_mois($m)
{
  $a_mois = array("","Janvier","Fevrier","Mars","Avril","Mai","Juin","Juilliet","Aout","Septembre","Octobre","Novembre","Decembre");
  return f_mois[$m]; 
} 

0
karango Messages postés 80 Date d'inscription vendredi 29 juillet 2016 Statut Membre Dernière intervention 10 janvier 2023
28 avril 2018 à 13:05
Donc.. le "lien" dont tu parles... c'est de l'AJAX.

non c'est php

voila le lien issu de ma function f_mois:

	
echo '<ul class="nav nav-stacked">';
for ($i=1; $i <= 12; $i++) {
echo '<li class="text-center">';
echo '<a href="/public/src/commands/index.php?mois='.$i.'">'.f_mois($i).'</a>';
echo '</li>';
}
echo '</ul>';
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
28 avril 2018 à 13:11

Donc.. le "lien" dont tu parles... c'est de l'AJAX.

Non Non... je confirme.. c'est de l' AJAX !
(je parle de ta phrase :

es deux pages php sont lie par une page js


Sais tu au moins ce que c'est ???
C'est ce qui permet, à un script JAVASCRIPT de communiquer avec un script PHP.

Quoi qu'il en soit, je t'ai donné la solution à ta question.
Merci de clore le sujet une fois que tu auras pu le mettre en place.
0
karango Messages postés 80 Date d'inscription vendredi 29 juillet 2016 Statut Membre Dernière intervention 10 janvier 2023
29 avril 2018 à 00:31
apres avoir mise en place voici l'erreur envoyer par le server:

SyntaxError: missing } after property list
[Learn More]
commands.js:11:39
note: { opened at line 10, column 12
commands.js:10:12



commands.js

"ajax": {
"url": "/public/src/commands/retrieve.php",
"type": "POST",
"order": [],
"data": {
"mois": $("#mois_select").val();
}
}


retrieve.php


$mois = !empty($_POST['mois']) ? $_POST['mois'] : NULL;

$output = array('data' => array());

$sql = "SELECT * FROM commandes join clients using(cl_id) where EXTRACT(MONTH FROM co_date)=".$mois;
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
29 avril 2018 à 01:45
retire le point-virgule à la ligne
"data": {
"mois": $("#mois_select").val()
}
0
karango Messages postés 80 Date d'inscription vendredi 29 juillet 2016 Statut Membre Dernière intervention 10 janvier 2023
29 avril 2018 à 02:19
parfait...! vous etes un ange, merci.
0