I am creating a table with a cell in the form of input text to enter a number, and the rest of the cells will be printed after the operations have been performed to determine its value.
After the table has a submit button to send the value of the input text to the variable that will initiate the calculations.
It turns out that I can not print the results.
<form method="POST" action="meixautonomo.php">
<table border="1">
<tr>
<td class="indicador">Informações Gerais</td>
<td class="indicador">Autonômo</td>
<td class="indicador">MEI/ME</td>
<td class="indicador">% de Econômia</td>
</tr>
<tr>
<td>Bônus Bruto</td>
<td><input type="text" name="entrada"></td>
<?php
if(isset($_POST['calcular'])){
$autonomoBonusBruto = $_POST['entrada'];
$meimeBonusBruto = $autonomoBonusBruto;
$porcEconomiaBonusBruto = ($autonomoBonusBruto - $meimeBonusBruto) / $autonomoBonusBruto;
$autonomoTaxa = 3;
$meimeTaxa = 3.99;
$porcEconomiaTaxa = ($autonomoTaxa - $meimeTaxa) / $autonomoTaxa;
$autonomoINSS;
if($autonomoTaxa + $meimeTaxa > 5189.82){
$autonomoINSS = 570.88;
}
else{
$autonomoINSS = ($autonomoBonusBruto - $autonomoTaxa) * 0.11;
}
$meimeINSS;
if($meimeBonusBruto <= 5000){
$meimeINSS = 44;
}
else if($meimeBonusBruto > 5189.82){
$meimeINSS = 570.88;
}
else{
$meimeINSS = $meimeBonusBruto * 0.11;
}
$porcEconomiaINSS = ($autonomoINSS - $meimeINSS) / $autonomoINSS;
$autonomoIRRF = 2864.91 * 0.15 - 354.80;
$meimeIRRF;
if($meimeBonusBruto <= 5000){
$meimeIRRF = 21033.22 * 0 - 0 / 12;
}
else{
$meimeIRRF = $meimeBonusBruto * 0.06;
}
$porcEconomiaIRRF = ($autonomoIRRF - $meimeIRRF) / $autonomoIRRF;
$autonomoISS = $autonomoBonusBruto * 0.05;
$meimeISS;
if($meimeBonusBruto <= 5000){
$meimeISS = 5;
}
else{
$meimeISS = $meimeBonusBruto * 0.05;
}
$porcEconomiaISS = ($autonomoISS - $meimeISS) / $autonomoISS;
$autonomoBonusLiquido = $autonomoBonusBruto - $autonomoTaxa - $autonomoINSS - $autonomoIRRF - $autonomoISS;
$meimeBonusLiquido = $meimeBonusBruto - $meimeTaxa - $meimeINSS - $meimeIRRF - $meimeISS;
$porcEconomiaBonusLiquido = ($autonomoBonusLiquido - $meimeBonusLiquido) / $autonomoBonusLiquido;
$meimeLucro = $meimeBonusLiquido - $autonomoBonusLiquido;
?>
<td><?php echo $meimeBonusBruto;?></td>
<td><?php echo $porcEconomiaBonusBruto;?></td>
</tr>
<tr>
<td>Taxa DOC/Boleto</td>
<td><?php echo $autonomoTaxa;?></td>
<td><?php echo $meimeTaxa;?></td>
<td><?php echo $porcEconomiaTaxa;?></td>
</tr>
<tr>
<td>INSS</td>
<td><?php echo $autonomoINSS;?></td>
<td><?php echo $meimeINSS;?></td>
<td><?php echo $porcEconomiaINSS;?></td>
</tr>
<tr>
<td>IRRF</td>
<td><?php echo $autonomoIRRF;?></td>
<td><?php echo $meimeIRRF;?></td>
<td><?php echo $porcEconomiaIRRF;?></td>
</tr>
<tr>
<td>ISS</td>
<td><?php echo $autonomoISS;?></td>
<td><?php echo $meimeISS;?></td>
<td><?php echo $porcEconomiaISS;?></td>
</tr>
<tr>
<td>Bônus Líquido</td>
<td><?php echo $autonomoBonusLiquido;?></td>
<td><?php echo $meimeBonusLiquido;?></td>
<td><?php echo $porcEconomiaBonusLiquido;?></td>
</tr>
</table>
<?php echo $meimeLucro;}?>
<br>
<input type="submit" name="calcular" value="Gerar resultados">
</form>