Пример #1
0
 public function save($conn = null)
 {
     //Caldrà guardar els descomptes!!!!
     $this->updateObject();
     $OC = $this->getObject();
     $OC->save();
     $A_DESC = $this['ADescomptes']->getValue();
     //Guardem els descomptes
     DescomptesPeer::saveDescomptes($A_DESC, $OC->getIdcursos(), $OC->getSiteId(), DescomptesPeer::TIPUS_CURS);
     $OC->save();
     //Si guardem el curs per primera vegada, mirem les imatges que s'han entrat i que no tenen curs. Les assignarem a aquest.
     $dir = getcwd() . '/images/cicles/';
     $mini = false;
     $normal = false;
     $big = false;
     $pdf = false;
     $IDC = $OC->getIdcursos();
     foreach (glob($dir . 'C--*') as $K => $arxiu) {
         $a = str_replace($dir, "", $arxiu);
         //Si té un -M és la foto mini.
         if (substr_count($arxiu, "-M") > 0) {
             rename($arxiu, str_replace('--', '-' . $IDC . '-', $arxiu));
         }
         if (substr_count($arxiu, "-L") > 0) {
             rename($arxiu, str_replace('--', '-' . $IDC . '-', $arxiu));
         }
         if (substr_count($arxiu, "-XL") > 0) {
             rename($arxiu, str_replace('--', '-' . $IDC . '-', $arxiu));
         }
         if (substr_count($arxiu, "-PDF") > 0) {
             rename($arxiu, str_replace('--', '-' . $IDC . '-', $arxiu));
         }
     }
 }
 public function setup()
 {
     $this->setWidgets(array('idDescompte' => new sfWidgetFormChoice(array('choices' => DescomptesPeer::getDescomptesArray($this->getOption('IDS'), true, true))), 'idExtern' => new sfWidgetNumber(array(), array()), 'Nom' => new sfWidgetFormInput(array(), array('style' => 'width:200px;')), 'Percentatge' => new sfWidgetFormInput(array(), array('style' => 'width:50px;')), 'Preu' => new sfWidgetFormInput(array(), array('style' => 'width:50px;')), 'Tipus' => new sfWidgetFormChoice(array('choices' => array(1 => 'Estàndard'))), 'actiu' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No')), array()), 'site_id' => new sfWidgetFormInputHidden()));
     $this->setValidators(array('idDescompte' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIddescompte()), 'empty_value' => $this->getObject()->getIddescompte(), 'required' => false)), 'idExtern' => new sfValidatorInteger(array('required' => true)), 'Nom' => new sfValidatorString(), 'Percentatge' => new sfValidatorNumber(), 'Preu' => new sfValidatorNumber(), 'Tipus' => new sfValidatorInteger(array('min' => -32768, 'max' => 32767, 'required' => false)), 'actiu' => new sfValidatorInteger(array('min' => -128, 'max' => 127)), 'site_id' => new sfValidatorInteger(array('min' => -32768, 'max' => 32767))));
     $this->widgetSchema->setNameFormat('descomptes[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setLabels(array('idDescompte' => 'Escull un descompte: ', 'idExtern' => 'Titol', 'Descripcio' => 'Descripció', 'Percentatge' => 'Descompte (%)', 'Percentatge_txt' => 'Descompte text (20%)', 'Tipus' => 'Tipus'));
 }
 public function setup()
 {
     $this->setWidgets(array('idEntrada' => new sfWidgetFormInputHidden(), 'entrades_preus_horari_id' => new sfWidgetFormInputHidden(), 'usuari_id' => new sfWidgetFormJQueryAutocompleter(array('url' => $this->getOption('ajax')), array('style' => 'width:400px')), 'nom_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'email_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:200px')), 'telefon_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:200px')), 'quantitat' => new sfWidgetFormChoice(array('choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5')), array('style' => 'width:50px')), 'data' => new sfWidgetFormShowText(), 'estat' => new sfWidgetFormInputHidden(), 'tipus_pagament' => new sfWidgetFormChoice(array('choices' => EntradesReservaPeer::getTipusPagaments($this->getOption('IDH'), true)), array('style' => 'width:200px;')), 'descompte' => new sfWidgetFormChoice(array('choices' => DescomptesPeer::getDescomptesEntradesArray($this->getOption('IDH'), true)), array('style' => 'width:200px;')), 'actiu' => new sfWidgetFormInputHidden(), 'site_id' => new sfWidgetFormInputHidden(), 'comentari' => new sfWidgetFormTextarea()));
     if (!$this->isNew()) {
         $this->setWidget('estat', new sfWidgetFormChoice(array('choices' => EntradesReservaPeer::selectEstats())));
     }
     $this->setValidators(array('idEntrada' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdentrada()), 'empty_value' => $this->getObject()->getIdentrada(), 'required' => false)), 'entrades_preus_horari_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647)), 'usuari_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647, 'required' => false)), 'nom_reserva' => new sfValidatorString(array('required' => false)), 'email_reserva' => new sfValidatorString(array('required' => false)), 'telefon_reserva' => new sfValidatorString(array('required' => false)), 'quantitat' => new sfValidatorInteger(array('min' => -128, 'max' => 127)), 'data' => new sfValidatorDateTime(array('required' => false)), 'estat' => new sfValidatorInteger(array('min' => -32768, 'max' => 32767, 'required' => false)), 'tipus_pagament' => new sfValidatorInteger(array('required' => false), array()), 'descompte' => new sfValidatorInteger(array('required' => false), array()), 'actiu' => new sfValidatorInteger(array('min' => -128, 'max' => 127)), 'site_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647, 'required' => false)), 'comentari' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setLabels(array('usuari_id' => 'Usuari hospici: ', 'nom_reserva' => 'Nom: ', 'quantitat' => 'Entrades:', 'data' => 'Data: ', 'tipus_pagament' => 'Pagament?', 'comentari' => 'Comentari: '));
     $this->widgetSchema->setNameFormat('entrades_reserva[%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);
 }
Пример #5
0
 /**
  * Entra un preu i un array de descompte i es fan els càlculs pertinents
  * @param array('PREU'=>,'PERCENT'=>,'NOM'=>)
  * */
 public function getPreuAmbDescompte($idC, $idD)
 {
     $OC = self::retrieveByPK($idC);
     $P = $OC->getPreu();
     return DescomptesPeer::getPreuAmbDescompte($P, $idD);
 }
Пример #6
0
 public function executeGConfig(sfWebRequest $request)
 {
     $this->setLayout('gestio');
     $this->IDS = $this->getUser()->getSessionPar('idS');
     $this->accio = $request->getParameter('accio', 'C');
     $ROPTIONS = $request->getParameter('options', array('option_id' => '0'));
     $RESPAIS = $request->getParameter('espais', array('EspaiID' => '0'));
     $RMATERIAL = $request->getParameter('materialgeneric', array('idMaterialGeneric' => ''));
     $RDESCOMPTE = $request->getParameter('descomptes', array('idDescompte' => '0'));
     $this->FOPTIONS = OptionsPeer::initialize($ROPTIONS['option_id'], $this->IDS, false);
     $this->FESPAIS = EspaisPeer::initialize($RESPAIS['EspaiID'], $this->IDS);
     $this->FMATERIAL = MaterialgenericPeer::initialize($RMATERIAL['idMaterialGeneric'], $this->IDS);
     $this->FENTITAT = SitesPeer::initialize($this->IDS);
     //$this->FDESCOMPTE = DescomptesPeer::initialize( $RDESCOMPTE['idDescompte'] , $this->IDS );
     //Agafem el codi de facebook de l'usuari
     $this->FBI = UsuarisPeer::getUserFbCode($this->getUser()->getSessionPar('idU'));
     $this->PARS = array();
     $this->PARS = myUser::f_FbAuth(false, $this->getController()->genUrl('@fb_link', true));
     //Carreguem les dades del facebook.
     $this->ERROR = "";
     if ($request->hasParameter('BNEWOPTION')) {
         $this->accio = 'NEW_OPTION';
     }
     if ($request->hasParameter('BSAVEOPTION')) {
         $this->accio = 'SAVE_OPTION';
     }
     if ($request->hasParameter('BSAVEESPAI')) {
         $this->accio = 'SAVE_ESPAI';
     }
     if ($request->hasParameter('BDELETEESPAI')) {
         $this->accio = 'DELETE_ESPAI';
     }
     if ($request->hasParameter('BSAVEMATERIAL')) {
         $this->accio = 'SAVE_MATERIAL';
     }
     if ($request->hasParameter('BDELETEMATERIAL')) {
         $this->accio = 'DELETE_MATERIAL';
     }
     if ($request->hasParameter('BSAVESITE')) {
         $this->accio = 'SAVE_SITE';
     }
     if ($request->hasParameter('BSAVEDESCOMPTE')) {
         $this->accio = 'SAVE_DESCOMPTE';
     }
     switch ($this->accio) {
         case 'AJAX_OPCIO':
             return $this->renderText(OptionsPeer::getString($request->getParameter('IDO'), $this->IDS));
             break;
         case 'NEW_OPTION':
             $this->FOPTIONS = OptionsPeer::initialize($ROPTIONS['option_id'], $this->IDS, true);
             break;
         case 'SAVE_OPTION':
             $this->FOPTIONS->bind($ROPTIONS);
             if ($this->FOPTIONS->isValid()) {
                 $this->FOPTIONS->save();
                 $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FOPTIONS->getObject());
                 $this->FOPTIONS = OptionsPeer::initialize($this->FOPTIONS->getObject()->getOptionId(), $this->IDS, false);
             }
             break;
         case 'SAVE_ESPAI':
             //Si entrem un espai que és 0, llavors vol dir que fem un nou espai
             if ($RESPAIS['EspaiID'] == 0) {
                 unset($RESPAIS['EspaiID']);
             }
             $this->FESPAIS->bind($RESPAIS, $request->getFiles('espais'));
             if ($this->FESPAIS->isValid()) {
                 $this->FESPAIS->save();
                 $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FESPAIS->getObject());
                 $this->FESPAIS = EspaisPeer::initialize($this->FESPAIS->getObject()->getEspaiid(), $this->IDS);
             }
             //Agafem els multimèdia dels paràmetres
             $AMR = $request->getParameter('multimedia');
             $FMR = $request->getFiles('multimedia');
             foreach ($AMR as $K => $MR) {
                 if ($MR['accio'] == 1 || $MR['accio'] == 0) {
                     //És nou o una modificació
                     $FM = MultimediaPeer::initialize($MR['multimedia_id'], $MR['site_id'], $MR['taula'], $MR['id_extern'], $K);
                     $FM->bind($MR, $FMR[$K]);
                     $FM->saveNewUpdate();
                 } elseif ($MR['accio'] == 2) {
                     //S'ha d'esborrar
                     $FM = MultimediaPeer::initialize($MR['multimedia_id'], $MR['site_id'], $MR['taula'], $MR['id_extern'], $K);
                     $FM->delete();
                 }
             }
             break;
         case 'DELETE_ESPAI':
             $this->FESPAIS->getObject()->setActiu(false)->save();
             $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FESPAIS->getObject());
             $this->FESPAIS = EspaisPeer::initialize(0, $this->IDS);
             break;
         case 'SAVE_MATERIAL':
             //Si entrem un espai que és 0, llavors vol dir que fem un nou espai
             if ($RMATERIAL['idMaterialGeneric'] == 0) {
                 unset($RMATERIAL['idMaterialGeneric']);
             }
             $this->FMATERIAL->bind($RMATERIAL);
             if ($this->FMATERIAL->isValid()) {
                 $this->FMATERIAL->save();
                 $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FMATERIAL->getObject());
                 $this->FMATERIAL = MaterialgenericPeer::initialize($this->FMATERIAL->getObject()->getIdmaterialgeneric(), $this->IDS);
             }
             break;
         case 'DELETE_MATERIAL':
             $this->FMATERIAL->getObject()->setInactiu();
             $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FMATERIAL->getObject());
             $this->FMATERIAL = MaterialgenericPeer::initialize(0, $this->IDS);
             break;
             //Vincula l'usuari del facebook
         //Vincula l'usuari del facebook
         case 'FB_LINK':
             $idU = $this->getUser()->getSessionPar('idU');
             $OU = UsuarisPeer::retrieveByPK($idU);
             $FB_ID = $this->PARS['user']['id'];
             //Mirem si el número de facebook està associat a un altre usuari. Si és així, no fem res però emetem error.
             $OUF = UsuarisPeer::getUserFromFacebook($FB_ID);
             if ($OUF instanceof Usuaris) {
                 $this->ERROR = 'El compte de facebook actual està vinculat a un altre usuari. <br />Si us plau comuniqui-ho a informatica@casadecultura.org o bé entri al seu usuari de facebook i torni-ho a provar.';
             } elseif ($OU instanceof Usuaris) {
                 $OU->setFacebookid($this->PARS['user']['id']);
                 $OU->save();
             }
             $this->FBI = UsuarisPeer::getUserFbCode($this->getUser()->getSessionPar('idU'));
             break;
             //Desvincula l'usuari del facebook
         //Desvincula l'usuari del facebook
         case 'FB_UNLINK':
             $idU = $this->getUser()->getSessionPar('idU');
             $OU = UsuarisPeer::retrieveByPK($idU);
             $OU->setFacebookid(NULL);
             $OU->save();
             $this->FBI = UsuarisPeer::getUserFbCode($this->getUser()->getSessionPar('idU'));
             break;
             //Guardem els canvis a una entitat
         //Guardem els canvis a una entitat
         case 'SAVE_SITE':
             $RS = $request->getParameter('sites');
             $this->FENTITAT->bind($RS, $request->getFiles('sites'));
             if ($this->FENTITAT->isValid()) {
                 $this->FENTITAT->save();
                 $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FENTITAT->getObject());
                 $this->FENTITAT = SitesPeer::initialize($this->IDS);
             }
             break;
         case 'SAVE_DESCOMPTE':
             //Si entrem un descompte que és 0, vol dir que creem un nou descompte
             $this->FDESCOMPTE->bind($RDESCOMPTE);
             if ($this->FDESCOMPTE->isValid()) {
                 $this->FDESCOMPTE->save();
                 $this->getUser()->addLogAction($this->accio, 'gConfig', $this->FDESCOMPTE->getObject());
                 $this->FDESCOMPTE = DescomptesPeer::initialize($this->FDESCOMPTE->getObject()->getIddescompte(), $this->IDS);
             }
             break;
     }
 }
Пример #7
0
 public function getDescompteString()
 {
     $A_OD = DescomptesPeer::getDescomptesEntradesArray($this->getEntradesPreusHorariId(), true);
     return $A_OD[$this->getDescompte()];
 }
Пример #8
0
 public function getADescomptes()
 {
     $RET = array();
     $AOD = DescomptesPeer::getDescomptes($this->getIdcursos());
     foreach ($AOD as $OD) {
         $RET[$OD->getIddescompte()]['Id'] = $OD->getIddescompte();
         $RET[$OD->getIddescompte()]['Nom'] = $OD->getNom();
         $RET[$OD->getIddescompte()]['Preu'] = $OD->getPreu();
         $RET[$OD->getIddescompte()]['Percentatge'] = $OD->getPercentatge();
         $RET[$OD->getIddescompte()]['Actiu'] = $OD->getActiu();
     }
     return $RET;
 }
Пример #9
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 = DescomptesPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setIddescompte($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setIdextern($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setNom($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setPercentatge($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setPreu($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setTipus($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setActiu($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setSiteId($arr[$keys[7]]);
     }
 }
Пример #10
0
 /**
  * Aquesta funció guarda el descompte a la taula descomptes
  * */
 public function setDescomptes($v)
 {
     DescomptesPeer::saveDescomptes($v, $this->getHorariId(), $this->getSiteId(), DescomptesPeer::TIPUS_ENTRADA);
     return parent::setDescomptes(null);
 }
Пример #11
0
 public static function getPreuAmbDescompte($valor, $idD)
 {
     //Si no hi ha descompte, tornem el valor.
     if (is_null($idD)) {
         return $valor;
         //Si hi ha descompte, el busquem. Si no el trobem, no l'apliquem.
     } else {
         $OD = DescomptesPeer::retrieveByPK($idD);
         if (!$OD instanceof Descomptes || $idD == DescomptesPeer::CAP) {
             return $valor;
         } elseif ($OD->getPreu() > 0) {
             return $OD->getPreu();
         } else {
             return $valor - round((int) $valor * (double) $OD->getPercentatge() / (int) 100);
         }
     }
 }
Пример #12
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(DescomptesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(DescomptesPeer::DATABASE_NAME);
         $criteria->add(DescomptesPeer::IDDESCOMPTE, $pks, Criteria::IN);
         $objs = DescomptesPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Пример #13
0
        
        <!-- Si el curs no es ple, o bé es ple amb llista d'espera... -->
        <?php 
    $PAGAMENTS = $OC->getSelectPagaments(true);
    $ACCEPTA_LLISTA_ESPERA = array_key_exists(TipusPeer::PAGAMENT_LLISTA_ESPERA, $PAGAMENTS);
    ?>
        <?php 
    if ($ACCEPTA_LLISTA_ESPERA && $OC->isPle() || !$OC->isPle()) {
        ?>
        
        
            <!-- Preu i descomptes -->
            <div style="float: left; ">
                <div style="float: left; width:150px;"><b>Preu i descomptes: </b></div>
                <div style="float: left;"><?php 
        echo select_tag('matricules[descompte]', options_for_select(DescomptesPeer::getDescomptesCursArray($OC->getIdcursos(), true)), array('style' => 'width:300px', 'id' => 'DESCOMPTES'));
        ?>
</div>
            </div>
                                            
            <div id="compra" style="float: left; clear:both; margin-top:5px;">
                <div style="float: left; width:150px;"><b>Tipus de pagament? </b></div>
                <?php 
        if ($OC->isPle()) {
            ?>
                    <div style="float: left;"><?php 
            echo select_tag('matricules[mode_pagament]', options_for_select(array(TipusPeer::PAGAMENT_LLISTA_ESPERA => $PAGAMENTS[TipusPeer::PAGAMENT_LLISTA_ESPERA])), array('style' => 'width:300px'));
            ?>
</div>                                            
                <?php 
        } else {
 /**
  * Treu un llistat dels assistents a l'espectacle.
  * */
 public static function DocLlistatEntrades($IDH, $IDA, $idS)
 {
     //Comença la càrrega d'informació.
     $LOER = self::getEntradesVenudes($IDA, $IDH, true);
     $desc = DescomptesPeer::getDescomptesArray($idS, false, false);
     $OA = ActivitatsPeer::retrieveByPK($IDA);
     //$HTML = file_get_contents('c:\temp\hola.html');
     $HTML = OptionsPeer::getString('BODY_DOC_LLISTAT_ENTRADES', $idS);
     preg_match_all('/^\\s*####(.*?)####(.*?)####\\/(.*?)####\\s*$/sm', $HTML, $A);
     $FILA = "";
     $PATTERN = $A[2][0];
     $i = 1;
     $TMP = "";
     foreach ($LOER as $OER) {
         $TMP = $PATTERN;
         $TMP = str_replace('@@ID@@', $i++, $TMP);
         $TMP = str_replace('@@NOM_USUARI@@', $OER->getNomUsuari(), $TMP);
         $TMP = str_replace('@@CODI_UNIC@@', substr(sha1($OER->getIdentrada()), 0, 4), $TMP);
         $TMP = str_replace('@@QUANTITAT@@', $OER->getQuantitat(), $TMP);
         $TMP = str_replace('@@ESTAT@@', $OER->getEstatString(), $TMP);
         $TMP = str_replace('@@DESCOMPTE@@', $desc[$OER->getDescompte()], $TMP);
         $TMP = str_replace('@@COMENTARI@@', $OER->getComentari(), $TMP);
         $FILA .= $TMP;
     }
     //CONSULTEM USUARI
     $HTML = str_replace('@@NOM_ESPECTACLE@@', $OA->getNom(), $HTML);
     $HTML = str_replace($A[0][0], $FILA, $HTML);
     return $HTML;
 }