}
if ($_GET['tipo_tabla'] == 'original') {
    $tabla = $contra->showTablaAmortizacion($_GET['contrato']);
} else {
    $tabla = $contra->showNewTablaAmortizacion($_GET['contrato']);
}
while ($l = $tabla->NextRow()) {
    $fecha_generacion = $l['fecha_generacion'];
    $monto = $l['monto'];
    break;
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetY(15);
$pdf->Cell(60);
$pdf->Cell(50, 5, utf8_decode("FECHA DE PRÉSTAMO: ") . $fecha_generacion, 0, 0, 'C');
$pdf->Ln();
$pdf->Cell(60);
$pdf->Cell(50, 5, utf8_decode("IMPORTE DEL PRÉSTAMO: \$") . $monto, 0, 0, 'C');
$pdf->Ln(20);
$pdf->SetFont('Times', '', 12);
//tabla de amortizacion
//cabeceras
$pdf->SetFillColor(192, 192, 192);
$fill = true;
if ($_GET['tipo_tabla'] == 'original') {
    $pdf->SetFont("Arial", "B", 8);
    $pdf->Cell(10, 6, "#", 1, "", "", $fill);
    $pdf->Cell(27, 6, "SALDO INSOLUTO", 1, "", "", $fill);
    $pdf->Cell(30, 6, "CAPITAL PAGADO", 1, "", "", $fill);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$util = new cUtilerias();
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 12);
//tabla de amortizacion
//cabeceras
$pdf->SetFillColor(192, 192, 192);
$fecha = $_GET['fecha'];
$fill = true;
$pdf->SetFont("Arial", "B", 8);
$pdf->Cell(10, 6, "#", 1, "", "", $fill);
$pdf->Cell(30, 6, "SALDO INSOLUTO", 1, "", "", $fill);
$pdf->Cell(30, 6, "CAPITAL PAGADO", 1, "", "", $fill);
$pdf->Cell(35, 6, "% INTERES " . $ti, 1, "", "", $fill);
$pdf->Cell(25, 6, "INTERES", 1, "", "", $fill);
$pdf->Cell(25, 6, "PAGO", 1, "", "", $fill);
$pdf->Cell(35, 6, "FECHA DE CORTE", 1, "", "", $fill);
//cuerpo de la tabla
$pdf->SetFillColor(224, 224, 224);
$fill = false;
$pdf->SetFont('', 'I');
$tota = $total;
$pdf->Ln();
$fecha = date('Y-m-d', strtotime($fecha . ' ' . $interval));
$pdf->Cell(10, 6, 1, 1, "", "", $fill);
$pdf->Cell(30, 6, '$' . number_format($total, 2), 1, "", "", $fill);
    function Footer()
    {
        // Position at 1.5 cm from bottom
        $this->SetY(-15);
        // Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage("L");
$pdf->SetFont('Times', '', 12);
//crea las cabeceras de la tabla
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
$pdf->Cell(25, 10, "CONTRATO");
    }
    function Footer()
    {
        // Position at 1.5 cm from bottom
        $this->SetY(-15);
        // Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 12);
$pdf->Cell(30, 15, "NUMERO DE REFERENCIA: " . $det['num_ref']);
$pdf->Ln();
$pdf->Cell(30, 15, "FOLIO DEL TICKER O COMBROBANTE DE PAGO: " . $det['folio_ficha']);
$pdf->Ln();
$pdf->Cell(30, 15, "NUMERO DE CONTRATO: " . $det['num_ref']);
$pdf->Ln();
$pdf->Cell(30, 15, "NUMERO DE ESTATUS DEL CONTRATO: " . $det['id_contrato']);
$pdf->Ln();
$pdf->Cell(30, 15, "FECHA Y HORA DEL PAGO: " . $det['fecha_pago']);
$pdf->Ln();
$pdf->Cell(30, 15, "FECHA Y HORA DEL REGISTRO DEL PAGO: " . $det['fecha_reg']);
$pdf->Ln();
$pdf->Cell(30, 15, "BANCO DONDE SE REALIZO EL PAGO: " . $det['banco']);
$pdf->Ln();
$pdf->Cell(30, 15, "CUENTA: " . $det['cuenta']);
$pdf->Ln();
    }
    function Footer()
    {
        // Position at 1.5 cm from bottom
        $this->SetY(-15);
        // Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 12);
$pdf->Cell(50, 10, "NOMBRE/RAZON SOCIAL: " . strtoupper($det['razon'] . " " . $det['nombre'] . " " . $det['a_pat'] . " " . $det['a_mat']));
$pdf->Ln();
$pdf->Cell(50, 10, "FECHA DE NACIMIENTO/CONSTITUCION: " . $util->convierteFecha($det['fecha_nac']));
$pdf->Ln();
$sepso = "MASCULINO";
if ($det['sexo'] == 0) {
    $sepso = "FEMENINO";
}
$pdf->Cell(100, 10, "GENERO: " . strtoupper($sepso));
$pdf->Cell(50, 10, "NACIONALIDAD: " . strtoupper($det['nacionalidad']));
$pdf->Ln();
$pdf->Cell(100, 10, "CURP: " . strtoupper($det['curp']));
$pdf->Cell(50, 10, "RFC: " . strtoupper($det['rfc']));
$pdf->Ln();
$pdf->Cell(100, 10, "CIUDAD DE NACIMIENTO/CONSTITUCION: " . strtoupper($det['ciudad']));
$pdf->Ln();