示例#1
0
 static function isPle($IDC, $idS)
 {
     //Si les places ocupades són més grans o igual que el total, el curs és ple
     $PLACES = CursosPeer::getPlaces($IDC, $idS);
     return $PLACES['OCUPADES'] >= $PLACES['TOTAL'];
 }
示例#2
0
 static function CalculaPreu($IDCURS, $DESCOMPTE, $idS)
 {
     //Recuperem les places del curs
     $PLACES = CursosPeer::getPlaces($IDCURS, $idS);
     //Si les places ocupades són iguals o més que el total, fem la matrícula gratuïta.
     if ($PLACES['OCUPADES'] >= $PLACES['TOTAL']) {
         $DESCOMPTE = MatriculesPeer::REDUCCIO_GRATUIT;
     }
     //Carreguem el curs i retornem el preu reduit o normal segons el que hem entrat
     $CURS = CursosPeer::retrieveByPK($IDCURS);
     switch ($DESCOMPTE) {
         case MatriculesPeer::REDUCCIO_CAP:
             return $CURS->getPreu();
         case MatriculesPeer::REDUCCIO_ATURAT:
             return $CURS->getPreur();
         case MatriculesPeer::REDUCCIO_JUBILAT:
             return $CURS->getPreur();
         case MatriculesPeer::REDUCCIO_MENOR_25_ANYS:
             return $CURS->getPreur();
         case MatriculesPeer::REDUCCIO_GRATUIT:
             return 0;
         case MatriculesPeer::REDUCCIO_ESPECIAL:
             return $CURS->getPreur();
     }
 }
示例#3
0
文件: Cursos.php 项目: nagiro/intra
 public function getPlacesArray()
 {
     return CursosPeer::getPlaces($this->getIdcursos(), $this->getSiteId());
 }
 
	      	</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>';
        }
    }
    ?>
      
示例#5
0
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 
}