-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adicionando a função de exporta para planilha.
- Loading branch information
1 parent
1175211
commit fc4750b
Showing
130 changed files
with
119,226 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
include 'conecta.php'; | ||
include 'consumo-banco.php'; | ||
|
||
$o_arquivo = "meu-consumo.xls"; | ||
|
||
$html = "<meta charset='utf-8'>"; | ||
$html .= "<table border='1'> | ||
<tr> | ||
<td>Data Consumo</td> | ||
<td>Hora Consumo</td> | ||
<td>Dia Semana</td> | ||
<td>Café</td> | ||
<td>Qtd</td> | ||
<td>R$ Preço</td> | ||
</tr>"; | ||
|
||
$consumos = listaConsumo($conexao); | ||
foreach ($consumos as $consumo) | ||
{ | ||
$html .= "<tr> | ||
<td>{$consumo["data_consumo"]}</td> | ||
<td>{$consumo["hora_consumo"]}</td> | ||
<td>{$consumo["dia_semana"]}</td> | ||
<td>{$consumo["cafe_nome"]}</td> | ||
<td>{$consumo["qtd"]}</td> | ||
<td>{$consumo["preco"]}</td> | ||
</tr>"; | ||
} | ||
|
||
$html .= "</table>"; | ||
|
||
header("content-Type: application/xls"); | ||
header("content-Disposition:attachment; filename=" . $o_arquivo); | ||
header("content-Discription: Dados gerados via PHP."); | ||
|
||
echo $html; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
include 'cabecalho-menu.php'; | ||
include 'conecta.php'; | ||
include 'consumo-banco.php'; | ||
?> | ||
<h1>O que eu já consumir...</h1> | ||
|
||
<button class="btn btn-primary" onclick="window.location.href='consumo-form-adiciona.php'">Mais café</button></button> | ||
<button class="btn btn-secondary" onclick="window.open('consumo-lista-planilha.php', 'blank')">Exportar para planilha</button></button> | ||
<button class="btn btn-secondary" onclick="window.open('consumo-lista-report.php', 'blank')">Relatório</button></button> <br> <br> | ||
|
||
|
||
<table class="table table-striped table-bordered"> | ||
|
||
<?php | ||
$consumos = listaConsumo($conexao); | ||
foreach ($consumos as $consumo) | ||
{ | ||
?> | ||
<tr> | ||
<td><?=$consumo['data_consumo']?></td> | ||
<td><?=$consumo['hora_consumo']?></td> | ||
<td><?=$consumo['dia_semana']?></td> | ||
<td><?=$consumo['cafe_nome']?></td> | ||
<td><?=$consumo['qtd']?>ml</td> | ||
<td>R$ <?=number_format($consumo['preco'],2,',','.')?></td> | ||
<td> | ||
<form name="form-remove" method="post" action="consumo-exclui.php"> | ||
<input type="hidden" name="id" value="<?=$consumo['consumo_id']?>" /> | ||
<button class="btn btn-danger">remove</button> | ||
</form> | ||
</td> | ||
</tr> | ||
<?php | ||
} | ||
?> | ||
|
||
</table> | ||
|
||
<?php | ||
include 'rodape.php'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.