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');
 }
Пример #2
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");
     }
 }
Пример #3
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);
 }
 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);
 }
Пример #6
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;
 }
Пример #7
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;
 }
Пример #8
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;
 }
Пример #9
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;
 }
Пример #10
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, '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;
 }
Пример #11
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;
 }
Пример #12
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;
 }
Пример #13
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;
 }
Пример #14
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');
 }
 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');
     }
 }
Пример #16
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'dtEntrada' => $this->dtEntrada, 'isAdmin' => $this->isAdmin, 'isAtivo' => $this->isAtivo]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'cpf', $this->cpf])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'password', $this->password])->andFilterWhere(['like', 'matricula', $this->matricula])->andFilterWhere(['like', 'siape', $this->siape])->andFilterWhere(['like', 'perfil', $this->perfil])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token]);
     return $dataProvider;
 }
Пример #17
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'id_perfil' => $this->id_perfil]);
     $query->andFilterWhere(['like', 'nickname', $this->nickname])->andFilterWhere(['like', 'password', $this->password]);
     return $dataProvider;
 }
Пример #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->joinWith('institucion');
     $query->joinWith('role');
     $query->andFilterWhere(['id' => $this->id, 'fecha_registro' => $this->fecha_registro, 'usuario_id_activo' => $this->usuario_id_activo, 'fecha_login' => $this->fecha_login]);
     $query->andFilterWhere(['like', 'nombres', $this->nombres])->andFilterWhere(['like', 'apellidos', $this->apellidos])->andFilterWhere(['like', 'cedula', $this->cedula])->andFilterWhere(['like', 'cargo', $this->cargo])->andFilterWhere(['like', 'correo', $this->correo])->andFilterWhere(['like', 'tlf', $this->tlf])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'institucion.nombre_institucion', $this->institucion_id])->andFilterWhere(['like', 'role.nombre_role', $this->role_id])->andFilterWhere(['like', 'password', $this->password]);
     return $dataProvider;
 }
Пример #19
0
 /**
  * Lists all Frequencia models.
  * @return mixed
  */
 public function actionIndex($id)
 {
     // Deixar essa pesquisa mais limpa
     $frequencias = array();
     $aluno = Usuario::find()->where(['CPF' => Yii::$app->user->identity->cpf])->one();
     // pesquisa para pegar o id do aluno
     $todas = Frequencia::find()->where(['IDMonitoria' => $id])->all();
     foreach ($todas as $freq) {
         $evento = new \yii2fullcalendar\models\Event();
         $evento->id = $freq->id;
         $evento->allDay = true;
         $evento->className = 'btn';
         //$evento->title = $freq->ch .'h -' . $freq->atividade;
         if ($freq->atividade == null) {
             $evento->title = $freq->ch . 'h';
         } else {
             $evento->title = $freq->ch . 'h -' . $freq->atividade;
         }
         $evento->start = $freq->dmy;
         //$evento->end = date("Y-m-d", strtotime("+1 day", strtotime($freq->dmy)));
         $frequencias[] = $evento;
     }
     return $this->render('index', ['events' => $frequencias, 'erro' => $id != null ? '0' : '1', 'idM' => $id]);
 }
Пример #20
0
 public function actionIndex()
 {
     $usuarios = Usuario::find()->joinWith('role')->with('institucion')->all();
     return $this->render('index', ['usuarios' => $usuarios]);
 }
Пример #21
0
 -->

    <?php 
echo $form->field($model, 'idDisciplina')->dropDownList($arrayDisciplinas, ['prompt' => 'Selecione uma disciplina', 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'codTurma')->textInput(['maxlength' => true, 'style' => 'width:130px']);
?>

    <?php 
echo $form->field($model, 'idCurso')->dropDownList(ArrayHelper::map(Curso::find()->orderBy('nome')->asArray()->all(), 'id', 'nome'), ['prompt' => 'Selecione um curso', 'style' => 'width:300px']);
?>

    <?php 
echo $form->field($model, 'idProfessor')->dropDownList(ArrayHelper::map(Usuario::find()->where(['perfil' => 'Professor'])->orderBy('name')->asArray()->all(), 'id', 'name'), ['prompt' => 'Selecione o professor', 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'nomeUnidade')->textInput(['maxlength' => true, 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'numPeriodo')->textInput(['style' => 'width:130px']);
?>

    <?php 
echo $form->field($model, 'anoPeriodo')->textInput(['style' => 'width:130px']);
?>

    <?php 
Пример #22
0
    public function actionFrequenciaindividual()
    {
        $modelPeriodo = DisciplinaPeriodo::find()->orderBy(['anoPeriodo' => SORT_DESC, 'numPeriodo' => SORT_DESC])->one();
        $periodoletivo = $modelPeriodo->anoPeriodo . '/' . $modelPeriodo->numPeriodo;
        $dadosCabecalho = Periodo::find()->where(['codigo' => $periodoletivo])->one();
        $monitor = Usuario::find()->where(['cpf' => Yii::$app->user->identity->cpf])->one();
        $monitoria = AlunoMonitoria::find()->where(['periodo' => $periodoletivo])->andWhere(['IDAluno' => $monitor->id])->andFilterWhere(['or', ['like', 'status', 'Selecionado com bolsa'], ['like', 'status', 'Selecionado sem bolsa']])->one();
        if ($monitoria == null) {
            return $this->render('index', ['erro' => 1]);
        } else {
            $disc = DisciplinaMonitoria::find()->where(['id' => $monitoria->id_disciplina])->one();
        }
        if ($dadosCabecalho != null) {
            $cssfile = file_get_contents('../web/css/estilo5.css');
            $mpdf = new mPDF('utf-8', 'A4-L');
            $mpdf->title = '3. Frequência Individual';
            $mpdf->WriteHTML($cssfile, 1);
            // Cabeçalho do doc
            $mpdf->SetHTMLHeader('
                <img src="../web/img/cabecalho5.png" alt="Universidade Federal do Amazonas...." width="980" height="100">
                ');
            $mes = Monitoria::nomeMes(date('m') - 1);
            $ano = date('Y');
            if ($mes == 0) {
                $mes = 12;
                $ano = $ano - 1;
            }
            $mesNome = Monitoria::nomeMes($mes);
            $mpdf->WriteHTML('
                <br><br><br><br>
                <table id="periodoLetivo_mesAno" width="56%">
                    <tr>
                        <td bgcolor="#e6e6e6" width="7%">PERÍODO LETIVO</td>
                        <td width="21%">' . $periodoletivo . '</td>
                        <td bgcolor="#e6e6e6" width="7%">MÊS/ANO</td>
                        <td width="21%">' . $mesNome . '/' . $ano . '</td>
                    </tr>
                </table>
                <br>
                <table id="department_unity" width="99%">
                    <tr>
                        <td bgcolor="#e6e6e6" width="11%">DEPARTAMENTO</td>
                        <td width="40%">Coordenação Acadêmica</td>
                        <td bgcolor="#e6e6e6" width="10%">UNIDADE</td>
                        <td width="28%">Instituto de Computação - IComp</td>
                    </tr>
                </table>
                <br>
                <table id="disc_dados" width="99%">
                    <tr>
                        <td bgcolor="#e6e6e6" width="25%">DISCIPLINA<br>(código e título sem abreviações)</td>
                        <td width="74%">' . $disc->codDisciplina . ' - ' . $monitoria->nomeDisciplina . '</td>
                    </tr>
                </table>
            ');
            $mpdf->WriteHTML('
                <br>
                <table id="prof_monitor" width="99%">
                    <tr>
                        <td bgcolor="#e6e6e6" width="49%">PROFESSOR ORIENTADOR<br>(nome completo, sem abreviações e assinatura)</td>
                        <td bgcolor="#e6e6e6" width="50%">MONITOR<br>(nome completo, sem abreviações, nº de matrícula e assinatura)</td>
                    </tr>
                    <tr>
                        <td width="49%" align="left">Nome completo: ' . $monitoria->professor . '</td>
                        <td width="50%" align="left">Nome completo: ' . $monitoria->aluno . '</td>
                    </tr>
                    <tr>
                        <td width="49%" height="50" align="left">Ass:</td>
                        <td width="50%" height="50" align="left">Ass:</td>
                    </tr>
                </table>
                <br>
            ');
            $array_diaSemana = array();
            $array_diaMes = array();
            $array_carga = array();
            $cont_dia = 1;
            $dia = $ano . '-' . $mes . '-01';
            // O primeiro dia (data) do mês anterior
            $diaTotal = date('d', strtotime(date('Y-m-t', strtotime($dia))));
            while ($cont_dia <= $diaTotal) {
                $f = Frequencia::find()->where(['dmy' => $dia])->andWhere(['>=', 'IDMonitoria', $monitoria->id])->one();
                if ($f != null) {
                    $array_carga[] = $f->ch;
                } else {
                    $array_carga[] = '-';
                }
                $array_diaSemana[] = Monitoria::nomeDia(date('w', strtotime($dia)));
                // Pega tradução do dia da semana e põe no array
                $aux = strtotime("+1 day", strtotime($dia));
                $dia = date('Y-m-d', $aux);
                $array_diaMes[] = $cont_dia;
                // Põe o dia no array
                $cont_dia++;
            }
            //return $this->render('index');
            if ($diaTotal == 28) {
                $mpdf->WriteHTML('
                    <table id="calendario"  height="25px" width="900px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_da_semana.png" alt="DIA DA SEMANA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaSemana[0] . '</td> <td width="30px">' . $array_diaSemana[1] . '</td> <td width="30px">' . $array_diaSemana[2] . '</td> 
                            <td width="30px">' . $array_diaSemana[3] . '</td> <td width="30px">' . $array_diaSemana[4] . '</td> <td width="30px">' . $array_diaSemana[5] . '</td>
                            <td width="30px">' . $array_diaSemana[6] . '</td> <td width="30px">' . $array_diaSemana[7] . '</td> <td width="30px">' . $array_diaSemana[8] . '</td>
                            <td width="30px">' . $array_diaSemana[9] . '</td> <td width="30px">' . $array_diaSemana[10] . '</td> <td width="30px">' . $array_diaSemana[11] . '</td>
                            <td width="30px">' . $array_diaSemana[12] . '</td> <td width="30px">' . $array_diaSemana[13] . '</td> <td width="30px">' . $array_diaSemana[14] . '</td>
                            <td width="30px">' . $array_diaSemana[15] . '</td> <td width="30px">' . $array_diaSemana[16] . '</td> <td width="30px">' . $array_diaSemana[17] . '</td>
                            <td width="30px">' . $array_diaSemana[18] . '</td> <td width="30px">' . $array_diaSemana[19] . '</td> <td width="30px">' . $array_diaSemana[20] . '</td>
                            <td width="30px">' . $array_diaSemana[21] . '</td> <td width="30px">' . $array_diaSemana[22] . '</td> <td width="30px">' . $array_diaSemana[23] . '</td>
                            <td width="30px">' . $array_diaSemana[24] . '</td> <td width="30px">' . $array_diaSemana[25] . '</td> <td width="30px">' . $array_diaSemana[26] . '</td>
                            <td width="30px">' . $array_diaSemana[27] . '</td> <td width="30px">' . $array_diaSemana[28] . '</td> <td width="30px">' . $array_diaSemana[29] . '</td>
                            <td width="30px">' . $array_diaSemana[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="902px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_do_mes.png" alt="DIA DO MÊS" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaMes[0] . '</td> <td width="30px">' . $array_diaMes[1] . '</td> <td width="30px">' . $array_diaMes[2] . '</td> 
                            <td width="30px">' . $array_diaMes[3] . '</td> <td width="30px">' . $array_diaMes[4] . '</td> <td width="30px">' . $array_diaMes[5] . '</td>
                            <td width="30px">' . $array_diaMes[6] . '</td> <td width="30px">' . $array_diaMes[7] . '</td> <td width="30px">' . $array_diaMes[8] . '</td>
                            <td width="30px">' . $array_diaMes[9] . '</td> <td width="30px">' . $array_diaMes[10] . '</td> <td width="30px">' . $array_diaMes[11] . '</td>
                            <td width="30px">' . $array_diaMes[12] . '</td> <td width="30px">' . $array_diaMes[13] . '</td> <td width="30px">' . $array_diaMes[14] . '</td>
                            <td width="30px">' . $array_diaMes[15] . '</td> <td width="30px">' . $array_diaMes[16] . '</td> <td width="30px">' . $array_diaMes[17] . '</td>
                            <td width="30px">' . $array_diaMes[18] . '</td> <td width="30px">' . $array_diaMes[19] . '</td> <td width="30px">' . $array_diaMes[20] . '</td>
                            <td width="30px">' . $array_diaMes[21] . '</td> <td width="30px">' . $array_diaMes[22] . '</td> <td width="30px">' . $array_diaMes[23] . '</td>
                            <td width="30px">' . $array_diaMes[24] . '</td> <td width="30px">' . $array_diaMes[25] . '</td> <td width="30px">' . $array_diaMes[26] . '</td>
                            <td width="30px">' . $array_diaMes[27] . '</td> <td width="30px">' . $array_diaMes[28] . '</td> <td width="30px">' . $array_diaMes[29] . '</td>
                            <td width="30px">' . $array_diaMes[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="90px">
                        <tr>
                            <td bgcolor="#e6e6e6">
                            <img src="../web/img/carga_horaria.png" alt="CARGA HORÁRIA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_carga[0] . '</td> <td width="30px">' . $array_carga[1] . '</td> <td width="30px">' . $array_carga[2] . '</td> 
                            <td width="30px">' . $array_carga[3] . '</td> <td width="30px">' . $array_carga[4] . '</td> <td width="30px">' . $array_carga[5] . '</td>
                            <td width="30px">' . $array_carga[6] . '</td> <td width="30px">' . $array_carga[7] . '</td> <td width="30px">' . $array_carga[8] . '</td>
                            <td width="30px">' . $array_carga[9] . '</td> <td width="30px">' . $array_carga[10] . '</td> <td width="30px">' . $array_carga[11] . '</td>
                            <td width="30px">' . $array_carga[12] . '</td> <td width="30px">' . $array_carga[13] . '</td> <td width="30px">' . $array_carga[14] . '</td>
                            <td width="30px">' . $array_carga[15] . '</td> <td width="30px">' . $array_carga[16] . '</td> <td width="30px">' . $array_carga[17] . '</td>
                            <td width="30px">' . $array_carga[18] . '</td> <td width="30px">' . $array_carga[19] . '</td> <td width="30px">' . $array_carga[20] . '</td>
                            <td width="30px">' . $array_carga[21] . '</td> <td width="30px">' . $array_carga[22] . '</td> <td width="30px">' . $array_carga[23] . '</td>
                            <td width="30px">' . $array_carga[24] . '</td> <td width="30px">' . $array_carga[25] . '</td> <td width="30px">' . $array_carga[26] . '</td>
                            <td width="30px">' . $array_carga[27] . '</td> <td width="30px"> -- </td> <td width="30px"> -- </td>
                            <td width="30px"> -- </td>
                        </tr>
                    </table>
                ');
            } elseif ($diaTotal == 29) {
                $mpdf->WriteHTML('
                    <table id="calendario"  height="25px" width="900px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_da_semana.png" alt="DIA DA SEMANA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaSemana[0] . '</td> <td width="30px">' . $array_diaSemana[1] . '</td> <td width="30px">' . $array_diaSemana[2] . '</td> 
                            <td width="30px">' . $array_diaSemana[3] . '</td> <td width="30px">' . $array_diaSemana[4] . '</td> <td width="30px">' . $array_diaSemana[5] . '</td>
                            <td width="30px">' . $array_diaSemana[6] . '</td> <td width="30px">' . $array_diaSemana[7] . '</td> <td width="30px">' . $array_diaSemana[8] . '</td>
                            <td width="30px">' . $array_diaSemana[9] . '</td> <td width="30px">' . $array_diaSemana[10] . '</td> <td width="30px">' . $array_diaSemana[11] . '</td>
                            <td width="30px">' . $array_diaSemana[12] . '</td> <td width="30px">' . $array_diaSemana[13] . '</td> <td width="30px">' . $array_diaSemana[14] . '</td>
                            <td width="30px">' . $array_diaSemana[15] . '</td> <td width="30px">' . $array_diaSemana[16] . '</td> <td width="30px">' . $array_diaSemana[17] . '</td>
                            <td width="30px">' . $array_diaSemana[18] . '</td> <td width="30px">' . $array_diaSemana[19] . '</td> <td width="30px">' . $array_diaSemana[20] . '</td>
                            <td width="30px">' . $array_diaSemana[21] . '</td> <td width="30px">' . $array_diaSemana[22] . '</td> <td width="30px">' . $array_diaSemana[23] . '</td>
                            <td width="30px">' . $array_diaSemana[24] . '</td> <td width="30px">' . $array_diaSemana[25] . '</td> <td width="30px">' . $array_diaSemana[26] . '</td>
                            <td width="30px">' . $array_diaSemana[27] . '</td> <td width="30px">' . $array_diaSemana[28] . '</td> <td width="30px">' . $array_diaSemana[29] . '</td>
                            <td width="30px">' . $array_diaSemana[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="902px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_do_mes.png" alt="DIA DO MÊS" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaMes[0] . '</td> <td width="30px">' . $array_diaMes[1] . '</td> <td width="30px">' . $array_diaMes[2] . '</td> 
                            <td width="30px">' . $array_diaMes[3] . '</td> <td width="30px">' . $array_diaMes[4] . '</td> <td width="30px">' . $array_diaMes[5] . '</td>
                            <td width="30px">' . $array_diaMes[6] . '</td> <td width="30px">' . $array_diaMes[7] . '</td> <td width="30px">' . $array_diaMes[8] . '</td>
                            <td width="30px">' . $array_diaMes[9] . '</td> <td width="30px">' . $array_diaMes[10] . '</td> <td width="30px">' . $array_diaMes[11] . '</td>
                            <td width="30px">' . $array_diaMes[12] . '</td> <td width="30px">' . $array_diaMes[13] . '</td> <td width="30px">' . $array_diaMes[14] . '</td>
                            <td width="30px">' . $array_diaMes[15] . '</td> <td width="30px">' . $array_diaMes[16] . '</td> <td width="30px">' . $array_diaMes[17] . '</td>
                            <td width="30px">' . $array_diaMes[18] . '</td> <td width="30px">' . $array_diaMes[19] . '</td> <td width="30px">' . $array_diaMes[20] . '</td>
                            <td width="30px">' . $array_diaMes[21] . '</td> <td width="30px">' . $array_diaMes[22] . '</td> <td width="30px">' . $array_diaMes[23] . '</td>
                            <td width="30px">' . $array_diaMes[24] . '</td> <td width="30px">' . $array_diaMes[25] . '</td> <td width="30px">' . $array_diaMes[26] . '</td>
                            <td width="30px">' . $array_diaMes[27] . '</td> <td width="30px">' . $array_diaMes[28] . '</td> <td width="30px">' . $array_diaMes[29] . '</td>
                            <td width="30px">' . $array_diaMes[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="90px">
                        <tr>
                            <td bgcolor="#e6e6e6">
                            <img src="../web/img/carga_horaria.png" alt="CARGA HORÁRIA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_carga[0] . '</td> <td width="30px">' . $array_carga[1] . '</td> <td width="30px">' . $array_carga[2] . '</td> 
                            <td width="30px">' . $array_carga[3] . '</td> <td width="30px">' . $array_carga[4] . '</td> <td width="30px">' . $array_carga[5] . '</td>
                            <td width="30px">' . $array_carga[6] . '</td> <td width="30px">' . $array_carga[7] . '</td> <td width="30px">' . $array_carga[8] . '</td>
                            <td width="30px">' . $array_carga[9] . '</td> <td width="30px">' . $array_carga[10] . '</td> <td width="30px">' . $array_carga[11] . '</td>
                            <td width="30px">' . $array_carga[12] . '</td> <td width="30px">' . $array_carga[13] . '</td> <td width="30px">' . $array_carga[14] . '</td>
                            <td width="30px">' . $array_carga[15] . '</td> <td width="30px">' . $array_carga[16] . '</td> <td width="30px">' . $array_carga[17] . '</td>
                            <td width="30px">' . $array_carga[18] . '</td> <td width="30px">' . $array_carga[19] . '</td> <td width="30px">' . $array_carga[20] . '</td>
                            <td width="30px">' . $array_carga[21] . '</td> <td width="30px">' . $array_carga[22] . '</td> <td width="30px">' . $array_carga[23] . '</td>
                            <td width="30px">' . $array_carga[24] . '</td> <td width="30px">' . $array_carga[25] . '</td> <td width="30px">' . $array_carga[26] . '</td>
                            <td width="30px">' . $array_carga[27] . '</td> <td width="30px">' . $array_carga[28] . '</td> <td width="30px"> -- </td>
                            <td width="30px"> -- </td>
                        </tr>
                    </table>
                ');
            } elseif ($diaTotal == 30) {
                $mpdf->WriteHTML('
                    <table id="calendario"  height="25px" width="900px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_da_semana.png" alt="DIA DA SEMANA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaSemana[0] . '</td> <td width="30px">' . $array_diaSemana[1] . '</td> <td width="30px">' . $array_diaSemana[2] . '</td> 
                            <td width="30px">' . $array_diaSemana[3] . '</td> <td width="30px">' . $array_diaSemana[4] . '</td> <td width="30px">' . $array_diaSemana[5] . '</td>
                            <td width="30px">' . $array_diaSemana[6] . '</td> <td width="30px">' . $array_diaSemana[7] . '</td> <td width="30px">' . $array_diaSemana[8] . '</td>
                            <td width="30px">' . $array_diaSemana[9] . '</td> <td width="30px">' . $array_diaSemana[10] . '</td> <td width="30px">' . $array_diaSemana[11] . '</td>
                            <td width="30px">' . $array_diaSemana[12] . '</td> <td width="30px">' . $array_diaSemana[13] . '</td> <td width="30px">' . $array_diaSemana[14] . '</td>
                            <td width="30px">' . $array_diaSemana[15] . '</td> <td width="30px">' . $array_diaSemana[16] . '</td> <td width="30px">' . $array_diaSemana[17] . '</td>
                            <td width="30px">' . $array_diaSemana[18] . '</td> <td width="30px">' . $array_diaSemana[19] . '</td> <td width="30px">' . $array_diaSemana[20] . '</td>
                            <td width="30px">' . $array_diaSemana[21] . '</td> <td width="30px">' . $array_diaSemana[22] . '</td> <td width="30px">' . $array_diaSemana[23] . '</td>
                            <td width="30px">' . $array_diaSemana[24] . '</td> <td width="30px">' . $array_diaSemana[25] . '</td> <td width="30px">' . $array_diaSemana[26] . '</td>
                            <td width="30px">' . $array_diaSemana[27] . '</td> <td width="30px">' . $array_diaSemana[28] . '</td> <td width="30px">' . $array_diaSemana[29] . '</td>
                            <td width="30px">' . $array_diaSemana[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="902px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_do_mes.png" alt="DIA DO MÊS" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaMes[0] . '</td> <td width="30px">' . $array_diaMes[1] . '</td> <td width="30px">' . $array_diaMes[2] . '</td> 
                            <td width="30px">' . $array_diaMes[3] . '</td> <td width="30px">' . $array_diaMes[4] . '</td> <td width="30px">' . $array_diaMes[5] . '</td>
                            <td width="30px">' . $array_diaMes[6] . '</td> <td width="30px">' . $array_diaMes[7] . '</td> <td width="30px">' . $array_diaMes[8] . '</td>
                            <td width="30px">' . $array_diaMes[9] . '</td> <td width="30px">' . $array_diaMes[10] . '</td> <td width="30px">' . $array_diaMes[11] . '</td>
                            <td width="30px">' . $array_diaMes[12] . '</td> <td width="30px">' . $array_diaMes[13] . '</td> <td width="30px">' . $array_diaMes[14] . '</td>
                            <td width="30px">' . $array_diaMes[15] . '</td> <td width="30px">' . $array_diaMes[16] . '</td> <td width="30px">' . $array_diaMes[17] . '</td>
                            <td width="30px">' . $array_diaMes[18] . '</td> <td width="30px">' . $array_diaMes[19] . '</td> <td width="30px">' . $array_diaMes[20] . '</td>
                            <td width="30px">' . $array_diaMes[21] . '</td> <td width="30px">' . $array_diaMes[22] . '</td> <td width="30px">' . $array_diaMes[23] . '</td>
                            <td width="30px">' . $array_diaMes[24] . '</td> <td width="30px">' . $array_diaMes[25] . '</td> <td width="30px">' . $array_diaMes[26] . '</td>
                            <td width="30px">' . $array_diaMes[27] . '</td> <td width="30px">' . $array_diaMes[28] . '</td> <td width="30px">' . $array_diaMes[29] . '</td>
                            <td width="30px">' . $array_diaMes[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="90px">
                        <tr>
                            <td bgcolor="#e6e6e6">
                            <img src="../web/img/carga_horaria.png" alt="CARGA HORÁRIA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_carga[0] . '</td> <td width="30px">' . $array_carga[1] . '</td> <td width="30px">' . $array_carga[2] . '</td> 
                            <td width="30px">' . $array_carga[3] . '</td> <td width="30px">' . $array_carga[4] . '</td> <td width="30px">' . $array_carga[5] . '</td>
                            <td width="30px">' . $array_carga[6] . '</td> <td width="30px">' . $array_carga[7] . '</td> <td width="30px">' . $array_carga[8] . '</td>
                            <td width="30px">' . $array_carga[9] . '</td> <td width="30px">' . $array_carga[10] . '</td> <td width="30px">' . $array_carga[11] . '</td>
                            <td width="30px">' . $array_carga[12] . '</td> <td width="30px">' . $array_carga[13] . '</td> <td width="30px">' . $array_carga[14] . '</td>
                            <td width="30px">' . $array_carga[15] . '</td> <td width="30px">' . $array_carga[16] . '</td> <td width="30px">' . $array_carga[17] . '</td>
                            <td width="30px">' . $array_carga[18] . '</td> <td width="30px">' . $array_carga[19] . '</td> <td width="30px">' . $array_carga[20] . '</td>
                            <td width="30px">' . $array_carga[21] . '</td> <td width="30px">' . $array_carga[22] . '</td> <td width="30px">' . $array_carga[23] . '</td>
                            <td width="30px">' . $array_carga[24] . '</td> <td width="30px">' . $array_carga[25] . '</td> <td width="30px">' . $array_carga[26] . '</td>
                            <td width="30px">' . $array_carga[27] . '</td> <td width="30px">' . $array_carga[28] . '</td> <td width="30px">' . $array_carga[29] . '</td>
                            <td width="30px"> -- </td>
                        </tr>
                    </table>
                ');
            } elseif ($diaTotal == 31) {
                $mpdf->WriteHTML('
                    <table id="calendario"  height="25px" width="900px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_da_semana.png" alt="DIA DA SEMANA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaSemana[0] . '</td> <td width="30px">' . $array_diaSemana[1] . '</td> <td width="30px">' . $array_diaSemana[2] . '</td> 
                            <td width="30px">' . $array_diaSemana[3] . '</td> <td width="30px">' . $array_diaSemana[4] . '</td> <td width="30px">' . $array_diaSemana[5] . '</td>
                            <td width="30px">' . $array_diaSemana[6] . '</td> <td width="30px">' . $array_diaSemana[7] . '</td> <td width="30px">' . $array_diaSemana[8] . '</td>
                            <td width="30px">' . $array_diaSemana[9] . '</td> <td width="30px">' . $array_diaSemana[10] . '</td> <td width="30px">' . $array_diaSemana[11] . '</td>
                            <td width="30px">' . $array_diaSemana[12] . '</td> <td width="30px">' . $array_diaSemana[13] . '</td> <td width="30px">' . $array_diaSemana[14] . '</td>
                            <td width="30px">' . $array_diaSemana[15] . '</td> <td width="30px">' . $array_diaSemana[16] . '</td> <td width="30px">' . $array_diaSemana[17] . '</td>
                            <td width="30px">' . $array_diaSemana[18] . '</td> <td width="30px">' . $array_diaSemana[19] . '</td> <td width="30px">' . $array_diaSemana[20] . '</td>
                            <td width="30px">' . $array_diaSemana[21] . '</td> <td width="30px">' . $array_diaSemana[22] . '</td> <td width="30px">' . $array_diaSemana[23] . '</td>
                            <td width="30px">' . $array_diaSemana[24] . '</td> <td width="30px">' . $array_diaSemana[25] . '</td> <td width="30px">' . $array_diaSemana[26] . '</td>
                            <td width="30px">' . $array_diaSemana[27] . '</td> <td width="30px">' . $array_diaSemana[28] . '</td> <td width="30px">' . $array_diaSemana[29] . '</td>
                            <td width="30px">' . $array_diaSemana[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="902px">
                        <tr>
                            <td bgcolor="#e6e6e6" >
                            <img src="../web/img/dia_do_mes.png" alt="DIA DO MÊS" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_diaMes[0] . '</td> <td width="30px">' . $array_diaMes[1] . '</td> <td width="30px">' . $array_diaMes[2] . '</td> 
                            <td width="30px">' . $array_diaMes[3] . '</td> <td width="30px">' . $array_diaMes[4] . '</td> <td width="30px">' . $array_diaMes[5] . '</td>
                            <td width="30px">' . $array_diaMes[6] . '</td> <td width="30px">' . $array_diaMes[7] . '</td> <td width="30px">' . $array_diaMes[8] . '</td>
                            <td width="30px">' . $array_diaMes[9] . '</td> <td width="30px">' . $array_diaMes[10] . '</td> <td width="30px">' . $array_diaMes[11] . '</td>
                            <td width="30px">' . $array_diaMes[12] . '</td> <td width="30px">' . $array_diaMes[13] . '</td> <td width="30px">' . $array_diaMes[14] . '</td>
                            <td width="30px">' . $array_diaMes[15] . '</td> <td width="30px">' . $array_diaMes[16] . '</td> <td width="30px">' . $array_diaMes[17] . '</td>
                            <td width="30px">' . $array_diaMes[18] . '</td> <td width="30px">' . $array_diaMes[19] . '</td> <td width="30px">' . $array_diaMes[20] . '</td>
                            <td width="30px">' . $array_diaMes[21] . '</td> <td width="30px">' . $array_diaMes[22] . '</td> <td width="30px">' . $array_diaMes[23] . '</td>
                            <td width="30px">' . $array_diaMes[24] . '</td> <td width="30px">' . $array_diaMes[25] . '</td> <td width="30px">' . $array_diaMes[26] . '</td>
                            <td width="30px">' . $array_diaMes[27] . '</td> <td width="30px">' . $array_diaMes[28] . '</td> <td width="30px">' . $array_diaMes[29] . '</td>
                            <td width="30px">' . $array_diaMes[30] . '</td>
                        </tr>
                    </table>
                ');
                $mpdf->WriteHTML('
                    <table id="calendario" height="25px" width="90px">
                        <tr>
                            <td bgcolor="#e6e6e6">
                            <img src="../web/img/carga_horaria.png" alt="CARGA HORÁRIA" width="42px" height="50px">
                            </td>
                            <td width="30px">' . $array_carga[0] . '</td> <td width="30px">' . $array_carga[1] . '</td> <td width="30px">' . $array_carga[2] . '</td> 
                            <td width="30px">' . $array_carga[3] . '</td> <td width="30px">' . $array_carga[4] . '</td> <td width="30px">' . $array_carga[5] . '</td>
                            <td width="30px">' . $array_carga[6] . '</td> <td width="30px">' . $array_carga[7] . '</td> <td width="30px">' . $array_carga[8] . '</td>
                            <td width="30px">' . $array_carga[9] . '</td> <td width="30px">' . $array_carga[10] . '</td> <td width="30px">' . $array_carga[11] . '</td>
                            <td width="30px">' . $array_carga[12] . '</td> <td width="30px">' . $array_carga[13] . '</td> <td width="30px">' . $array_carga[14] . '</td>
                            <td width="30px">' . $array_carga[15] . '</td> <td width="30px">' . $array_carga[16] . '</td> <td width="30px">' . $array_carga[17] . '</td>
                            <td width="30px">' . $array_carga[18] . '</td> <td width="30px">' . $array_carga[19] . '</td> <td width="30px">' . $array_carga[20] . '</td>
                            <td width="30px">' . $array_carga[21] . '</td> <td width="30px">' . $array_carga[22] . '</td> <td width="30px">' . $array_carga[23] . '</td>
                            <td width="30px">' . $array_carga[24] . '</td> <td width="30px">' . $array_carga[25] . '</td> <td width="30px">' . $array_carga[26] . '</td>
                            <td width="30px">' . $array_carga[27] . '</td> <td width="30px">' . $array_carga[28] . '</td> <td width="30px">' . $array_carga[29] . '</td>
                            <td width="30px">' . $array_carga[30] . '</td>
                        </tr>
                    </table>
                ');
            }
            $mpdf->WriteHTML('
                <br>
                <table id="assinatura" style="margin-left:30em;">
                    <tr>
                        <td bgcolor="#e6e6e6" text-align:center>
                            VISTO DA CHEFIA <br>DO DEPARTAMENTO ACADÊMICO <br> (COM CARIMBO)
                        </td>

                        <td width="70%" height="100"> </td>
                    </tr>
                </table>');
            $mpdf->Output();
            exit;
        } else {
            return $this->render('index', ['erro' => 2]);
        }
    }
Пример #23
0
 public function actionNovasenha()
 {
     if (Yii::$app->request->post()) {
         $email = Yii::$app->request->post('email');
         $user = Usuario::find()->where(['email' => $email])->one();
         if ($user != null) {
             set_time_limit(0);
             $mensagem = Yii::$app->mailer->compose()->setFrom('*****@*****.**', 'Sistema de Apoio à Monitoria e Aproveitamento de Estudos')->setTo($user->email)->setSubject('Nova senha')->setTextBody('Sua nova senha temporária é: ' . $user->gerarSenhaNova())->send();
             return $this->render('novasenhaenviada');
         } else {
             return $this->render('emailnaoexiste');
         }
     } else {
         return $this->render('novasenha');
     }
 }
Пример #24
0
 /**
  * Permite crear un registro de usuario
  *
  * @param  Request $request
  * @param  integer $id
  * @return Response View
  */
 public function edit(Request $request, $id = 0)
 {
     $usuario = Usuario::find($id);
     $roles = Role::whereIn('id', [1, 2]);
     return view('super.usuarios.edit')->withUsuario($usuario)->withRoles($roles);
 }
Пример #25
0
 /**
  * Permite crear un registro de usuario
  *
  * @param  Request $request
  * @param  integer $id
  * @return Response View
  */
 public function edit(Request $request, $id = 0)
 {
     $usuario = Usuario::find($id);
     return view('admin.expositores.edit')->withUsuario($usuario)->withRole(new Role())->withPais(new Pais());
 }
Пример #26
0
 /**
  * Displays a single EmpresaPyme model.
  * @param string $id
  * @return mixed
  */
 public function actionView($id)
 {
     $usuario = Usuario::find()->where(["emp_rut" => $id])->andWhere(["usu_tipo" => 1])->one();
     return $this->render('view', ['model' => $this->findModel($id), 'usuario' => $usuario]);
 }
 public function desativar($id)
 {
     $user = Usuario::find($id);
     $user->ativo = '0';
     return $user->save() ? "1" : "0";
 }
Пример #28
0
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use app\models\Usuario;
/* @var $this yii\web\View */
/* @var $model app\models\Login */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="login-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'idUsuario')->dropDownList(ArrayHelper::map(Usuario::find()->all(), 'idUsuario', 'nome'));
?>

    <?php 
echo $form->field($model, 'usuario')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'senha')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'nivel')->dropDownList(array(1 => 'Administrador', 2 => 'Moderador', 3 => 'Usuário'));
?>
    
    <?php 
Пример #29
0
    <?php 
echo $form->field($model, 'periodo_id')->dropDownList(ArrayHelper::map(\app\models\Periodo::find()->all(), 'id', 'codigo'), ['prompt' => 'Selecione']);
?>


    <!-- preenchendo o campo solicitante_id com os ids do Aluno, e escondendo do formulario. caso seja coordenador que esteja criando uma solicitação pro Aluno, então o Coordenador preencherá.-->
    <!--<?php 
echo $form->field($model, 'solicitante_id')->textInput();
?>
-->
    <?php 
if (isset(Yii::$app->user->identity)) {
    if (Yii::$app->user->identity->perfil == 'Aluno') {
        echo $form->field($model, 'solicitante_id')->hiddenInput(['value' => Yii::$app->user->identity->id])->label(false);
    } elseif (Yii::$app->user->identity->perfil == 'Coordenador') {
        echo $form->field($model, 'solicitante_id')->dropDownList(ArrayHelper::map(\app\models\Usuario::find()->all(), 'id', 'name'), ['prompt' => 'Selecione']);
    }
}
?>


    <!--preenchendo o campo aprovador_id com os ids de coordenador ou secretaria, e escondendo do formulario.-->
    <!--<?php 
echo $form->field($model, 'aprovador_id')->textInput();
?>
-->
    <?php 
if (isset(Yii::$app->user->identity)) {
    if (Yii::$app->user->identity->perfil == 'Coordenador') {
        echo $form->field($model, 'aprovador_id')->hiddenInput(['value' => Yii::$app->user->identity->id])->label(false);
    }
Пример #30
0
 /**
  * Displays a single Usuario model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $res = Usuario::find()->select(['institucion.nombre_institucion', 'usuario.nombres', 'usuario.apellidos', 'usuario.cedula', 'usuario.cargo', 'usuario.correo', 'usuario.id', 'role.nombre_role'])->innerJoinWith('institucion')->innerJoinWith("role")->where(['usuario.id' => $id])->all();
     return $this->render('view', ['model' => $this->findModel($id)]);
 }