<style>
.headtop{font-family:'Verdana';font-size:10px;background-color:2C72DA;font-weight:bold;text-align:center;color:ffffff;border:1px solid ffffff;}
.head{font-family:'Verdana';font-size:10px;background-color:F1F1F1;font-weight:bold;text-align:center;color:333333;border:1px solid ffffff;}
.head2{font-family:'Verdana';font-size:10px;background-color:c9c8b4;font-weight:bold;text-align:center;color:333333;border:1px solid ffffff;}
.res1{font-family:'Verdana';font-size:10px;background-color:ffffff;text-align:center;color:000000;}
.res2{font-family:'Verdana';font-size:10px;background-color:f1f1f1;text-align:center;color:000000;border:1px solid ffffff;}
.res4{font-family:'Verdana';font-size:9px;background-color:ffffff;font-weight:bold;text-align:center;color:666666;}
</style>
<?php
$minvalor = 10; // VALOR MINIMO DE CADA PARCELA
$desconto = 0;//Valor da percentagem de Desconto atribuída ao produto
$parcelaqtminimacc = '10'; ///QUANTIDADE MÁXIMA DE PARCELAS
$totalValue = 500;///PREÇO DO PRODUTO
$taxa0 = 0;
$i = 0;
$splits = (int) ($totalValue/$minvalor);
$valor = ( $totalValue / ($i+1) );
$totaldesconto = $valor - (($desconto/100)$valor);
$minSemJuros = 0;
// Atualizado por Antonio C. Dias em 2008-10-25
//
$taxajuros = 1.99; // definição da taxa de juros mensal a ser aplicada. Altere apenas esse valor
?>
<table width="280" style="border: 1px dotted CCCCCC;" cellpadding="1" cellspacing="1"><tr><td colspan="3" class="headtop">FORMAS DE PAGAMENTO</td></tr><tr>
<td class="head">Nº de parcelas</td>
<td class="head">Valor da parcela</td><td class="head">Valor Total</td></tr>
<?php
for($i = 0; $i < $splits; $i++){
if($i>$parcelaqtminimacc - 1){break;}
$i % 2 == 0 ? $class = "res1" : $class = "res2";
if($i=='0'){
$parcela = $valor - (($desconto/100)$valor);
?><tr>
<td class="res1">Deposito Bradesco</td>
<td class="res1"><?php echo "R$ ". number_format($totalValue+$taxa0 , 2 , "," , "."); ?></td>
<td class="res1"><?php echo "<b>R$ ". number_format($totalValue+$taxa01 , 2 , "," , "."); ?></b></td>
</tr><?php
$parcela = $valor - (($desconto/100)$valor);
}
if($i <= $minSemJuros){
?><tr>
<td class="<?php echo $class; ?>"><b><?php echo ($i+1) ."x Sem Juros"; ?></b></td>
<td class="<?php echo $class; ?>"><b><?php echo "R$ ". number_format($valor/($i+1) , 2 , "," , "."); ?></b></td>
<td class="<?php echo $class; ?>"><b><?php echo " R$". number_format($valor, 2 , "," , "."); ?></b></td>
</tr><?php
}
else
{
// Atualizado por Antonio C. Dias em 2008-10-25
//
//fórmula para calculo dos multiplicadores de acordo com livro sobre economia
// onde : A -> valor da parcela
// P -> valor do produto
// i -> juros no período (no caso o período é mensal ou de 30 dias)
// n -> número de parcelas
//
// i[(1+i)^n]
// A/P = -
// [ (1+i)^n ] -1
$juros=$taxajuros/100;
$taxa = ($juros(pow((1+$juros),($i+1))))/((pow((1+$juros),($i+1)))-1);
////////////////////////////ATUALIZADO POR BYTESDESIGN.COM//////////////
/ if($i+1=='2'){$taxa = 0.5201;}// MULTIPLICADOR DA 2ª PARCELA
if($i+1=='3'){$taxa = 0.35365;} // MULTIPLICADOR DA 3ª PARCELA
if($i+1=='4'){$taxa = 0.2705;} // MULTIPLICADOR DA 4ª PARCELA
if($i+1=='5'){$taxa = 0.2207;} // MULTIPLICADOR DA 5ª PARCELA
if($i+1=='6'){$taxa = 0.1876;} // MULTIPLICADOR DA 6ª PARCELA
if($i+1=='7'){$taxa = 0.1640;} // MULTIPLICADOR DA 7ª PARCELA
if($i+1=='8'){$taxa = 0.1463;} // MULTIPLICADOR DA 8ª PARCELA
if($i+1=='9'){$taxa = 0.132665;} // MULTIPLICADOR DA 9ª PARCELA
if($i+1=='10'){$taxa = 0.1218;} // MULTIPLICADOR DA 10ª PARCELA
if($i+1=='11'){$taxa = 0.112908;} // MULTIPLICADOR DA 10ª PARCELA
if($i+1=='12'){$taxa = 0.105565;} // MULTIPLICADOR DA 12ª PARCELA /
if (number_format($totalValue$taxa , 2 , "," , ".") > $minvalor){
$valor = ( $totalValue / ($i+1) );
?><tr>
<td class="<?php echo $class; ?>"><?php echo ($i+1) ."x com juros"; ?></td>
<td class="<?php echo $class; ?>"><?php echo "R$ ". number_format($totalValue$taxa , 2 , "," , "."); ?></td>
<td class="<?php echo $class; ?>"><?php echo "R$ ". number_format($totalValue$taxa($i+1) , 2 , "," , "."); ?></td>
</tr>
<?php
}
}
}
?></table>
<table width="280" style="border: 0px dotted ff0000;" cellpadding="0" cellspacing="0">
<tr><td class="res4" align="left">Parcelado no cartão, juros de 1.99% ao mês<br>Valor minimo de cada parcela R$10,00</tr></td></table>