Les dejo el código a ver si pueden ayudarme:
Código PHP:
Ver original
<script src="../js/search.js"></script> <?php include "conexion.php"; $sql1= "select * from horario INNER JOIN user ON horario.id_docente = user.id INNER JOIN materia ON horario.id_materia = materia.id INNER JOIN aula ON horario.id_aula = aula.id INNER JOIN seccion ON horario.id_seccion = seccion.id INNER JOIN turno ON horario.id_turno = turno.id"; $query = $con->query($sql1);?> <div> <form> <input class="form-control" id="searchTerm" type="text" onkeyup="doSearch()" placeholder="Escriba aquí la palabra a buscar..."/> </form> </div> <?php if($query->num_rows>0):?> <table class="table table-bordered table-hover" id="search"> <thead> <th>Docente</th> <th>Materia</th> <th>Aula</th> <th>Sección</th> <th>Turno</th> <th>Día</th> <th>Hora de Inicio</th> <th>Hora de Fin</th> <th>Estatus</th> <th>Estatus</th> </thead> <?php while ($r=$query->fetch_array()): $materia=$r["id_materia"]; if ($materia==$_GET["id"]):?> <tr> <td><?php echo $r["name"]; ?></td> <td><?php echo $r["materia"]; ?></td> <td><?php echo $r["aula"]; ?></td> <td><?php echo $r["seccion"]; ?></td> <td><?php echo $r["turno"]; ?></td> <td><?php echo $r["dia"]; ?></td> <td><?php echo $r["hora_inicio"]; ?></td> <td><?php echo $r["hora_fin"]; ?></td> <?php $estatus=$r["estatus"]; if ($estatus): ?> <td><img src="http://www.forosdelweb.com/f18/img/on.jpg" height="30" width="25"> En Clase</td> <?php else:?><td><img src="http://www.forosdelweb.com/f18/img/off.jpg" height="30" width="25"> Ausente</td><?php endif;?> <td style="width:150px;"> <a href="#" id="del-<?php echo $r["id_horario"];?>" class="btn btn-sm btn-danger">Eliminar</a> <script> $("#del-"+<?php echo $r["id_horario"];?>).click(function(e){ e.preventDefault(); p = confirm("Estas seguro?"); if(p){ window.location="./eliminarHorario.php?id="+<?php echo $r["id_horario"];?>; } }); </script> </td> <?php else:?> <p class="alert alert-warning">No hay horarios disponibles</p> <?php endif;?> </tr> <?php endwhile;?> </table> <?php endif;?>