I have made the connection to my Database and I have a table that filters the records in real time with Ajax. I have added the delete and modify buttons but I can not make them work, I have tried several tutorials but most use Json. If anyone knows where I can find the solution or how to do it, I appreciate it.
This is the code:
<body>
<h1 class="text-center titulo">Vehiculos</h1>
<div class="container">
<div class="row">
<div class="panel panel-default panel-table">
<div class="panel-heading">
<div class="row">
<div class="col col-xs-6">
<div class="input-group"> <span class="input-group-addon">Buscar vehiculos</span>
<input id="filtrar" type="text" class="form-control" placeholder="Ingrese texto a buscar">
</div>
</div>
</div>
</div>
<div class="panel-body">
<table class="table table-striped table-bordered table-list">
<thead>
<tr>
<center>
<th ><em style="margin-left: 50%;" class="fa fa-cog"></em></th>
<th>Dominio</th>
<th>Marca</th>
<th>Modelo</th>
</center>
</tr>
</thead>
<tbody class="contenidobusqueda">
<?php
//Guardamos en $query los datos de la consulta.
//asi a $row en un array con los datos de $query
$query = mysqli_query($conn, "SELECT dominio,marca,modelo FROM vehiculos");
for($i=0; $i<mysqli_num_rows ($query); ++$i){
$row = mysqli_fetch_row($query);
?>
<tr>
<td align="center">
<a class="btn btn-default"><em class="fa fa-pencil"></em></a>
<a class="btn btn-danger"><em class="fa fa-trash"></em></a>
</td>
<td>
<?php echo $row[0];?>
</td>
<td>
<?php echo $row[1];?>
</td>
<td>
<?php echo $row[2];?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3 text-right">
<a class="btn btn-info" href="../vistas/principalAdmin.php">Volver</a>
</div>
</div>
</div>
And I have a javascript that is to search that is jsbuscar to which I refer in the previous code
$(document).ready(function () {
(function ($) {
$('#filtrar').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.contenidobusqueda tr').hide();
$('.contenidobusqueda tr').filter(function () {
return rex.test($(this).text());
}).show();
})
}(jQuery));
});