public function setup() { $this->setWidgets(array('idMatricules' => new sfWidgetFormInputHidden(), 'Usuaris_UsuariID' => new sfWidgetFormInputHidden(), 'Cursos_idCursos' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCursos())), 'Estat' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::getEstatsSelect())), 'DataInscripcio' => new sfWidgetFormDateTime(array('date' => array('format' => '%day%/%month%/%year%'))), 'Pagat' => new sfWidgetFormInputText(), 'tReduccio' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::selectDescomptes())), 'tPagament' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::selectPagament())), 'Comentari' => new sfWidgetFormTextarea())); $this->setValidators(array('idMatricules' => new sfValidatorPropelChoice(array('model' => 'Matricules', 'column' => 'idMatricules', 'required' => false)), 'Usuaris_UsuariID' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID')), 'Cursos_idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos')), 'Estat' => new sfValidatorInteger(array('required' => false)), 'Comentari' => new sfValidatorString(array('required' => false)), 'DataInscripcio' => new sfValidatorDateTime(array('required' => false)), 'Pagat' => new sfValidatorNumber(array('required' => false)), 'tReduccio' => new sfValidatorInteger(), 'tPagament' => new sfValidatorInteger())); $this->widgetSchema->setLabels(array('Cursos_idCursos' => 'Curs: ', 'Estat' => 'Estat: ', 'Comentari' => 'Comentari: ', 'DataInscripcio' => 'Data d\'inscripció: ', 'Descompte' => 'Te descompte? ', 'tReduccio' => 'Te reducció? ', 'tPagament' => 'Com ha pagat? ')); $this->widgetSchema->setNameFormat('matricules[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
public function setup() { $this->setWidgets(array('idCursos' => new sfWidgetFormInputHidden(), 'Codi' => new sfWidgetFormChoice(array('choices' => CursosPeer::getCodisOptions($this->getOption('IDS'))), array('style' => 'width:300px')), 'CodiT' => new sfWidgetFormInputText(array(), array('style' => 'width:100px;')))); // 'Codi' => new sfWidgetFormJQueryAutocompleter(array('config'=>'{ max:100 , width:500 }' , 'url'=>$this->getOption('url'))), $this->setValidators(array('idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos', 'required' => false)), 'Codi' => new sfValidatorString(array('required' => false)), 'CodiT' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->setLabels(array('Codi' => 'Codi existent: ', 'CodiT' => 'Nou codi:')); $this->widgetSchema->setNameFormat('cursos_codi[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); $this->widgetSchema->setFormFormatterName('Span'); }
/** * Retorna els descomptes d'un curs concret * */ public static function getDescomptesCursArray($idC, $edicio = false) { $RET = array(); $OC = CursosPeer::retrieveByPK($idC); if ($edicio) { $RET[-1] = 'Cap descompte (' . $OC->getPreu() . '€)'; } foreach (self::getDescomptes($idC, false) as $OD) { $RET[$OD->getIddescompte()] = $OD->getNom() . ' (' . self::getPreuAmbDescompte($OC->getPreu(), $OD->getIddescompte()) . '€)'; } return $RET; }
public function setup() { $this->WEB_IMATGE = 'images/cursos/'; $this->WEB_PDF = 'images/cursos/'; $this->BASE = sfConfig::get('sf_websysroot'); $this->setWidgets(array('idCursos' => new sfWidgetFormInputHidden(), 'Codi' => new sfWidgetFormInputText(array(), array('style' => 'width:100px;')), 'TitolCurs' => new sfWidgetFormInputText(array(), array('style' => 'width:100%;')), 'isActiu' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No'))), 'Places' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'Descripcio' => new sfWidgetFormTextareaTinyMCE(array(), array()), 'Preu' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'Preur' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'Horaris' => new sfWidgetFormInputText(array(), array('style' => 'width:50%;')), 'Categoria' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCategories())), 'OrdreSortida' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'DataInici' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'DataInMatricula' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'DataFiMatricula' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'site_id' => new sfWidgetFormInputHidden(), 'VisibleWEB' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No'))), 'actiu' => new sfWidgetFormInputHidden(), 'isEntrada' => new sfWidgetFormChoice(array('choices' => array(0 => 'No', 1 => 'Només reserva', 2 => 'Matrícula i pagament amb targeta')), array()), 'PDF' => new sfWidgetFormInputFileEditableMy(array('file_src' => '/' . $this->WEB_PDF . $this->getObject()->getPdf(), 'is_image' => false, 'with_delete' => false)), 'ADescomptes' => new sfWidgetFormChoice(array('renderer_class' => 'sfWidgetFormSelectManyMy', 'choices' => MatriculesPeer::selectDescomptes(), 'multiple' => true, 'expanded' => true), array('class' => 'ul_espais')))); $this->setDefaults(array('isEntrada' => CursosPeer::HOSPICI_RESERVA, 'VisibleWEB' => 1, 'isActiu' => 1)); $this->setValidators(array('idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos', 'required' => false)), 'TitolCurs' => new sfValidatorString(array('required' => true)), 'isActiu' => new sfValidatorBoolean(array('required' => true)), 'Places' => new sfValidatorInteger(array('required' => true)), 'Codi' => new sfValidatorString(array('required' => true)), 'Descripcio' => new sfValidatorString(array('required' => true)), 'Preu' => new sfValidatorInteger(array('required' => true)), 'Preur' => new sfValidatorInteger(array('required' => true)), 'Horaris' => new sfValidatorString(array('required' => true)), 'Categoria' => new sfValidatorString(array('required' => true)), 'OrdreSortida' => new sfValidatorInteger(array('required' => false)), 'DataInMatricula' => new sfValidatorDate(array('required' => true)), 'DataFiMatricula' => new sfValidatorDate(array('required' => true)), 'DataInici' => new sfValidatorDate(array('required' => true)), 'VisibleWEB' => new sfValidatorInteger(array('required' => true)), 'site_id' => new sfValidatorInteger(array('min' => -128, 'max' => 127, 'required' => false)), 'actiu' => new sfValidatorInteger(array('min' => -128, 'max' => 127, 'required' => false)), 'isEntrada' => new sfValidatorInteger(array('required' => true), array()), 'PDF' => new sfValidatorFile(array('path' => $this->BASE . $this->WEB_PDF, 'required' => false)), 'ADescomptes' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->setLabels(array('TitolCurs' => 'Títol del curs: ', 'isActiu' => 'Matrícula oberta? ', 'Places' => 'Núm de places: ', 'Descripcio' => 'Descripció: ', 'Preu' => 'Preu: ', 'Preur' => 'Preu reduït: ', 'Horaris' => 'Descripció d\'horaris: ', 'Categoria' => 'Categoria: ', 'OrdreSortida' => 'Ordre de sortida: ', 'DataInici' => 'Inici del curs: ', 'DataInMatricula' => 'WEB: Inici matriculació: ', 'DataFiMatricula' => 'WEB: Fi matriculació: ', 'VisibleWEB' => 'WEB: Visible a hospici?', 'isEntrada' => 'WEB: Reserva i pagament?', 'PDF' => 'WEB: Doc. pdf: ', 'ADescomptes' => 'WEB: Descompte possible? ')); $this->widgetSchema->setNameFormat('cursos[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); $this->widgetSchema->setFormFormatterName('Span'); }
public function setup() { $A_Years = array(); $avui = date('Y', time()); for ($year = $avui - 10; $year < $avui + 10; $year++) { $A_Years[$year] = $year; } $IDU = $this->getObject()->getUsuarisUsuariid(); $this->setWidgets(array('idMatricules' => new sfWidgetFormInputHidden(), 'Usuaris_UsuariID' => new sfWidgetFormInputHidden(), 'Cursos_idCursos' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCursosMatriculaInterna($this->getOption('IDS'), $this->getObject()->getCursosidcursos()))), 'Estat' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::getEstatsSelect())), 'DataInscripcio' => new sfWidgetFormDateTime(array('date' => array('format' => '%day%/%month%/%year%'))), 'Data_pagament' => new sfWidgetFormJQueryDate(array('format' => '%day%/%month%/%year%', 'years' => $A_Years), array()), 'data_baixa' => new sfWidgetFormDate(array('format' => '%day%/%month%/%year%')), 'Pagat' => new sfWidgetFormInputText(), 'tReduccio' => new sfWidgetFormChoice(array('choices' => DescomptesPeer::getDescomptesCursArray($this->getOption('IDC'), true))), 'tPagament' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentInternArray())), 'idDadesBancaries' => new sfWidgetFormChoice(array('choices' => DadesBancariesPeer::getSelectBySelect(DadesBancariesPeer::getDadesUsuari($IDU), false, true))), 'Comentari' => new sfWidgetFormTextarea())); $this->setValidators(array('idMatricules' => new sfValidatorPropelChoice(array('model' => 'Matricules', 'column' => 'idMatricules', 'required' => false)), 'Usuaris_UsuariID' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID')), 'Cursos_idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos')), 'Estat' => new sfValidatorInteger(array('required' => false)), 'Comentari' => new sfValidatorString(array('required' => false)), 'DataInscripcio' => new sfValidatorDateTime(array('required' => false)), 'data_baixa' => new sfValidatorDateTime(array('required' => false)), 'Data_pagament' => new sfValidatorDateTime(array('required' => false)), 'Pagat' => new sfValidatorNumber(array('required' => false)), 'tReduccio' => new sfValidatorInteger(), 'tPagament' => new sfValidatorInteger(), 'idDadesBancaries' => new sfValidatorInteger(array('required' => false)))); $this->widgetSchema->setLabels(array('Cursos_idCursos' => 'Curs: ', 'Estat' => 'Estat: ', 'Comentari' => 'Comentari: ', 'DataInscripcio' => 'Data d\'inscripció: ', 'data_baixa' => 'Data de baixa: ', 'Data_pagament' => 'Data de pagament: ', 'Descompte' => 'Te descompte? ', 'tReduccio' => 'Te reducció? ', 'tPagament' => 'Com ha pagat? ', 'idDadesBancaries' => 'CCC')); $this->widgetSchema->setNameFormat('matricules[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
</div> <table class="DADES"> <?php if ($CURSOS->getNbResults() == 0) { echo '<TR><TD class="LINIA" colspan="3">No s\'ha trobat cap curs amb aquestes dades.</TD></TR>'; } else { $i = 0; $CAT_ANT = ""; foreach ($CURSOS->getResults() as $C) { if ($CAT_ANT != $C->getCategoria()) { echo '<TR><TD colspan="6" class="TITOLCAT">' . $C->getCategoriaText() . '</TD></TR>'; } $CAT_ANT = $C->getCategoria(); $SPAN = ""; $PLACES = CursosPeer::getPlaces($C->getIdcursos(), $IDS); $ple = $PLACES['OCUPADES'] >= $PLACES['TOTAL'] ? "style=\"background-color:#EDE765;\"" : ""; $PAR = ParImpar($i++); echo '<TR> <TD ' . $ple . ' class="' . $PAR . '">' . checkbox_tag('curs_sel[]', $C->getIdcursos()) . '</TD> <TD ' . $ple . ' class="' . $PAR . '">' . link_to($C->getCodi() . $SPAN, "gestio/gCursos?accio=EC&IDC=" . $C->getIdcursos(), array('class' => 'tt2')) . '</TD> <TD ' . $ple . ' class="' . $PAR . '">' . $C->getTitolcurs() . ' (' . $C->getHoraris() . ')</TD> <TD ' . $ple . ' class="' . $PAR . '">' . $C->getPreu() . '€ </TD> <TD ' . $ple . ' class="' . $PAR . '">' . $PLACES['OCUPADES'] . '/' . $PLACES['TOTAL'] . '</TD> <TD ' . $ple . ' width="70px" class="' . $PAR . '">' . $C->getDatainici('d-m-Y') . '</TD> <TD ' . $ple . ' class="' . $PAR . '">' . link_to(image_tag('template/user.png') . '<span>Llistat d\'alumnes matriculats.</span>', 'gestio/gCursos?accio=L&IDC=' . $C->getIdcursos(), array('class' => 'tt2')) . '</TD> </TR>'; } } ?>
public function executeCursos(sfWebRequest $request) { $any = date('Y', time()); $di = null; $df = null; $mes = date('m', time()); if ($mes > 9) { $di = strval($any) . '-08-01'; $df = strval($any + 1) . '-08-01'; } else { $di = strval($any - 1) . '-08-01'; $df = strval($any) . '-08-01'; } $this->LoadWeb($request); $this->setTemplate('index'); $this->ACCIO = 'cursos'; $this->CURSOS = CursosPeer::getCursos(CursosPeer::CURSACTIU, 1, '', $this->IDS, true); $this->CURSOS_TANCATS = CursosPeer::getCursos(CursosPeer::PASSAT, 1, '', $this->IDS, true, $di, $df); }
public function CalculaPreu($DESCOMPTE) { return CursosPeer::CalculaPreu($this->getIdcursos(), $DESCOMPTE, $this->getSiteId()); }
/** * Selects a collection of Matricules objects pre-filled with all related objects except Usuaris. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Matricules objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptUsuaris(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden // $criteria->getDbName() will return the same object if not set to another value // so == check is okay and faster if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } MatriculesPeer::addSelectColumns($criteria); $startcol2 = MatriculesPeer::NUM_COLUMNS - MatriculesPeer::NUM_LAZY_LOAD_COLUMNS; CursosPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + (CursosPeer::NUM_COLUMNS - CursosPeer::NUM_LAZY_LOAD_COLUMNS); $criteria->addJoin(MatriculesPeer::CURSOS_IDCURSOS, CursosPeer::IDCURSOS, $join_behavior); // symfony_behaviors behavior foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) { call_user_func($sf_hook, 'BaseMatriculesPeer', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = MatriculesPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = MatriculesPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = MatriculesPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); MatriculesPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined Cursos rows $key2 = CursosPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = CursosPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = CursosPeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); CursosPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (Matricules) to the collection in $obj2 (Cursos) $obj2->addMatricules($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function setMatriculaPagada($OM) { //Mirem si el curs és ple $CURS_PLE = CursosPeer::isPle($OM->getCursosIdcursos(), $OM->getSiteId()); //Si no és ple, posem a pagat. if (!$CURS_PLE) { $OM->setEstat(self::ACCEPTAT_PAGAT); } else { //Si és ple i l'import és 0, posem en espera if ($OM->getPagat() > 0) { $OM->setEstat(self::ACCEPTAT_PAGAT); } else { $OM->setEstat(self::EN_ESPERA); } } $OM->save(); return true; }
private function CarregaInfoCursos($idS, $cat = 0) { $RET = array(); $A_OC_PAGER = CursosPeer::getCursos(CursosPeer::CURSACTIU, 0, '', $idS, true); foreach ($A_OC_PAGER->getResults() as $OC) { if (!isset($RET[$OC->getCategoria()])) { $OT = TipusPeer::retrieveByPK($OC->getCategoria()); if ($OT instanceof Tipus) { $RET[$OC->getCategoria()] = array('mode' => 3, 'titol' => $OT->getTipusdesc(), 'elements' => array()); } else { $RET[$OC->getCategoria()] = array('mode' => 3, 'titol' => 'n/d', 'elements' => array()); } } $RET[$OC->getCategoria()]['elements'][$OC->getIdcursos()] = array('url' => '@web_menu_click_curs?idCategoria=' . $OC->getCategoria() . '&idCurs=' . $OC->getIdcursos() . '&titol=' . $OC->getNomForUrl(), 'titol' => ' <div style="float:left; width: 400px;"><span style="font-size:8px; color:black;"> ' . $OC->getCodi() . ' </span><br />' . $OC->getTitolcurs() . '</div><div style="float:left;">' . $OC->getHoraris() . '<br /><span style="font-size:9px; color:gray;">Inici: ' . $OC->getDatainici('d-m-Y') . '</div><div style="clear:both"></div>', 'img' => 'color'); } return $RET; }
function VerificaMatricula($TPV, $DADES_MATRICULA, $ISPLE, $IDS) { $RET = ""; //Si la matricula es paga amb Targeta de crèdit, passem al TPV, altrament mostrem el comprovant if ($DADES_MATRICULA['MODALITAT'] == MatriculesPeer::PAGAMENT_TARGETA || $DADES_MATRICULA['MODALITAT'] == MatriculesPeer::PAGAMENT_TELEFON) { $URL = OptionsPeer::getString('TPV_URL', $IDS); $RET .= '<FORM name="COMPRA" action="' . $URL . '" method="POST" target="TPV">'; //$RET .= '<FORM name="COMPRA" action="https://sis-t.sermepa.es:25443/sis/realizarPago" method="POST" target="TPV">'; //$RET .= '<form name="COMPRA" action="https://sis.sermepa.es/sis/realizarPago" method="POST" target="TPV">'; foreach ($TPV as $K => $T) { $RET .= input_hidden_tag($K, $T); } } else { $RET .= '<form method="post" action="gestio/uGestio?accio=FI_MATRICULA">'; } //Carreguem totes les dades de matrícula foreach ($DADES_MATRICULA as $K => $V) { $str = "DADES_MATRICULA[" . $K . "]"; $RET .= input_hidden_tag($str, $V); } $IDC = $DADES_MATRICULA['CURS']; $ESPLE = $ISPLE ? '(EN ESPERA)' : ''; $RET .= '<FIELDSET class="REQUADRE"><LEGEND class="LLEGENDA">Verificació de la matrícula</LEGEND>'; $RET .= ' <TABLE class="FORMULARI" style="magin-right:40px;"> <TR><TD><b>DNI</b></TD> <TD>' . $DADES_MATRICULA['DNI'] . '</TD></TR> <TR><TD><b>NOM</b></TD> <TD>' . $DADES_MATRICULA['NOM'] . '</TD></TR> <TR><TD><b>PAGAMENT</b></TD><TD>' . MatriculesPeer::textPagament($DADES_MATRICULA['MODALITAT']) . '</TD></TR> <TR><TD><b>IMPORT</b></TD> <TD>' . $DADES_MATRICULA['PREU'] . '€' . '</TD></TR> <TR><TD><b>DATA</b></TD> <TD>' . $DADES_MATRICULA['DATA'] . '</TD></TR> <TR><TD><b>DESCOMPTE</b></TD> <TD>' . MatriculesPeer::textDescomptes($DADES_MATRICULA['DESCOMPTE']) . '</TD></TR> <TR><TD><b>CURS</b></TD> <TD>'; $RET .= '<TABLE width="100%" class="FORMULARI">'; $CURS = CursosPeer::retrieveByPK($DADES_MATRICULA['CURS']); $RET .= ' <TR> <TD>' . $CURS->getCodi() . '</TD> <TD>' . $CURS->getTitolcurs() . ' ' . $ESPLE . '</TD> <TD>' . $CURS->CalculaPreu($DADES_MATRICULA['DESCOMPTE']) . '€' . '</TD> </TR> </TABLE> </TD></TR> </TABLE> <div style="text-align:right"> <button type="submit" name="BPAGAMATRICULA" class="BOTO_ACTIVITAT" > ' . image_tag('template/coins.png') . ' Finalitzar la matrícula </button> </div> </FIELDSET> </FORM>'; return $RET; }
public static function getDatesCursosHospici($a_cursos) { $C = new Criteria(); $C->add(self::ACTIU, true); $C->add(self::IDCURSOS, $a_cursos, CRITERIA::IN); $C->addJoin(TipusPeer::IDTIPUS, self::CATEGORIA); $C->addGroupByColumn(self::IDCURSOS); $RET = array(); $SOL = array(); $RET[0] = array('NOM' => "En el futur...", 'COUNT' => 0); foreach (CursosPeer::doSelect($C) as $OC) { $m = $OC->getDatainici('m'); $y = $OC->getDatainici('Y'); $TRIM = self::toTrimestre($m, $y); if (!isset($RET[$TRIM['ID']])) { $RET[$TRIM['ID']] = array('NOM' => $y . ' . ' . $TRIM['NOM'], 'COUNT' => 0); } $RET[$TRIM['ID']]['COUNT'] += 1; $RET[0]['COUNT'] += 1; } asort($RET); foreach ($RET as $K => $V) { $SOL[$K] = $V['NOM'] . " ({$V['COUNT']})"; } return $SOL; }
/** * Mostra les etiquetes amb els estats i accions dels cursos * @param $AUTEN Si l'usuari està autentificat o no * @param $OC Objecte Cursos * @param $url On s'ha d'anar si es clica l'enllaç * @return String * */ public static function ph_getEtiquetaCursos($AUTH, $OC, $url, $CURSOS_MATRICULATS) { $ESTAT = self::ph_EstatCurs($AUTH, $OC, $url, $CURSOS_MATRICULATS); $datai = $OC->getDatainmatricula('U'); $avui = time(); $JaMat = isset($CURSOS_MATRICULATS[$OC->getIdcursos()]); $url = url_for('@hospici_detall_curs?idC=' . $OC->getIdcursos() . '&titol=' . $OC->getNomForUrl()); $OS = SitesPeer::retrieveByPK($OC->getSiteId()); $nom = $OS->getNom(); $email = $OS->getEmailString(); $tel = $OS->getTelefonString(); $MatAntIdi = CursosPeer::IsAnticAlumne($OC->getIdcursos(), $CURSOS_MATRICULATS); $dataiA = mktime(0, 0, 0, 9, 12, 2011); $RET = ""; //Si no està autentificat if ($ESTAT == 'NO_AUTENTIFICAT') { $RET = ph_getRoundCorner('<a class="auth" href="' . $url . '">Autentifica\'t i matricula\'t</a>', '#FFCC00'); } elseif ($ESTAT == 'MATRICULAT') { $RET = ' <div class="tip" title="Vostè està matriculat correctament al curs.<br /><br /> Per a més informació ha de posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al <b>' . $tel . '</b>">'; $RET .= ph_getRoundCorner('Ja hi esteu matriculat', '#29A729') . '</div>'; } elseif ($ESTAT == 'EN_ESPERA') { $RET = ' <div class="tip" title="El curs està complet. La seva matrícula queda en llista d\'espera.<br /><br /> Per a més informació ha de posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al <b>' . $tel . '</b>">'; $RET .= ph_getRoundCorner('En espera de plaça', '#F184DD') . '</div>'; } elseif ($ESTAT == 'ANULADA') { $RET = ' <div class="tip" title="Vostè s\'ha matriculat en aquest curs, però s\'ha donat de baixa o el procés no s\'ha completat correctament. Matrícula sense efecte.<br /><br /> Per a més informació ha de posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al <b>' . $tel . '</b>">'; $RET .= ph_getRoundCorner('Matrícula aunl·lada', '#CCCCCC') . '</div>'; } elseif ($ESTAT == 'NO_HI_PLACES') { $RET = ' <div class="tip" title="Aquest curs no disposa de més places.<br /><br /> Si vol pot matricular-s\'hi igualment i restarà en llista d\'espera. En el cas que s\'alliberi alguna plaça, que vostè pot ocupar, el trucarem el més aviat possible. Per a més informació, pot posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al telèfon <b>' . $tel . '</b>.<br /><br />Disculpi les molèsties.">'; $RET .= ph_getRoundCorner('<a href="' . $url . '#matricula">Curs ple</a>', '#EF0101') . '</div>'; } elseif ($ESTAT == 'NO_HI_HA_RESERVA_LINIA') { $RET = ' <div class="tip" title="Aquest curs no disposa de matrícula en línia.<br /><br /> Per poder-s\'hi matricular, ha de posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al telèfon <b>' . $tel . '</b>.<br /><br />Disculpi les molèsties.">'; $RET .= ph_getRoundCorner('Matrícula presencial', '#CCCCCC') . '</div>'; } elseif ($ESTAT == 'ABANS_PERIODE_MATRICULA_AA_IDIOMES') { $RET = ' <div class="tip" title="Vostè podrà matricular-se a aquest curs per internet a partir del dia ' . date('d/m/Y', $dataiA) . ' si vol continuar els estudis d\'idiomes. Assegureu-vos que us matriculeu al curs que us correspon o la matrícula quedarà invalidada sense guardar plaça. <br /><br /> Per a més informació pot posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al <b>' . $tel . '</b>">'; $RET .= ph_getRoundCorner('Tancada fins ' . date('d/m/Y', $dataiA), '#CBAD85') . '</div>'; } elseif ($ESTAT == 'ABANS_PERIODE_MATRICULA') { $RET = ' <div class="tip" title="Vostè podrà matricular-se a aquest curs per internet a partir del dia ' . date('d/m/Y', $datai) . '.<br /><br /> Per a més informació pot posar-se en contacte amb <b>' . $nom . '</b> enviant un correu electrònic a <b>' . $email . '</b> o bé trucant al <b>' . $tel . '</b>">'; $RET .= ph_getRoundCorner('Tancada fins ' . date('d/m/Y', $datai), '#CBAD85') . '</div>'; } elseif ($ESTAT == 'POT_MATRICULAR') { $RET = ph_getRoundCorner('<a href="' . $url . '#matricula">Matriculeu-vos</a>', '#FF8D00'); } return $RET; }
/** * hospiciActions::executeEspais() * * Part de mostra dels espais per reservar a l'hospici * * @param mixed $request * @return void */ public function executeEspais(sfWebRequest $request) { $this->setLayout('hospici'); $this->setTemplate('indexReservaEspais'); $this->accio = $request->getParameter('accio', 'index'); //Carrego la cerca $this->CERCA = $this->getUser()->getSessionPar('cerca'); switch ($this->accio) { case 'cerca_cursos': //Agafo el parà metre $C = $request->getParameter('cerca', array()); //Normalitzo tots els camps $C2 = $this->getCercaComplet($C); //Guardem a sessió la cerca "actual" $this->CERCA = $C2; $this->getUser()->setSessionPar('cerca', $this->CERCA); $this->LLISTAT_CURSOS = CursosPeer::getCursosHospici($this->CERCA['TEXT'], $this->CERCA['SITE'], $this->CERCA['POBLE'][0], $this->CERCA['CATEGORIA'][0], $this->CERCA['DATA'][0], $this->CERCA['DATAR'], $this->CERCA['P']); $this->MODE = 'CERCA'; break; case 'detall_curs': $this->CURS = CursosPeer::retrieveByPK($request->getParameter('idC')); $this->MODE = 'DETALL'; break; //Arribem per primer cop al web o no entrem per cap url interessant //Arribem per primer cop al web o no entrem per cap url interessant default: //Inicialitzem la cerca i la guardem a memòria $this->CERCA = $this->getCercaComplet(null); $this->getUser()->setSessionPar('cerca', $this->CERCA); $this->MODE = 'INICIAL'; } }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(CursosPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(CursosPeer::DATABASE_NAME); $criteria->add(CursosPeer::IDCURSOS, $pks, Criteria::IN); $objs = CursosPeer::doSelect($criteria, $con); } return $objs; }
/** * Ens torna el codi HTML del document per imprimir quan tenim una matrícula amb pagament en metàl·lic per caixer. * */ public static function DocMatriculaPagamentCaixer($OM, $idS) { $inici = OptionsPeer::getString('PAG_CAIXER_CODI_OP', $idS); $entitat = OptionsPeer::getString('PAG_CAIXER_CODI_ENTITAT', $idS); $referencia = str_pad(strval($OM->getIdmatricules()), 11, '0', STR_PAD_LEFT); //Càlcul de valor de check $ponderacions = array(10 => 2, 9 => 3, 8 => 4, 7 => 5, 6 => 6, 5 => 7, 4 => 8, 3 => 9, 2 => 2, 1 => 3, 0 => 4); $tot = 0; for ($i = 10; $i >= 0; $i--) { $tot += $referencia[$i] * $ponderacions[$i]; } $cc = $tot % 11; if ($cc == 10) { $cc = 0; } //Afegim el valor de check a la referència i seguim. $referencia .= $cc; $import = str_pad(strval($OM->getPagat() * 100), 10, '0', STR_PAD_LEFT); $codi = $inici . $entitat . $referencia . $import; $barcode = new phpCode128($codi, 150, false, false); $barcode->setEanStyle(true); $barcode->setAutoAdjustFontSize(true); $barcode->saveBarcode(OptionsPeer::getString('SF_WEBSYSROOT', 1) . 'tmp/' . $idS . '-barcode.png'); //Comença la càrrega d'informació. $i = 1; $HTML = OptionsPeer::getString('BODY_DOC_MATR_CAIXER', $idS); //CONSULTEM USUARI $OU = UsuarisPeer::retrieveByPK($OM->getUsuarisusuariid()); $OC = CursosPeer::retrieveByPK($OM->getCursosidcursos()); $HTML = str_replace('@@LOGO_URL@@', OptionsPeer::getString('LOGO_URL', $idS), $HTML); $HTML = str_replace('@@CODI_BARRES@@', $idS, $HTML); $HTML = str_replace('@@TIPUS_PAGAMENT@@', $OM->getTpagamentString(), $HTML); $HTML = str_replace('@@CODI@@', $codi, $HTML); $HTML = str_replace('@@ENTITAT@@', $entitat, $HTML); $HTML = str_replace('@@REFERENCIA@@', $referencia, $HTML); $HTML = str_replace('@@IMPORT@@', $OM->getPagat() . '€', $HTML); $HTML = str_replace('@@FACTURA@@', $OM->getIdmatricules(), $HTML); $HTML = str_replace('@@CODI_CLIENT@@', $OM->getUsuarisusuariid(), $HTML); $HTML = str_replace('@@DATA_FACTURA@@', $OM->getDatainscripcio('d/m/Y'), $HTML); $HTML = str_replace('@@NOM@@', $OU->getNomComplet(), $HTML); $HTML = str_replace('@@TELEFON@@', $OU->getTelefonString(), $HTML); $HTML = str_replace('@@NIF@@', $OU->getDni(), $HTML); $HTML = str_replace('@@CARRER@@', $OU->getAdreca(), $HTML); $HTML = str_replace('@@POBLE@@', $OU->getPoblacioString(), $HTML); $HTML = str_replace('@@CODI_POSTAL@@', $OU->getCodipostal(), $HTML); $HTML = str_replace('@@CONCEPTE@@', $OC->getTitolcurs(), $HTML); $HTML = str_replace('@@DIA@@', $OC->getDatainici('d/m/Y'), $HTML); $HTML = str_replace('@@HORARIS@@', $OC->getHoraris(), $HTML); $HTML = str_replace('@@P@@', $OM->getPagat(), $HTML); $HTML = str_replace('@@Q@@', 1, $HTML); $HTML = str_replace('@@I@@', $OM->getPagat(), $HTML); $HTML = str_replace('@@BASE@@', $OM->getPagat(), $HTML); $HTML = str_replace('@@IVA@@', 0, $HTML); $HTML = str_replace('@@TOTAL@@', $OM->getPagat(), $HTML); $HTML = str_replace('@@TITULAR@@', $OM->getTitularDB(), $HTML); $HTML = str_replace('@@CCC@@', $OM->getCcc(), $HTML); return $HTML; }
function mostraCursos($CURSOS, $is_actiu) { ?> <fieldset class="REQUADRE"> <?php if ($is_actiu) { ?> <legend class="LLEGENDA">MATRÍCULA OBERTA</legend> <?php } else { ?> <legend class="LLEGENDA">MATRÍCULA TANCADA</legend> <?php } ?> <table class="DADES"> <tr> <td class="TITOL">Codi</td> <td class="TITOL">Títol</td> <td class="TITOL">Preu</td> <td class="TITOL">Data d'inici</td> <td class="TITOL">Vacants</td> </tr> <?php $CAT_ANT = ""; ?> <?php foreach ($CURSOS->getResults() as $C) { ?> <?php if ($C->getVisibleweb() == 1 && $C->getIsactiu() == $is_actiu) { ?> <?php if ($CAT_ANT != $C->getCategoria()) { ?> <tr><td colspan="5" class="TITOL_CATEGORIA"><?php echo $C->getCategoriaText(); ?> </td></tr> <?php } ?> <?php $PLACES = CursosPeer::getPlaces($C->getIdcursos(), $IDS); ?> <tr> <td class="LINIA"> <div style="clear:both;"> <a href="#TB_inline?height=480&width=640&inlineId=hidden<?php echo $C->getIdcursos(); ?> &modal=false" class="thickbox"> <?php echo $C->getCodi(); ?> </a> <div style="display: none;" id="hidden<?php echo $C->getIdcursos(); ?> "> <div id="TEXT_WEB"> <?php echo $C->getDescripcio(); ?> </div> </div> </div> </td> <td class="LINIA"><?php echo $C->getTitolcurs(); ?> ( <?php echo $C->getHoraris(); ?> ) </td> <td class="LINIA"><?php echo $C->getPreu(); ?> €</td> <td class="LINIA" width="70px"><?php echo $C->getDatainici('d-m-Y'); ?> </td> <td class="LINIA"> <?php if ($is_actiu) { ?> <?php echo intval($PLACES['TOTAL']) - intval($PLACES['OCUPADES']); ?> <?php } else { ?> Tancat <?php } ?> </td> </tr> <?php $CAT_ANT = $C->getCategoria(); ?> <?php } ?> <?php } ?> </table> </fieldset> <?php }
<div class="h_requadre_resultats"> <div class="h_subtitle_gray c1"> L'HOSPICI... </div> <?php if ($CURS instanceof Cursos) { $datai = $CURS->getDatainmatricula('U'); $url = url_for('@hospici_detall_curs?idC=' . $CURS->getIdcursos() . '&titol=' . $CURS->getNomForUrl()); $MatAntIdi = CursosPeer::IsAnticAlumne($CURS->getIdcursos(), $CURSOS_MATRICULATS); $dataiA = mktime(0, 0, 0, 9, 12, 2011); $OS = SitesPeer::retrieveByPK($CURS->getSiteId()); $nom = $OS->getNom(); $email = $OS->getEmailString(); $tel = $OS->getTelefonString(); $ESTAT = myUser::ph_EstatCurs($AUTH, $CURS, $url, $CURSOS_MATRICULATS); //Carrego la imatge del site $imatge = SitesPeer::getSiteLogo($CURS->getSiteId()); //Si l'entitat té un pdf, l'hauríem de carregar. if (empty($pdf)) { $pdf = 0; } ?> <div style="border:0px solid #96BF0D; clear:both; padding:10px;"> <div style="font-size:11px"><b><?php echo $CURS->getTitolcurs(); ?> </b><br /><span style="color: gray;"><?php echo $nom; ?> </span></div>
echo $CERCA['TEXT']; ?> " style="width: 500px;" /> </div> </div> <div style="clear:both; float: left;"> <div style="margin: 5px;"> <b>Qui?</b><br /><?php echo select_tag('cerca[SITE]', options_for_select(CursosPeer::selectSitesCursos($CERCA['TEXT']), $CERCA['SITE'][0]), array('multiple' => 'multiple', 'style' => 'height:130px; width:360px;', 'id' => 'E_ON')); ?> </div> </div> <div style="float: left;"> <div style="margin: 5px;"> <b>Quan?</b><br /><?php echo select_tag('cerca[DATA]', options_for_select(CursosPeer::selectDatesCursos(null, null, $CERCA['TEXT'], $CERCA['SITE'][0]), $CERCA['DATA'][0]), array('multiple' => 'multiple', 'style' => 'height:130px; width:180px;', 'id' => 'DATAE')); ?> </div> </div> <div style="clear:both; float: left;"> <div id="RANGE" style="float: left; margin-right:5px; margin-top:4px;"> Des de: <input type="text" id="DIE" name="cerca[DATA_R][DI]" style="height:30px; width:100px;" /> Fins a: <input type="text" id="DFE" name="cerca[DATA_R][DF]" style="height:30px; width:100px;" /> </div> <div style="float: left; margin-right:5px; margin-top:4px;"> <input type="hidden" name="cerca[P]" value="1" style="height:30px; width:100px;" /> </div> </div> <div style="float: right; margin-right:5px; margin-top:4px;">
/** * Aquest funció serveix per fer UPLOAD d'arxius a una activitat * */ public function executeUpload(sfWebRequest $request) { $base = getcwd(); $Opcio = $request->getParameter('OPCIO'); if ($Opcio == 'DELETE') { //Abans d'esborrar un arxiu, comprovaré que l'activitat sigui del site de l'usuari. $url = $request->getParameter('NOM_ARXIU'); $A = explode('-', $url); $id = $A[1]; $B = explode('/', $A[0]); $tipus = $B[2]; $IDS = $this->getUser()->getSessionPar('idS'); if ($tipus == 'activitats') { $OA = ActivitatsPeer::retrieveByPK($id); if ($OA instanceof Activitats && $IDS == $OA->getSiteid()) { unlink($base . $url); return $this->renderText("ok"); } } elseif ($tipus == 'cicles') { $OC = CiclesPeer::retrieveByPK($id); if ($OC instanceof Cicles && $IDS == $OC->getSiteid()) { unlink($base . $url); return $this->renderText("ok"); } } elseif ($tipus == 'cursos') { $OC = CursosPeer::retrieveByPK($id); if ($OC instanceof Cursos && $IDS == $OC->getSiteid()) { unlink($base . $url); return $this->renderText("ok"); } } return $this->renderText("ko"); } elseif ($Opcio == 'UPLOAD' || $Opcio == 'UPLOAD_SINGLE') { $nom = $request->getParameter('qqfile'); $parts = explode(".", $nom); $extensio = end($parts); if ($Opcio == 'UPLOAD') { //En aquest cas, NOM_ARXIU és el nom i directori on anirà dins de web $url = $request->getParameter('NOM_ARXIU'); $url .= '.' . $extensio; } else { //En aquest cas, NOM_ARXIU és el directori on anirà només $tmp = $request->getParameter('NOM_ARXIU'); if (!file_exists($base . '/' . $tmp)) { mkdir($base . '/' . $tmp); } $url = '/' . $tmp . $nom; } $input = fopen("php://input", "r"); $temp = tmpfile(); $realSize = stream_copy_to_stream($input, $temp); fclose($input); $target = fopen($base . $url, "w"); fseek($temp, 0, SEEK_SET); $size = stream_copy_to_stream($temp, $target); fclose($target); $result = true; if ($realSize > 0 && $size == $realSize) { $result = array('success' => true); } else { $return = array('error' => 'Hi ha hagut algun error carregant l\'arxiu.'); } return $this->renderText(htmlspecialchars(json_encode($result), ENT_NOQUOTES)); } }
/** * Get the associated Cursos object * * @param PropelPDO Optional Connection object. * @return Cursos The associated Cursos object. * @throws PropelException */ public function getCursos(PropelPDO $con = null) { if ($this->aCursos === null && $this->cursos_idcursos !== null) { $this->aCursos = CursosPeer::retrieveByPk($this->cursos_idcursos); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aCursos->addMatriculess($this); */ } return $this->aCursos; }
function gestiona_verificacio($DADES_MATRICULA, $TPV, $ISPLE) { //Si la matricula es paga amb Targeta de crèdit, passem al TPV, altrament mostrem el comprovant if ($DADES_MATRICULA['MODALITAT'] == MatriculesPeer::PAGAMENT_TARGETA || $DADES_MATRICULA['MODALITAT'] == MatriculesPeer::PAGAMENT_TELEFON) { // echo '<FORM name="COMPRA" action="https://sis-t.sermepa.es:25443/sis/realizarPago" method="POST" target="TPV">'; echo '<FORM name="COMPRA" action="https://sis.sermepa.es/sis/realizarPago" method="POST" target="TPV">'; foreach ($TPV as $K => $T) { echo input_hidden_tag($K, $T); } } else { echo '<form method="post" action="gestio/gMatricules">'; } //Carreguem totes les dades de matrícula foreach ($DADES_MATRICULA as $K => $V) { $str = "DADES_MATRICULA[" . $K . "]"; echo input_hidden_tag($str, $V); } $IDC = $DADES_MATRICULA['CURS']; $ESPLE = $ISPLE ? '(EN ESPERA)' : ''; ?> <FIELDSET class="REQUADRE"><LEGEND class="LLEGENDA">Verificació de la matrícula</LEGEND> <TABLE class="FORMULARI" style="magin-right:40px;"> <TR><TD><b>DNI</b></TD> <TD><?php echo $DADES_MATRICULA['DNI']; ?> </TD></TR> <TR><TD><b>NOM</b></TD> <TD><?php echo $DADES_MATRICULA['NOM']; ?> </TD></TR> <TR><TD><b>PAGAMENT</b></TD><TD><?php echo MatriculesPeer::textPagament($DADES_MATRICULA['MODALITAT']); ?> </TD></TR> <TR><TD><b>IMPORT</b></TD> <TD><?php echo $DADES_MATRICULA['PREU'] . '€'; ?> </TD></TR> <TR><TD><b>DATA</b></TD> <TD><?php echo $DADES_MATRICULA['DATA']; ?> </TD></TR> <TR><TD><b>DESCOMPTE</b></TD> <TD><?php echo MatriculesPeer::textDescomptes($DADES_MATRICULA['DESCOMPTE']); ?> </TD></TR> <TR><TD><b>CURS</b></TD> <TD> <TABLE width="100%" class="FORMULARI"> <?php $CURS = CursosPeer::retrieveByPK($DADES_MATRICULA['CURS']); ?> <TR> <TD><?php echo $CURS->getCodi(); ?> </TD> <TD><?php echo $CURS->getTitolcurs() . ' ' . $ESPLE; ?> </TD> <TD><?php echo $CURS->CalculaPreu($DADES_MATRICULA['DESCOMPTE']) . '€'; ?> </TD> </TR> </TABLE> </TD></TR> <TR><TD colspan="7"><?php echo submit_tag('Matriculeu-me', array('NAME' => 'BSAVE', 'style' => 'width:100px')); ?> <BR /></TD></TR> </TABLE> </FIELDSET> </FORM> <?php }
/** * Funció que retorna el descompte en format text * */ public function getTreduccioString() { $A_D = CursosPeer::getDescomptesArray($this->getCursosIdcursos(), true); return $A_D[$this->getTreduccio()]; }
/** * Populates the object using an array. * * This is particularly useful when populating an object from one of the * request arrays (e.g. $_POST). This method goes through the column * names, checking to see whether a matching key exists in populated * array. If so the setByName() method is called for that column. * * You can specify the key type of the array by additionally passing one * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * The default key type is the column's phpname (e.g. 'AuthorId') * * @param array $arr An array to populate the object from. * @param string $keyType The type of keys the array uses. * @return void */ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = CursosPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setIdcursos($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setTitolcurs($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setIsactiu($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setPlaces($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setCodi($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setDescripcio($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setPreu($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setPreur($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setHoraris($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setCategoria($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setOrdresortida($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setDataaparicio($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setDatadesaparicio($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setDatainmatricula($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setDatafimatricula($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setDatainici($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setVisibleweb($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setSiteId($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setActiu($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setActivitatId($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setIsentrada($arr[$keys[20]]); } if (array_key_exists($keys[21], $arr)) { $this->setPdf($arr[$keys[21]]); } if (array_key_exists($keys[22], $arr)) { $this->setAdescomptes($arr[$keys[22]]); } }
public function executeCursos(sfWebRequest $request) { $this->LoadWeb($request); $this->setTemplate('index'); $this->ACCIO = 'cursos'; $this->CURSOS = CursosPeer::getCursos(CursosPeer::CURSACTIU, 1, '', $this->IDS, true); }
public function setup() { $this->setWidgets(array('idCursos' => new sfWidgetFormInputHidden(), 'Codi' => new sfWidgetFormInputText(array(), array('style' => 'width:100px;')), 'TitolCurs' => new sfWidgetFormInputText(array(), array('style' => 'width:100%;')), 'isActiu' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No'))), 'Places' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'Descripcio' => new sfWidgetFormTextareaTinyMCE(array(), array()), 'Preu' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'Horaris' => new sfWidgetFormInputText(array(), array('style' => 'width:50%;')), 'Categoria' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCategories())), 'OrdreSortida' => new sfWidgetFormInputText(array(), array('style' => 'width:10%;')), 'DataInici' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'DataInMatricula' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'DataFiMatricula' => new sfWidgetFormJQueryDateMy(array('format' => '%day%/%month%/%year%'), array()), 'site_id' => new sfWidgetFormInputHidden(), 'VisibleWEB' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No'))), 'actiu' => new sfWidgetFormInputHidden(), 'PagamentExtern' => new sfWidgetFormChoice(array('choices' => array())), 'PagamentIntern' => new sfWidgetFormChoice(array('choices' => array())), 'ADescomptes' => new sfWidgetFormChoice(array('choices' => array()), array()), 'isRestringit' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No'))))); $this->setValidators(array('idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos', 'required' => false)), 'TitolCurs' => new sfValidatorString(array('required' => true)), 'isActiu' => new sfValidatorBoolean(array('required' => true)), 'Places' => new sfValidatorInteger(array('required' => true)), 'Codi' => new sfValidatorString(array('required' => true)), 'Descripcio' => new sfValidatorString(array('required' => true)), 'Preu' => new sfValidatorInteger(array('required' => true)), 'Horaris' => new sfValidatorString(array('required' => true)), 'Categoria' => new sfValidatorString(array('required' => true)), 'DataInMatricula' => new sfValidatorDate(array('required' => true)), 'DataFiMatricula' => new sfValidatorDate(array('required' => true)), 'DataInici' => new sfValidatorDate(array('required' => true)), 'VisibleWEB' => new sfValidatorInteger(array('required' => true)), 'site_id' => new sfValidatorInteger(array('min' => -128, 'max' => 127, 'required' => false)), 'actiu' => new sfValidatorInteger(array('min' => -128, 'max' => 127, 'required' => false)), 'ADescomptes' => new sfValidatorCallback(array('callback' => array('CursosForm', 'ComprovaDescomptes'), 'arguments' => array(), 'required' => true)), 'PagamentIntern' => new sfValidatorCallback(array('callback' => array('CursosForm', 'PagamentIntern'), 'arguments' => array(), 'required' => true)), 'PagamentExtern' => new sfValidatorCallback(array('callback' => array('CursosForm', 'PagamentExtern'), 'arguments' => array(), 'required' => true)), 'isRestringit' => new sfValidatorBoolean(array('required' => false)))); $this->widgetSchema->setNameFormat('cursos[%s]'); }
/** * hospiciActions::executeCursos() * * Part de mostra de cursos a l'hospici * * @param mixed $request * @return void */ public function executeCursos(sfWebRequest $request) { $this->setLayout('hospici'); $this->setTemplate('indexCursos'); $this->accio = $request->getParameter('accio', 'index'); //Carrego la cerca $this->CERCA = $this->getUser()->getSessionPar('cerca', array()); $C = $this->CERCA; $this->DESPLEGABLES = array(); $this->AUTH = $this->getUser()->isAuthenticated(); $this->CURSOS_MATRICULATS = MatriculesPeer::h_getMatriculesCursosUsuariArray($this->getUser()->getSessionPar('idU')); if ($this->accio == 'cerca_cursos' || $this->accio == 'inici') { //Agafo els paràmetres si é sun post o bé si canvi de pàgina o sinó doncs cerca en blanc. if ($request->getMethod() == 'POST') { $C = $request->getParameter('cerca', array()); } $C['P'] = $request->getParameter('P', 1); //Si em trobo el paràmetre SITE, impilca que he entrat per llistat d'entitats i vull veure tot el d'una. if ($request->hasParameter('SITE')) { $C['SITE'] = $request->getParameter('SITE'); } $C2 = $this->getCercaCursosComplet($C); //Faig la cerca dels cursos de l'Hospici i ho retorno amb valors //La cerca hauria de tornar els cursos, segons els paràmetres i a més els llistats amb els valors. $RET = CursosPeer::getCursosCercaHospici($C2['TEXT'], $C2['SITE'], $C2['POBLE'], $C2['CATEGORIA'], $C2['DATA'], $C2['P']); $this->LLISTAT_CURSOS = $RET['PAGER']; $LCURSOS = $RET['LCURSOS']; $this->DESPLEGABLES['SELECT_POBLACIONS'] = CursosPeer::getPoblacionsCursosHospici($LCURSOS); $this->DESPLEGABLES['SELECT_ENTITATS'] = CursosPeer::getEntitatCursosHospici($LCURSOS); $this->DESPLEGABLES['SELECT_CATEGORIES'] = CursosPeer::getCategoriaCursosHospici($LCURSOS); $this->DESPLEGABLES['SELECT_DATES'] = CursosPeer::getDatesCursosHospici($LCURSOS); //Guardem a sessió la cerca "actual" $this->CERCA = $C2; $this->getUser()->setSessionPar('cerca', $this->CERCA); $this->MODE = 'CERCA'; } elseif ($this->accio == 'detall_curs') { $this->CURS = CursosPeer::retrieveByPK($request->getParameter('idC')); $this->MODE = 'DETALL'; } }
$BASE = OptionsPeer::getString('SF_WEBROOT', $IDS); ?> <div style="margin-top:20px; float:left; background-color:#CCC; color:#555; padding:5px; width:640px; ">CURS</div> <div style="margin-top:10px; float:left; clear:both;"> <?php foreach ($CURSOS as $OC) { ?> <?php $places = $OC->getPlacesArray(); ?> <?php if ($OC->isPle()) { $style = " background-color: #FFC4C4; "; } elseif ($OC->getIsRestringit() && !CursosPeer::getRestrictedNotes($IDU, $OC->getIdCursos())) { $style = " background-color: #FFC670; "; } else { $style = ""; } ?> <div style="margin-top:3px; clear: both; <?php echo $style; ?> " class="linia_curs"> <div style="float: left;"> <?php echo radiobutton_tag('matricules[idC]', $OC->getIdcursos(), false, array('class' => 'matricula')); ?> </div>
/** * Funció que retorna els descomptes aplicats amb el preu per mostrar-ho. * $DESC['NOM'], $DESC['PREU'], $DESC['PERCENT'] * */ public function getDescomptesArray($ambPreu = true) { $RET = array(); $RET[-1] = 'Sense descompte'; if ($ambPreu) { $RET[-1] .= ' (' . $this->getPreu() . '€)'; } $AD = $this->getADescomptes(); foreach ($AD as $k => $DESC) { if (!empty($DESC['NOM'])) { $RET[$k] = $DESC['NOM']; if ($ambPreu) { $RET[$k] .= ' (' . CursosPeer::getPreuAmbDescompte($this->getIdcursos(), $k) . '€)'; } } } return $RET; }