elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  PHP (Moderador: #!drvy)
| | | |-+  Alguien me orienta
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Alguien me orienta  (Leído 1,764 veces)
MellaSystems

Desconectado Desconectado

Mensajes: 46



Ver Perfil
Alguien me orienta
« en: 18 Enero 2016, 14:39 pm »

Tengo este codigo:

Código
  1. public function CalcPrestamo($monto, $interes, $tiempo){
  2.                $this->monpre = $monto;
  3.                $this->intpre = $interes;
  4.                $this->timepre = $tiempo;
  5.  
  6.                $interes /=100;
  7.  
  8.                $int = $monto * $interes;
  9.                $pagCap = $monto / $tiempo;
  10.                $cuotas = $int + $pagCap;
  11.                $amort = $cuotas - $pagCap;
  12.                $vf = $monto + $int;
  13.  
  14.                echo "<HR />";
  15.                echo "<h3><strong>Calculos del Prestamo</strong></h3>";
  16.  
  17.                echo '<table width="361" border="0" cellspacing="2" cellpadding="1">';
  18.                echo "<tr>";
  19.                echo "<td width='295'><div align='right' class='style2'>MONTO: </div></td>";
  20.                echo '<td width="56"><div align="right" class="style2">'.$monto.'</div></td>';
  21.                echo '</tr>';
  22.                echo '<tr>';
  23.                echo '<td width="295"><div align="right" class="style2">INTERES:</div></td>';
  24.                echo '<td width="56"><div align="right" class="style2">'. $int .'</div></td>';
  25.                echo '</tr>';
  26.                echo '<tr>';
  27.                echo '<td width="295"><div align="right" class="style2">TIEMPO DE PAGO:</div></td>';
  28.                echo '<td width="56"><div align="right" class="style2">'.$tiempo.'</div></td>';
  29.                echo '</tr>';
  30.                echo "<tr>";
  31.                echo '<td width="295"><div align="right" class="style2">CUOTA</div></td>';
  32.                echo '<td width="56"><div align="right" class="style2">'.$cuotas.'</div></td>';
  33.                echo "</tr>";
  34.                echo "</table>";
  35.                echo "<br />";
  36.  
  37.                echo "<table class='tableloans' align='center'>";
  38.                            echo "<tr>";
  39.                                echo "<th align='center'>TIEMPO</th>";
  40.                                echo "<th align='center'>CUOTA</th>";
  41.                                echo "<th align='center'>INTERES</th>";
  42.                                echo "<th align='center'>AMORTIZACION</th>";
  43.                                echo "<th align='center'>T AMORTIZADO</th>";
  44.                            echo "</tr>";
  45.  
  46.                        for($i = 1; i <= $tiempo; $i++){
  47.                            echo "<tr>";
  48.                                echo "<td align='left'>".$tiempo . "</td>";
  49.                                echo "<td align='left'>".$cuotas . "</td>";
  50.                                echo "<td align='left'>".$int . "</td>";
  51.                                echo "<td align='left'>".$amort . "</td>";
  52.                                echo "<td align='left'>".$vf . "</td>";
  53.                            echo "</tr>";
  54.                        }
  55.                        echo "<table>";
  56. //aqui no me imprime nada
  57.            }
  58.  

Gracias de ante mano!!!


En línea

engel lex
Moderador Global
***
Desconectado Desconectado

Mensajes: 15.514



Ver Perfil
Re: Alguien me orienta
« Respuesta #1 en: 18 Enero 2016, 16:57 pm »

eso es un código y muestra unos datos... si quieres más ayuda, deberías decir en que necesitas ayuda


En línea

El problema con la sociedad actualmente radica en que todos creen que tienen el derecho de tener una opinión, y que esa opinión sea validada por todos, cuando lo correcto es que todos tengan derecho a una opinión, siempre y cuando esa opinión pueda ser ignorada, cuestionada, e incluso ser sujeta a burla, particularmente cuando no tiene sentido alguno.
MellaSystems

Desconectado Desconectado

Mensajes: 46



Ver Perfil
Re: Alguien me orienta
« Respuesta #2 en: 18 Enero 2016, 19:59 pm »

Gracias brother pero errores tras errores pude lograr que me imprima la tabla de amortizacion que hacia llamaba en el ciclo for.
Código
  1. public function CalcPrestamo($monto, $interes, $tiempo){
  2.                $this->monpre = $monto;
  3.                $this->intpre = $interes;
  4.                $this->timepre = $tiempo;
  5.  
  6.                $interes /=100;
  7.  
  8.                $int = $monto * $interes;
  9.                $intCuo = $int / $tiempo;
  10.                $pagCap = $monto / $tiempo;
  11.                $cuotas = $intCuo + $pagCap;
  12.                $amort = $cuotas - $int;
  13.                $vf = $monto + $int;
  14.  
  15.                echo "<HR />";
  16.                echo "<h3><strong>Calculos del Prestamo</strong></h3>";
  17.  
  18.                echo '<table align="center" width="40%" border="0" cellspacing="1" cellpadding="1">';
  19.                echo "<tr>";
  20.                echo "<td align='left'>MONTO: </td>";
  21.                echo '<td colspan="2"><div align="left" >'.$monto.'</div></td>';
  22.                echo '<td align="left">INTERES:</td>';
  23.                echo '<td colspan="2"><div align="left" >'. $int .'</div></td>';
  24.                echo '</tr>';
  25.                echo "<tr>";
  26.                echo "<td align='left'>TIEMPO: </td>";
  27.                echo '<td colspan="2"><div align="left" >'.$tiempo.'</div></td>';
  28.                echo '<td align="left">CUOTA:</td>';
  29.                echo '<td colspan="2"><div align="left" >'. round($cuotas,2) .'</div></td>';
  30.                echo '</tr>';
  31.                echo "</table>";
  32.                echo "<br />";
  33.  
  34.                            echo "<table class='tableloans' cellspacing='1' align='center' border='1'>";
  35.                            echo "<tr>";
  36.                                echo "<th align='center'>Periodo</th>";
  37.                                echo "<th align='center'>Cuota</th>";
  38.                                echo "<th align='center'>Inter&eacute;s</th>";
  39.                                echo "<th align='center'>Amortz</th>";
  40.                                echo "<th align='center'>T Amortizado</th>";
  41.                            echo "</tr>";
  42.  
  43.                        $tar = 0;
  44.  
  45.                        for($valor = 1; $valor <= $tiempo; $valor++){
  46.                            $tar = $tar+$amort;
  47.  
  48.                            echo "<tr>";
  49.                                echo "<td align='center'>".$valor. "</td>";
  50.                                echo "<td align='center'>".round($cuotas,2) . "</td>";
  51.                                echo "<td align='center'>".$int . "</td>";
  52.                                echo "<td align='center'>".round($amort,2). "</td>";
  53.                                echo "<td align='right'>". round($tar,2) ."</td>";
  54.                            echo "</tr>";
  55.                        }
  56.                        echo "<table>";
  57.            }
Esa fue la solucion a mi problema Gracias
En línea

eLank0
eLhAcKeR r00Lz


Desconectado Desconectado

Mensajes: 1.062



Ver Perfil WWW
Re: Alguien me orienta
« Respuesta #3 en: 19 Enero 2016, 14:47 pm »

Si una etiqueta <table> no la cierras correctamente, es normal que no te funcione.

Salu2
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Alguien a escuchado sobre la teoria de los reptilianos, alguien con informacion?
Foro Libre
XXXXXX 1 2,519 Último mensaje 7 Septiembre 2010, 01:26 am
por alondra2
alguien me orienta para el futuro web
Desarrollo Web
Roboto 4 2,442 Último mensaje 17 Abril 2011, 11:47 am
por peib0l
quien me orienta con este ejercicio en c++
Programación C/C++
EL PORTU 3 2,356 Último mensaje 11 Mayo 2013, 14:46 pm
por leosansan
alguien me orienta sobre como interpretar css sass?
Desarrollo Web
Roboto 1 1,843 Último mensaje 22 Noviembre 2014, 16:39 pm
por EFEX
Alguien me orienta sobre traer htmls locales de websites?
Desarrollo Web
Roboto 1 1,528 Último mensaje 6 Abril 2017, 16:33 pm
por ThinkByYourself
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines