vendredi 3 septembre 2021

How to validate multiple rows with one button

I have a list of data in my table fiche. Each row has a button validate. Now I want to have a column in each row for checking the row to validate and in bottom of table have a button for validating the checking row.

My code:

    <?php
     while ($row = $stmtP->fetch(PDO::FETCH_ASSOC)){
     extract($row);
     ?>
     <tr >

     <?php echo "<td>{$Matricule} {$NomPrenom} {$Service}</td>" ?>
      <?php echo "<td class='form-group form-md-line-input  '>  <input name='check[]' 
     class='form-check-input' id='form_control_1' type='checkbox' value='$ID' style></td>" ?>
    <?php echo "<td class='form-group form-md-line-input  '>  <input  disabled class='form- 
     control' id='form_control_1' type='text' value='{$Direction}'></td>" ?>

    <?php echo "<td class='form-group form-md-line-input  '>  <textarea disabled class='form- 
    control' rows='2' >{$IDFormation}</textarea></td>" ?>
   <?php echo "<td class='form-group form-md-line-input  '>  <input  disabled class='form- 
   control' id='form_control_1' type='text' value='{$DateFiche}'></td>" ?>
    <?php echo "<td class='form-group form-md-line-input  '>  <textarea disabled class='form- 
   control' rows='2' >{$FonctionCible}</textarea></td>" ?>
    <?php echo "<td class='form-group form-md-line-input  '>  <textarea disabled class='form- 
   control' rows='2' >{$IndicateurSucces}</textarea></td>" ?>
    <?php echo "<td class='form-group form-md-line-input  '>  <input disabled class='form- 
   control' id='form_control_1' type='text' value='{$PeriodeSouhaite}'></td>" ?>
    <?php echo "<td class='form-group form-md-line-input  '>  <input disabled class='form- 
    control' id='form_control_1' type='text' value='{$NbrePersonne}'></td>" ?>


    <?php  if ('b'=='a')
     { echo "<td>

    <a class='btn green  btn-outline btn-sm' href='a_planifier.php?IDF={$IDFiche}&amp;IDFD= 
   {$ID}' role='button'><span class='glyphicon glyphicon-floppy-save ' aria-hidden='true'> 
   </span> ENREGISTRER</a>

     </td>"; }
  else
  {
    echo "<td> <a class='btn btn-lg red' href='edit-a-planifier.php?ID={$ID}' data- 
    toggle='confirmation' data-placement='left' data-original-title='Modifier ?'>  <i 
    class='fa 
    fa-edit'></i></a>
    <a class='btn btn-lg green' href='a_valider.php?ID={$ID}' data-toggle='confirmation' 
    data-placement='left' data-original-title='Valider ?'>
    <i class='glyphicon glyphicon-floppy-save'></i>
     </a>
    </td>" ;
     }       ?>
   </tr>



Aucun commentaire:

Enregistrer un commentaire