1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<th class="text-center">Action</th>
</tr>
<?php
while($data = $req->fetch())
{
?>
<tr>
<td class="pt-3-half" contenteditable="true"><?php echo htmlspecialchars($data['id']);?></td>
<td class="pt-3-half" contenteditable="true"><?php echo htmlspecialchars($data['num_cmd']);?></td>
<td class="pt-3-half" contenteditable="true"><?php echo htmlspecialchars($data['title']);?></td>
<td class="pt-3-half" contenteditable="true">xxx</td>
<td class="pt-3-half" contenteditable="true">xxx</td>
<td class="pt-3-half"> xxx </td>
<td><span class="label label-important">Pas Ok</span></td>
<td>
<div class="buttonInline">
<button class="btn-delete" data-id="<?php echo($data['id']);?>">
<i class="fa fa-times"></i>
</button>
</div>
</td>
<?php }
$req->closeCursor();?>
</tr>
</table>
<!-- <input type="button" id="ajax" value="Test Ajax" /><br>
<p>Résultats de l'appel ajax:</p>
<textarea id="results"></textarea> -->
</div>
</div>
</div>
</main>
<script>
$(function()
{
$('.btn-delete').click(function()
{
var idReceive = $(this).data('id');
// var idAjax=$("#ajax").val();
$.ajax({
url: "cmdDelete.php",
method: "POST",
data: 'idReceive='+idReceive,
dataType: "html",
success: function(msg){
$('#results').val(msg);
}
});
});
});
</script> |