Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 public function asignarDoctor($request)
 {
     $respuesta = new dispModel();
     if ($respuesta->dispositivo($request)) {
         $asistente = $this->find($request->idtblasistente);
         if ($asistente->tblasistenteDoctores == "") {
             $asistente->tblasistenteDoctores = $request->tblasistenteDoctores;
         } else {
             $asistente->tblasistenteDoctores = $asistente->tblasistenteDoctores . ',' . $request->tblasistenteDoctores;
         }
         if (!$asistente->save()) {
             return Response::json(array('estado' => '0', 'msg' => 'Error al Editar el asistente'));
         } else {
             return Response::json(array('estado' => '1', 'msg' => 'Asistente se ha editado satisfactoriamente'));
         }
     } else {
         $asistente = $this->find($request->idtblasistente);
         if ($asistente->tblasistenteDoctores == "") {
             $asistente->tblasistenteDoctores = $request->tblasistenteDoctores;
         } else {
             $asistente->tblasistenteDoctores = $asistente->tblasistenteDoctores . ',' . $request->tblasistenteDoctores;
         }
         if (!$asistente->save()) {
             return Response::json(array('estado' => '0', 'msg' => 'Error al Editar el asistente'));
         } else {
             return Response::json(array('estado' => '1', 'msg' => 'Asistente se ha editado satisfactoriamente'));
         }
     }
 }
Ejemplo n.º 4
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]);
     }
 }