Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2013 01:41
Show Gist options
  • Save anonymous/6085380 to your computer and use it in GitHub Desktop.
Save anonymous/6085380 to your computer and use it in GitHub Desktop.
Quero que apareça: - João dos Santos 1 Adriano Toledo 3 E assim por diante
<h1>Relatórios</h1>
<form action="" method="POST">
<p>
Insira a data: <input type="text" name="data"> Formato: YYYY-MM-DD
</p>
<p>
<input type="submit" value="Gerar" name="porDia">
</p>
</form>
<?php if ($_POST['porDia']): ?>
<table>
<caption>Total de ordens retiradas em <?= date("d/m/Y", strtotime($_POST['data'])) ?></caption>
<thead>
<th>Funcionario</th>
<th>Quantidade</th>
<?php foreach ($view_sql as $sql): ?>
<tr>
<td><?= $sql['func'] ?></td>
<td><?= count($sql['func']) ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
/*
* Saída de um print_r para ver como os dados são apresentados na view: ordem.phtml;
*/
Array
(
[0] => Array
(
[id] => 12
[func] => João dos Santos
[urgencia] => Sim
[retirada] => 2013-07-24
[prazo] => 10
[setor] => Contabilidade
)
[1] => Array
(
[id] => 13
[func] => Adriano Toledo
[urgencia] => Sim
[retirada] => 2013-07-24
[setor] => Contabilidade
)
[2] => Array
(
[id] => 14
[func] => Adriano Toledo
[urgencia] => Sim
[retirada] => 2013-07-24
[setor] => Recursos Humanos
)
[3] => Array
(
[id] => 15
[func] => Adriano Toledo
[urgencia] => Sim
[retirada] => 2013-07-24
[setor] => Caixas
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment