通过将其从javascript发送到php页面来删除所选行

i didn't find a similar post, i am trying to post an array from a javascript to a php page called delete.php, i want to delete a row whene clicking on the delete button situated in the last column Which is displayed by bye the php page select like this .

  while($row = mysqli_fetch_array($result))
 { 
 ?>
 <tr>
  <td><?php echo $row['code'] ;?></td>
  <td><?php echo $row['designiation'] ;?></td>
  <td><?php echo $row['diametre'] ;?></td>
  <td><?php echo $row['epaisseur'] ;?></td>
  <td><?php echo $row['prix'] ;?></td>
  <td><?php echo $row['etat'] ;?></td>
  <td><?php echo $row['id'] ;?><!--style="display:none;"-->

  <td><button type="button" class="btn btn-success btn-edit">Modifier     </button> | 
      <button type="button" onclick="pdelete();" class="btn btn-danger btn-delete">Supprimer  </button>
  </td>

 </tr>

as you see here the function pdelete() is on the onclick of the button and the id is btn-delete so i did like this

  function pdelete(){

    var _id = $('input[name="idrow"]').val();
    var _type = $('#typeid').val();
    var _pression = $('#pressionid').val();   
    var _code = $('input[name="code"]').val();
    var _designiation = $('input[name="designiation"]').val();
    var _diametre = $('input[name="diametre"]').val();
    var _epaisseur = $('input[name="epaisseur"]').val();
    var _prix = $('input[name="prix"]').val();
    var _etat = $('input[name="etat"]').val();

    $.post('delete.php', {postid:_id, posttype:_type, 
                          postpression:_pression, postcode:_code, 
                          postdesigniation:_designiation, 
                          postdiametre:_diametre, 
                          postepaisseur:_epaisseur, postprix:_prix, 
                          postetat:_etat}, 
          function(data){
            $('tbody').append(data);
          });
    }

    $(document).on('click','.btn-delete', function(){

        _trEdit = $(this).closest('tr');
        var _id = $(_trEdit).find('td:eq(6)').text();
        $('input[name="idrow"]').val(_id);

        if(confirm("Vous etes sur de supprimer cette ligne?")){
            $(this).closest('tr').remove(); 
            alert("suppression réussite .");
        }
});

the page delete.php is like this

$id_tube = $_POST['postid'];
$type_utilisation = $_POST['posttype'];
$pression_tube = $_POST['postpression'];
$code_tube = $_POST['postcode'];
$designiation_tube =$_POST['postdesigniation'];
$diametre_tube = $_POST['postdiametre'];
$epaisseur_tube = $_POST['postepaisseur'];                       
$prix_tube =$_POST['postprix'];
$etat_tube = $_POST['postetat'];


if(isset($pression_tube)){
    if($pression_tube=="pn4"){
        if($type_utilisation=="pehdtelecom" && $pression_tube=="pn4" ){ echo "verifier le type du Tube S.v.p";}else{

            $sql="DELETE from  pn4  where id='".$id_tube."'";    
            echo"$sql";  
            $result = mysqli_query($link, $sql);

            // echo"$id_tube";
            if($result){
                // do something here 

            } else{
                echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
            }
    }
}

it doesnt find the id and it did not pass through post. to put it in the condition of the sql request in the delete.php page , i have tried almost evrything a i found i am out of idea please help me to solve it to delete the row from the database also when clicking the delete button in the last column.

First of all you don't need to send all this data to delete a row since you are going to use the "postid"

Then I don't see where is you "input[name="idrow"]" on your html.

What I suggest you to do is on the click funciton to insert the post id.

  while($row = mysqli_fetch_array($result))
 { 
 ?>
 <tr>
  <td><?php echo $row['code'] ;?></td>
  <td><?php echo $row['designiation'] ;?></td>
  <td><?php echo $row['diametre'] ;?></td>
  <td><?php echo $row['epaisseur'] ;?></td>
  <td><?php echo $row['prix'] ;?></td>
  <td><?php echo $row['etat'] ;?></td>
  <td style="display:none;"><?php echo $row['id'] ;?></td>

  <td><button type="button" class="btn btn-success btn-edit">Modifier     </button> | 
      <button type="button" onclick="pdelete(<?php echo $row['id']; ?> );" class="btn btn-danger btn-delete">Supprimer  </button>
  </td>

 </tr> <?php } ?>

Then when you call the function you just get the id from it as

function pdelete(postid){

}