Esempio n. 1
0
 /**
  * 
  */
 public function actionPasswordupdate()
 {
     $modelo = new Usuario();
     if ($parametros = Yii::$app->request->post()) {
         if ($parametros['password'] == $parametros['repeat_password']) {
             $usuario = $modelo->findOne(['id' => $parametros['Usuario']['id']]);
             $usuario->setPassword($parametros['password']);
             $usuario->repeat_password = $parametros['repeat_password'];
             if ($usuario->update(false)) {
                 Yii::$app->session->setFlash('success', 'Usuario Editado con éxito!');
             } else {
                 $errores = $usuario->getErrors();
                 foreach ($usuario->getErrors() as $key => $value) {
                     for ($i = 0; $i < count($value); $i++) {
                         Yii::$app->session->setFlash('danger', 'El campo ' . $key . ' ' . $value[$i]);
                     }
                 }
             }
             Yii::$app->response->redirect(array('usuario/cambiarpassword', 'id' => $parametros['Usuario']['id']));
         } else {
             Yii::$app->session->setFlash('warning', 'Las contraseña deben ser iguales exactamente');
             Yii::$app->response->redirect(array('usuario/cambiarpassword', 'id' => $parametros['Usuario']['id']));
         }
     }
 }
Esempio n. 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function searchAluno($params)
 {
     $query = AlunoMonitoria::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     //Pega o id do usuario baseando-se no CPF do usuário logado
     $usuario = Usuario::findOne(['CPF' => Yii::$app->user->identity->cpf]);
     $query->andFilterWhere(['id' => $this->id, 'IDAluno' => $usuario->id]);
     $query->andFilterWhere(['like', 'aluno', $this->aluno]);
     $query->andFilterWhere(['like', 'matricula', $this->matricula]);
     $query->andFilterWhere(['like', 'cpf', $this->cpf]);
     $query->andFilterWhere(['like', 'codDisciplina', $this->codDisciplina]);
     $query->andFilterWhere(['like', 'nomeDisciplina', $this->nomeDisciplina]);
     $query->andFilterWhere(['like', 'codTurma', $this->codTurma]);
     $query->andFilterWhere(['like', 'professor', $this->professor]);
     $query->andFilterWhere(['like', 'nomeCurso', $this->nomeCurso]);
     $query->andFilterWhere(['like', 'bolsa_traducao', $this->bolsa_traducao]);
     $query->andFilterWhere(['like', 'status', $this->status]);
     $query->andFilterWhere(['like', 'periodo', $this->periodo]);
     $query->orderBy(['id' => SORT_DESC]);
     return $dataProvider;
 }
 public function destroy($id)
 {
     $usuarios = Usuario::find($id);
     $usuarios->delete();
     Session::flash('message', 'El usuario ' . $usuarios->nombres . '  de rut ' . $usuarios->rut . ' fue eliminado');
     return redirect()->route('Administrador.usuarios.index');
 }
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = Usuario::findByUsername($this->username);
     }
     return $this->_user;
 }
Esempio n. 5
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function searchAluno($params)
 {
     $query = Monitoria::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         //return $dataProvider;
     }
     //Pega o id do usuario baseando-se no CPF do usuário logado
     $usuario = Usuario::findOne(['CPF' => Yii::$app->user->identity->cpf]);
     $query->joinWith(['usuario']);
     $query->joinWith(['disciplinaperiodo']);
     $query->joinWith(['periodoinscricao']);
     $query->leftJoin('disciplina', 'disciplina.id = disciplina_periodo.idDisciplina');
     $query->leftJoin('curso', 'curso.id = disciplina_periodo.idCurso');
     $query->andFilterWhere(['id' => $this->id, 'IDAluno' => $usuario->id]);
     $query->andFilterWhere(['like', 'usuario.name', $this->IDAluno]);
     $query->andFilterWhere(['like', 'disciplina.nomeDisciplina', $this->IDDisc]);
     $query->andFilterWhere(['like', 'curso.nome', $this->nomeCurso]);
     $query->andFilterWhere(['like', 'periodoinscricao.ano', $this->IDperiodoinscr]);
     $query->orderBy(['id' => SORT_DESC]);
     return $dataProvider;
 }
Esempio n. 6
0
 public function savePersona($persona)
 {
     if ($persona != null) {
         //validar que el ci no exista
         //la persona no existe
         $persona->eliminado = 0;
         $usuario = new Usuario();
         $usuario->usuario = $persona->nick;
         $usuario->contrasenha = $persona->pass;
         $persona->id_tipo = 1;
         $persona->save(false);
         $usuario->id_persona = $persona->id;
         $usuario->save();
         return true;
     }
 }
Esempio n. 7
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = Usuario::findByCpf($this->cpf);
     }
     return $this->_user;
 }
Esempio n. 8
0
 public function usuario_existe($attribute, $params)
 {
     $table = Usuario::find()->where("nombre_usuario=:nom", [":nom" => $this->nombre_usuario]);
     if ($table->count() != 0) {
         $this->addError($attribute, "El nobre de usuario seleccionado existe");
     }
 }
Esempio n. 9
0
 protected function getEditarPrograma(Request $request)
 {
     $numero_de_programa = $request['numero_de_programa'];
     $programaSeleccionado = Programa::where('numero_de_programa', $numero_de_programa)->get();
     $programa = $programaSeleccionado[0];
     $usuarios = Usuario::all();
     return view('Programa/editarPrograma', compact('programa', 'usuarios'));
 }
Esempio n. 10
0
 /**
  * Finds user by username
  *
  * @param  string      $username
  * @return static|null
  */
 public static function findByUsername($username)
 {
     $dbUser = DbUser::find()->where(["username" => $username])->one();
     if (!count($dbUser)) {
         return null;
     }
     return new static($dbUser);
 }
Esempio n. 11
0
 /**
  * Find or create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function findOrNew(array $data)
 {
     $usuario = Usuario::findOrNew($data['usuario_id']);
     $usuario->fill($data);
     $usuario->registrado = 1;
     $usuario->password = bcrypt($data['password']);
     $usuario->save();
     return $usuario;
 }
Esempio n. 12
0
 /**
  * Creates a new EmpresaPyme model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $empresa = new EmpresaPyme();
     $servicio = new EmpContrataServ();
     $usuario = new Usuario();
     if ($empresa->load(Yii::$app->request->post()) && $servicio->load(Yii::$app->request->post()) && $usuario->load(Yii::$app->request->post())) {
         $servicio->emp_rut = $empresa->emp_rut;
         $servicio->serv_fecha_ini = date('Y-m-d');
         $usuario->emp_rut = $empresa->emp_rut;
         $usuario->usu_contraseña = "1234";
         $usuario->usu_tipo = 1;
         if ($empresa->save() && $servicio->save() && $usuario->save()) {
             return $this->redirect(['view', 'id' => $empresa->emp_rut]);
         }
     } else {
         return $this->render('create', ['empresa' => $empresa, 'servicio' => $servicio, 'usuario' => $usuario]);
     }
 }
Esempio n. 13
0
 public function getWord()
 {
     if ($this->_word === false) {
         $this->_word = Usuario::findBySenha($this->senha);
         if (!$this->_word) {
             $this->_word = Usuario::validatePassword($this->senha);
         }
     }
     return $this->_word;
 }
 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postLogin(Request $request)
 {
     $usuario = Usuario::where('accountname', $request->accountname)->first();
     if (empty($usuario)) {
         return redirect('login');
     } else {
         Auth::login($usuario);
         return redirect('home');
     }
 }
 public function __construct(Factory $factory)
 {
     //Custom Validator Rut
     $factory->extend('old_password', function ($attribute, $value, $parameters) {
         $id = $this->id;
         $usuario = Usuario::find($id);
         return Hash::check($value, $usuario->password);
     }, 'La Constraseña actual no corresponde');
     $factory->extend('rut_valid', function ($attribute, $value, $parameters) {
         return Rut::check($value);
     }, 'El campo Rut no tiene un formato válido');
 }
 /**
  * Display all conversations
  *
  * @return data array json
  */
 public function showconversations()
 {
     //$results = DB::select('select * from conversations where user1_id = ?', dataay($input['user1_id']));
     $conversations = Conversation::where('user1_id', Input::get('user1_id'))->orderBy('updated_at', 'DESC')->get();
     foreach ($conversations as $conversation) {
         //Se rellenan las imagenes de usuario en la lista de conversaciones
         $id = $conversation->user2_id;
         //ID del usuario a buscar
         $imagen = Usuario::find($id)->imagen;
         $conversation['imagen'] = $imagen;
     }
     return json_encode($conversations);
 }
Esempio n. 17
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idUsuario' => $this->idUsuario, 'nome' => $this->nome, 'email' => $this->email, 'telefone' => $this->telefone, 'data_criacao' => $this->data_criacao]);
     return $dataProvider;
 }
Esempio n. 18
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'login', $this->login])->andFilterWhere(['like', 'senha', $this->senha])->andFilterWhere(['like', 'nome', $this->nome])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'pagina', $this->pagina]);
     return $dataProvider;
 }
Esempio n. 19
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idusuario' => $this->idusuario, 'idefiscal' => $this->idefiscal, 'idorganizacion' => $this->idorganizacion, 'persona' => $this->persona, 'status' => $this->status, 'liquidador' => $this->liquidador, 'poseeimpresora' => $this->poseeimpresora, 'puerto' => $this->puerto, 'impresora' => $this->impresora, 'idcoordinacion' => $this->idcoordinacion, 'iddireccion' => $this->iddireccion, 'rememberMe' => $this->rememberMe]);
     $query->andFilterWhere(['like', 'login', $this->login])->andFilterWhere(['like', 'passwd', $this->passwd])->andFilterWhere(['like', 'accaplicacion', $this->accaplicacion])->andFilterWhere(['like', 'accorganizacion', $this->accorganizacion])->andFilterWhere(['like', 'accestructura', $this->accestructura])->andFilterWhere(['like', 'acccambiofecha', $this->acccambiofecha])->andFilterWhere(['like', 'accusuario', $this->accusuario])->andFilterWhere(['like', 'accpersona', $this->accpersona])->andFilterWhere(['like', 'acccambioefiscal', $this->acccambioefiscal])->andFilterWhere(['like', 'acciva', $this->acciva])->andFilterWhere(['like', 'accut', $this->accut])->andFilterWhere(['like', 'accdesbloquear', $this->accdesbloquear])->andFilterWhere(['like', 'accdesconectar', $this->accdesconectar])->andFilterWhere(['like', 'acctasaactiva', $this->acctasaactiva])->andFilterWhere(['like', 'accusuariocat', $this->accusuariocat])->andFilterWhere(['like', 'accfichacat', $this->accfichacat])->andFilterWhere(['like', 'accvalorterrecat', $this->accvalorterrecat])->andFilterWhere(['like', 'accvalortipocat', $this->accvalortipocat])->andFilterWhere(['like', 'accdepreciacioncat', $this->accdepreciacioncat])->andFilterWhere(['like', 'accrepcedcat', $this->accrepcedcat])->andFilterWhere(['like', 'accrepceremp', $this->accrepceremp])->andFilterWhere(['like', 'accrepfichacat', $this->accrepfichacat])->andFilterWhere(['like', 'accrepgenseccat', $this->accrepgenseccat])->andFilterWhere(['like', 'acccontribuyente', $this->acccontribuyente])->andFilterWhere(['like', 'accactividad', $this->accactividad])->andFilterWhere(['like', 'accdeclaraciones', $this->accdeclaraciones])->andFilterWhere(['like', 'accedocuenta', $this->accedocuenta])->andFilterWhere(['like', 'accconfigcome', $this->accconfigcome])->andFilterWhere(['like', 'accusuariocome', $this->accusuariocome])->andFilterWhere(['like', 'accreppatente', $this->accreppatente])->andFilterWhere(['like', 'accimpedoctasectcome', $this->accimpedoctasectcome])->andFilterWhere(['like', 'accrepgensector', $this->accrepgensector])->andFilterWhere(['like', 'accrepactividad', $this->accrepactividad])->andFilterWhere(['like', 'accrepfecdecla', $this->accrepfecdecla])->andFilterWhere(['like', 'accrepmondecla', $this->accrepmondecla])->andFilterWhere(['like', 'accimppatente', $this->accimppatente])->andFilterWhere(['like', 'accinmueble', $this->accinmueble])->andFilterWhere(['like', 'accedoctainmue', $this->accedoctainmue])->andFilterWhere(['like', 'accvalfisterre', $this->accvalfisterre])->andFilterWhere(['like', 'accvalfiscons', $this->accvalfiscons])->andFilterWhere(['like', 'accconfiginmue', $this->accconfiginmue])->andFilterWhere(['like', 'accusuarioinmue', $this->accusuarioinmue])->andFilterWhere(['like', 'accusrepsectcat', $this->accusrepsectcat])->andFilterWhere(['like', 'accusrepmontaval', $this->accusrepmontaval])->andFilterWhere(['like', 'accusreptipconstruc', $this->accusreptipconstruc])->andFilterWhere(['like', 'accusrepmontdeud', $this->accusrepmontdeud])->andFilterWhere(['like', 'accusrepvalorconstruc', $this->accusrepvalorconstruc])->andFilterWhere(['like', 'accimpedoctasectinmue', $this->accimpedoctasectinmue])->andFilterWhere(['like', 'accapuesta', $this->accapuesta])->andFilterWhere(['like', 'accclaseapuesta', $this->accclaseapuesta])->andFilterWhere(['like', 'accedoctaapuesta', $this->accedoctaapuesta])->andFilterWhere(['like', 'accconfigapuesta', $this->accconfigapuesta])->andFilterWhere(['like', 'accusuarioapuesta', $this->accusuarioapuesta])->andFilterWhere(['like', 'accvehiculo', $this->accvehiculo])->andFilterWhere(['like', 'accclasevehiculo', $this->accclasevehiculo])->andFilterWhere(['like', 'accedoctavehiculo', $this->accedoctavehiculo])->andFilterWhere(['like', 'accconfigvehiculo', $this->accconfigvehiculo])->andFilterWhere(['like', 'accusuariovehiculo', $this->accusuariovehiculo])->andFilterWhere(['like', 'accrepgenvehi', $this->accrepgenvehi])->andFilterWhere(['like', 'accrepcontvehideud', $this->accrepcontvehideud])->andFilterWhere(['like', 'accreptipvehi', $this->accreptipvehi])->andFilterWhere(['like', 'accpublicidad', $this->accpublicidad])->andFilterWhere(['like', 'accclasepublicidad', $this->accclasepublicidad])->andFilterWhere(['like', 'accedoctapublicidad', $this->accedoctapublicidad])->andFilterWhere(['like', 'accconfigpublicidad', $this->accconfigpublicidad])->andFilterWhere(['like', 'accusuariopublicidad', $this->accusuariopublicidad])->andFilterWhere(['like', 'accrepgensecpubli', $this->accrepgensecpubli])->andFilterWhere(['like', 'accrepcontpublideud', $this->accrepcontpublideud])->andFilterWhere(['like', 'accreptippubli', $this->accreptippubli])->andFilterWhere(['like', 'accrepedoctapubli', $this->accrepedoctapubli])->andFilterWhere(['like', 'accrenta', $this->accrenta])->andFilterWhere(['like', 'accedoctarenta', $this->accedoctarenta])->andFilterWhere(['like', 'accconfigrenta', $this->accconfigrenta])->andFilterWhere(['like', 'accusuariorenta', $this->accusuariorenta])->andFilterWhere(['like', 'accefiscal', $this->accefiscal])->andFilterWhere(['like', 'acccatpro', $this->acccatpro])->andFilterWhere(['like', 'accpuc', $this->accpuc])->andFilterWhere(['like', 'acccrearfactura', $this->acccrearfactura])->andFilterWhere(['like', 'accanularfactura', $this->accanularfactura])->andFilterWhere(['like', 'accusuariofactura', $this->accusuariofactura])->andFilterWhere(['like', 'acctiporenta', $this->acctiporenta])->andFilterWhere(['like', 'accrepgenrenta', $this->accrepgenrenta])->andFilterWhere(['like', 'accurepcontratorenta', $this->accurepcontratorenta])->andFilterWhere(['like', 'accrepdeudarenta', $this->accrepdeudarenta])->andFilterWhere(['like', 'accrepedoctarenta', $this->accrepedoctarenta])->andFilterWhere(['like', 'accreptiporenta', $this->accreptiporenta])->andFilterWhere(['like', 'accbanco', $this->accbanco])->andFilterWhere(['like', 'acccuentabancaria', $this->acccuentabancaria])->andFilterWhere(['like', 'numcaja', $this->numcaja])->andFilterWhere(['like', 'accusuariopresu', $this->accusuariopresu])->andFilterWhere(['like', 'accformpresu', $this->accformpresu])->andFilterWhere(['like', 'accaprobpresup', $this->accaprobpresup])->andFilterWhere(['like', 'accreppuc', $this->accreppuc])->andFilterWhere(['like', 'accrepformpresu', $this->accrepformpresu])->andFilterWhere(['like', 'accreppresuing', $this->accreppresuing])->andFilterWhere(['like', 'accrepedofinanc', $this->accrepedofinanc])->andFilterWhere(['like', 'accrepmovpresu', $this->accrepmovpresu])->andFilterWhere(['like', 'accrepcondicpar', $this->accrepcondicpar])->andFilterWhere(['like', 'accrepcomprom', $this->accrepcomprom])->andFilterWhere(['like', 'accpartext', $this->accpartext])->andFilterWhere(['like', 'accaumentopart', $this->accaumentopart])->andFilterWhere(['like', 'accdisminucionpart', $this->accdisminucionpart])->andFilterWhere(['like', 'acctraslado', $this->acctraslado])->andFilterWhere(['like', 'acccompromiso', $this->acccompromiso])->andFilterWhere(['like', 'accfacturar', $this->accfacturar])->andFilterWhere(['like', 'accanularfact', $this->accanularfact])->andFilterWhere(['like', 'accusuariofacturacion', $this->accusuariofacturacion])->andFilterWhere(['like', 'accrepfactemit', $this->accrepfactemit])->andFilterWhere(['like', 'accurepfactporcobrar', $this->accurepfactporcobrar])->andFilterWhere(['like', 'accrepfactcobrada', $this->accrepfactcobrada])->andFilterWhere(['like', 'accrepfactanulada', $this->accrepfactanulada])->andFilterWhere(['like', 'accrepfactportipo', $this->accrepfactportipo])->andFilterWhere(['like', 'accingresos', $this->accingresos])->andFilterWhere(['like', 'accsupervisor', $this->accsupervisor])->andFilterWhere(['like', 'accrepresumcaja', $this->accrepresumcaja])->andFilterWhere(['like', 'accreptransdiarias', $this->accreptransdiarias])->andFilterWhere(['like', 'accrepactutransac', $this->accrepactutransac])->andFilterWhere(['like', 'accreptransacciones', $this->accreptransacciones])->andFilterWhere(['like', 'accrepcontrolcheq', $this->accrepcontrolcheq])->andFilterWhere(['like', 'accrepcontroldepo', $this->accrepcontroldepo])->andFilterWhere(['like', 'accusuariocaja', $this->accusuariocaja])->andFilterWhere(['like', 'acctipoingreso', $this->acctipoingreso])->andFilterWhere(['like', 'acctipoimpuesto', $this->acctipoimpuesto])->andFilterWhere(['like', 'accrepconstancia', $this->accrepconstancia])->andFilterWhere(['like', 'accrepvalconstruc', $this->accrepvalconstruc])->andFilterWhere(['like', 'accrepvalterreno', $this->accrepvalterreno])->andFilterWhere(['like', 'accrepdepreciacion', $this->accrepdepreciacion])->andFilterWhere(['like', 'accreptipoapuesta', $this->accreptipoapuesta])->andFilterWhere(['like', 'accrepgensectapu', $this->accrepgensectapu])->andFilterWhere(['like', 'accrepdeclanualapu', $this->accrepdeclanualapu])->andFilterWhere(['like', 'accrepdeudapuesta', $this->accrepdeudapuesta])->andFilterWhere(['like', 'accrepedoctapuesta', $this->accrepedoctapuesta])->andFilterWhere(['like', 'accactudeuindustria', $this->accactudeuindustria])->andFilterWhere(['like', 'accactudeuinmue', $this->accactudeuinmue])->andFilterWhere(['like', 'accactudeurenta', $this->accactudeurenta])->andFilterWhere(['like', 'accactudeuvehiculo', $this->accactudeuvehiculo])->andFilterWhere(['like', 'accactudeuapuesta', $this->accactudeuapuesta])->andFilterWhere(['like', 'acctasapasiva', $this->acctasapasiva])->andFilterWhere(['like', 'accgestores', $this->accgestores])->andFilterWhere(['like', 'accasignacion', $this->accasignacion])->andFilterWhere(['like', 'accvisitas', $this->accvisitas])->andFilterWhere(['like', 'accefectividad', $this->accefectividad])->andFilterWhere(['like', 'accrepresucaja', $this->accrepresucaja])->andFilterWhere(['like', 'accreptransadia', $this->accreptransadia])->andFilterWhere(['like', 'accrepmovactu', $this->accrepmovactu])->andFilterWhere(['like', 'accrepdeudaperi', $this->accrepdeudaperi])->andFilterWhere(['like', 'accrepfactuasigna', $this->accrepfactuasigna])->andFilterWhere(['like', 'accrepdeudarecu', $this->accrepdeudarecu])->andFilterWhere(['like', 'accusuariogestion', $this->accusuariogestion])->andFilterWhere(['like', 'acclicores', $this->acclicores])->andFilterWhere(['like', 'actipotasa', $this->actipotasa])->andFilterWhere(['like', 'accedoctalicores', $this->accedoctalicores])->andFilterWhere(['like', 'accconfiglicores', $this->accconfiglicores])->andFilterWhere(['like', 'accusuariolicores', $this->accusuariolicores])->andFilterWhere(['like', 'accrepgenseclicor', $this->accrepgenseclicor])->andFilterWhere(['like', 'accrepcontlicores', $this->accrepcontlicores])->andFilterWhere(['like', 'accreptipotasa', $this->accreptipotasa])->andFilterWhere(['like', 'accrepedoctalicores', $this->accrepedoctalicores])->andFilterWhere(['like', 'accexplicores', $this->accexplicores])->andFilterWhere(['like', 'acctiporetencion', $this->acctiporetencion])->andFilterWhere(['like', 'accusuarioadmini', $this->accusuarioadmini])->andFilterWhere(['like', 'accegresos', $this->accegresos])->andFilterWhere(['like', 'acctransferenciabanc', $this->acctransferenciabanc])->andFilterWhere(['like', 'accconciliacion', $this->accconciliacion])->andFilterWhere(['like', 'acccheqanul', $this->acccheqanul])->andFilterWhere(['like', 'accdebito', $this->accdebito])->andFilterWhere(['like', 'acccredito', $this->acccredito])->andFilterWhere(['like', 'acccausar', $this->acccausar])->andFilterWhere(['like', 'accaproborden', $this->accaproborden])->andFilterWhere(['like', 'accrepordenpago', $this->accrepordenpago])->andFilterWhere(['like', 'accrepbanco', $this->accrepbanco])->andFilterWhere(['like', 'accrepretencion', $this->accrepretencion])->andFilterWhere(['like', 'accrepfondoterc', $this->accrepfondoterc])->andFilterWhere(['like', 'accdeposito', $this->accdeposito])->andFilterWhere(['like', 'accfondotercero', $this->accfondotercero])->andFilterWhere(['like', 'accpagoordenes', $this->accpagoordenes])->andFilterWhere(['like', 'accregobras', $this->accregobras])->andFilterWhere(['like', 'accusuarioingenieria', $this->accusuarioingenieria])->andFilterWhere(['like', 'accasigobras', $this->accasigobras])->andFilterWhere(['like', 'acccaratula', $this->acccaratula])->andFilterWhere(['like', 'acccuaderno', $this->acccuaderno])->andFilterWhere(['like', 'accrepgenobras', $this->accrepgenobras])->andFilterWhere(['like', 'accrepobrasasig', $this->accrepobrasasig])->andFilterWhere(['like', 'accrepobraejecu', $this->accrepobraejecu])->andFilterWhere(['like', 'accrepcontratista', $this->accrepcontratista])->andFilterWhere(['like', 'acccamstainmue', $this->acccamstainmue])->andFilterWhere(['like', 'acccontratista', $this->acccontratista])->andFilterWhere(['like', 'acccargos', $this->acccargos])->andFilterWhere(['like', 'accactivos', $this->accactivos])->andFilterWhere(['like', 'accaprocompro', $this->accaprocompro])->andFilterWhere(['like', 'accalmacen', $this->accalmacen])->andFilterWhere(['like', 'accsolisuministro', $this->accsolisuministro])->andFilterWhere(['like', 'accunimedi', $this->accunimedi])->andFilterWhere(['like', 'accproveedor', $this->accproveedor])->andFilterWhere(['like', 'acctipoproducto', $this->acctipoproducto])->andFilterWhere(['like', 'accproducto', $this->accproducto])->andFilterWhere(['like', 'accrequisicion', $this->accrequisicion])->andFilterWhere(['like', 'accsolicompra', $this->accsolicompra])->andFilterWhere(['like', 'accaprosolicompra', $this->accaprosolicompra])->andFilterWhere(['like', 'accusuariocompra', $this->accusuariocompra])->andFilterWhere(['like', 'accrepalmacen', $this->accrepalmacen])->andFilterWhere(['like', 'accreprespalmacen', $this->accreprespalmacen])->andFilterWhere(['like', 'accrepsolicompra', $this->accrepsolicompra])->andFilterWhere(['like', 'accrepsolisumi', $this->accrepsolisumi])->andFilterWhere(['like', 'accreprequisicion', $this->accreprequisicion])->andFilterWhere(['like', 'acccontrolinterno', $this->acccontrolinterno])->andFilterWhere(['like', 'acccuentacontable', $this->acccuentacontable])->andFilterWhere(['like', 'accaprobpagoobras', $this->accaprobpagoobras])->andFilterWhere(['like', 'accsolicpagoobras', $this->accsolicpagoobras])->andFilterWhere(['like', 'accubicacionalmacen', $this->accubicacionalmacen])->andFilterWhere(['like', 'accentradaalmacen', $this->accentradaalmacen])->andFilterWhere(['like', 'accsalidaalmacen', $this->accsalidaalmacen])->andFilterWhere(['like', 'accdespachoalmacen', $this->accdespachoalmacen])->andFilterWhere(['like', 'acclisgencompraalmacen', $this->acclisgencompraalmacen])->andFilterWhere(['like', 'acclismovcompraalmacen', $this->acclismovcompraalmacen])->andFilterWhere(['like', 'acclisinventario', $this->acclisinventario])->andFilterWhere(['like', 'acclissolicompraalmacen', $this->acclissolicompraalmacen])->andFilterWhere(['like', 'accaprodesaprodespacho', $this->accaprodesaprodespacho])->andFilterWhere(['like', 'accespecial', $this->accespecial])->andFilterWhere(['like', 'accrepresugenobra', $this->accrepresugenobra])->andFilterWhere(['like', 'accusuarionomina', $this->accusuarionomina])->andFilterWhere(['like', 'accpermdecla', $this->accpermdecla])->andFilterWhere(['like', 'accacreditacion', $this->accacreditacion])->andFilterWhere(['like', 'acctipomulta', $this->acctipomulta])->andFilterWhere(['like', 'accmultaindu', $this->accmultaindu])->andFilterWhere(['like', 'accmultainmu', $this->accmultainmu])->andFilterWhere(['like', 'accmultavehi', $this->accmultavehi])->andFilterWhere(['like', 'accmultaapu', $this->accmultaapu])->andFilterWhere(['like', 'accmultapropa', $this->accmultapropa])->andFilterWhere(['like', 'accmultarenta', $this->accmultarenta])->andFilterWhere(['like', 'accmultalico', $this->accmultalico])->andFilterWhere(['like', 'accformucue', $this->accformucue])->andFilterWhere(['like', 'accvincucue', $this->accvincucue])->andFilterWhere(['like', 'accrepplancue', $this->accrepplancue])->andFilterWhere(['like', 'accrepvincucue', $this->accrepvincucue])->andFilterWhere(['like', 'accusuarioconta', $this->accusuarioconta])->andFilterWhere(['like', 'acctipoactivo', $this->acctipoactivo])->andFilterWhere(['like', 'accubicacionbien', $this->accubicacionbien])->andFilterWhere(['like', 'accmotivoincorporacion', $this->accmotivoincorporacion])->andFilterWhere(['like', 'accmotivodesincorporacion', $this->accmotivodesincorporacion])->andFilterWhere(['like', 'accincorporacionmueble', $this->accincorporacionmueble])->andFilterWhere(['like', 'accincorporacioninmueble', $this->accincorporacioninmueble])->andFilterWhere(['like', 'accdesincorporacionmueble', $this->accdesincorporacionmueble])->andFilterWhere(['like', 'accdesincorporacioninmueble', $this->accdesincorporacioninmueble])->andFilterWhere(['like', 'acctransferenciabien', $this->acctransferenciabien])->andFilterWhere(['like', 'accreptipoactivo', $this->accreptipoactivo])->andFilterWhere(['like', 'accrepubicacionbien', $this->accrepubicacionbien])->andFilterWhere(['like', 'accrepdisposicion', $this->accrepdisposicion])->andFilterWhere(['like', 'accrepincorporacion', $this->accrepincorporacion])->andFilterWhere(['like', 'accrepdesincorporacion', $this->accrepdesincorporacion])->andFilterWhere(['like', 'accreptransferencia', $this->accreptransferencia])->andFilterWhere(['like', 'accusuariobien', $this->accusuariobien])->andFilterWhere(['like', 'acccargarcue', $this->acccargarcue])->andFilterWhere(['like', 'accasiento', $this->accasiento])->andFilterWhere(['like', 'accmodreten', $this->accmodreten])->andFilterWhere(['like', 'accrepobras', $this->accrepobras])->andFilterWhere(['like', 'accenvchecausar', $this->accenvchecausar])->andFilterWhere(['like', 'accrepcatcue', $this->accrepcatcue])->andFilterWhere(['like', 'accrepsalini', $this->accrepsalini])->andFilterWhere(['like', 'accrepsaldo', $this->accrepsaldo])->andFilterWhere(['like', 'accrepbalacom', $this->accrepbalacom])->andFilterWhere(['like', 'accrepbalagen', $this->accrepbalagen])->andFilterWhere(['like', 'accrepasiento', $this->accrepasiento])->andFilterWhere(['like', 'accrepestamov', $this->accrepestamov])->andFilterWhere(['like', 'accrepinvemueble', $this->accrepinvemueble])->andFilterWhere(['like', 'accrepresuinvemueble', $this->accrepresuinvemueble])->andFilterWhere(['like', 'accrepmovimueble', $this->accrepmovimueble])->andFilterWhere(['like', 'accrepmresucuemue', $this->accrepmresucuemue])->andFilterWhere(['like', 'accrepmayoranali', $this->accrepmayoranali])->andFilterWhere(['like', 'accacticontri', $this->accacticontri])->andFilterWhere(['like', 'accadministrador', $this->accadministrador]);
     return $dataProvider;
 }
Esempio n. 20
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idusuario' => $this->idusuario]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'edad', $this->edad])->andFilterWhere(['like', 'sexo', $this->sexo])->andFilterWhere(['like', 'apellido_pat', $this->apellido_pat])->andFilterWhere(['like', 'apellido_mat', $this->apellido_mat]);
     return $dataProvider;
 }
Esempio n. 21
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['Id_Grupo' => $this->Id_Grupo, 'Id' => $this->Id, 'Id_Empleado' => $this->Id_Empleado, 'Eliminado' => $this->Eliminado]);
     $query->andFilterWhere(['like', 'Cuenta', $this->Cuenta])->andFilterWhere(['like', 'Contrasena', $this->Contrasena]);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'activate' => $this->activate]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'lastname', $this->lastname])->andFilterWhere(['like', 'role', $this->role])->andFilterWhere(['like', 'password', $this->password])->andFilterWhere(['like', 'authKey', $this->authKey])->andFilterWhere(['like', 'accessToken', $this->accessToken]);
     return $dataProvider;
 }
Esempio n. 23
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['usua_codigo' => $this->usua_codigo, 'usua_habilitado' => $this->usua_habilitado, 'usua_data_criacao' => $this->usua_data_criacao, 'usua_data_alteracao' => $this->usua_data_alteracao]);
     $query->andFilterWhere(['like', 'usua_nome', $this->usua_nome])->andFilterWhere(['like', 'usua_email', $this->usua_email])->andFilterWhere(['like', 'usua_senha', $this->usua_senha])->andFilterWhere(['like', 'usua_auth_key', $this->usua_auth_key]);
     return $dataProvider;
 }
Esempio n. 24
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'id_persona' => $this->id_persona]);
     $query->andFilterWhere(['like', 'usuario', $this->usuario])->andFilterWhere(['like', 'contrasenha', $this->contrasenha]);
     return $dataProvider;
 }
 public function store(Request $request)
 {
     //dd('jajaja');
     $file = $request->file('file');
     if (is_null($request->file('file'))) {
         Session::flash('message', 'Seleccion el archivo');
         return redirect()->back();
     }
     //obtenemos el campo file obtenido por el formulario
     $nombre = $file->getClientOriginalName();
     //indicamos que queremos guardar un nuevo archivo en el disco local
     \Storage::disk('local')->put($nombre, \File::get($file));
     $falla = false;
     \Excel::load('/storage/public/files/' . $nombre, function ($archivo) use(&$falla) {
         $result = $archivo->get();
         //leer todas las filas del archivo
         foreach ($result as $key => $value) {
             $var = new Usuario();
             $datos = ['rut' => $value->rut, 'nombres' => $value->nombres, 'apellidos' => $value->apellidos, 'email' => $value->email];
             $validator = Validator::make($datos, Usuario::storeRules());
             if ($validator->fails()) {
                 Session::flash('message', 'Los Usuarios ya existen o el archivo ingresado no es valido');
                 $falla = true;
             } else {
                 $var->fill($datos);
                 $var->save();
             }
         }
     })->get();
     if ($falla) {
         // Fallo la validacion de algun campus, retornar al index con mensaje
         return redirect()->route('Administrador.usuarios.index');
     }
     \Storage::delete($nombre);
     Session::flash('message', 'Los Usuarios fueron agregados exitosamente!');
     return redirect()->route('Administrador.usuarios.index');
 }
 public function search($input)
 {
     $query = Usuario::query();
     $columns = Schema::getColumnListing('usuarios');
     $attributes = array();
     foreach ($columns as $attribute) {
         if (isset($input[$attribute]) and !empty($input[$attribute])) {
             $query->where($attribute, $input[$attribute]);
             $attributes[$attribute] = $input[$attribute];
         } else {
             $attributes[$attribute] = null;
         }
     }
     return [$query->get(), $attributes];
 }
Esempio n. 27
0
 function login()
 {
     $inputs = Input::all();
     $user = ['usuario' => $inputs['user']['usuario'], 'usuario_password' => $inputs['user']['usuario_password']];
     $usuario = Usuario::where('usuario', $user['usuario'])->first();
     if (is_null($usuario)) {
         return Response::json(['response' => 'Usuário não existe', 'status' => 400]);
     }
     $verify_pass = Hash::check($user['usuario_password'], $usuario->usuario_password);
     if (!$verify_pass) {
         return Response::json(['response' => 'Senha incorreta', 'status' => 400]);
     }
     unset($usuario['usuario_password']);
     return Response::json(['response' => $usuario, 'status' => 200]);
 }
 public function show($id)
 {
     $usuarios = Usuario::find($id);
     //dd($Campus);
     if ($usuarios) {
         $data = array(array('rut', 'nombres', 'apellidos', 'email'), array($estudiantes->rut, $estudiantes->nombres, $estudiantes->apellidos, $estudiantes->email));
         Excel::create('Usuarios' . $usuarios->nombres, function ($excel) use($data) {
             $excel->sheet('Sheetname', function ($sheet) use($data) {
                 $sheet->fromArray($data);
             });
         })->download('csv');
     } else {
         abort('404');
     }
 }
Esempio n. 29
0
 public function login()
 {
     $input = Input::all();
     $lembreMe = empty($input['lembre_me']) ? false : true;
     if (Auth::attempt(['usuario' => $input['usuario'], 'password' => $input['senha']], $lembreMe)) {
         $pessoa = Usuario::find(Auth::user()->id)->first();
         session()->put('user_nome', $pessoa->nome);
         session()->put('user_email', $pessoa->email);
         session()->put('user_usuario', $pessoa->usuario);
         session()->put('user_id', $pessoa->id);
         return redirect('admin/home');
     }
     flash()->error('Login', trans('admin.msg_usuario_error'));
     return $this->wbd->view('backend.pages.login.index');
 }
Esempio n. 30
0
 public function confirma($serial)
 {
     $dados = ['titulo' => 'Cadastro inválido', 'texto' => 'Não há cadastro válido para essa solicitação, por favor verifique o link de confirmação e tente novamente ou utilize a opção para reenviar e-mail de confirmação'];
     $usuario = Usuario::withTrashed()->where('serial', $serial)->first();
     if (empty($usuario)) {
         return view('site.paginainfo', $dados);
     }
     if (is_null($usuario->deleted_at)) {
         return view('site.paginainfo', $dados);
     }
     $usuario->deleted_at = null;
     $usuario->setSerial();
     $usuario->save();
     $dados = ['titulo' => 'Cadastro confirmado', 'texto' => 'Seu cadastro foi confirmado e agora você está pronto para palpitar as partidas dos melhores campeonatos do país!'];
     return view('site.paginainfo', $dados);
 }