File: /home/austral3d/fourdplan.com/php/aoc.php
<?php
require('conexion2.php');
$consulta_oc_liberada = mysql_query("Select id From Orden_Compra where status = 'Liberada'");
while($ocl = mysql_fetch_array($consulta_oc_liberada)){
$tocl[] = $ocl[0];
}
$consulta = mysql_query("select * FROM Orden_Compra WHERE date_Add(fecha_oc, interval 5 day) < NOW() and status = 'Liberada'");
while($a = mysql_fetch_array($consulta)){
$b[] = $a[0];
}
?>
<html>
<head>
<title>
</title>
<meta charset="UTF-8">
</head>
<body>
<p>Estimado [nombre],</p>
<p>Existen <?php echo count($b);?> de OC de un total de <?php echo count($tocl);?> con antiguedad mayor a 5 días que aún no se recibe la mercadería.</p>
<p>Se adjunta detalle.</p>
</body>
</html>