Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/03/2009, 07:42
Avatar de gokufast
gokufast
 
Fecha de Ingreso: abril-2007
Mensajes: 540
Antigüedad: 17 años
Puntos: 3
como poner las tablas de una tabla en arrays?

hola amigos tengo la siguiente duda, genero la tabla:
Código PHP:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {font-size: 10px}
.style2 {font-size: 10px; font-weight: bold; }
-->
</style>
</head>
<body>
<?

$monto 
11188;
$interes_mes_1 0.08/12;/*$monto*(8/12/100);*/
$amortizacion_mes_1 $cuota_mes $interes_mes_1;
$acumulada_mes_1 $amortizacion_mes_1;
$pendiente_mes_1 $monto $amortizacion_mes_1;
$meses 18;
$cuota_mes $monto/((1-(1/pow((1+$interes_mes_1),$meses)))/$interes_mes_1);
?>
<table width="361" border="0" cellspacing="2" cellpadding="1">
  <tr>
    <td width="295"><div align="right" class="style2">MONTO</div></td>
    <td width="56"><div align="right" class="style2"><? echo $monto?></div></td>
  </tr>
  <tr>
    <td width="295"><div align="right" class="style2">INTERES MENSUAL </div></td>
    <td width="56"><div align="right" class="style2"><? echo number_format($interes_mes_1,2); ?></div></td>
  </tr>
  <tr>
    <td width="295"><div align="right" class="style2">TIEMPO DE PAGO EN MESES </div></td>
    <td width="56"><div align="right" class="style2"><? echo $meses?></div></td>
  </tr>
  <tr>
    <td width="295"><div align="right" class="style2">CUOTA MES EN USD </div></td>
    <td width="56"><div align="right" class="style2"><? echo $cuota_mes?></div></td>
  </tr>
</table>
<br />
<table width="600" border="1" cellspacing="1" cellpadding="1">
  <tr>
    <td width="33"><div align="center"><span class="style1"></span></div></td>
    <td width="110"><div align="center" class="style1"><strong>AMORTIZACION</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>INTERES</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>TOTAL</strong></div></td>
    <td colspan="2"><div align="center" class="style1"><strong>AMORTIZACION</strong></div></td>
  </tr>
  <tr>
    <td width="33"><div align="center" class="style1"><strong>nro</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>MES</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>MES</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>MES</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>ACUMULADA</strong></div></td>
    <td width="110"><div align="center" class="style1"><strong>PENDIENTE</strong></div></td>
  </tr>
  <?
  $amort
=0;
  
$inter=0;
  
$cuota=0;
  
$acumu=0;
  
$pendi=$monto;
  function 
roundo($valor
  {
   
$float_redondeado=round($valor 100) / 100;
   return 
$float_redondeado;


for(
$x=0;$x<=$meses;$x++){ 
  
?>
  <tr>
    <td width="33"> <span class="style2"><? echo $x;?></span></td>
    <td width="110"><span class="style2"><? echo $amort;  ?></span></td>
    <td width="110"><span class="style2"><? echo $inter;  $inter=$pendi*8/12/100;?></span></td>
    <td width="110"><span class="style2"><? echo $cuota;  $cuota=$cuota_mes*1;?></span></td>
    <td width="110"><span class="style2"><? echo $acumu;  ?></span></td>
    <td width="110"><span class="style2"><? echo $pendi;  $amort=$cuota-$inter$pendi=$pendi-$amort$acumu=$acumu+$amort;?></span></td>
  </tr>
  <? ?>
</table>

</body>
</html>
los datos de cada columna lo quiero ingresar en un array por ejemplo un array que sea amortizacion y que tenga todos los datos desde el 1 al 18.
otro array que sea interes y que tenga todos los datos del 1 al 18 y asi tener un array para cada columna y que guarde todos los datos que la tabla contiene.

ademas ver si ingresando todo en arrays sea mas facil para ingresarlo en una base de datos, para poder la misma tabla posteriormente.

saludos