<?php
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
session_start();
require_once("conexion_mantenimiento.php");
$obj=new Mantenimiento();
$modulos=$obj->modulos();
$datos=$obj->seguimiento_modulo($modulo);
$nom=$obj->saluda_al_usuario($_SESSION["session_mante"]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="estilos.css">
<link rel="stylesheet" href="fonts.css">
<title></title>
<style type="text/css">
#principal{ width:800px; height:100%; text-align: center }
#header{ width:800px; height:100px; background-color:#ff0000; color:#FFF; text-align: center}
#menu{ width:800px; height:25px; float:left; text-align: center}
.boton{ width:100px; height:25px; float:left; background-color:#FF0000; color:#FFFFFF}
.buscador{ width:300px; height:25px; float:left}
#main{ width:800px; height:100%; text-align: center}
.ajustar{text-align: justify}
.color{color: white}
</style>
</head>
<body>
<form action="seguimiento_modulo.php" method='post'>
<tr>
<td align='right' style="font:bold">Seleccione el Modulo:</td>
<input type="hidden" name="ficha" value="<?php echo $nom[0]["ficha"];?>"/>
<div class="form-group">
<select required name='modulo'><option value="0">[Seleccione el Módulo o Tipo de Servicio]</option>
<?php
for ($i=0;$i<sizeof($modulos);$i++)
{
$idmodulo=$modulos[$i]['idmodulo'];
$descrip=$modulos[$i]['descripcion'];
echo "<OPTION VALUE='$idmodulo'>$descrip</OPTION>";
}
?>
</select></div>
<tr>
<td><input TYPE="submit" NAME="modulo" VALUE="Buscar">
</TD>
</tr>
</form>
<?php
if ($_POST['modulo'] && $_POST['buscar'])
{
}
?>
<tr>
<table class="form">
<tr>
<!-- <td> -->
<div id="content">
<div id="contenedor">
<div id="main">
<table width="800">
<tr>
<td valign="top" align="center" width="500" colspan="4">
<h3>Resultados de su búsqueda</h3>
</td>
</tr>
<?php echo "<STRONG>Al día de hoy</STRONG>" ." ". date('d-m-Y');
echo "<br>";
echo "<STRONG>Tiene:</STRONG>";
?>
<tr style="background-color:#666666; color:#FFFFFF; font-weight:bold">
<td valign="top" align="center" width="300" bgcolor="ff0000">
Módulo
</td>
<td valign="top" align="center" width="300" bgcolor="ff0000">
Ficha
</td>
<td valign="top" align="center" width="300" bgcolor="ff0000">
Fecha del Primer Mantenimiento
</td>
<td valign="top" align="center" width="300" bgcolor="ff0000">
Meses(al Día de hoy)
</td>
<td valign="top" align="center" width="300" bgcolor="ff0000">
Días(al Día de hoy)
</td>
<td valign="top" align="center" width="300" bgcolor="ff0000">
Tipo de Mantenimiento
</td>
</tr>
<?php
if (isset($_GET["pos"]))
{
$correo=$_GET["pos"];
}
else
{
$correo=0;
}
// $datos=$obj->listar_fichas($correo);
if(count($datos)==0)
{
?>
<tr>
<td valign="top" align="center" width="500" colspan="3" style="background-color:#f0f0f0">
No hay registros para ese criterio de búsqueda
</td>
</tr>
<?php
}else
{
$impresos=0;
// $datos=$obj->listar_fichas($correo);
for ($i=0;$i<count($datos);$i++)
{
// $impresos++;
?>
<tr>
<td class="color" valign="top" align="center" width="50" bgcolor="023859">
<?php echo $datos[$i]["direccion"];?>
</td>
<td class="color" valign="top" align="center" width="100" bgcolor="023859">
<?php echo $datos[$i]["nombres"];?>
</td>
<td class="color" valign="top" align="center" width="100" bgcolor="023859">
<?php echo $datos[$i]["telefonos"];?>
</td>
<?php
$inicio= $datos[$i]["fecha"];
$hoy=date('d-m-Y');
$datetime1=new DateTime($inicio);
$datetime2=new DateTime($hoy);
# obtenemos la diferencia entre las dos fechas
$interval=$datetime2->diff($datetime1);
$intervalDias=$interval->format("%d");
# obtenemos la diferencia en meses
$intervalMeses=$interval->format("%m");
# obtenemos la diferencia en años y la multiplicamos por 12 para tener los meses
$intervalAnos = $interval->format("%y")*12;
// echo "hay una diferencia de ".($intervalMeses+$intervalAnos)." meses";
?>
<td class="color" valign="top" align="center" width="100" bgcolor="023859">
<?php echo $intervalMeses;?>
</td>
<td class="color" valign="top" align="center" width="100" bgcolor="023859">
<?php echo $intervalDias;?>
</td>
<td class="color" valign="top" align="center" width="100" bgcolor="023859">
<?php echo $datos[$i]["descripcion"];?>
</td>
</tr>
<?php
echo "<br>";
echo ($intervalMeses) ." "."Meses"." ". $intervalDias ." ". "Días";
}
echo "<br>";
echo "Respectivamente para cada FICHA";
}
?>
<tr>
<td valign="top" align="center" width="500" colspan="6">
<hr>
<!--*************************************-->
<!--*************************************-->
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- <input class="color1" type="submit" name="action" align="left" value="Enviar"/>
</td>-->
</tr>
</table>
</body>
</html>
<?php
//}
?>