Newer
Older
ournorth2021 / admin / views / botones.php
LuisOlaya on 8 Apr 2021 2 KB primer
<div align="left" style="padding: 10px 0px;">
	<table width="100%">
    	<tr>
        	<td><h5 style="margin-top: 8px;"><i class="fas fa-chevron-right"></i> Botones</h5></td>
            <td align="right" width="200">
            	<input class="form-control" type="text" placeholder="Búsqueda rápida..." id="buscador" />
            </td>
        </tr>
    </table>
</div>

<div align="right">
	<a href="?pg=boton/detalle">
		<button type="button" class="btn btn-warning btn-md " style="margin-bottom:15px">
			<i class="fa fa-plus btn-left"></i> Crear Boton
		</button>
	</a>
    <a href="?pg=boton/activar_boton">
		<button type="button" class="btn btn-danger btn-md " style="margin-bottom:15px">
			<i class="fa fa-plus btn-left" style="margin-right: 0px"></i>
		</button>
	</a>
</div>

<table class="table table-bordered">
	<thead class="thead-dark">
	<tr>
		<th scope="col" width="15">#</th>
		<th scope="col" width="150">Boton</th>
		<th scope="col" width="150">Inicia</th>
		<th scope="col" width="150">Termina</th>
		<th scope="col" width="100"></th>
	</tr>
	</thead>
    
	<tbody id="tabla_lista">
	<?php
		$count = 1;
		$query = mysqli_query($connect,"SELECT * FROM Botones ");
		while($data = mysqli_fetch_array($query)){
			
		
				
				echo '
				<tr>
					<th scope="row">'.$count.'</th>
					<td>'.$data["boton"].'</td>
					<td>'.$data["hora_inicia"].'</td>
					<td>'.$data["hora_termina"].'</td>
					<td>
						<a href="?pg=boton/detalle&id='.$data["id"].'">
						<button type="button" class="btn btn-success btn-sm">
							<i class="fa fa-edit"></i>
						</button>
						</a>
					</td>
				</tr>
				';
				$count++;

					
		}
	?>
	</tbody>
</table>

<script>

$(document).ready(function(){
	$("#buscador").on("keyup", function() {
		var value = $(this).val().toLowerCase();
		$("#tabla_lista tr").filter(function() {
		  $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
		});
	});	  
});



</script>

<script src="js/functions.js"></script>