<style type="text/css">
.midnight-blue{	background:#2c3e50;	padding: 4px 4px 4px; color:white;	font-weight:bold; font-size:12px;}
.silver{ background:white; padding: 3px 4px 3px;}
.clouds{ background: #CDE4F5; padding: 3px 4px 3px;}
</style>
<?php
session_start();
if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1) 
{
	header("location: ../../login.php");
	exit;
}
include("../../config/db.php");
include("../../config/conexion.php");
$session_id= session_id();
$id_factura= intval($_GET['id_factura']);
$sql_count=mysqli_query($con,"select * from facturas where id_factura='".$id_factura."'");
$count=mysqli_num_rows($sql_count);
if ($count==0)
{
	echo "<script>alert('Venta no encontrada')</script>";
	echo "<script>window.close();</script>";
	exit;
}
	
$sql_factura=mysqli_query($con,"select * from facturas where id_factura='".$id_factura."'");
$rw_factura=mysqli_fetch_array($sql_factura);
$numero_factura=$rw_factura['numero_factura'];
$id_cliente=$rw_factura['id_cliente'];
$id_vendedor=$rw_factura['id_vendedor'];
$fecha_factura=$rw_factura['fecha_factura'];
$tienda_factura=$rw_factura['almacen'];
$condiciones=$rw_factura['condiciones'];
	
$sql_cliente=mysqli_query($con,"select * from clientes where id_cliente='$id_cliente'");
$rw_cliente=mysqli_fetch_array($sql_cliente);
$nombre=$rw_cliente['nombre_cliente'];
$direccion=$rw_cliente['direccion_cliente'];
$telefono=$rw_cliente['telefono_cliente'];
$correo=$rw_cliente['email_cliente'];
$rif=$rw_cliente['rif_cliente'];
?>

<page backtop="10mm" backbottom="10mm" backleft="20mm" backright="20mm">
    <page_header>
        <table style="width: 100%; border: solid 1px black;">
            <tr>
                <td style="text-align: left; width:33%;">FONTUR</td>
                <td style="text-align: center; width:34%;">TABLA DE AMORTIZACION DE PAGOS</td>
				<td style="text-align: right; width:33%;"><?php echo date('d/m/Y'); ?></td>
            </tr>
        </table>
    </page_header>
    <page_footer>
        <table style="width: 100%; border: solid 1px black;">
            <tr>
                <td style="text-align:left; width: 50%;">FONTUR</td>
                <td style="text-align:right; width: 50%;">page [[page_cu]]/[[page_nb]]</td>
            </tr>
        </table>
    </page_footer>
    <table style="width:100%;">
        <tr>
            <td style="width: 100%; color: #444444;">
            <img style="width: 100%;" src="../../img/cintillo-cedil.png" alt="Logo">
            </td>
        </tr>
    </table>
	<br>
    <br>
    <table cellspacing="0" style=" width: 100%; text-align: center; font-size: 11pt;">
        <tr>
            <td colspan="4" border="1" style="width:66.64%;" class='midnight-blue'>DATOS DEL BENEFICIARIO</td>
            <td colspan="2" border="1" style="width:33.36%;" class='midnight-blue'>DATOS DEL VEHICULO</td>
        </tr>
		<tr>
           	<td border="1" style="width:16.66%;"><strong>NOMBRES Y APELLIDOS</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>CEDULA DE IDENTIDAD</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>MARCA / MODELO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
           	<td border="1" style="width:16.66%;"><strong>ESTADO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>DIRECCION</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>PLACA</strong></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
	</table>
	<br>
    <br>
    <table cellspacing="0" style=" width: 100%; text-align: center; font-size: 11pt;">
        <tr>
           <td colspan="6" style="width:100%;" border="1" class='midnight-blue'>DATOS DEL FINANCIAMIENTO</td>
        </tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>MONTO TOTAL</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>PLAZO DEL CREDITO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>FECHA ENTREGA</strong></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>INICIAL (%)</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>PLAZO SEMANAL</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>FECHA PRIMERA CUOTA</strong></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>TASA</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>TASA SEMANAL</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td style="width:16.66%;"></td>
           	<td style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>MONTO A FINANCIAR</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"><strong>CUOTA SEMANAL</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td style="width:16.66%;"></td>
           	<td style="width:16.66%;"></td>
		</tr>
		
     </table>
     <br>
     <br>
    <table height="113" border="1" cellspacing="0" style="width: 100%;">
        <tr>
            <th style="width: 10%; font-size: 8pt;" class='midnight-blue'>N CUOTA</th>
            <th style="width: 14%; font-size: 8pt;" class='midnight-blue'>FECHA VENCIMIENTO</th>
            <th style="width: 14%; font-size: 8pt;" class='midnight-blue'>AMORTIZACION CAPITAL</th>
            <th style="width: 14%; font-size: 8pt;" class='midnight-blue'>AMORTIZACION INTERES</th>
			<th style="width: 10%; font-size: 8pt;" class='midnight-blue'>SALDO CAPITAL</th>
            <th style="width: 10%; font-size: 8pt;" class='midnight-blue'>MONTO CUOTA</th>
            <th style="width: 10%; font-size: 8pt;" class='midnight-blue'>SALDO FINAL</th>
            <th style="width: 10%; font-size: 8pt;" class='midnight-blue'>FECHA DE PAGO</th>
			<th style="width: 10%; font-size: 8pt;" class='midnight-blue'>DIAS DE MORA</th>
            <th style="width: 10%; font-size: 8pt;" class='midnight-blue'>MONTO POR MORA</th>
        </tr>
		<tr>
			<th height="15" style="width: 10%;">1</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">2</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">3</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">4</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">5</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">6</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">7</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">8</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
		<tr>
			<th height="15" style="width: 10%;">9</th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
			<th height="15" style="width: 10%;"></th>
            <th height="15" style="width: 10%;"></th>
		</tr>
  </table>
  <br>
  <br>
  <table cellspacing="0" style=" width: 100%; text-align: center; font-size: 11pt;">
        <tr>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"><strong>CUOTA</strong></td>
			<td border="1" style="width:16.66%;"><strong>CAPITAL</strong></td>
           	<td border="1" style="width:16.66%;"><strong>INTERES</strong></td>
			<td border="1" style="width:16.66%;"><strong>TOTAL</strong></td>
           	<td border="1" style="width:16.66%;"><strong>MORA ACUM</strong></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>SALDO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>PAGADO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>VENCIDO</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		<tr>
			<td border="1" style="width:16.66%;"><strong>POR COBRAR</strong></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
			<td border="1" style="width:16.66%;"></td>
           	<td border="1" style="width:16.66%;"></td>
		</tr>
		
     </table>
</page>