Calculadora de Reflorestamento em PHP

Calcula a quanto de área a ser replantada/paga
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<html> <head> <title>Calculadora Reflorestamento</title> <META charset="UTF-8" lang="pt-br"> <style> body { font-family: Arial; } table { border: none; font-weight: bold; } tr, td { border: black 1px solid; } </style> </head> <body> <div class="Calc"> <form method="POST"> <fieldset> <table> <legend>Calculadora de Reflorestamento</legend> <tr> <td>Ano</td><td>Estado</td><td>Árvores cortadas</td><td>Volume (m³)</td> </tr> <tr> <td><input name="ano" type="text" maxlength="4" size="8"></td> <td> <select name="estado"> <option value="AC">Acre</option> <option value="AL">Alagoas</option> <option value="AP">Amapá</option> <option value="AM">Amazonas</option> <option value="BA">Bahia</option> <option value="CE">Ceará</option> <option value="DF">Distrito Federal</option> <option value="ES">Espírito Santo</option> <option value="GO">Goiás</option> <option value="MA">Maranhão</option> <option value="MT">Mato Grosso</option> <option value="MS">Mato Grosso do Sul</option> <option value="MG">Minas Gerais</option> <option value="PA">Pará</option> <option value="PB">Paraíba</option> <option value="PR">Paraná</option> <option value="PE">Pernambuco</option> <option value="PI">Piauí</option> <option value="RJ">Rio de Janeiro</option> <option value="RN">Rio Grande do Norte</option> <option value="RS">Rio Grande do Sul</option> <option value="RO">Rondônia</option> <option value="RR">Roraima</option> <option value="SC">Santa Catarina</option> <option value="SP">São Paulo</option> <option value="SE">Sergipe</option> <option value="TO">Tocantins</option> </select> </td> <td><input name="arvore" type="number" max="9999" value="0"></td> <td><input name="volume" type="number" max="9999" value="0"></td> </tr> <tr> <td colspan="4"><input type="submit" value="Calcular"><input type="reset"></td> </tr> </table> </fieldset> </form> </div> </body> </html> <?php if($_POST != null) { $ano = $_POST['ano']; $estado = $_POST['estado']; $arvore = $_POST['arvore']; $volume = $_POST['volume']; $arvoreR = (intval($volume) * 6); $totalPagar = (intval($arvore) * 0.75); } else { $ano = 0; $estado = 0; $arvore = 0; $volume = 0; $arvoreR = 0; $totalPagar = 0; } ?> <legend align='center'></legend> <table border='1' align='center'> <tr> <td colspan='6' align='center'>Resultado</td> </tr> <tr style='size: 16px; font-weight:bold; font-family: 'Arial Narrow';> <td>Ano Base </td><td>Estado Origem </td><td>Árvores cortadas </td><td>Volume (m³) </td><td>Árvores a repor </td><td>Total a ser Pago</td> </tr> <tr align='center'> <td><?php echo $ano ?></td> <td><?php echo $estado ?></td> <td><?php echo $arvore ?></td> <td><?php echo $volume ?></td> <td><?php echo $arvoreR ?></td> <td><?php echo $totalPagar ?></td> </tr> </table>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus