Калькулятор доходности банковского вклада

первоначальный взнос ” class=”v” name=”first_pay”/>
размер дополнительных взносов (в месяц)1 ” class=”v” name=”another_pay”/>
срок вклада
” class=”v” name=”deposittime”/> процентная ставка (годовая) ” class=”v” name=”procent”/> %
капитализация процентов
начисление процентов:

12)
while ($zz>12)
$zz-=12;
$t+= daysInMonth( $zz, $_year);
$ty=$depositMult-1;

if ((($_POST[‘periodicity’])== 12) && ($_POST[‘another_pay’]!=0)&&(!isset($_POST[‘kapi’])))
{
//$s = “((” .$p .”+” .$another_pay .”) *” .$i .”*” .$t .”/” .$k .”) / 100″ .”=” .round((($p+$another_pay) * $i * $t / $k) / 100,2) .””;
//print $s;
$s = (($p+$another_pay) * $i * $t / $k) / 100;
//print $s .”
“;
$summ+=$s;

$summ=round($summ,2);
$rr=$t;
$t=0;

$ar[$q][0]=$another_pay;;
$ar[$q][1]=$summ3;
$ar[$q][2]=$s;
$ar[$q][3]=$summ3;
}
else
{
if (( $zz % $_POST[‘periodicity’])== 0)
{

//$s= “(” .$summ .”*” .$i .”*” .$t .”/” .$k .”) /100″;
//print $s;
$s= ($summ * $i * $t / $k ) /100;
//print ” =” .round($s,2) .”
“;

$t=0;
}
elseif (($q==$ty)&&(( $zz % $_POST[‘periodicity’])!= 0 ))
{
//$s= “(” .$summ .”*” .$i .”*” .$t .”/” .$k .”) /100″;
//print $s;
//$s= ($summ * $i * $t / $k ) /100;
print ” =” .round($s,2) .”
“;
}
else
{

$s=0;
}
}
$summp2=$summp2+$s;
if ($q==$ty)
{
$summ+=$s;
$summ=round($summ,2);

}

}
else
{

if (($q % 12)==0)
$_year++;
$zz=$q;
if ($zz > 12)
while ($zz>12)
$zz-=12;
$t+= daysInMonth( $zz, $_year);
$ty=$depositMult-1;

if ((( $zz % $_POST[‘periodicity’])== 0))
{

//$s = “((” .$p .”+” .$another_pay .”) *” .$i .”*” .$t .”/” .$k .”) / 100″ .”=” .round((($p+$another_pay) * $i * $t / $k) / 100,2) .””;
//print $s;
$s = (($p+$another_pay) * $i * $t / $k) / 100;
//print $s .”
“;
$summ+=$s;

$summ=round($summ,2);
$rr=$t;
$t=0;
}
elseif (($q==$ty)&&(( $zz % $_POST[‘periodicity’])!= 0 ))
{
//$s = “((” .$p .”+” .$another_pay .”) *” .$i .”*” .$t .”/” .$k .”) / 100″ .”=” .round((($p+$another_pay) * $i * $t / $k) / 100,2) .””;
//print $s;
$s = ($p * $i * $t / $k) / 100;
//print $s .”
“;
$summ+=$s;
$summ=round($summ,2);
}
else
$s=0;
$summp+=$s;

}

$summ=round($summ,2);
$p=round($p,2);
$s=round($s,2);

if ((($_POST[‘periodicity’])== 12) && ($_POST[‘another_pay’]!=0)&&(!isset($_POST[‘kapi’])))
{
}
else
{
if ($q==1) $ar[$q][0]=$_POST[‘first_pay’];
else
$ar[$q][0]=$another_pay;;
$ar[$q][1]=$p+$another_pay;
$ar[$q][2]=$s;
$ar[$q][3]=$summ;;
}

if (!isset($_POST[‘kapi’]))
$summp=round($s,2);

$p=$summ;

}
}
?>

размер вклада в конце срока:

сумма начисленных процентов:

месяц взнос капитал в начале месяца начисление процентов сумма

‘;
$sum_ar2=0;
$count_m=1;
for ($i=1;$i!=$q;$i++)
{

$sum_ar0+=$ar[$i][0];
$sum_ar2+=$ar[$i][2];
if ((($_POST[‘periodicity’])== 12) && ($_POST[‘another_pay’]!=0)&&(!isset($_POST[‘kapi’])))
{
if (($i % 12)!=0)
print ‘

‘ .$i .’ ‘.number_format($ar[$i][0],2,’.’,’ ‘).’ ‘.number_format($ar[$i][1],2,’.’,’ ‘).’ 0.00 ‘.number_format($ar[$i][3],2,’.’,’ ‘) .’

‘;
else
print ‘

‘ .$i .’ ‘.number_format($ar[$i][0],2,’.’,’ ‘).’ ‘.number_format($ar[$i][1],2,’.’,’ ‘).’ ‘.number_format($sum_ar2,2,’.’,’ ‘).’ ‘.number_format($ar[$i][3]+$sum_ar2,2,’.’,’ ‘) .’

‘;
}

else
print ‘

‘ .$i .’ ‘.number_format($ar[$i][0],2,’.’,’ ‘).’ ‘.number_format($ar[$i][1],2,’.’,’ ‘).’ ‘.number_format($ar[$i][2],2,’.’,’ ‘).’ ‘.number_format($ar[$i][3],2,’.’,’ ‘) .’

‘;
if (($i % 12)==0)
{
$sum_ar1=$ar[$i-11][1];
if ($count_m==1)
$sum_ar0-=$_POST[‘first_pay’];

if ((($_POST[‘periodicity’])== 12) && ($_POST[‘another_pay’]!=0)&&(!isset($_POST[‘kapi’])))
print ‘

‘ .$count_m.’-й год’ .’ ‘.number_format($sum_ar0,2,’.’,’ ‘).’ ‘.number_format($sum_ar1,2,’.’,’ ‘).’ ‘.number_format($sum_ar2,2,’.’,’ ‘) .’ ‘.number_format($ar[$i][3]+$sum_ar2,2,’.’,’ ‘) .’

‘;
else
print ‘

‘ .$count_m.’-й год’ .’ ‘.number_format($sum_ar0,2,’.’,’ ‘).’ ‘.number_format($sum_ar1,2,’.’,’ ‘).’ ‘.number_format($sum_ar2,2,’.’,’ ‘) .’ ‘.number_format($ar[$i][3],2,’.’,’ ‘) .’

‘;

$count_m++;
$sum_ar2=0;
$sum_ar0=0;
}

}
print “

“;

}

?>

Сообщить об опечатке

Текст, который будет отправлен нашим редакторам: