$datosfam = array(); $totpagar = (double) 0.0; $sql = call_user_func(array($objFamiliar, "beneficiarios")); if ($stmt->prepare($sql)) { $stmt->bind_param('i', $_GET['codigo']); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { while ($rowsf = $result->fetch_assoc()) { array_push($datosfam, $rowsf); } } } else { throw new Exception("Ocurrio un problema con la siguiente consulta SQL: " . $sql); } $pdf->SetFont('Arial', '', 8); if (count($datosfam) == 0) { $pdf->Cell(194, 5, 'NO POSEE BENEFICIARIOS', 0, 1, 'C'); } foreach ($datosfam as $indice => $rows_fam) { $pdf->Cell(63, 5, $rows_fam['apefam'] . "," . $rows_fam['nomfam'], 0, 0); $cedfam = str_pad($rows_fam['cedfam'], 10, "0", STR_PAD_LEFT); $pdf->Cell(25, 5, $cedfam, 0, 0, 'C'); list($anio, $mes, $dia) = explode("-", $rows_fam['fecnacfam']); $date->setDate((int) $anio, (int) $mes, (int) $dia); $fecha = $date->format('d/m/Y'); $pdf->Cell(26, 5, $fecha, 0, 0, 'C'); $pdf->Cell(15, 5, $rows_fam['nom_corto'], 0, 0, 'C'); list($anio, $mes, $dia) = explode("-", $rows_fam['fecingfam']); $date->setDate((int) $anio, (int) $mes, (int) $dia); $fecha = $date->format('d/m/Y');