/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { $this->layout = 'sitio'; $especialidades = CHtml::listData(Especialidad::model()->findAll(), 'especialidad_id', 'especialidad_nombre'); $buscarProfesionalApellidoModel = new BuscarProfesionalApellido(); $buscarProfesionalEspecialidadModel = new BuscarProfesionalEspecialidad(); // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' $this->render('index', array('buscarProfesionalApellidoModel' => $buscarProfesionalApellidoModel, 'buscarProfesionalEspecialidadModel' => $buscarProfesionalEspecialidadModel, 'especialidades' => $especialidades)); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $profesional = Profesional::leftJoin('especialidades', 'especialidades.id', '=', 'profesionales.especialidades_id')->leftJoin('sedes_profesionales', 'sedes_profesionales.profesional_id', '=', 'profesionales.id')->leftJoin('sedes', 'sedes.id', '=', 'sedes_profesionales.sede_id')->leftJoin('users', 'users.id', '=', 'profesionales.user_id')->groupBy('profesionales.id')->select('sedes.nombre', 'profesionales.id as p_id', 'profesionales.*', 'users.firstname as u_n', 'users.lastname as u_a', 'especialidades.*', DB::raw('GROUP_CONCAT(sedes.id) as sedes_pid'))->find($id); $sedes_pid = explode(',', $profesional->sedes_pid); $especialidades = Especialidad::lists('especialidad', 'id'); $sedes = Sedes::get(); $profesionales_cuser = Profesional::where('user_id', '!=', 0)->lists('user_id'); $usuarios = User::whereNotIn('id', $profesionales_cuser)->get()->lists('fullname', 'id'); $usuarios[0] = '-- Ninguno --'; asort($usuarios); return View::make('profesionales.edit')->with('profesional', $profesional)->with('sedes', $sedes)->with('especialidades', $especialidades)->with(array('sedes_pid' => $sedes_pid, 'usuarios' => $usuarios)); }
/** * 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->aEspecialidad instanceof Persistent) { $this->aEspecialidad->clearAllReferences($deep); } if ($this->aMedico instanceof Persistent) { $this->aMedico->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) $this->aEspecialidad = null; $this->aMedico = null; }
function crearDatosRpc() { $objTipoOrg = new TipoOrganizacion(); $objEspecialidad = new Especialidad(); $objProveedor = new Proveedor(); $objBeneficiario = new Beneficiario(); //Insertar tipo de organización por defecto $objTipoOrg->codtipoorg = '--'; $objTipoOrg->dentipoorg = '---seleccione---'; $objTipoOrg->incluir(); //Insertar especialidad por defecto $objEspecialidad->codesp = '---'; $objEspecialidad->denesp = '---seleccione---'; $objEspecialidad->incluir(); //Insertar proveedor por defecto $objProveedor->codemp = '0001'; $objProveedor->cod_pro = '----------'; $objProveedor->nompro = 'Ninguno'; $objProveedor->dirpro = '-'; $objProveedor->telpro = ''; $objProveedor->faxpro = ''; $objProveedor->nacpro = ''; $objProveedor->rifpro = ''; $objProveedor->nitpro = ''; $objProveedor->fecreg = '1900-01-01'; $objProveedor->capital = 0; $objProveedor->sc_cuenta = ''; $objProveedor->obspro = ''; $objProveedor->estpro = 1; $objProveedor->estcon = 0; $objProveedor->estaso = 0; $objProveedor->ocei_fec_reg = '1900-01-01'; $objProveedor->ocei_no_reg = ''; $objProveedor->monmax = 0; $objProveedor->cedrep = ''; $objProveedor->nomreppro = ''; $objProveedor->emailrep = ''; $objProveedor->carrep = ''; $objProveedor->registro = ''; $objProveedor->nro_reg = ''; $objProveedor->tomo_reg = ''; $objProveedor->folreg = ''; $objProveedor->fecregmod = '1900-01-01'; $objProveedor->regmod = ''; $objProveedor->nummod = ''; $objProveedor->tommod = ''; $objProveedor->folmod = ''; $objProveedor->inspector = 0; $objProveedor->foto = ''; $objProveedor->codbansig = '---'; $objProveedor->codban = '---'; $objProveedor->codmon = '---'; $objProveedor->codtipoorg = '--'; $objProveedor->codesp = '---'; $objProveedor->ctaban = '---'; $objProveedor->numlic = ''; $objProveedor->fenvenrnc = '1900-01-01'; $objProveedor->numregsso = ''; $objProveedor->fecvensso = '1900-01-01'; $objProveedor->numregince = ''; $objProveedor->fecvenince = '1900-01-01'; $objProveedor->estprov = 0; $objProveedor->pagweb = ''; $objProveedor->email = ''; $objProveedor->codpai = '---'; $objProveedor->codest = '---'; $objProveedor->codmun = '---'; $objProveedor->codpar = '---'; $objProveedor->graemp = ''; $objProveedor->tipconpro = ''; $objProveedor->sc_cuentarecdoc = ''; $objProveedor->sc_ctaant = ''; $objProveedor->incluir(); //Insertar beneficiario por defecto $objBeneficiario->codemp = '0001'; $objBeneficiario->ced_bene = '----------'; $objBeneficiario->codpai = '---'; $objBeneficiario->codest = '---'; $objBeneficiario->codmun = '---'; $objBeneficiario->codpar = '---'; $objBeneficiario->codtipcta = ''; $objBeneficiario->rifben = ''; $objBeneficiario->nombene = 'Beneficiario Nulo'; $objBeneficiario->apebene = ''; $objBeneficiario->dirbene = ''; $objBeneficiario->telbene = ''; $objBeneficiario->celbene = ''; $objBeneficiario->email = ''; $objBeneficiario->sc_cuenta = ''; $objBeneficiario->codbansig = '---'; $objBeneficiario->codban = ''; $objBeneficiario->ctaban = ''; $objBeneficiario->foto = ''; $objBeneficiario->fecregben = '1900-01-01'; $objBeneficiario->nacben = ''; $objBeneficiario->numpasben = ''; $objBeneficiario->tipconben = ''; $objBeneficiario->tipcuebanben = ''; $objBeneficiario->sc_cuentarecdoc = ''; $objBeneficiario->incluir(); unset($objTipoOrg); unset($objEspecialidad); unset($objProveedor); unset($objBeneficiario); }
/** * Filter the query by a related Especialidad object * * @param Especialidad|PropelObjectCollection $especialidad The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return AgendaQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByEspecialidad($especialidad, $comparison = null) { if ($especialidad instanceof Especialidad) { return $this->addUsingAlias(AgendaPeer::SERVICIO, $especialidad->getId(), $comparison); } elseif ($especialidad instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(AgendaPeer::SERVICIO, $especialidad->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByEspecialidad() only accepts arguments of type Especialidad or PropelCollection'); } }
/** * Reload all already loaded nodes to sync them with updated db * * @param Especialidad $prune Object to prune from the update * @param PropelPDO $con Connection to use. */ public static function updateLoadedNodes($prune = null, PropelPDO $con = null) { if (Propel::isInstancePoolingEnabled()) { $keys = array(); foreach (EspecialidadPeer::$instances as $obj) { if (!$prune || !$prune->equals($obj)) { $keys[] = $obj->getPrimaryKey(); } } if (!empty($keys)) { // We don't need to alter the object instance pool; we're just modifying these ones // already in the pool. $criteria = new Criteria(EspecialidadPeer::DATABASE_NAME); $criteria->add(EspecialidadPeer::ID, $keys, Criteria::IN); $stmt = EspecialidadPeer::doSelectStmt($criteria, $con); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key = EspecialidadPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($object = EspecialidadPeer::getInstanceFromPool($key))) { $object->setLeftValue($row[6]); $object->setRightValue($row[7]); $object->setLevel($row[8]); $object->clearNestedSetChildren(); } } $stmt->closeCursor(); } } }
/** * 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 Especialidad the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Especialidad::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { $especi = Especialidad::find($id); $especi->update(Input::all()); return Redirect::action('EspecialidadController@index')->with('message', 'Especialidad actualizada'); }
/** * 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->collAdmisions) { foreach ($this->collAdmisions as $o) { $o->clearAllReferences($deep); } } if ($this->collCitas) { foreach ($this->collCitas as $o) { $o->clearAllReferences($deep); } } if ($this->collConsultas) { foreach ($this->collConsultas as $o) { $o->clearAllReferences($deep); } } if ($this->collMedicoespecialidads) { foreach ($this->collMedicoespecialidads as $o) { $o->clearAllReferences($deep); } } if ($this->collMedicofacturacions) { foreach ($this->collMedicofacturacions as $o) { $o->clearAllReferences($deep); } } if ($this->aEspecialidad instanceof Persistent) { $this->aEspecialidad->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) if ($this->collAdmisions instanceof PropelCollection) { $this->collAdmisions->clearIterator(); } $this->collAdmisions = null; if ($this->collCitas instanceof PropelCollection) { $this->collCitas->clearIterator(); } $this->collCitas = null; if ($this->collConsultas instanceof PropelCollection) { $this->collConsultas->clearIterator(); } $this->collConsultas = null; if ($this->collMedicoespecialidads instanceof PropelCollection) { $this->collMedicoespecialidads->clearIterator(); } $this->collMedicoespecialidads = null; if ($this->collMedicofacturacions instanceof PropelCollection) { $this->collMedicofacturacions->clearIterator(); } $this->collMedicofacturacions = null; $this->aEspecialidad = null; }
echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 100)); ?> <?php echo $form->error($model, 'email'); ?> </div> <div class="span2"> <?php echo $form->labelEx($model, 'especialidad_id'); ?> <?php echo $form->dropDownList($model, 'especialidad_id', CHtml::listData(Especialidad::model()->findAll(), 'id', 'nombre'), array('prompt' => 'Seleccione Especialidad')); ?> <?php echo $form->error($model, 'especialidad_id'); ?> </div> <div class="clearfix"></div> <br/> <div class="span2"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar', array('class' => 'btn')); ?> </div> <br/>
/** * Filter the query to restrict the result to roots of an object. * Same as ancestorsOf(), except that it includes the object passed as parameter in the result * * @param Especialidad $especialidad The object to use for roots search * * @return EspecialidadQuery The current query, for fluid interface */ public function rootsOf($especialidad) { return $this->inTree($especialidad->getScopeValue())->addUsingAlias(EspecialidadPeer::LEFT_COL, $especialidad->getLeftValue(), Criteria::LESS_EQUAL)->addUsingAlias(EspecialidadPeer::RIGHT_COL, $especialidad->getRightValue(), Criteria::GREATER_EQUAL); }
/** * 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 Especialidad $obj A Especialidad 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->getIdespecialidad(); } // if key === null EspecialidadPeer::$instances[$key] = $obj; } }
/** * Moves current node and its subtree to be the next sibling of $sibling * The modifications in the current object and the tree are immediate * * @param Especialidad $sibling Propel object for sibling node * @param PropelPDO $con Connection to use. * * @return Especialidad The current Propel object */ public function moveToNextSiblingOf($sibling, PropelPDO $con = null) { if (!$this->isInTree()) { throw new PropelException('A Especialidad object must be already in the tree to be moved. Use the insertAsNextSiblingOf() instead.'); } if ($sibling->isRoot()) { throw new PropelException('Cannot move to next sibling of a root node.'); } if ($sibling->getScopeValue() != $this->getScopeValue()) { throw new PropelException('Moving nodes across trees is not supported'); } if ($sibling->isDescendantOf($this)) { throw new PropelException('Cannot move a node as sibling of one of its subtree nodes.'); } $this->moveSubtreeTo($sibling->getRightValue() + 1, $sibling->getLevel() - $this->getLevel(), $con); return $this; }
/** * Declares an association between this object and a Especialidad object. * * @param Especialidad $v * @return Agenda The current object (for fluent API support) * @throws PropelException */ public function setEspecialidad(Especialidad $v = null) { if ($v === null) { $this->setServicio(NULL); } else { $this->setServicio($v->getId()); } $this->aEspecialidad = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Especialidad object, it will not be re-added. if ($v !== null) { $v->addAgenda($this); } return $this; }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $model = new Especialidad(); $labels = $model->attributeNames(); $data = $model->findAll(); //var_dump($labels); //var_dump($data); $excel = Yii::app()->excel; //Crea una instancia $excel->getActiveSheet()->getStyle('A1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FFFF0000'); $excel->getActiveSheet()->getStyle('A2:E2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('0000FF00'); $excel->getActivesheet()->getStyle('A2:E2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THICK); $excel->getActiveSheet()->mergeCells('A1:E1'); $excel->getActiveSheet()->setCellValue('A1', 'INFORME MENSUAL'); $excel->getActiveSheet()->setCellValue('A2', $labels[0]); $excel->getActiveSheet()->setCellValue('B2', $labels[1]); $excel->getActiveSheet()->setCellValue('C2', 'Categoria'); $excel->getActiveSheet()->setCellValue('D2', $labels[2]); $excel->getActiveSheet()->setCellValue('E2', $labels[5]); $i = 3; foreach ($data as $record) { $excel->getActiveSheet()->setCellValue('A' . $i, $record->idEspecialidad); $excel->getActiveSheet()->setCellValue('B' . $i, $record->nombre); $excel->getActiveSheet()->setCellValue('C' . $i, $record["categoria"]["nombre"]); $excel->getActiveSheet()->setCellValue('D' . $i, $record->estatus); $excel->getActiveSheet()->setCellValue('E' . $i, $record->fecha_creacion);
public function agendas_multi_dias() { $params = Input::all(); $especialidad = Especialidad::findOrFail($params['especialidad_id']); $dias = $especialidad->lapso; $desde = isset($params["desde"]) && !empty($params["desde"]) ? $params["desde"] : date("Y-m-d"); $hasta = isset($params["hasta"]) && !empty($params["hasta"]) ? $params["hasta"] : date("Y-m-d", strtotime($desde . " +" . $dias . " days")); $coes = CentroOdontologoEspecialidad::where('odontologo_id', $params['odontologo_id'])->where('centro_id', $params['centro_id'])->where('especialidad_id', $params['especialidad_id'])->get(); $agendas_array = array(); foreach ($coes as $coe) { $aa = $agendas_array; $agendas = $coe->agendas()->whereBetween('fecha', array($desde, $hasta))->with(array('turnos' => function ($query) { $query->where('estado', '=', 'L'); }))->get(); $agendas_array = array_merge($aa, $agendas->toArray()); } /* cuento turnos libres */ function turnoslibres($a) { $a["turnos"] = count($a["turnos"]) ? true : false; return $a; } $agendas_array1 = array_map('turnoslibres', $agendas_array); return Response::json(array('error' => false, 'listado' => $agendas_array1), 200); }
/** * Exclude object from result * * @param Especialidad $especialidad Object to remove from the list of results * * @return EspecialidadQuery The current query, for fluid interface */ public function prune($especialidad = null) { if ($especialidad) { $this->addUsingAlias(EspecialidadPeer::IDESPECIALIDAD, $especialidad->getIdespecialidad(), Criteria::NOT_EQUAL); } return $this; }