Exemplo n.º 1
0
 /**
  * Muestra la cuenta, los alumnos y los responsables
  **/
 public function executeVerCompleta()
 {
     $c = new Criteria();
     $c->add(CuentaPeer::ID, $this->getRequestParameter('id'));
     $this->cuenta = CuentaPeer::doSelectOne($c);
     $this->forward404Unless($this->cuenta);
     $c = new Criteria();
     $c->add(AlumnoPeer::FK_CUENTA_ID, $this->getRequestParameter('id'));
     $this->aAlumno = AlumnoPeer::doSelect($c);
     $c = new Criteria();
     $c->add(ResponsablePeer::FK_CUENTA_ID, $this->getRequestParameter('id'));
     $this->aResponsable = ResponsablePeer::doSelect($c);
 }
Exemplo n.º 2
0
 public function executeAlumnosPorDivisionListado()
 {
     // inicializando variables
     $aAlumno = array();
     // tomando los datos del formulario
     $division_id = $this->getRequestParameter('division_id');
     // buscando division
     $division = DivisionPeer::retrieveByPK($division_id);
     // buscando alumnos
     $criteria = new Criteria();
     $criteria->add(DivisionPeer::ID, $division_id);
     $criteria->addJoin(RelAlumnoDivisionPeer::FK_ALUMNO_ID, AlumnoPeer::ID);
     $criteria->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID);
     $criteria->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
     $alumnos = AlumnoPeer::doSelect($criteria);
     // asignando variables para ser usadas en el template
     $this->aAlumno = $alumnos;
     $this->division = $division;
 }
Exemplo n.º 3
0
 public function getAlumnos($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(EstadosalumnosPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collAlumnos === null) {
         if ($this->isNew()) {
             $this->collAlumnos = array();
         } else {
             $criteria->add(AlumnoPeer::FK_ESTADOALUMNO_ID, $this->id);
             AlumnoPeer::addSelectColumns($criteria);
             $this->collAlumnos = AlumnoPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(AlumnoPeer::FK_ESTADOALUMNO_ID, $this->id);
             AlumnoPeer::addSelectColumns($criteria);
             if (!isset($this->lastAlumnoCriteria) || !$this->lastAlumnoCriteria->equals($criteria)) {
                 $this->collAlumnos = AlumnoPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastAlumnoCriteria = $criteria;
     return $this->collAlumnos;
 }
Exemplo n.º 4
0
 public function executeListarAlumnos()
 {
     $id = $this->getRequestParameter('division_id');
     if (!$id) {
         return $this->renderText("");
     }
     $c = new Criteria();
     $c->add(RelAlumnoDivisionPeer::FK_DIVISION_ID, $id);
     if ($this->getRequestParameter('division_no_id')) {
         $not_in_query = " %s NOT IN (";
         $not_in_query .= " SELECT %s FROM %s WHERE %s = %s AND %s = %s)";
         $not_in_query = sprintf($not_in_query, RelAlumnoDivisionPeer::FK_ALUMNO_ID, RelAlumnoDivisionPeer::FK_ALUMNO_ID, RelAlumnoDivisionPeer::TABLE_NAME, RelAlumnoDivisionPeer::FK_ALUMNO_ID, AlumnoPeer::ID, RelAlumnoDivisionPeer::FK_DIVISION_ID, $this->getRequestParameter("division_no_id"));
         $c->add(AlumnoPeer::ID, $not_in_query, Criteria::CUSTOM);
     }
     $c->addJoin(AlumnoPeer::ID, RelAlumnoDivisionPeer::FK_ALUMNO_ID, Criteria::INNER_JOIN);
     $c->addJoin(AlumnoPeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID, Criteria::INNER_JOIN);
     $c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
     $c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
     $this->alumnos = AlumnoPeer::doSelect($c);
     $this->alumnos_actuales = array();
     if ($this->getRequestParameter('division_no_id')) {
         $c = new Criteria();
         $c->add(RelAlumnoDivisionPeer::FK_DIVISION_ID, $this->getRequestParameter('division_no_id'));
         $c->addJoin(AlumnoPeer::ID, RelAlumnoDivisionPeer::FK_ALUMNO_ID, Criteria::INNER_JOIN);
         $c->addJoin(AlumnoPeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID, Criteria::INNER_JOIN);
         $c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
         $c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
     }
     $this->alumnos_actuales = AlumnoPeer::doSelect($c);
 }
Exemplo n.º 5
0
 function executeBusqueda()
 {
     $aAlumnoId = array();
     $criteria = new Criteria();
     if ($this->getRequestParameter('filtro_nombre_alumnos')) {
         $txt_nombre = $this->getRequestParameter('filtro_nombre_alumnos');
         $cton1 = $criteria->getNewCriterion(AlumnoPeer::APELLIDO, "{$txt_nombre}%", Criteria::LIKE);
     }
     if ($this->getRequestParameter('filtro_alumnos')) {
         switch ($this->getRequestParameter('filtro_alumnos')) {
             case 0:
                 break;
             case 1:
                 $c = new Criteria();
                 $c->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id'));
                 $c->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID);
                 $c->addJoin(AnioPeer::ID, DivisionPeer::FK_ANIO_ID);
                 $relAlumnoDivision = RelAlumnoDivisionPeer::doSelect($c);
                 foreach ($relAlumnoDivision as $r) {
                     $aAlumnoId[] = $r->getFkAlumnoId();
                 }
                 $criteria->add(AlumnoPeer::ID, $r->getFkAlumnoId(), Criteria::NOT_IN);
                 $cton2 = $criteria->getNewCriterion(AlumnoPeer::ID, $aAlumnoId, Criteria::NOT_IN);
                 if ($this->getRequestParameter('filtro_nombre_alumnos')) {
                     $cton1->addAnd($cton2);
                 } else {
                     $criteria->add($cton2);
                 }
                 break;
             default:
         }
     }
     if ($this->getRequestParameter('filtro_nombre_alumnos')) {
         $criteria->add($cton1);
     }
     $alumnos = AlumnoPeer::doSelect($criteria);
     $this->optionsAlumno = $alumnos;
 }
Exemplo n.º 6
0
<?php

$c = new Criteria();
$c->add(AlumnoPeer::FK_ESTABLECIMIENTO_ID, $sf_user->getAttribute('fk_establecimiento_id'));
$c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
$c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
$alumnos = AlumnoPeer::doSelect($c);
$optionsAlumnos = array();
$optionsAlumnos[""] = "";
foreach ($alumnos as $alumno) {
    $optionsAlumnos[$alumno->getId()] = $alumno->getApellido() . ", " . $alumno->getNombre();
}
echo select_tag('filters[fk_alumno_id]', options_for_select($optionsAlumnos, isset($filters['fk_alunmo_id']) ? $filters['fk_alumno_id'] : ''));
Exemplo n.º 7
0
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(AlumnoPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(AlumnoPeer::DATABASE_NAME);
         $criteria->add(AlumnoPeer::ID, $pks, Criteria::IN);
         $objs = AlumnoPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemplo n.º 8
0
 protected function getAlumnos($division_id)
 {
     $aAlumno = array();
     $criteria = new Criteria();
     $criteria->add(DivisionPeer::ID, $division_id);
     $criteria->addJoin(RelAlumnoDivisionPeer::FK_ALUMNO_ID, AlumnoPeer::ID);
     $criteria->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID);
     $criteria->addAscendingOrderbyColumn(AlumnoPeer::APELLIDO);
     $aAlumno = AlumnoPeer::doSelect($criteria);
     return $aAlumno;
 }