Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
APPSST
/
invenconsul
/
consulReposicion
:
excelReposicion.php.bak
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php include("../../bd/conexion.php"); header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=Inventariousado.xls"); header("Pragma: no-cache"); header("Expires: 0"); // Estructura HTML que Excel interpretará como tabla echo '<table border="1">'; echo '<tr> <th style="background-color: #37b1c4; color: white;">CODIGO</th> <th style="background-color: #37b1c4; color: white;">DESCRIPCION</th> <th style="background-color: #37b1c4; color: white;">CANTIDAD</th> </tr>'; // Obtener datos de la BD $consulta_inventario = $conexion->query("SELECT CODIGO, DESCRIPCION, CANTIDAD FROM inventario"); while ($fila_inventario = $consulta_inventario->fetch_assoc()) { echo '<tr> <td>' . $fila_inventario['CODIGO'] . '</td> <td>' . $fila_inventario['DESCRIPCION'] . '</td> <td>' . $fila_inventario['CANTIDAD'] . '</td> </tr>'; } echo '</table>'; exit; ?>