当前位置: 首页>>代码示例>>PHP>>正文


PHP Perfil::where方法代码示例

本文整理汇总了PHP中Perfil::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Perfil::where方法的具体用法?PHP Perfil::where怎么用?PHP Perfil::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Perfil的用法示例。


在下文中一共展示了Perfil::where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createMaestro

 public function createMaestro($post)
 {
     //Sanitisar los valores enviados por el usuario ( POST )
     $username = filter_var($post['username_input_data'], FILTER_SANITIZE_STRING);
     $mail = filter_var($post['email_input_data'], FILTER_SANITIZE_EMAIL);
     $password = filter_var($post['password_input_data'], FILTER_SANITIZE_STRING);
     $username = strip_tags(htmlspecialchars($username));
     $mail = strip_tags(htmlspecialchars($mail));
     $password = strip_tags(htmlspecialchars($password));
     //Validar el email
     $mail = filter_var($mail, FILTER_VALIDATE_EMAIL);
     $longitudPass = strlen($password);
     $perfil = Perfil::where('email', '=', $mail)->get();
     //Verificar que el email sea valido
     if (!$mail) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=1');
     }
     //Verificar la longitud del password
     if ($longitudPass < 8) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=2');
     }
     //Verificar que el email no exista en la base de datos (Perfil)
     if (count($perfil) > 0) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=3');
     }
     //Verificar que el username no exista en la base de datos
     $perfil = Perfil::where('username', '=', $username)->get();
     if (count($perfil) > 0) {
         $this->app->redirect($this->app->urlFor('join') . '?attempt=4');
     }
     //$user 		= 	Authentication::createUser( $username, $mail, $password, 100 );
     $user = new User();
     $salt = uniqid();
     $pwd = $password . $salt;
     $hash = hash('sha256', $pwd);
     $user->passwd = $hash;
     $user->salt = $salt;
     $user->level_id = 3;
     if ($user->save()) {
         $perfil = new Perfil();
         $perfil->perfil_id = $user->user_id;
         $perfil->email = $mail;
         $perfil->username = $username;
         $maestro = new Maestro();
         $maestro->maestro_id = $user->user_id;
         if ($perfil->save() && $maestro->save()) {
             $action = $this->app->urlFor('admin-maestro');
             $this->app->redirect($action . '?attempt=7');
         }
     } else {
         $action = $this->app->urlFor('admin-maestro');
         $this->app->redirect($action . '?attempt=5');
     }
 }
开发者ID:CodeSomethingMX,项目名称:barney,代码行数:54,代码来源:MaestroController.class.php

示例2: function

Route::get('/idioma/{idioma}', function ($idioma) {
    Session::put('locale', $idioma);
    return Redirect::to('/');
});
Route::get('/', 'CaptchaController@getLogin');
Route::post('/login', 'CaptchaController@postLogin');
Route::get('/crear_cuenta', 'CaptchaController@getCrearCuenta');
Route::post('/crear_cuenta', 'CaptchaController@postCrearCuenta');
Route::get('/crear_perfil', 'CaptchaController@getCrearPerfil');
Route::post('/crear_perfil', 'CaptchaController@postCrearPerfil');
Route::get('/crear_perfil/{id}', function ($id) {
    $idAlias = Session::get('usuario')->idAlias;
    $data = array();
    $data['ubicaciones'] = Ubicacion::all();
    $data['mascaras'] = Mascara::all();
    $data['perfil'] = Perfil::where('idPerfil', $id)->where('idAlias', $idAlias)->first();
    if (isset($data['perfil'])) {
        $mascaras = DB::select(DB::raw("\n\t\t\t\t\t\t\t\t\t\tSELECT GROUP_CONCAT(nombre) mascaras\n\t\t\t\t\t\t\t\t\t\tFROM mascaras_publicas\n\t\t\t\t\t\t\t\t\t\tWHERE idPerfil = {$id}\n\t\t\t\t\t\t\t\t\t"))[0];
        $apodos = DB::select(DB::raw("\n\t\t\t\t\t\t\t\t\t\tSELECT GROUP_CONCAT(apodo) apodos\n\t\t\t\t\t\t\t\t\t\tFROM apodos_publicos\n\t\t\t\t\t\t\t\t\t\tWHERE idPerfil = {$id}\n\t\t\t\t\t\t\t\t\t"))[0];
        $data['perfil']->masks = explode(",", $mascaras->mascaras);
        $data['perfil']->apods = explode(",", $apodos->apodos);
        $data['perfil']->mascaras = $mascaras->mascaras;
        $data['perfil']->apodos = $apodos->apodos;
        return View::make('update_perfil')->with('data', $data);
    } else {
        return Redirect::to('/perfiles');
    }
});
Route::post('/crear_perfil/{id}', function ($id) {
    $data = Input::all();
    $idAlias = Session::get('usuario')->idAlias;
开发者ID:Arvumti,项目名称:unmask_ultimo,代码行数:31,代码来源:routes.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["nombres"] = Perfil::where('id_rol', 2)->orderBy('nombres')->get()->lists('UserFullName', 'id');
             $data["tipos"] = RHTipo::all()->lists('nombre', 'id');
             $data["modalidades"] = RHModalidad::all()->lists('nombre', 'id');
             $data["departamentos"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["programacion"] = ProgramacionInternado::find($id);
             $ini = Carbon\Carbon::now()->startOfMonth();
             $end = Carbon\Carbon::now()->startOfMonth()->addMonth();
             while ($ini->month != $end->month) {
                 $dia = $ini->format('Y-m-d');
                 $temp = ProgramacionInternado::where('fecha_ini', '<=', $dia)->where('fecha_fin', '>=', $dia)->get();
                 if (!$temp->isEmpty()) {
                     foreach ($temp as $var) {
                         $dayEvents[$var->id] = $var;
                     }
                     $dias[$dia] = ["number" => $temp->count(), "badgeClass" => "badge-warning", "dayEvents" => $dayEvents];
                 } else {
                     $dias[$dia] = null;
                 }
                 $ini = $ini->addDay();
             }
             $dias = json_encode($dias);
             $data["dias"] = $dias;
             return View::make('rrhh.programacion_internado.edit', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
开发者ID:ktakayama91,项目名称:GTSlaravel,代码行数:44,代码来源:ProgramacionInternadoController.php

示例4: suscribirmeView

 public function suscribirmeView($curso_id)
 {
     $session = Utilities::getSession();
     $perfil = Perfil::where('perfil_id', '=', $session['user_id'])->get();
     $perfil = $perfil[0];
     $curso = Curso::find($curso_id);
     $action = '/suscribirme/' . $_SESSION['proceso']['curso'];
     $curso_perfil = CursoPerfil::where('curso_id', '=', $curso_id)->where('perfil_id', '=', $perfil->perfil_id)->get();
     if (count($curso_perfil) > 0) {
         unset($_SESSION['proceso']);
         $action = '/curso/' . $curso->nombre;
         $this->app->redirect($action);
     }
     $this->view = new SuscripcionView($perfil, $curso, Utilities::createToken(), $action);
     $this->view->display();
     //echo 'mostrar view suscribirse';
     //echo 'estoy por mostrar la vista de suscripcion';
     //var_dump($_SESSION['proceso']);
 }
开发者ID:CodeSomethingMX,项目名称:barney,代码行数:19,代码来源:AlumnoController.class.php


注:本文中的Perfil::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。