public function seeProfile($idUser = 37) { // echo '<pre>';print_r(Auth::user());exit; $idUser = 37; if (user::find($idUser) != false) { DB::statement("SET lc_time_names = 'es_ES'"); $dataUser = array('infoGeneral' => user::find($idUser), 'infoSocialin' => user::find($idUser)->socialin, 'infoExperience' => experienceModel::obtenerExperienciaPorUsuario($idUser), 'infoEducation' => educationModel::obtenerEstudiosPorUsuario($idUser), 'infoCourse' => courseModel::obtenerCursosPorUsuario($idUser)); // $doctor['infoLinkedin']['srcImage']=doctorModel::isImageHere($doctor['infoLinkedin']); // $doctor['infoLinkedin']['currentExperiences']=$exp->getCurrentExperience($idUser); // $doctor['infoLinkedin']['oldExperiences']=$exp->getOldExperience($idUser); // echo '<pre>';print_r($dataUser);exit; return view('perfil.show', ['dataUser' => $dataUser]); } else { //si el usuario no existe return redirect()->route('home'); } return view("perfil.show"); }
public function showEdit($id) { $menu = new menuModel(); $arrayMenu = $menu->generateMenu(); $isDoctor = $menu->isDoctor(); $exp = new experienceModel(); $doctor = array('infoGeneral' => doctorModel::find($id), 'infoLinkedin' => doctorModel::find($id)->linkedin, 'infoExperience' => json_decode(experienceModel::where('idtblDr', $id)->where('idcatstatus', '<>', '4')->orderBy('tblExperienceStartDate', 'desc')->get(), 2), 'infoEducation' => json_decode(educationModel::where('idtblDr', $id)->where('idcatstatus', '<>', '4')->orderBy('tblEducationStartDate', 'desc')->get(), 2), 'infoCourse' => json_decode(courseModel::where('idtblDr', $id)->where('idcatstatus', '<>', '4')->orderBy('tblCoursesDateInit', 'desc')->get(), 2)); $doctor['infoLinkedin']['srcImage'] = doctorModel::isImageHere($doctor['infoLinkedin']); $doctor['infoLinkedin']['currentExperiences'] = $exp->getCurrentExperience($id); $doctor['infoLinkedin']['oldExperiences'] = $exp->getOldExperience($id); return view('doctor.edit-perfil', ['doctor' => $doctor, 'menu' => $arrayMenu, 'isDoctor' => $isDoctor]); }
public function obtenerCursos($request) { $course = courseModel::where('idtblDr', '=', $request->idtblDr)->where('idcatstatus', '<>', '4')->get(); if ($course) { return Response::json(array('success' => '1', 'data' => $course, 'msg' => 'Registros obtenidos con exito.')); } else { return Response::json(array('success' => '0', 'data' => '', 'msg' => 'No hay registro asociados')); } }
public function updateStatusCourse($idtblCourses) { $education = ['idcatstatus' => '4']; if (courseModel::where('idtblCourses', '=', $idtblCourses)->update($education)) { return true; } else { return false; } }
public static function obtenerCursosPorUsuario($idUser) { $courses = json_decode(courseModel::where('idtblusers', $idUser)->where('idcatstatus', '<>', '4')->orderBy('tblcoursesdateinit', 'desc')->select('*', DB::raw("DATE_FORMAT(tblcoursesdateinit,' %M %Y ') as format_star_date_course"), DB::raw("CONCAT(TIMESTAMPDIFF(MONTH,tblcoursesdateinit,tblcoursesdateend),' meses') AS diff_time"), DB::raw("IF(tblcoursescurrent=1,'Actual'," . DB::raw("DATE_FORMAT(tblcoursesdateend,' %M %Y ')") . ") AS tblcourseenddateIF"))->get(), 2); return $courses; }
public function obtenerCursos(Request $request) { $course = new courseModel(); $response = $course->obtenerCursos($request); return $response; }