<?php
include_once("../src/conexion.php");

$link=ConectarseServidor();
ConectarseBaseDatos($link);
$creditos=list_creditos(); //consultamos los creditos

?>
<!DOCTYPE html>
<html>
<head>
<title>Presta Ya ! - Listado Creditos</title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
</head>

<body>

			<div class="row">
                  <table class="table" style="width:80%" align="center">
                      <thead>
                          <tr>
                              <th>No. Credito</th>
                              <th>Deudor</th>
                              <th>Codeudor</th>
                              <th>Capital Inicial</th>
                              <th>No. Cuota</th>
                              <th>Tasa Interes</th>
                              <th>Forma de Pago</th>
                              <th>Valor Cuota</th>
                              <th>Saldo Capital</th>
                              <th>Cuotas Pendientes</th>
                              <th>Cobrador</th>
                          </tr>	
                      </thead>
                      <tbody id="BodyTable">
           				<?php
						  while ($row = mysql_fetch_array($creditos)){
							  ?>
                              <tr>
                                <td align="center"><?php echo  $row['nro_credito']; ?></td>
                                <td><?php echo  $row['deudor']; ?></td>
                                <td><?php echo  $row['codeudor']; ?></td>
                                <td align="right"><?php echo  number_format($row['capital'],0,",","."); ?></td>
                                <td align="center"><?php echo  number_format($row['num_cuota'],0,",","."); ?></td>
                                <td><?php echo  $row['tasa_interes']."%"; ?></td>
                                <td><?php echo  $row['forma']; ?></td>
                                <td align="right"><?php echo  number_format($row['valor_cuota'],0,",","."); ?></td>
                                <td align="right"><?php echo  number_format($row['saldo_capital'],0,",","."); ?></td>
                                <td align="center"><?php echo  $row['cuota_pendiente']; ?></td>
                                <td><?php echo  $row['Cobrador']; ?></td>
                              </tr>
                              <?php
						  }
						  desconectarse($link);//cierra la conexion
						?>
                      </tbody>
                  </table>
              </div>

</body>
</html>