コード例 #1
0
ファイル: IntegrantesController.php プロジェクト: vvvhh/not
 public function consultaActivoIntegrantesPer()
 {
     if (!Sesion::isResponsable()) {
         if (!Sesion::isAdmin()) {
             return Redirect::to('administracion/logout');
         }
     }
     $data = Input::all();
     $seleccionar = IntegrantesController::consultaActivoIntegrantesRep($data['idPeriodo']);
     if (count($seleccionar) > 0) {
         $response = array('status' => 'OK', 'data' => $seleccionar, 'message' => 'Resultados obtenidos');
     } else {
         $response = array('status' => 'ERROR', 'message' => 'No se encontraron integrantes registrados.');
     }
     return Response::json($response);
 }
コード例 #2
0
ファイル: AsignacionesController.php プロジェクト: vvvhh/not
 public function ingresoAsignacionE()
 {
     /**INGRESO Servicio**/
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $token = Input::get('token');
     if (isset($token)) {
         $data = array('fuente' => Input::get('f'), 'representante' => Input::get('r'));
         $validaciones = array('fuente' => array('required', 'regex:/^([0-9a-zA-ñÑZáéíóúñÁÉÍÓÚ\\-\\s\\,\\.\\?\\¿\\¡\\!])+$/'));
         $validator = Validator::make($data, $validaciones);
         if ($validator->fails()) {
             $respuesta;
             $mensajes = $validator->messages();
             foreach ($mensajes->all() as $mensaje) {
                 $respuesta = $mensaje;
             }
             $response = array('status' => 'ERROR F', 'message' => $respuesta);
         } else {
             $duplicado = Asignaciones::where('asiFuentes', $data['fuente'])->where('asiResponsables', $data['representante'])->where('asiPeriodos', null)->get()->toArray();
             if (count($duplicado) > 0) {
                 return Response::json(array('status' => 'Error', 'message' => 'Ya existen asignaciones para el período especificado, verifique'));
             } else {
                 $insert = Asignaciones::insert(array('asiFuentes' => trim($data['fuente']), 'asiResponsables' => trim($data['representante'])));
                 if ($insert) {
                     $response = array('status' => 'OK', 'message' => 'Asignación correcta.');
                 } else {
                     $response = array('status' => 'ERROR', 'message' => 'No se pudo realizar el registro, intente de nuevo');
                 }
             }
         }
     } else {
         $response = array('status' => 'ERROR', 'message' => 'Vuelva a intentar en un momento');
     }
     return Response::json($response);
 }
コード例 #3
0
ファイル: AdmController.php プロジェクト: vvvhh/not
 public function darBajaAdm()
 {
     /**DAR BAJA SERVICIO*/
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $token = Input::get('token');
     if (isset($token)) {
         $data = array('id' => Input::get('i'));
         $validaciones = array('id' => array('required', 'alpha_num'));
         $validator = Validator::make($data, $validaciones);
         if ($validator->fails()) {
             $respuesta;
             $mensajes = $validator->messages();
             foreach ($mensajes->all() as $mensaje) {
                 $respuesta = $mensaje;
             }
             $response = array('status' => 'ERROR', 'message' => $respuesta);
         } else {
             $editar = Adm::where('admId', $data['id'])->where('admTipo', 2)->update(array('admActivo' => false));
             if ($editar) {
                 $response = array('status' => 'OK', 'message' => 'Sesión de administrador dado de baja');
             } else {
                 $response = array('status' => 'ERROR', 'message' => 'No se puede eliminar la sesión, quizás ya este dada de baja.');
             }
         }
     } else {
         $response = array('status' => 'ERROR', 'message' => 'Vuelva a intentar en un momento');
     }
     return Response::json($response);
 }
コード例 #4
0
ファイル: NoticiasController.php プロジェクト: vvvhh/not
 public function getNoticiasFechaFue()
 {
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $data = Input::all();
     $fi = $data['fecha'] . " 00:00:00";
     $ff = $data['fecha'] . " 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;');
     $seleccionar = DB::select('SELECT f.fueNombre, n.notTitulo, n.notContenido, r.resNombre, r.resId, n.notId, n.notFecha, n.notEnlace, n.notAutor  FROM noticias n, fuentes f, responsables r, asignaciones a WHERE n.notFecha>="' . $fi . '" AND n.notFecha<="' . $ff . '" AND n.notAsignaciones=a.asiId  AND a.asiFuentes=' . $data['idFuente'] . ' AND a.asiResponsables = r.resId  GROUP BY notId ORDER BY f.fueid;');
     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);
 }
コード例 #5
0
ファイル: InvitadosController.php プロジェクト: vvvhh/not
 public function enviarRecordatorio()
 {
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $data = Input::all();
     /*  $seleccionar = Responsables::where('resId',$data['i'])
             ->get()
             ->toArray();
     */
     $seleccionar = DB::select('SELECT resNombre, resCorreo FROM responsables WHERE resId=' . $data['i'] . ';');
     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);
 }
コード例 #6
0
ファイル: FuenteController.php プロジェクト: vvvhh/not
 public function getFuente()
 {
     if (!Sesion::isResponsable()) {
         if (!Sesion::isAdmin()) {
             return Redirect::to('administracion/logout');
         }
     }
     $data = Input::all();
     $seleccionar = Fuentes::where('fueId', $data['i'])->get()->toArray();
     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);
 }
コード例 #7
0
ファイル: filters.php プロジェクト: vvvhh/not
            return Response::make('Unauthorized', 401);
        } else {
            return Redirect::guest('login');
        }
    }
});
Route::filter('auth.basic', function () {
    return Auth::basic();
});
Route::filter('guest', function () {
    if (Auth::check()) {
        return Redirect::to('/');
    }
});
Route::filter('admin', function () {
    if (!Sesion::isAdmin()) {
        Session::flush();
        Cache::flush();
        return Redirect::to('/', 302)->header('cache-control', 'no-store, no-cache, must-revalidate')->header('pragma', 'no-cache');
    }
});
Route::filter('asesor', function () {
    if (!Sesion::isAsesor()) {
        Session::flush();
        Cache::flush();
        return Redirect::to('/', 302)->header('cache-control', 'no-store, no-cache, must-revalidate')->header('pragma', 'no-cache');
    }
});
Route::filter('usuario', function () {
    if (!Sesion::isUser()) {
        Session::flush();
コード例 #8
0
ファイル: CorreoController.php プロジェクト: vvvhh/not
 public function enviarEquipos()
 {
     /***********/
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $seleccionar = IntegrantesController::consultaGetTodosIntegrantes();
     if (count($seleccionar) > 0) {
         /*
                   $correoInt = Integrantes::where('intActivo',TRUE)
                   ->get(array(
                       'intCorreo'
                        ))
                       ->toArray();
             $correoRes = Responsables::where('resActivo',TRUE)
                     ->get(array(
                         'resCorreo'
                          ))
                     ->toArray();
         
         
         
                 foreach ($correoInt as $valor) {
                         $toEmail[]= $valor['intCorreo'];
                       }
                       foreach ($correoRes as $valor) {
                         $toEmail[]= $valor['resCorreo'];
                       }
         */
         $body = '';
         $head = '';
         $titulo = 'Integrantes de Equipos';
         $i = 1;
         $head = $head . '<td width="3%" >';
         $head = $head . '<div align="center"></div></td>';
         $head = $head . '<td width="10%" ><div align="center"> <h5><strong>Representante</strong> </h5> </div> </td>';
         $head = $head . '<td width="30%" colspan=2> <div align="center"> <h5><strong>Nombre</strong> </h5>  </div> </td>';
         $head = $head . '<td width="30%"> <div align="center"> <h5><strong>Correo</strong> </h5> </div> </td> </tr>';
         foreach ($seleccionar as $valor) {
             $resNombre = $valor['resNombre'];
             $intNombre = $valor['intNombre'];
             $intNombreC = $valor['intNombreCompleto'];
             $intCorreo = $valor['intCorreo'];
             $body = $body . '<tr>';
             $body = $body . '<td>' . $i . '</td>';
             $body = $body . '<td style="text-align: center">' . $resNombre . '</td>';
             $body = $body . '<td style="text-align: center">' . $intNombre . '</td>';
             $body = $body . '<td style="text-align: center">' . $intNombreC . '</td>';
             $body = $body . '<td style="text-align: center">' . $intCorreo . '</td>';
             $body = $body . '</tr>';
             $i++;
         }
         $dataCorreo = array('body' => $body, 'head' => $head, 'titulo' => $titulo);
         $toEmail = "*****@*****.**";
         Mail::send('emails.envioEquiposMail', $dataCorreo, function ($message) use($toEmail) {
             $message->to($toEmail);
             $message->subject('EQUIPOS.');
         });
         $response = array('status' => 'OK', 'message' => 'Correo enviado.');
     } else {
         $response = array('status' => 'ERROR', 'message' => 'No se pudo enviar correo.');
     }
     return Response::json($response);
 }
コード例 #9
0
ファイル: PeriodosController.php プロジェクト: vvvhh/not
 public function seleccionarPeriodo()
 {
     if (!Sesion::isResponsable()) {
         if (!Sesion::isAdmin()) {
             return Redirect::to('administracion/logout');
         }
     }
     $data = Input::all();
     /*  $seleccionar = Responsables::where('resId',$data['i'])
         ->get()
         ->toArray();*/
     $seleccionar = DB::select('SELECT perId, perInicio, perFin, perActivo FROM periodos WHERE perId=' . $data['i'] . ';');
     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);
 }
コード例 #10
0
 public function getEquipoActual()
 {
     if (!Sesion::isAdmin()) {
         return Redirect::to('administracion/logout');
     }
     $seleccionar = AsignacionIntegrantesController::consultaGetAsignacionesActual();
     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);
 }