Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvnp/eface2a5024f22cd30c00bcc2bc99726 to your computer and use it in GitHub Desktop.
Save mvnp/eface2a5024f22cd30c00bcc2bc99726 to your computer and use it in GitHub Desktop.
foreach ($planilha as $info) : ?>
<?php $count = 0; $total = 0; $remove = 0; ?>
<?php 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><?php echo $info[$i]['PCT_DESCRICAO'] ?></td>
<td><?php echo $info[$i]['NAT_DESCRICAO'] ?></td>
<?php else : ?>
<td>
<?php echo "<input type='text' value='".currencye($info[$i-1]['ORCD_VLR'])."' class='valor' />" ?>
</td>
<?php endif; ?>
<?php $total += $info[$i]['ORCD_VLR']; ?>
<?php endfor; ?>
<td class="valor retornatotal blue">
<?php echo "<input type='text' value='".currencye((($total-$remove)/12))."' class='valor blue' />" ?>
</td>
<td class="valor retornamedia">
<?php echo "<input type='text' value='".currencye(($total-$remove))."' class='valor laranja' />" ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment