My idea is to show an alert icon in the date record that is about to expire, I understand I have a system where requests are entered, if the request is not answered within a period of 10 days it will be automatically displayed the alert icon
<?php
require "PDO_Pagination.php";
/* Config Connection */
$root = 'root';
$password = '';
$host = 'localhost';
$dbname = 'bdpagina';
$connection = new PDO("mysql:host=$host;dbname=$dbname;", $root, $password);
$pagination = new PDO_Pagination($connection);
$search = null;
if(isset($_REQUEST["search"]) && $_REQUEST["search"] != "")
{
$search = htmlspecialchars($_REQUEST["search"]);
$pagination->param = "&search=$search";
$pagination->rowCount("SELECT * FROM contribuyente WHERE nombre LIKE '%$search%' OR id LIKE '%$search%' OR estado LIKE '%$search%'");
$pagination->config(3, 10);
$sql = "SELECT * FROM contribuyente WHERE nombre LIKE '%$search%' OR id LIKE '%$search%' OR estado LIKE '%$search%' ORDER BY id ASC LIMIT $pagination->start_row, $pagination->max_rows";
$query = $connection->prepare($sql);
$query->execute();
$model = array();
while($rows = $query->fetch())
{
$model[] = $rows;
}
}
else
{
$pagination->rowCount("SELECT * FROM contribuyente WHERE estado in ('Pendiente','Resuelto') ORDER BY id'");
$pagination->config(3, 10);
$sql = "SELECT * FROM contribuyente WHERE estado in ('Pendiente','Resuelto') ORDER BY id ASC LIMIT $pagination->start_row,
$pagination->max_rows";
$query = $connection->prepare($sql);
$query->execute();
$model = array();
while($rows = $query->fetch())
{
$model[] = $rows;
}
}
?>
<form method="POST" action="<?php echo $_SERVER["PHP_SELF"] ?>">
Buscar:
<input type="text" name="search" placeholder="Buscar folio/estado" value="<?php echo $search ?>">
<input type="submit" value="Buscar">
</form>
<br><br>
<center>
<table class="table table-striped table-hover">
<tr>
<th>Folio</th>
<th>Nombre</th>
<th>Rut</th>
<th>Correo</th>
<th>Telefono</th>
<th>Direccion</th>
<th>Poste</th>
<th>Solicitud</th>
<th>Fecha</th>
<th>Estado</th>
<th>Reporte</th>
<th>Borrar</th>
</tr>
<?php
foreach($model as $row)
{
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['nombre']."</td>";
echo "<td>".$row['rut']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['phone']."</td>";
echo "<td>".$row['direccion']."</td>";
echo "<td>".$row['poste']."</td>";
echo "<td>".$row['mensaje']."</td>";
echo "<td>".$row['fecha']."</td>";
echo "<td>";
if($row['estado'] == 'Resuelto'){
echo '<span class="label label-success">Resuelto</span>';
}
elseif ($row['estado'] == 'Pendiente' ){
echo '<span class="label label-warning">Pendiente</span>';
}
elseif ($row['estado'] == 'Rechazado' ){
echo '<span class="label label-danger">Rechazado</span>';
}
elseif ($row['estado'] == 'Resuelta' ){
echo '<span class="label label-success">Resuelta</span>';
}
echo "</td>";
echo "<td><a href='actualizar.php?id=$row[0]' title='Editar datos' class='btn btn-primary btn-sm'><span class='glyphicon glyphicon-edit' aria-hidden='true'></span></td>";
echo "<td><a href='eliminar.php?id=$row[0]&idborrar=2'' title='Eliminar' class='btn btn-danger btn-sm'><span class='glyphicon glyphicon-trash' aria-hidden='true'></span></a><th>";
echo "</tr>";
}
?>
</table>
<br>
<br>
<div>
<?php
$pagination->pages("btn");
?>
</div>
</center>
<br>
<br>
<br>
<br>
</body>
</html>