<?php include("db.php"); ?>
<?php include("header.php"); ?>
<div class="container mt-5">
<div class="col-12">
<div class="row">
<div class="col-12 grid-margin">
<div class="card">
<div class="card-body">
<h4 class="card-title">Buscador</h4>
<form action="index.php" method="POST" >
<div class="col-12 row">
<div class="col-11">
<input type="text" class="form-control" name="buscar" placeholder="Escriba la referencia">
</div>
<div class="col-md-1">
<input type= "submit" class="btn btn-success" value="Buscar">
</div>
</div>
<?php
$sql= $con->query("SELECT * FROM plan WHERE responsable LIKE '%".$_POST['buscar']."%' OR descripcion LIKE '%".$_POST['buscar']."%' ");
$numeroSql = mysqli_num_rows($sql);
?>
<p style="font-weight: bold; color:green;"><i class="mdi mdi-file-document"></i> <?php echo $numeroSql; ?> Resultados encontrados</p>
</form>
<div class="table-responsive">
<table class="table">
<thead>
<tr style="background-color: #00695c; color:#FFFFFF;">
<th style=" text-align: center;"> Fecha Inicio </th>
<th style=" text-align: center;"> Asunto </th>
<th style=" text-align: center;"> Accion </th>
<th style=" text-align: center;"> Responsable </th>
<th style=" text-align: center;"> Fecha Cierre </th>
<th style=" text-align: center;"> Status</th>
</tr>
</thead>
<tbody>
<?php while ($rowSql = mysqli_fetch_assoc($sql)){ ?>
<tr>
<td style="text-align: center;"><?php echo $rowSql["date_start"]; ?></td>
<td style="text-align: center;"><?php echo $rowSql["asunto"]; ?></td>
<td style="text-align: center;"><?php echo $rowSql["descripcion"]; ?></td>
<td style=" text-align: center;"><?php echo $rowSql["responsable"]; ?></td>
<td style=" text-align: center;"><?php echo $rowSql["date_close"]; ?></td>
<td style=" text-align: center;"><?php echo $rowSql["status"]; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include("footer.php"); ?>