public function listar() { $resultado = mysql_query("SELECT P.id, P.tipo, P.nome FROM pessoas P where p.tipo = 'medico'"); $lista = array(); while ($linha = mysql_fetch_array($resultado)) { $medico = new Medico(); $medico->setId($linha['id']); $medico->setNome($linha['nome']); $lista[] = $medico; } return $lista; }
public function postMedicos() { if (Request::ajax()) { $medico = new Medico(); //variables recibidas por el script bootstrap-table $search = Input::get('search'); //utilizada para buscar un médico en la base de datos $limit = Input::get('limit'); $offset = Input::get('offset'); //Si recibe la variable "search" vacía, obtiene todos los médicos, sino busca alguno en específico. //variable cantidad: sirve para conocer el total de registros y realizar la paginación de acuerdo al limit y offset. if (empty($search)) { $datos = $medico->datos_medico(0, 0, $limit, $offset); $cantidad = Medico::all()->count(); } else { //Obtiene todos los datos de los médicos que se buscan en la función "datos_medico" del modelo "medico" $datos = $medico->datos_medico($search, 1, $limit, $offset); //Funcion que recibe cuantos registros se obtienen al realizar la búsqueda. $c = DB::select("SELECT count(id) as cantidad FROM medicos WHERE concat(`cedula`,' ',`primer_nombre`,' ',`apellido_paterno`) LIKE '%" . $search . "%'"); $cantidad = $c[0]->cantidad; } $n = 1; $comilla = "'"; $data = array(); //ciclo para obtener todos los datos del médico y guardarlos en la variable "data" foreach ($datos as $medicos) { $img = '<img src=' . $comilla . URL::to('imgs/' . $medicos->foto) . $comilla . ' style=' . $comilla . 'width:50px;height:50px;' . $comilla . '>'; if (GrupoUsuario::where('id', Auth::user()->id_grupo_usuario)->first()->grupo_usuario != "RECEPCION") { $url = '<a href=' . $comilla . route('datos.medicos.edit', $medicos->id) . $comilla . ' class=' . $comilla . 'btn btn-success btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Editar Médico' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-pencil' . $comilla . '></span> Editar </a> <a href=' . $comilla . '#Show' . $comilla . ' id=' . $comilla . '' . $medicos->id . '' . $comilla . ' onclick=' . $comilla . 'show(' . $medicos->id . ');' . $comilla . ' class=' . $comilla . 'btn btn-info btn-sm' . $comilla . ' data-toggle=' . $comilla . 'modal' . $comilla . ' title=' . $comilla . 'Ver Médico' . $comilla . ' style=' . $comilla . 'margin:3px 0px;' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-eye-open' . $comilla . '></span> Ver </a> <a href=' . $comilla . '#' . $comilla . ' data-id=' . $comilla . '' . $medicos->id . '' . $comilla . ' onclick=' . $comilla . 'eliminar(' . $medicos->id . ');' . $comilla . ' class=' . $comilla . 'btn btn-danger btn-delete btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Eliminar' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-remove' . $comilla . '></span> Eliminar </a>'; } else { $url = '<a href=' . $comilla . route('datos.medicos.edit', $medicos->id) . $comilla . ' class=' . $comilla . 'btn btn-success btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Cargar Médico' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-search' . $comilla . '></span> Cargar </a> <a href=' . $comilla . '#Show' . $comilla . ' id=' . $comilla . '' . $medicos->id . '' . $comilla . ' onclick=' . $comilla . 'show(' . $medicos->id . ');' . $comilla . ' class=' . $comilla . 'btn btn-info btn-sm' . $comilla . ' data-toggle=' . $comilla . 'modal' . $comilla . ' title=' . $comilla . 'Ver Médico' . $comilla . ' style=' . $comilla . 'margin:3px 0px;' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-eye-open' . $comilla . '></span> Ver </a>'; } $data[] = array('num' => $n, 'foto' => $img, 'cedula' => $medicos->cedula, 'name' => $medicos->primer_nombre . ' ' . $medicos->segundo_nombre . ' ' . $medicos->apellido_paterno . ' ' . $medicos->apellido_materno, 'ext' => $medicos->extension, 'tel' => $medicos->telefono, 'cel' => $medicos->celular, 'esp' => $medicos->especialidad, 'url' => $url); $n++; } return Response::json(array('total' => $cantidad, 'rows' => $data)); } else { App::abort(403); } }
/** * Resets all references to other model objects or collections of model objects. * * This method is a user-space workaround for PHP's inability to garbage collect * objects with circular references (even in PHP 5.3). This is currently necessary * when using Propel in certain daemon or large-volume/high-memory operations. * * @param boolean $deep Whether to also clear the references on all referrer objects. */ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; if ($this->aMedico instanceof Persistent) { $this->aMedico->clearAllReferences($deep); } if ($this->aPaciente instanceof Persistent) { $this->aPaciente->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) $this->aMedico = null; $this->aPaciente = null; }
public function getCita($id) { //Declarar un arreglo para devolver los resultados. $parameter = array(); //Se instancian los objetos necesarios. $paciente = new Paciente(); $condiciones = new CondicionEnfermedad(); //Sentencia para crear un objeto para realizar los documentos PDF. $pdf = App::make('dompdf'); //Se almacena los datos pertenecientes a la cita. $parameter['cita'] = Cita::find($id); //Se almacena los datos pertenecientes al pacientes. $parameter['datos'] = $paciente->datos_pacientes($parameter['cita']->id_paciente); //Se busca la institucion respectiva del ID almacenado en la cita. $institucion = Institucion::find($parameter['cita']->id_institucion); if (empty($institucion)) { $parameter['institucion'] = new Institucion(); $parameter['institucion']->denominacion = 'No Definido'; } else { $parameter['institucion'] = Institucion::find($parameter['cita']->id_institucion); } //Se busca y se almacena al medico perteneciente al ID que se almaceno en la cita. $medico = Medico::find($parameter['cita']->id_medico); if (empty($medico)) { $parameter['medico'] = new Medico(); $parameter['medico']->primer_nombre = 'No'; $parameter['medico']->apellido_paterno = 'Definido'; } else { $parameter['medico'] = Medico::find($parameter['cita']->id_medico); } //Se busca y se almacenan los datos pertenecientes a los marcadores de la cita. $parameter['marcadores'] = MarcadorCita::where('id_cita', $id)->where('valor', '<>', '0')->get(); $parameter['cantidad'] = MarcadorCita::where('id_cita', $id)->where('valor', '<>', '0')->count(); //Se llama a la funcion obtenerEnfermedades que me devuelve un arreglo con las enfermedades que dieron positivo y negativo de la cita //correspondiente al ID que le envio. $parameter['resultados'] = $condiciones->obtenerEnfermedades($id); //Cargo la vista mandandole los respectivos datos correspondientes almacenados en el arreglo $parameter. $pdf = PDF::loadView('datos/citas/Print', $parameter); //Creo el archivo pdf y lo almaceno utilizando la cedula como el nombre del archivo. return $pdf->stream('' . $parameter['datos'][0]->cedula . '.pdf', array("Attachment" => false)); }
function datos_medico($id, $sw = 0, $limit = 10, $offset = 0) { if ($sw == 0) { if ($id == 0) { //obtiene todos los medicos $datos = DB::select("SELECT * FROM medicos WHERE id > 0 LIMIT " . $offset . "," . $limit . ";"); } else { $datos[0] = Medico::find($id); } } else { //Realiza la busqueda de los médicos por su nombre completo. $datos = DB::select("SELECT * FROM medicos WHERE concat(`cedula`,' ',`primer_nombre`,' ',`apellido_paterno`) LIKE '%" . $id . "%' LIMIT " . $offset . "," . $limit . ";"); } $x = 0; foreach ($datos as $medico) { if (empty($datos[$x]->foto)) { $foto = "default1.png"; } else { $foto = $datos[$x]->foto; } $datos[$x]->foto = $foto; if (!empty($medico->id_especialidades_medicas)) { $datos[$x]->especialidad = EspecialidadMedica::where('id_especialidades_medicas', $medico->id_especialidades_medicas)->first()->descripcion; } else { $datos[$x]->especialidad = 'POR DEFINIR'; } //Funciones para detectar si no esta vacio el campo retorna el valor de la busqueda al modal. if (!empty($medico->id_nivel)) { $datos[$x]->nivel = Nivel::where('id', $medico->id_nivel)->first()->nivel; } else { $datos[$x]->nivel = 'POR DEFINIR'; } if (!empty($medico->id_ubicacion)) { $datos[$x]->ubicacion = Ubicacion::where('id', $medico->id_ubicacion)->first()->ubicacion; } else { $datos[$x]->ubicacion = 'POR DEFINIR'; } $x++; } return $datos; }
/** * */ function listaExterna() { global $db; // Database connection $odbconn = MDB2::connect($db['dsn'], $db['opts']); $odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC); // listado de consultas disponibles $sql = "SELECT id,nombre1,nombre2,apellido1,apellido2, fecha_cita,to_char(hora_cita, 'HH12:MI PM') as hora_cita,\n telefono,celular,fecha_creacion,email,id_medico\n FROM solicitud_cita\n WHERE estado = '2'"; $pager_options = array('mode' => 'Sliding', 'perPage' => 16, 'delta' => 2, 'extraVars' => array('a' => $_REQUEST['a'])); $data = Pager_Wrapper_MDB2($odbconn, $sql, $pager_options); // Mensaje a mostrar en el template $msj = flashData(); // Muestra el template $Medico = new Medico(); $medicos = $Medico->lista(); $lmedico = arregloLista($medicos); include getTemplate('cita.externalista.php'); }
public function recuperarparamodificar($id) { $medeicoeditar = Medico::where('codmedico', '=', $id)->get(); return View::make('medico.modificar')->with('medeicoeditar', $medeicoeditar); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Medico::destroy($id); return Response::json(['success' => true, 'route' => 'datos/medicos']); }
/** * Resets all references to other model objects or collections of model objects. * * This method is a user-space workaround for PHP's inability to garbage collect * objects with circular references (even in PHP 5.3). This is currently necessary * when using Propel in certain daemon or large-volume/high-memory operations. * * @param boolean $deep Whether to also clear the references on all referrer objects. */ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; if ($this->collCargoconsultas) { foreach ($this->collCargoconsultas as $o) { $o->clearAllReferences($deep); } } if ($this->collConsultaanticipos) { foreach ($this->collConsultaanticipos as $o) { $o->clearAllReferences($deep); } } if ($this->collFacturas) { foreach ($this->collFacturas as $o) { $o->clearAllReferences($deep); } } if ($this->aConsultorio instanceof Persistent) { $this->aConsultorio->clearAllReferences($deep); } if ($this->aMedico instanceof Persistent) { $this->aMedico->clearAllReferences($deep); } if ($this->aPaciente instanceof Persistent) { $this->aPaciente->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) if ($this->collCargoconsultas instanceof PropelCollection) { $this->collCargoconsultas->clearIterator(); } $this->collCargoconsultas = null; if ($this->collConsultaanticipos instanceof PropelCollection) { $this->collConsultaanticipos->clearIterator(); } $this->collConsultaanticipos = null; if ($this->collFacturas instanceof PropelCollection) { $this->collFacturas->clearIterator(); } $this->collFacturas = null; $this->aConsultorio = null; $this->aMedico = null; $this->aPaciente = null; }
function listar() { require_once "../modelo/Medico.php"; $medico = new Medico(); return $medico->listar(); }
/** * Exclude object from result * * @param Medico $medico Object to remove from the list of results * * @return MedicoQuery The current query, for fluid interface */ public function prune($medico = null) { if ($medico) { $this->addUsingAlias(MedicoPeer::IDMEDICO, $medico->getIdmedico(), Criteria::NOT_EQUAL); } return $this; }
<?php include "../model/class.connect.php"; include "../model/class.medico.php"; @($action = $_POST['action']); @($crn = $_POST['crn']); @($nome_completo = $_POST['nome_completo']); @($cpf = $_POST['cpf']); @($data_nasc = $_POST['data_nasc']); @($telefone = $_POST['telefone']); @($endereco = $_POST['endereco']); @($nome_user = $_POST['nome_user']); @($senha = $_POST['senha']); @($id = $_POST['id']); $medico = new Medico(); $medico->setCrn($crn); $medico->setNome_completo($nome_completo); $medico->setCpf($cpf); $medico->setData_nasc($data_nasc); $medico->setTelefone($telefone); $medico->setEndereco($endereco); $medico->setNome_user($nome_user); $medico->setSenha($senha); $medico->setId($id); switch ($action) { case 'cadastrar_medico': $valor = $medico->cadastrar_medico(); if ($valor == 1) { echo "<script> \n\t\t\t\talert('Cadastro concluido com sucesso!'); \n\t\t\t\twindow.location.href = 'http://localhost:8080/projects/webconsulte_dev/cadastro_medico.html'; \n\t\t\t </script>"; } else { echo "Falha ao inserir!";
<?php include_once realpath(dirname(__FILE__) . '/Medico.class.php'); $Medico = new Medico(); switch ($_REQUEST['a']) { case 'listar': permisos(CONFIGURACION, 'r'); $Medico->listar(); break; case 'ingresarForm': permisos(CONFIGURACION, 'w'); $Medico->ingresarForm(); break; case 'ingresar': permisos(CONFIGURACION, 'w'); $Medico->ingresar(); break; case 'actualizarForm': permisos(CONFIGURACION, 'u'); $Medico->actualizarForm(); break; case 'actualizar': permisos(CONFIGURACION, 'u'); $Medico->actualizar(); break; case 'eliminar': permisos(CONFIGURACION, 'd'); $Medico->eliminar($_REQUEST['id']); break; }
/** * Filter the query by a related Medico object * * @param Medico|PropelObjectCollection $medico the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return EspecialidadQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByMedico($medico, $comparison = null) { if ($medico instanceof Medico) { return $this->addUsingAlias(EspecialidadPeer::IDESPECIALIDAD, $medico->getIdespecialidad(), $comparison); } elseif ($medico instanceof PropelObjectCollection) { return $this->useMedicoQuery()->filterByPrimaryKeys($medico->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByMedico() only accepts arguments of type Medico or PropelCollection'); } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Medico the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Medico::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php include '../../../CapaDatos/conexion.class.php'; include "../../../CapaNegocio/pacientehistoriaclinica.class.php"; include "../../../CapaNegocio/medico.class.php"; include "../../../CapaNegocio/cita.class.php"; include "../../../CapaNegocio/persona.class.php"; //instanciar clase $personaCl = new Persona('', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); //instanciar clase $PacienteCl = new pacientehistoriaclinica('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); $MedicoCl = new Medico('', '', '', '', '', '', '', '', '', '', '', '', ''); $CitaCl = new Cita('', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); //cargar ddl medico y paciente $datosMedico = $MedicoCl->listarMedico(0); $datosPaciente = $PacienteCl->listarPacienteHistoriaClinica(0); //$datosCita=$CitaCl->listarCita(0); //consultar todas las citas //crear/actualizar data.js $fh = fopen("data.js", 'w') or die("Error opening output file"); fwrite($fh, "data=" . $CitaCl->mostrarEvento() . ";"); fclose($fh); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Mundo Dental | Agenda</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <?php include_once "../cargarcss.php"; ?>
public function getValidarCedM() { $data = Input::all(); $medico = Medico::where('cedula', $data['ced']); return $medico->get(['cedula']); }
/** * @param Medico $medico The medico object to add. */ protected function doAddMedico($medico) { $this->collMedicos[] = $medico; $medico->setEspecialidad($this); }
/** * Filter the query by a related Medico object * * @param Medico|PropelObjectCollection $medico The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MedicofacturacionQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByMedico($medico, $comparison = null) { if ($medico instanceof Medico) { return $this->addUsingAlias(MedicofacturacionPeer::IDMEDICO, $medico->getIdmedico(), $comparison); } elseif ($medico instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(MedicofacturacionPeer::IDMEDICO, $medico->toKeyValue('PrimaryKey', 'Idmedico'), $comparison); } else { throw new PropelException('filterByMedico() only accepts arguments of type Medico or PropelCollection'); } }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Medico $obj A Medico object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getIdmedico(); } // if key === null MedicoPeer::$instances[$key] = $obj; } }