コード例 #1
0
ファイル: NoticiasController.php プロジェクト: vvvhh/not
 public function repBusquedaPer()
 {
     $data = Input::all();
     $fi = $data['fi'] . " 00:00:00";
     $ff = $data['ff'] . " 23:59:59";
     //  $seleccionar=DB::select('SELECT f.fueNombre, n.notTitulo, n.notContenido, r.resNombre, r.resId, n.notId, n.notFecha FROM noticias n, fuentes f, responsables r, asignaciones a WHERE a.asiPeriodos='.$data['idPeriodo'].' AND a.asiFuentes='.$data['idFuente'].' AND a.asiId = n.notAsignaciones AND a.asiResponsables = r.resId  GROUP BY notId ORDER BY f.fueid;');
     $buscar = '%' . $data['buscar'] . '%';
     $seleccionar = NoticiasController::consultaBusquedaPer($buscar, $data['i'], $data['i2'], $data['i3'], $data['i4'], $data['i5'], $data['i6'], $fi, $ff);
     if (count($seleccionar) > 0) {
         $response = array('status' => 'OK', 'data' => $seleccionar, 'message' => 'Resultados obtenidos');
     } else {
         $response = array('status' => 'ERROR', 'message' => 'No se encontraron noticias registradas.');
     }
     return Response::json($response);
 }
コード例 #2
0
ファイル: CorreoController.php プロジェクト: vvvhh/not
 public function envioRepBusquedaPer()
 {
     /***********/
     $data = array('fi' => Input::get('fi'), 'ff' => Input::get('ff'), 'representante' => Input::get('representante'), 'correo' => trim(Input::get('correo')), 'contenido' => Input::get('contenido'), 'buscar' => Input::get('buscar'), 'id' => Input::get('i'), 'id2' => Input::get('i2'), 'id3' => Input::get('i3'), 'id4' => Input::get('i4'), 'id5' => Input::get('i5'), 'id6' => Input::get('i6'));
     $fi = $data['fi'] . " 00:00:00";
     $ff = $data['ff'] . " 23:59:59";
     $buscar = '%' . $data['buscar'] . '%';
     $seleccionar = NoticiasController::consultaBusquedaPer($buscar, $data['id'], $data['id2'], $data['id3'], $data['id4'], $data['id5'], $data['id6'], $fi, $ff);
     if (count($seleccionar) > 0) {
         $body = CorreoController::crearBody($seleccionar, $data['fi'], $data['ff'], NULL, NULL, $data['representante'], NULL, $data['contenido'], $data['buscar']);
         $head = '';
         $titulo = 'Reporte de búsqueda';
         $i = 1;
         $dataCorreo = array('body' => $body, 'head' => $head, 'titulo' => $titulo);
         $toEmail = $data['correo'];
         Mail::send('emails.envioEquiposMail', $dataCorreo, function ($message) use($toEmail) {
             $message->to($toEmail);
             $message->subject('REPORTE DE BÚSQUEDA.');
         });
         $response = array('status' => 'OK', 'message' => 'Correo enviado.');
     } else {
         $response = array('status' => 'ERROR', 'message' => 'No se pudo enviar correo.');
     }
     return Response::json($response);
 }