protected function GenerateResponse() { try { $this->response = ReportesController::ClienteServicio(isset($_GET['id_cliente']) ? $_GET['id_cliente'] : null, isset($_GET['id_empresa']) ? $_GET['id_empresa'] : null, isset($_GET['id_sucursal']) ? $_GET['id_sucursal'] : null, isset($_GET['orden']) ? json_decode($_GET['orden']) : null); } catch (Exception $e) { //Logger::error($e); throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage())); } }
public function pdfReporteBusquedaFrase() { /*CONTRASEÑA Actualizar*/ $data = array('buscar' => Input::get('b')); /* $data = array( 'palabra1' => "leyes", 'palabra2' => "distrito", 'palabra3' => "", 'palabra4' => "", 'condicion'=> 1 );*/ /* $palabra1 = $data['palabra1']; $palabra2 = $data['palabra2']; $palabra3 = $data['palabra3']; $palabra4 = $data['palabra4']; */ $busqueda = ArticulosController::getBusquedaFrase($data['buscar']); $fecha = ReportesController::getFecha(); $i = 0; $cuerpoTabla = ''; foreach ($busqueda as $value) { $i = $i + 1; $titulo = $value->artTitulo; $tipo; if ($value->artTipo == 1) { $tipo = "artículo"; } if ($value->artTipo == 2) { $tipo = "consulta"; } if ($value->artTipo == 3) { $tipo = "tesis"; } if ($value->artTipo == 4) { $tipo = "jurisprudencia"; } if ($value->artTipo == 5) { $tipo = "tips"; } $autor; if ($value->artAutor == null || $value->artAutor == "" || $value->artAutor == "") { $autor = "Sin autor"; } else { $autor = $value->artAutor; } $pagina = $value->artPagina; $revista = $value->revNombre; $numero = $value->reNumero; $anio = $value->reAnio; $mes = ReportesController::selectMes($value->reMes); // $autor = $value['artAutor']; $ubicacion = $value->reUbicacion; $cuerpoTabla = $cuerpoTabla . '<tr> <td> <div align="center"> <p style="font-size:10px; ">' . $i . '</p> </div> </td> <td > <div align="justify"> <p style="font-size:10px; padding:0 5px 0 5px ">' . $titulo . '</p> </div> </td> <td> <div align="center"> <p style="font-size:10px; ">' . $tipo . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $pagina . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $revista . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $numero . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $anio . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $mes . '</p> </div> </td> <td > <div align="center"> <p style="font-size:10px; ">' . $autor . '</p> </div> </td> </tr>'; /*<td > <div align="center"> <p style="font-size:10px; ">'.$ubicacion.'</p> </div> </td>*/ } $html = '<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><body>' . '<span align="left">Buscador de revistas</span>' . '<h3 align="center">Resultados de búsqueda</h3>' . '<p><strong> Termino(s) de busqueda: </strong>' . $data['buscar'] . ' </p>' . '<table cellspacing="0" border="1" align="center" width="550" > <tbody > <tr style="background:#0d47a1;"> <th> <div align="center"> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Título</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Tipo</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Página</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Revista</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Número</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Año</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Mes</strong> </h5> </div> </th> <th> <div align="center"> <h5 style="color:#fff;"><strong>Autor</strong> </h5> </div> </th> </tr>' . $cuerpoTabla . '</tbody </table>' . '<p style="font-size:10px; "> Total: <CODE >' . $i . ' </code>' . $fecha . '</code> </p>' . ' </code> </body></html>'; return PDF::load($html, 'letter', 'portrait')->show(); }