public function getTodosFuentes() { /*if( !Sesion::isResponsable() ){ if( !Sesion::isAdmin() ) return Redirect::to('administracion/logout'); }*/ $seleccionar = FuenteController::consultagetTodosFuentes(); if (count($seleccionar) > 0) { $response = array('status' => 'OK', 'data' => $seleccionar, 'message' => 'Resultados obtenidos'); } else { $response = array('status' => 'ERROR', 'message' => 'No se encontraron fuentes registradas.'); } return Response::json($response); }
public static function imprimirFuentes() { $seleccionar = FuenteController::consultagetTodosFuentes(); $cuerpoTabla = ''; $i = 0; $periodo = ""; $fecha = PDFController::getFecha(); foreach ($seleccionar as $value) { $i = $i + 1; $fuenombre = $value['fueNombre']; $cuerpoTabla = $cuerpoTabla . '<tr> <td width="3%" > <div align="center"> <CODE style="font-size: 80%;">' . $i . '</code> </div> </td> <td> <div align="center"> <CODE>' . $fuenombre . '</code> </div> </td> </tr>'; } $html = '<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><body>' . '<h5 align="right">Sistema de Noticias </h5><h5 align="right">Vázquez Hernández Contadores, S.C.</h5>' . '<h3 align="center">Fuentes de información</h3>' . '<table cellspacing="0" border="1" align="center" width="400" > <tbody > <tr> <td width="3%" > <div align="center"> </div> </td> <td width="20%" > <div align="center"> <h5><strong>Fuente</strong> </h5> </div> </td> </tr>' . $cuerpoTabla . '</tbody </table>' . '<br><p> Fecha de generación: <CODE>' . $fecha . '</CODE></p>' . '</body></html>'; return PDF::load($html, 'letter', 'portrait')->show(); }