public function setup()
 {
     $this->setWidgets(array('horari_id' => new sfWidgetFormInputHidden(), 'actiu' => new sfWidgetFormChoice(array('choices' => array(0 => 'No', 1 => 'Sí')), array('style' => 'width:100px')), 'Preu' => new sfWidgetFormInputText(array(), array('style' => 'width:100px')), 'Places' => new sfWidgetFormInputText(array(), array('style' => 'width:100px')), 'PagamentExtern' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentExternArray(), 'multiple' => true), array('style' => 'height:150px')), 'PagamentIntern' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentInternArray(), 'multiple' => true), array('style' => 'height:150px')), 'site_id' => new sfWidgetFormInputHidden(), 'descomptes' => new sfWidgetFormChoice(array('choices' => array()), array())));
     $this->setValidators(array('horari_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->getHorariId()), 'empty_value' => $this->getObject()->getHorariId(), 'required' => false)), 'Preu' => new sfValidatorInteger(array('min' => 0, 'max' => 200, 'required' => false)), 'Places' => new sfValidatorInteger(array('min' => 1, 'max' => 3000, 'required' => false)), 'site_id' => new sfValidatorInteger(array('min' => 0, 'max' => 32767)), 'actiu' => new sfValidatorInteger(array('min' => 0, 'max' => 1)), 'descomptes' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'ComprovaDescomptes'), 'arguments' => array(), 'required' => true)), 'PagamentIntern' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'PagamentIntern'), 'arguments' => array(), 'required' => true)), 'PagamentExtern' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'PagamentExtern'), 'arguments' => array(), 'required' => true))));
     $this->widgetSchema->setNameFormat('entrades_preus[%s]');
     $this->widgetSchema->setLabels(array('Preu' => 'Preu', 'Places' => 'Places', 'Tipus' => 'Tipus', 'descomptes' => 'Descomptes', 'PagamentExtern' => 'P. Extranet', 'PagamentIntern' => 'P. Intranet', 'actiu' => 'Actiu'));
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setFormFormatterName('SpanHorizontal');
 }
 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);
 }
Exemplo n.º 3
0
 public function getPagamentExternSelect()
 {
     $RET = array();
     $A = $this->getPagamentExtern();
     $A2 = TipusPeer::getTipusPagamentExternArray();
     foreach ($A as $E) {
         $RET[$E] = $A2[$E];
     }
     if ($this->getIsPle() && $this->hasLlistaEspera()) {
         $RET = array();
         $RET[TipusPeer::PAGAMENT_LLISTA_ESPERA] = $A2[TipusPeer::PAGAMENT_LLISTA_ESPERA];
     } elseif (!$this->getIsPle()) {
         unset($RET[TipusPeer::PAGAMENT_LLISTA_ESPERA]);
     }
     return $RET;
 }
 public static function getTipusPagaments($IDH, $intern = false)
 {
     $RET = array();
     $OEP = EntradesPreusPeer::retrieveByPK($IDH);
     if ($intern) {
         $A = $OEP->getPagamentIntern();
         $AP = TipusPeer::getTipusPagamentInternArray();
     } else {
         $A = $OEP->getPagamentExtern();
         $AP = TipusPeer::getTipusPagamentExternArray();
     }
     foreach ($A as $id) {
         $RET[$id] = $AP[$id];
     }
     return $RET;
 }
Exemplo n.º 5
0
 /**
  * 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 = TipusPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setIdtipus($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setTipusnom($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setTipusdesc($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setSiteId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setActiu($arr[$keys[4]]);
     }
 }
Exemplo n.º 6
0
 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' => '&nbsp;<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;
 }
Exemplo n.º 7
0
 /**
  * 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(TipusPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(TipusPeer::DATABASE_NAME);
         $criteria->add(TipusPeer::IDTIPUS, $pks, Criteria::IN);
         $objs = TipusPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemplo n.º 8
0
 public static function getCategoriaCursosHospici($a_cursos)
 {
     $C = new Criteria();
     $C->add(self::ACTIU, true);
     $C->add(self::IDCURSOS, $a_cursos, CRITERIA::IN);
     $C->addJoin(TipusPeer::IDTIPUS, self::CATEGORIA);
     $RET = array();
     $SOL = array();
     $RET[0] = array('NOM' => "Totes les categories...", 'COUNT' => 0);
     foreach (TipusPeer::doSelect($C) as $OT) {
         if (!isset($RET[$OT->getIdtipus()])) {
             $RET[$OT->getIdtipus()] = array('NOM' => $OT->getTipusdesc(), 'COUNT' => 0);
         }
         $RET[$OT->getIdtipus()]['COUNT'] += 1;
         $RET[0]['COUNT'] += 1;
     }
     foreach ($RET as $K => $V) {
         $SOL[$K] = $V['NOM'] . " ({$V['COUNT']})";
     }
     return $SOL;
 }
Exemplo n.º 9
0
function gestiona_cursos($CURSOS, $MATRICULES, $MISSATGES, $LCURSOS)
{
    ?>
   <form method="post" action="<?php 
    echo url_for('web/gestio?accio=im');
    ?>
" id="FORM_CURSOS">
   
	   <FIELDSET class="REQUADRE"><LEGEND class="LLEGENDA">Cursos disponibles actualment </LEGEND>
       	      
	       	<?php 
    $LCURSOS = $LCURSOS->getResults();
    ?>
	       	<?php 
    if (empty($LCURSOS)) {
        echo "Actualment no es pot matricular a cap curs. ";
        ?>
			<?php 
    } else {
        ?>
	      
					   <TABLE class="DADES">
						   <tr>
						   	<td class="TITOL" colspan="2">CODI</td>						   	
						   	<td class="TITOL">NOM</td>
						   	<td class="TITOL">PREU</td>
						   	<td class="TITOL" width="70px">INICI</td>
						   	<td class="TITOL">PLACES</td>
						   </tr>
					   <?php 
        $CAT_ANT = "";
        ?>
   
					   <?php 
        foreach ($LCURSOS as $C) {
            ?>
                       <?php 
            if ($C->getVisibleweb() == 1) {
                ?>
                      
					   <?php 
                if ($CAT_ANT != $C->getCategoria()) {
                    ?>
					   
								<TR><TD colspan="6" class="TITOL_CATEGORIA"><?php 
                    echo $C->getCategoriaText();
                    ?>
</TD></TR>
					   <?php 
                }
                ?>
					   <?php 
                $PLACES = $C->getPlacesArray();
                $ple = $PLACES['OCUPADES'] == $PLACES['TOTAL'] ? "style=\"background-color:#FFCCCC;\"" : "";
                $jple = $PLACES['OCUPADES'] == $PLACES['TOTAL'];
                ?>
					                       	
					   		<TR>
					      		<TD <?php 
                echo $ple;
                ?>
><?php 
                echo radiobutton_tag('D[CURS]', $C->getIdcursos(), false, array('onClick' => 'ActivaBoto(' . $jple . ');', 'class' => 'class_cursos '));
                ?>
</TD>					      		
					      		<TD <?php 
                echo $ple;
                ?>
>
					      		
									<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>

					      		</TD>
										      							      							      		
					      		<TD <?php 
                echo $ple;
                ?>
><?php 
                echo $C->getTitolcurs();
                ?>
 ( <?php 
                echo $C->getHoraris();
                ?>
 ) </TD>
					      		<TD <?php 
                echo $ple;
                ?>
><?php 
                echo $C->getPreu();
                ?>
 €</TD>      							
					      		<TD <?php 
                echo $ple;
                ?>
><?php 
                echo $C->getDatainici('d-m-Y');
                ?>
</TD>
					      		<TD <?php 
                echo $ple;
                ?>
><?php 
                echo $PLACES['OCUPADES'] . '/' . $PLACES['TOTAL'];
                ?>
</TD>
					      	</TR>                		                 										
					   <?php 
                $CAT_ANT = $C->getCategoria();
                ?>
                       <?php 
            }
            ?>
			   
					   <?php 
        }
        ?>
        					                         
					   </TABLE>
					   <br /><br />
                       
                       <?php 
        //Mirem que l'usuari es pugui matricular segons les dates de matrícules
        list($DIA_Y, $DIA_M, $DIA_D) = explode("-", TipusPeer::getDataIniciMatriculaAnticsAlumnes()->getTipusdesc());
        list($DIT_Y, $DIT_M, $DIT_D) = explode("-", TipusPeer::getDataIniciMatriculaTothom()->getTipusdesc());
        $DIA_T = mktime(0, 0, 0, $DIA_M, $DIA_D, $DIA_Y);
        $DIT_T = mktime(0, 0, 0, $DIT_M, $DIT_D, $DIT_Y);
        ?>

                       
					   <TABLE class="FORMULARI" width="100%">					   		
					   		<TR><TD width="100px;" style="font-size:10px;"><b>DESCOMPTE</b></TD><td><?php 
        echo select_tag('D[DESCOMPTE]', options_for_select(MatriculesPeer::selectDescomptesWeb(), MatriculesPeer::REDUCCIO_CAP));
        ?>
</TD></TR>
					   		<TR><TD width="100px"></TD>
                                <TD>    
                                    <?php 
        $avui = time();
        if (sizeof($MATRICULES) == 0) {
            if ($avui < $DIT_T) {
                echo "<div class=\"text\" style=\"font-weight:bold; \">El període de matrícules per a nous alumnes comença el dia " . date('d/m/Y', $DIT_T) . '</div>';
            } else {
                echo "<div>" . submit_tag('Matriculeu-me', array('name' => 'BMATRICULA', 'class' => 'BOTO_ACTIVITAT', 'style' => 'width:100px')) . '</div>';
            }
        } else {
            if ($avui < $DIA_T) {
                echo "<div style=\"font-size:11px; font-weight:bold; \">El període de matrícules per a antics alumnes comença el dia " . date('d/m/Y', $DIA_T) . '</div>';
            } else {
                echo '<div>' . submit_tag('Matriculeu-me', array('name' => 'BMATRICULA', 'class' => 'BOTO_ACTIVITAT', 'style' => 'width:100px')) . '</div>';
            }
        }
        ?>
                                     <br />
                                     <div class="text">Si necessita més informació sobre el nou sistema de matrícules, si us plau, cliqui <a href="<?php 
        echo url_for('web/index?accio=mc&node=35');
        ?>
">aquí</a>.</div>                                                                                                                                                                  
                                </TD>
                            </TR>
					   </TABLE>
					   
			<?php 
    }
    ?>
		            
	   </FIELDSET>
      
	   <FIELDSET class="REQUADRE"><LEGEND class="LLEGENDA">Cursos matriculats amb anterioritat</LEGEND>
	              
		   <TABLE class="DADES">
		   
		   <?php 
    if (sizeof($MATRICULES) == 0) {
        ?>
				<TR><TD>No tenim constància informàtica que hagueu realitzat un curs a la Casa de Cultura. <br />Si no és així, si us plau notifiqueu-nos-ho. </TD></TR>
           <?php 
    } else {
        ?>
                <TR><TD class="titol">CODI</TD>
                    <TD class="titol">NOM</TD>
                    <TD class="titol">ESTAT</TD>
                    <TD class="titol">DATA MATRÍCULA</TD>
                    <TD class="titol">DESCOMPTE</TD></TR>                                   
		   <?php 
    }
    ?>
		   
		   <?php 
    foreach ($MATRICULES as $M) {
        ?>
		      <?php 
        $CURSOS = $M->getCursos();
        ?>
                           
		   		<TR>
		   			<TD>
						<a href="#TB_inline?height=480&width=640&inlineId=hidden<?php 
        echo $CURSOS->getIdcursos();
        ?>
&modal=false" class="thickbox">
      						<?php 
        echo $CURSOS->getCodi();
        ?>
      					</a>
      					<div style="display:none" id="hidden<?php 
        echo $CURSOS->getIdcursos();
        ?>
">
      						<?php 
        echo $CURSOS->getDescripcio();
        ?>
      					</div>
      				</TD>		   				   			
		      		<TD><?php 
        echo $CURSOS->getTitolCurs();
        ?>
</TD>
		      		<TD><?php 
        echo MatriculesPeer::getEstatText($M->getEstat());
        ?>
</TD>
		      		<TD><?php 
        echo $M->getDataInscripcio('d/m/Y H:i');
        ?>
</TD>
		      		<TD><?php 
        echo MatriculesPeer::textDescomptes($M->getTReduccio());
        ?>
</TD>                                                                                             
			     </TR>                                   
		   <?php 
    }
    ?>
                              
		   </TABLE>
		      
	   </FIELDSET>
	      	      	   	   	
   	</form>
   
<?php 
}
Exemplo n.º 10
0
</span>
                    </div>
                    
                    <div class="clear row fb">
                        <span class="title row_title fb"><label for="cursos_VisibleAWeb">Pagament acceptat? </label></span>
                        <span class="row_field fb">
                            <div style="float: left; margin-right:10px;">
                                <b>Extranet</b><br />
                                <?php 
    echo select_tag('cursos[PagamentExtern]', options_for_select(TipusPeer::getTipusPagamentExternArray(), $FOC['PagamentExtern']->getValue()), array('multiple' => 'multiple', 'style' => 'height:140px; width:200px;'));
    ?>
                            </div>                        
                            <div style="float: left; margin-right:10px;">
                                <b>Intranet</b><br />
                                <?php 
    echo select_tag('cursos[PagamentIntern]', options_for_select(TipusPeer::getTipusPagamentInternArray(), $FOC['PagamentIntern']->getValue()), array('multiple' => 'multiple', 'style' => 'height:140px; width:200px;'));
    ?>
                            </div>                                                                                                
                        </span>
                    </div>

                    <div class="clear row fb">
                        <span class="title row_title fb"><label for="cursos_ADescomptes">Descomptes? </label></span>
                        <table>
                            <tr>                                
                                <td style=" width:200px; font-weight:bold; ">Text descompte</td>                                                    
                                <td style=" width:70px; font-weight:bold; ">Imp.</td>
                                <td style=" width:70px; font-weight:bold; ">% Desc.</td>
                                <td style=" width:70px; font-weight:bold; ">Import.</td>
                                <td style=" width:50px; font-weight:bold; ">Actiu?</td>
                            </tr>                            
Exemplo n.º 11
0
 public function h_getDescomptes()
 {
     $RET = array();
     foreach (explode('@', $this->getAdescomptes()) as $DESC) {
         $OT = TipusPeer::retrieveByPK($DESC);
         if ($OT instanceof Tipus) {
             $RET[$DESC] = $OT->getTipusdesc();
         }
     }
     return $RET;
 }
Exemplo n.º 12
0
 /**
  * Retorna els tipus de pagament que hi ha pel curs existent. 
  * @param intranet bool ( Indica si és per a usar a la intranet o a la extranet )
  * */
 public function getSelectPagaments($intranet = false, $mostra_escull = false)
 {
     $ALL = TipusPeer::getTipusPagamentInternArray();
     $RET = array();
     $SEL = $intranet ? $this->getPagamentintern() : $this->getPagamentextern();
     if ($mostra_escull) {
         $RET[0] = 'Escull una modalitat...';
     }
     foreach ($SEL as $E) {
         if (!empty($E)) {
             $RET[$E] = $ALL[$E];
         }
     }
     return $RET;
 }
Exemplo n.º 13
0
 /**
  * Ens mostra les categories que podem posar a les activitats i que després mostrà als nodes
  * */
 public static function selectCategoriaActivitat($idS, $web = false)
 {
     return TipusPeer::getTipusBy('class_activitat');
 }
Exemplo n.º 14
0
 static function textPagament($P)
 {
     return TipusPeer::getTipusPagamentString($P);
 }