Пример #1
0
 /**
  * Carrego les dades bàsiques de les comandes que ha vist l'usuari
  **/
 public function getComandes()
 {
     $RET = array();
     $LlistatComandes = $this->db->select("\r\n                SELECT * \r\n                  FROM comandes c\r\n                  LEFT JOIN localitats l ON (l.l_idComanda = c.co_idComanda)\r\n                  LEFT JOIN sessions s ON (s.s_id = l.l_idSessio)\r\n                  LEFT JOIN espectacles e ON (e.e_id = s.s_idEspectacle)\r\n                 where c.co_IdClient = :id AND c.co_estat = 'P' AND l.l_estat = 'O'\r\n                ", array('id' => $this->client['c_id']));
     foreach ($LlistatComandes as $K => $V) {
         if (!isset($RET[$V['co_Codi']])) {
             $RET[$V['co_Codi']] = array();
         }
         $RET[$V['co_Codi']]['Espectacle'] = $V['e_Titol'];
         $RET[$V['co_Codi']]['Sessio'] = G::getDataText($V['s_DataHora']);
         $RET[$V['co_Codi']]['Seient'][] = $V['l_zona'] . '-' . $V['l_fila'] . '-' . $V['l_seient'];
         $RET[$V['co_Codi']]['URL_ENTRADES'] = Pdf::getEntradesWeb($V['co_Codi']);
     }
     return $RET;
 }
Пример #2
0
 /**
  * Funció de retorn del pagament amb targeta del TPV
  **/
 public function doPagamentResponse()
 {
     $Par = G::validaPagamentTPV($_GET['Ds_SignatureVersion'], $_GET['Ds_MerchantParameters'], $_GET['Ds_Signature']);
     $TotOK = false;
     $Errors = array();
     $Codi = 0;
     if (!isset($Par['idComanda'])) {
         $Errors[] = "El codi de comanda rebut no és correcte. Contacti amb el teatre.";
     } elseif (strcmp($Par['Error'], 'SIGNATURA') == 0) {
         $Errors[] = "La compra no s'ha pogut realitzar per un error en hash del TPV. Contacti amb el teatre.";
     } elseif (strcmp($Par['Error'], 'RESPONSE') == 0) {
         $Errors[] = "La compra no s'ha pogut realitzar perquè el tpv ha retornat un codi d'error.";
     } elseif (strcmp($Par['Error'], 'COMANDA') == 0) {
         $Errors[] = "La compra no s'ha pogut realitzar perquè el codi de comanda és incorrecte. Si us plau, contacti amb el teatre.";
     } else {
         $idComanda = $Par['idComanda'];
         if ($idComanda == Session::get('idComanda')) {
             $TotOK = true;
         } else {
             $Errors[] = "La comanda de la que s'ha fet el pagament no és la mateixa que s'està editant actualment.";
         }
     }
     //Redireccionem al home amb un id comanda
     $this->home($Par['idComanda']);
 }
Пример #3
0
 /**
  * Funció que guarda una sessió
  **/
 public function doSave($fromFormulari = false)
 {
     //Si entrem aquí des del formulari hem de validar les dades
     if ($fromFormulari) {
         if (empty($this->sessio['tmp_Dia'])) {
             throw new MyException("Has d'entrar un dia.");
         }
         if (empty($this->sessio['tmp_Hora'])) {
             throw new MyException("Has d'entrar una hora.");
         }
         if (empty($this->sessio['tmp_DiaCompra'])) {
             throw new MyException("Has d'entrar un dia d'inici de venda.");
         }
         if (empty($this->sessio['tmp_HoraCompra'])) {
             throw new MyException("Has d'entrar una hora d'inici de venda.");
         }
         if (empty($this->sessio['s_idTeatre'])) {
             throw new MyException("Has d'escollir un teatre.");
         }
         if (empty($this->sessio['s_Preus'])) {
             throw new MyException("Has d'entrar preus per un espectacle.");
         }
         if (empty($this->sessio['s_idEspectacle']) || !is_numeric($this->sessio['s_idEspectacle'])) {
             throw new MyException("Les sessions han de tenir un espectacle relacionat.");
         }
         $PreuVisibleInternet = false;
         foreach ($this->sessio['s_Preus'] as $OP) {
             if ($OP->isVisibleInternet()) {
                 $PreuVisibleInternet = true;
             }
             $OP->ValidaPreu();
         }
         if (!$PreuVisibleInternet && $this->sessio['s_VisibleWeb']) {
             throw new MyException("Si és visible a Internet, cal que hi hagi preus visibles a internet.");
         }
         //Convertim la data i hora en format UNIX
         $this->sessio['s_DataHora'] = G::ConvertToUnixTimestamp($this->sessio['tmp_Dia'], $this->sessio['tmp_Hora'], true);
         //Convertim la data i hora d'obertura de venda a UNIX
         $this->sessio['s_DataHoraCompra'] = G::ConvertToUnixTimestamp($this->sessio['tmp_DiaCompra'], $this->sessio['tmp_HoraCompra'], true);
         //Calculem els seients totals i els lliures si cal
         if ($this->sessio['s_Localitats'] == 0) {
             $TTO = new TeatreTableObject(null, TeatreTableObject::FROM_EMPTY);
             $TTO->loadById($this->sessio['s_idTeatre']);
             $this->sessio['s_Localitats'] = $TTO->getNumeroLocalitats();
         }
         if ($this->sessio['s_SeientsLliures'] == 0) {
             $this->sessio['s_SeientsLliures'] = $this->sessio['s_Localitats'];
         }
         //    if( $this->sessio['s_SeientsLliures'] > 0 ) throw new MyException("Estàs modificant un espectacle o sessió que ja té entrades venudes. Allibera les places abans de poder-ho modificar.");
         //Marquem que ja és correcte i el guardem
         $this->sessio['s_Correcte'] = 1;
     }
     //Convertim els preus en format json per guardar
     $this->sessio['s_Preus'] = json_encode($this->sessio['s_Preus']);
     //Esborrem els camps de suport
     $this->treuExtres();
     //Guardem la sessió
     if (!$this->getSessioId()) {
         $this->sessio['s_id'] = $this->db->insert('sessions', $this->sessio);
     } else {
         $this->db->update('sessions', $this->sessio, array('s_id' => $this->sessio['s_id']));
     }
     //Actualitzo la taula de mesos
     $stmt = $this->db->prepare('CALL update_mesos()');
     $stmt->execute();
 }
Пример #4
0
 /**
  * Recorda contrasenya
  **/
 public function ajaxRemember()
 {
     $R = $this->getAjaxData();
     $CTO = new ClientTableObject();
     if (!isset($R['TelefonUsuari']) || empty($R['TelefonUsuari'])) {
         throw new MyException("Has d'entrar un número telefònic per recordar la contrasenya.");
     }
     $CTO->loadByTelefon($R['TelefonUsuari']);
     //Canvio el password directament
     $Password = G::RandomString();
     $CTO->setPassword($Password);
     $CTO->doSave();
     //Envio el nou password al correu electrònic
     if (!G::sendEmailRemember($CTO->client['c_Email'], $Password)) {
         throw new MyException("No s'ha pogut enviar la nova contrasenya per un problema amb el correu. Si us plau, intenti-ho mes tard.");
     }
 }
Пример #5
0
?>
img/logo.png" alt="" />
            </a>
          </div>
          <div style="float:left; padding-top:20px; margin-left:20px;">
            <div style="font-size:22px; font-weight:bold;">TEATRE</div>            
            <div style="font-size:18px; color:#DDDDDD;">Palamós</div>
          </div>
        </div>
        <div class="col-lg-3" style="padding-top:80px; color:#c28068">
          <a class="btn btn-social-icon btn-twitter" target="_NEW" href="http://www.twitter.com/GorgaTeatre">
            <span class="fa fa-twitter"></span></a> 
          <a class="btn btn-social-icon btn-facebook" target="_NEW" href="http://www.facebook.com/TeatreLaGorga">
            <span class="fa fa-facebook"></span></a>        
          <?php 
echo G::generaData(time());
?>
          
        </div>
        <div class="col-lg-7" style="padding-top:80px;">        
          <a href="/">Inici</a> &nbsp;&nbsp;|&nbsp;&nbsp;   
          <a href="/calendari">Calendari</a> &nbsp;&nbsp;|&nbsp;&nbsp; 
          <a href="/privacitat">Informació a l'espectador</a> &nbsp;&nbsp;|&nbsp;&nbsp;
          <a href="/usuaris">Amics del teatre</a> &nbsp;&nbsp;|&nbsp;&nbsp;
          <a href="/cistella">Cistella</a>
        </div>
      </div>
    </div>
    <div class="row hidden-lg">
      <div class="col-xs-12" id="capcalera2">
        <div class="col-xs-12" style="padding-top:20px;">