HEX
Server: Apache
System: Linux iad1-shared-e1-19 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: austral3d (14892361)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /home/austral3d/fourdplan.com/php/crear_excel.php
<?php
require('conexion2.php');
$consulta = mysql_query("select * FROM Orden_Compra WHERE date_Add(fecha_oc, interval 5 day) < NOW() and status = 'Liberada'");
$a = '<table>	
	<tr>
		<th>OC</th>
		<th>Nota de venta</th>
		<th>Codigo provee</th>
		<th>Nombre provee</th>
		<th>Fecha OC</th>
		<th>In</th>
		<th>Codigo</th>
		<th>Descripcion</th>
		<th>UM</th>
		<th>Cant Solicitada</th>
		<th>Cant Recibida</th>
		<th>Precio unitario</th>
		<th>Total linea</th>
		<th>Status</th>
		<th>OT</th>
		<th>Lote</th>
	</tr>';						
	while($array = mysql_fetch_array($consulta)){
		$a.= '<tr>';
		$a.= "<td>".$array[1]."</td><td>".$array[2]."</td><td>".$array[3]."</td><td>".$array[4]."</td><td>".$array[5]."</td><td>".$array[6]."</td><td>".$array[7]."</td><td>".$array[8]."</td><td>".$array[9]."</td><td>".$array[10]."</td><td>".$array[11]."</td><td>".$array[12]."</td>"."<td>".$array[13]."</td>"."<td>".$array[14]."</td>"."<td>".$array[15]."</td>"."<td>".$array[16]."</td>";
		$a.= '</tr>';
	}
$a.='</table>';
$scarpeta="../excel";
$sfile=$scarpeta."/OrdenesDeCompraAtrasadas.xls"; 
$fp=fopen($sfile,"w");
fwrite($fp,$a);
fclose($fp);
$sfile;
$consulta1 = mysql_query("Select * From Requisiciones where status = 'En Proceso' and date_Add(fecha, interval 3 day) < NOW()");
$b = '<table>	
	<tr>
		<th>N rep</th>
		<th>Codigo Proveedor</th>
		<th>Nombre</th>
		<th>Fecha</th>
		<th>Linea</th>
		<th>Codigo</th>
		<th>Descripcion</th>
		<th>UM</th>
		<th>Cant Conv</th>
		<th>Cant Inv</th>
		<th>Total Linea</th>
		<th>Status</th>
	</tr>';						
	while($array1 = mysql_fetch_array($consulta1)){
		$b.= '<tr>';
		$b.= "<td>".$array1[1]."</td><td>".$array1[2]."</td><td>".$array1[3]."</td><td>".$array1[4]."</td><td>".$array1[5]."</td><td>".$array1[6]."</td><td>".$array1[7]."</td><td>".$array1[8]."</td><td>".$array1[9]."</td><td>".$array1[10]."</td><td>".$array1[11]."</td><td>".$array1[12]."</td>";
		$b.= '</tr>';
	}
$b.='</table>';
$sfile1=$scarpeta."/RequisicionesAtrasadas.xls"; 
$fp1=fopen($sfile1,"w");
fwrite($fp1,$b);
fclose($fp1);
$sfile1;
?>