Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $planilha = [
- [
- [
- 'PCT_DESCRICAO' => 'teste',
- 'NAT_DESCRICAO' => 'teste2',
- 'ORCD_VLR' => 99
- ],
- ['ORCD_VLR' => 100],
- ['ORCD_VLR' => 101],
- ['ORCD_VLR' => 102],
- ['ORCD_VLR' => 103],
- ['ORCD_VLR' => 104],
- ['ORCD_VLR' => 105],
- ['ORCD_VLR' => 106],
- ['ORCD_VLR' => 107],
- ['ORCD_VLR' => 108],
- ['ORCD_VLR' => 109],
- ['ORCD_VLR' => 110],
- ['ORCD_VLR' => 111],
- ],
- [
- [
- 'PCT_DESCRICAO' => 'teste3',
- 'NAT_DESCRICAO' => 'teste4',
- 'ORCD_VLR' => 89
- ],
- ['ORCD_VLR' => 90],
- ['ORCD_VLR' => 91],
- ['ORCD_VLR' => 92],
- ['ORCD_VLR' => 93],
- ['ORCD_VLR' => 94],
- ['ORCD_VLR' => 95],
- ['ORCD_VLR' => 96],
- ['ORCD_VLR' => 97],
- ['ORCD_VLR' => 98],
- ['ORCD_VLR' => 99],
- ['ORCD_VLR' => 100],
- ['ORCD_VLR' => 101],
- ],
- ];
- function currencye($param)
- {
- return $param;
- }
- ?>
- <table>
- <?php foreach ($planilha as $info) {
- $count = 0;
- $total = 0;
- $remove = 0;
- if ($count == 0 OR ($count % 13 === 0)) {
- $count++; ?>
- <tr>
- <?php for ($i = 0; $i < 13; $i++) { ?>
- <?php $remove = $info[0]['ORCD_VLR']; ?>
- <?php if ($i === 0) { ?>
- <td><?= $info[$i]['PCT_DESCRICAO'] ?></td>
- <td><?= $info[$i]['NAT_DESCRICAO'] ?></td>
- <?php } else { ?>
- <td>
- <?= "<input type='text' value='" . currencye($info[$i - 1]['ORCD_VLR']) . "' class='valor' />" ?>
- </td>
- <?php } ?>
- <?php $total += $info[$i]['ORCD_VLR']; ?>
- <?php } ?>
- <td class="valor retornatotal blue">
- <?= "<input type='text' value='" . currencye((($total - $remove) / 12)) . "' class='valor blue' />" ?>
- </td>
- <td class="valor retornamedia">
- <?= "<input type='text' value='" . currencye(($total - $remove)) . "' class='valor laranja' />" ?>
- </td>
- </tr>
- <?php }
- } ?>
- <tr>
- <td></td>
- <td></td>
- <?php
- for ($i = 0; $i < 13; $i++) {
- $totalPorColuna = '0';
- foreach ($planilha as $item) {
- $totalPorColuna = bcadd($totalPorColuna, $item[$i]['ORCD_VLR']);
- }
- echo '<td><input type="text" value="' . $totalPorColuna . '"></td>';
- }
- ?>
- </tr>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement