Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function downloadExcel(status)
- {
- $.ajax({
- url: "http://localhost/WareHouse/reporte.php?status="+status,
- type: "GET",
- success:function(status)
- {
- console.log("Entre a download excel");
- var tmpElemento = document.createElement('a');
- var data_type = 'data:application/vnd.ms-excel';
- var tabla_div = document.getElementById('actives');
- tmpElemento.href = data_type + ', ' + tabla_div;
- //Asignamos el nombre a nuestro EXCEL
- tmpElemento.download = 'InventoryToReorder.xls';
- tmpElemento.click();
- }
- });
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <?php echo'<title>Inventory To Reorder</title>';?>
- </head>
- <body onload="window.print()">
- <?php echo '<img src="http://localhost/WareHouse/assets/img/Esterline.png" style="position: absolute; top: 0; left: 0; height:6%; width:23%; margin-top:40px; margin-left:40px;"/>';?>
- <?php echo '<center style="margin-top:120px; font-size:14pt;"><strong>Inventory To Reorder</strong></center>';?>
- <?php echo '<label><center>____________________________________________________________________________</center></label><br>';?>
- <?php
- require_once('apis/connection.php');
- if(isset($_GET['status']))
- {
- $status = $_GET["status"];
- //Trae todos los item que esten por debajo de su minimo en stock.
- $connection = new MySqlServerConnection();
- $query = "SELECT i.description_item,i.quantity,u.name_unit,i.reorder_Level,i.target_Stock,l.name_location,i.commentt,io.quantity_s,i.status
- FROM inventory_list AS i
- INNER JOIN unit_mesurement AS u ON id_unit = fkUnit
- INNER JOIN location AS l on id_location = fkLocation
- INNER JOIN inventory_output as io on id_output = fkInventory
- WHERE i.quantity <= i.reorder_Level OR i.status = 1";
- $result = $connection->executeQuery($query,array($status));
- if ($result > 0) {
- //echo $query;
- ?>
- <center>
- <table class="table table-striped xd" border="1px;" id="actives">
- <thead>
- <tr>
- <th style="width: 3%;">Description</th>
- <th style="width: 3%;">Quantity</th>
- <th style="width: 3%;">Usage</th>
- <th style="width: 3%;">Name Unit</th>
- <th style="width: 3%;">Reorder Level</th>
- <th style="width: 3%;">Target Stock</th>
- <th style="width: 3%;">Area</th>
- <th style="width: 3%;">Comment</th>
- </tr>
- </thead>
- <?php
- $arraycount=count($result);
- $i=0;
- $total=0;
- while ($i < $arraycount)
- {
- ?>
- <tr>
- <td><center><?php echo $result[$i]['description_item']; ?></td>
- <td><p style="color:red;" ><?php echo $result[$i]['quantity']; ?></p></td>
- <td>
- <?php
- $qs = $result[$i]['quantity_s'];
- switch (true) {
- case ($qs >= 1000 && $qs <= 2000) :
- echo " 1000 a 2000 SEMANAL";
- break;
- case ($qs >= 100 && $qs <= 200) :
- echo " 100 a 200 SEMANAL Y/O QUINCENAL";
- break;
- }
- ?>
- </td>
- <td><?php echo $result[$i]['name_unit']; ?></td>
- <td><?php echo $result[$i]['reorder_Level']; ?></td>
- <td><?php echo $result[$i]['target_Stock']; ?></td>
- <td><?php echo $result[$i]['name_location']; ?></td>
- <td><?php echo $result[$i]['commentt']; ?></center></td>
- </tr>
- <?php $i++;
- }
- ?>
- </table><br><br>
- </center>
- <?php
- }
- //}
- }
- ?>
- </body>
Add Comment
Please, Sign In to add comment