<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<title> Cuadro de Amortización &raquo </title>
    
<!-- Comment Rating plugin by Bob King, http://wealthynetizen.com/, dynamic comment styling. --> 
<style type="text/css" media="screen">
   .ckrating_highly_rated {background-color:#FFFFCC !important;}
   .ckrating_poorly_rated {opacity:0.6;filter:alpha(opacity=70);}
 
<!--
body {
    background-color: #FFFFFF;
}
.Estilo1 {
    color: #0000FF;
    font-weight: bold;
}
.Estilo3 {color: #000000}
.Estilo4 {color: #000000; font-weight: bold; }
.Estilo5 {
    font-size: 12px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: bold;
}
-->
</style></head>
<body>
<div id="outer">
  <div id="content">
    <div id="main">
      <div class="post">
        <table width="469" border='0' align="center" bgcolor="#99FFFF">
         <tr><td width="463" height="724" valign='top'>             <div class="post-content">
              <form name="formcuadro">
               <!--<div align="center">
               		<input type="hidden" name="phpMyAdmin" value="30cf65db69384ae2fff3163efe3b599b" />
               		<span class="post-title Estilo5">Cuadro de Amortización - Prestamo Banco Comunal </span> 
               </div>-->
               
               
               
               
         <table width="450" border='0' align="center">
           <tr bgcolor="#FFFFFF">
              <td width="174">
              <div align="right" class="Estilo1 Estilo3">Dinero a solicitar:</div></td>
              <td width="266"> <input name="capital" type="text" value="100" size="6" maxlength="5"></td>
           </tr>
         
         
         
         
         <tr bgcolor="#FFFFFF">
              <td><div align="right" class="Estilo4">Plazo: </div></td>
              <td> <span class="Estilo3">
              <input name="anos" type="text" id="anos" value="1" size="3" maxlength="1" />              
              <strong>A&ntilde;os y</strong>
              <input name="meses" type="text" id="meses" size="3" maxlength="2" />
              <strong>Meses</strong></span></td>
            </tr>
            
            <tr bgcolor="#FFFFFF">
              <td><div align="right"><span class="Estilo3"><b>Interes:</b></span></div></td>
              <td><span class="Estilo3">
                <input name="int1"  type="text" value="6" size="2" maxlength="1" />
% 
<input name="button" type="button" onclick=cuadroamortizacion(this.form) value= "Calcular" />
</span></td>
            </tr>
            </table>
 
        <div align="center"><span class="Estilo3"></span></div>
        <div align="center">
        	<span class="Estilo3"></span>
        	<span class="Estilo3"></span>
        	<span class="Estilo3"></span>
           <textarea cols=60 rows=37 name=cuadro></textarea>
		</div>
 </form>
 
                <div align="center">
<script language="JavaScript" type="text/javascript"> 
function cuadroamortizacion(form)
  {
      
      i=Number(form.int1.value); //interes
      princ =Number(form.capital.value);//capital
      intRate = (i/100) / 12;
      months=Number(form.anos.value*12) + Number(form.meses.value); //meses
      
      cuota = Math.floor((princ*intRate)/(1-Math.pow(1+intRate,(-1*months)))*100)/100;
      
    
    txtcuadro="Año\tMes\tCuota\tInteres\tAmortizacion\tCapital\n";
    
    capitalpendiente=princ;
    ano=1;
    m=0;
    for (i=1;i<=months;i++) {
      m++;
        if (m>12) {
          ano++;
          m=1;
        }
          txtlinea="";
          txtlinea+=ano;
          txtlinea+="\t" + m;
          txtlinea+="\t" + cuota;
          intereses=Math.round(capitalpendiente * intRate*100)/100;
          txtlinea+="\  " +intereses;
          amortizacion=Math.round((cuota-intereses)*100)/100;
          txtlinea+="\t" + amortizacion;
          capitalpendiente=Math.round((capitalpendiente-amortizacion)*100)/100;
          txtlinea+="\         " + capitalpendiente;
          txtlinea+="\n";
          
          if (i==months) { //ultima cuota redondeo
              txtlinea="";
              txtlinea+=ano + "\t" + m;
              nuevacuota=Math.round((cuota + capitalpendiente)*100)/100;
              txtlinea+="\t" + nuevacuota;
              txtlinea+="\t" + intereses;
              txtlinea+="\t" + nuevacuota;
              txtlinea+="\t\t" + 0 ;
              txtlinea+="\n";
          }
          txtcuadro+=txtlinea;
        }  
    
    form.cuadro.value=txtcuadro;
}     
                                </script>
                  <span class="Estilo5"><a href="purecssmenu.html" target="_self"></a></span> </div>
                                </div></td></tr>
 </table>
    
        <p>&nbsp;</p>
      </div>
    </div>
</div>
</div>
 
<p><p align="center">&nbsp;</p>
<div align="center">
  <script type="text/javascript" language="javascript1.2">
<!--
function printPage()
{
    document.getElementById('print').style.visibility = 'hidden';
    // Do print the page
    if (typeof(window.print) != 'undefined') {
        window.print();
    }
    document.getElementById('print').style.visibility = '';
}
//-->
</script>
  
 <?php
  $strPrint="Imprimir";
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
?>
 
</body>
</div>
</html>