Example #1
0
 public function __construct()
 {
     $menu = new menuModel();
     $this->arrayMenu = $menu->generateMenu();
     $this->isDoctor = $menu->isDoctor();
     $this->adWords = adwordsModel::getAllAdwords();
 }
Example #2
0
 public function listarServicios()
 {
     $menu = new menuModel();
     $arrayMenu = $menu->generateMenu();
     $hospital = new serviciosModel();
     $arrayHospitales = $hospital->listarHospitales();
     return view('hospital.show-all-hospital', ['hospitales' => $arrayHospitales, 'menu' => $arrayMenu]);
 }
Example #3
0
 public function listarProductos()
 {
     $menu = new menuModel();
     $arrayMenu = $menu->generateMenu();
     $isDoctor = $menu->isDoctor();
     $hospital = new productoModel();
     $arrayServicios = $hospital->listarProductos();
     return view('producto.show-all-producto', ['producto' => $arrayServicios, 'menu' => $arrayMenu, 'isDoctor' => $isDoctor]);
 }
Example #4
0
 public function edit($idcatHospital, $idServicio)
 {
     $menu = new menuModel();
     $arrayMenu = $menu->generateMenu();
     $isDoctor = $menu->isDoctor();
     $servicio = new servicioModel();
     $servicioProfile = $servicio->obtenerServicio($idcatHospital, $idServicio);
     return view('servicio.edit-perfil-servicio', ['servicio' => $servicioProfile, 'menu' => $arrayMenu, 'isDoctor' => $isDoctor]);
 }
Example #5
0
 public function show($idPaciente)
 {
     $menu = new menuModel();
     $arrayMenu = $menu->generateMenu();
     $isDoctor = $menu->isDoctor();
     $paciente = new pacienteModel();
     $pacienteResult = $paciente->getPaciente($idPaciente);
     $pacienteResult[0]->srcImage = pacienteModel::isImageHere($pacienteResult);
     return view('paciente.show-perfil', ['paciente' => $pacienteResult, 'menu' => $arrayMenu, 'isDoctor' => $isDoctor]);
 }
Example #6
0
 public function horarios($request, $id = false)
 {
     $respuesta = new dispModel();
     if ($respuesta->dispositivo($request)) {
         $horarios = $this->obtenerHorarios($request->idtblDr);
     } else {
         $menu = new menuModel();
         $horarios = view('agenda.agenda')->with('Labores', $this->obtenerHorarios($id))->with('isDoctor', $menu->isDoctor());
     }
     return $horarios;
 }
Example #7
0
 public function citasPaciente($request, $idtblpaciente = false)
 {
     $respuesta = new dispModel();
     if ($respuesta->dispositivo($request)) {
         $citas = $this->listarCitasPaciente($request->idtblpaciente);
     } else {
         $menu = new menuModel();
         $isDoctor = $menu->isDoctor();
         //            $c = $this->listarCitasPaciente($isDoctor['usuario']['id_usuario'],$idtblpaciente);
         $c = $this->listarCitasPaciente($idtblpaciente);
         $d = $this->listarCitasPacienteSolitadas($idtblpaciente);
         $e = $this->listarCitasPacientePorAprobar($idtblpaciente);
         $flagYear = 0;
         if (!$c) {
             $c = false;
         } else {
             foreach ($c as $ind_p => $p) {
                 $src = pacienteModel::isImageHereGroup($p);
                 $c[$ind_p]->srcImage = $src['srcImage'];
                 if ($flagYear != $p->anio_reserva) {
                     $flagYear = $p->anio_reserva;
                     $c[$ind_p]->changeYear = 1;
                 } else {
                     $c[$ind_p]->changeYear = 0;
                 }
             }
         }
         if (!$d) {
             $d = false;
         } else {
             foreach ($d as $ind_p => $p) {
                 $src = pacienteModel::isImageHereGroup($p);
                 $d[$ind_p]->srcImage = $src['srcImage'];
                 if ($flagYear != $p->anio_reserva) {
                     $flagYear = $p->anio_reserva;
                     $d[$ind_p]->changeYear = 1;
                 } else {
                     $d[$ind_p]->changeYear = 0;
                 }
             }
         }
         if (!$e) {
             $e = false;
         } else {
             foreach ($e as $ind_p => $p) {
                 $src = pacienteModel::isImageHereGroup($p);
                 $e[$ind_p]->srcImage = $src['srcImage'];
                 if ($flagYear != $p->anio_reserva) {
                     $flagYear = $p->anio_reserva;
                     $e[$ind_p]->changeYear = 1;
                 } else {
                     $e[$ind_p]->changeYear = 0;
                 }
             }
         }
         $citas = view('paciente.mis-citas')->with('citas', $c)->with('citasSolictadas', $d)->with('citasPorAprobar', $e)->with('isDoctor', $isDoctor);
     }
     return $citas;
 }
Example #8
0
 public function edit($id)
 {
     $menu = new menuModel();
     $arrayMenu = $menu->generateMenu();
     $isDoctor = $menu->isDoctor();
     $hospital = new hospitalModel();
     $hospitalProfile = $hospital->obtenerHospital($id);
     return view('hospital.edit-perfil-hospital', ['hospital' => $hospitalProfile, 'menu' => $arrayMenu, 'isDoctor' => $isDoctor]);
 }
Example #9
0
 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]);
 }
Example #10
0
 public function listarDoctoresLimit($rows = 50, $limit = 0, $catSiglasHospital = false, $especialidad = false)
 {
     $menu = new menuModel();
     $isDoctor = $menu->isDoctor();
     if ($isDoctor['isDoctor']) {
         if ($catSiglasHospital != false && $especialidad != false) {
             $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->where('tbllinkedindr.tblLinkedInDrProfHead', 'LIKE', "%" . $especialidad . "%")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
             $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->where('tbllinkedindr.tblLinkedInDrProfHead', 'LIKE', "%" . $especialidad . "%")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
         } else {
             if ($catSiglasHospital != false) {
                 $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
                 $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
             } else {
                 $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
                 $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('tbldr.idtblDr', '<>', $isDoctor['usuario']['id_usuario'])->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
             }
         }
     } else {
         if ($catSiglasHospital != false && $especialidad != false) {
             $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->where('tbllinkedindr.tblLinkedInDrProfHead', 'LIKE', "%" . $especialidad . "%")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
             $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->where('tbllinkedindr.tblLinkedInDrProfHead', 'LIKE', "%" . $especialidad . "%")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
         } else {
             if ($catSiglasHospital != false) {
                 $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
                 $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->where('cathospital.catSiglas', '=', "{$catSiglasHospital}")->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
             } else {
                 $datos = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit)->get();
                 $datos2 = DB::table('tbldr')->join('tbllinkedindr', 'tbllinkedindr.idtblDr', '=', 'tbldr.idtblDr')->join('cathospital', 'cathospital.catSiglas', '=', 'tbldr.cathospital')->orderby('tbldr.tblDoctorName', 'asc')->take($rows)->skip($limit + $rows)->get();
             }
         }
     }
     $datos = json_encode($datos);
     $datos2 = json_encode($datos2);
     //$datos=$this->obtenerTodosLosDoctores();
     $arrayDoctores = json_decode($datos, 2);
     $arrayDoctoresFuture = json_decode($datos2, 2);
     $disabled = count($arrayDoctoresFuture) > 0 ? 0 : 1;
     $fileSystem = new Filesystem();
     if (count($arrayDoctores) > 0) {
         foreach ($arrayDoctores as $ind => $aDoctores) {
             if ($aDoctores['tblLinkedInDrImg'] == "") {
                 $arrayDoctores[$ind]['srcImage'] = '/img/contacto_foto.jpg';
             } else {
                 if (!$fileSystem->exists("upload/doctores/{$aDoctores['idtblDr']}/profile_img/" . $aDoctores['tblLinkedInDrImg'])) {
                     $arrayDoctores[$ind]['srcImage'] = '/img/contacto_foto.jpg';
                 } else {
                     $arrayDoctores[$ind]['srcImage'] = "/upload/doctores/{$aDoctores['idtblDr']}/profile_img/" . $aDoctores['tblLinkedInDrImg'];
                 }
             }
         }
         foreach ($arrayDoctores as $ind => $aDoc) {
             $alertas = DB::table('catalertas')->get();
             $arrayDoctores[$ind]['modalAgenda'] = $isDoctor['isDoctor'] ? view('agenda.agenda-doctor-modal')->with('isDoctor', $isDoctor)->with('doctor', $aDoc)->with('alertas', $alertas)->render() : view('agenda.agenda-patient-modal')->with('isDoctor', $isDoctor)->with('doctor', $aDoc)->with('alertas', $alertas)->render();
         }
         $view = view('doctor.rows-doctor', ['doctores' => $arrayDoctores, 'isDoctor' => $isDoctor])->render();
         $estado = "1";
         $msg = "Celdas cargadas correctamente";
     } else {
         $view = "";
         $estado = "0";
         $msg = "No hay mas registros disponibles";
     }
     return json_encode(array("rows" => $view, "estado" => $estado, "msg" => $msg, "disabled" => $disabled));
 }
Example #11
0
 public function obtenerServicio($idcatHospital = false, $idServicio)
 {
     $menu = new menuModel();
     $hospitalModel = new hospitalModel();
     $isDoctor = $menu->isDoctor();
     if ($idcatHospital != false) {
         $servicio = servicioModel::join('tblhospitalesservicios as b', 'b.idcatservicio', '=', 'catservicios.idcatservicio')->join('cathospital as c', 'c.idcatHospital', '=', 'b.idcathospital')->where("catservicios.idcatservicio", "=", $idServicio)->where("c.idcatHospital", "=", $idcatHospital)->firstOrFail();
         $servicio->cuadroMedico = $this->obtenerCuadroMedico($idcatHospital, $idServicio);
     } else {
         $servicio = servicioModel::join('tblhospitalesservicios as b', 'b.idcatservicio', '=', 'catservicios.idcatservicio')->join('cathospital as c', 'c.idcatHospital', '=', 'b.idcathospital')->where("catservicios.idcatservicio", "=", $idServicio)->firstOrFail();
         $servicio->cuadroMedico = false;
     }
     $hospitales = $hospitalModel->listarHospitales();
     $servicio->srcImage = $this->isImageHere($servicio);
     $servicio->hospitales = $this->hospitalByServicio($idServicio);
     foreach ($servicio->hospitales as $ind => $hs) {
         $hospitales[$hs->idcatHospital]['checked'] = "checked";
         $hospitales[$hs->idcatHospital]['catservicioimage'] = $hs->catservicioimage;
         $hospitales[$hs->idcatHospital]['catservicioimagebanner'] = $hs->catservicioimagebanner;
         $hospitales[$hs->idcatHospital]['tbltelefonoservicio'] = $hs->tbltelefonoservicio;
         $hospitales[$hs->idcatHospital]['tblextservicio'] = $hs->tblextservicio;
         $hospitales[$hs->idcatHospital]['tblresponsableservicio'] = $hs->tblresponsableservicio;
         $hospitales[$hs->idcatHospital]['tblhorarioservicio'] = $hs->tblhorarioservicio;
     }
     $servicio->listaHospitales = $hospitales;
     //        echo '<pre>';print_r($servicio->listaHospitales);exit;
     $alertas = DB::table('catalertas')->get();
     $servicio->modalAgenda = view('agenda.agenda-servicio-modal')->with('isDoctor', $isDoctor)->with('servicio', $servicio)->with('alertas', $alertas);
     return $servicio;
 }
Example #12
0
 public function cargarCSV($request)
 {
     echo '<pre>';
     print_r($request->all());
     exit;
     $respuesta = new dispModel();
     if ($respuesta->dispositivo($request)) {
         $asistentes = floresRegalosModel::all();
         if ($asistentes) {
             return Response::json(array('success' => '1', 'data' => $asistentes, 'msg' => 'Registros obtenidos con exito.'));
         } else {
             return Response::json(array('success' => '0', 'data' => '', 'msg' => 'No hay registro asociados'));
         }
     } else {
         $menu = new menuModel();
         $isDoctor = $menu->isDoctor();
         $flores = floresRegalosModel::all();
         foreach ($flores as $ind => $f) {
             $flores[$ind]->srcImage = $this->isImageHere($flores[$ind]);
         }
         return view('flores.show-all-floresregalos', ['flores' => $flores, 'isDoctor' => $isDoctor]);
     }
 }