Пример #1
0
 public function actionNotificar()
 {
     if (isset($_GET['uid'], $_GET['eid'], $_GET['tipo'], $_GET['token'])) {
         if ($_GET['uid'] > 0 and $_GET['eid'] > 0 and $_GET['token'] == hash('crc32b', round(time() * 0.01))) {
             //$admin=Usuarios::model()->findByPk(184);
             $admin = Usuarios::model()->findByPk(57);
             $admin2 = Usuarios::model()->findByPk(17);
             $evento = Evento::model()->findByPk($_GET['eid']);
             $usuario = Usuarios::model()->findByPk($_GET['uid']);
             $boletos = array();
             $out = "";
             if (isset($_GET['vid'], $_GET['b1']) and $_GET['vid'] > 0) {
                 $i = 1;
                 while (isset($_GET['b' . $i])) {
                     $clave = $_GET['b' . $i];
                     if (strlen($clave) == 16 and is_numeric($clave)) {
                         $parametros = array('VentasId' => intval($_GET['vid']), 'EventoId' => intval(substr($clave, 0, 4)), 'FuncionesId' => intval(substr($clave, 4, 2)), 'ZonasId' => intval(substr($clave, 6, 2)), 'SubzonaId' => intval(substr($clave, 8, 2)), 'FilasId' => intval(substr($clave, 10, 3)), 'LugaresId' => intval(substr($clave, 13, 3)));
                         $boleto = Ventaslevel1::model()->with(array('evento', 'funcion', 'zona', 'subzona', 'fila', 'lugar'))->findByPk($parametros);
                         if (is_object($boleto)) {
                             $boletos[] = $boleto;
                         } else {
                             print_r($parametros);
                         }
                         $out .= CJSON::encode($parametros);
                     } else {
                         echo "No es valido";
                     }
                     $i++;
                 }
             }
             $tabla = "<table class='table '>\n\t\t\t\t\t\t\t\t<tr> <th>Evento</th> <th>Funcion</th> <th>Zona</th> <th>Subzona</th> <th>Fila</th> <th>Lugar</th> </tr> ";
             foreach ($boletos as $boleto) {
                 $tabla .= sprintf("\n\t\t\t\t\t\t\t\t\t\t<tr> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> ", $boleto->evento->EventoNom, $boleto->funcion->funcionesTexto, $boleto->zona->ZonasAli, $boleto->subzona->SubzonaId, $boleto->fila->FilasAli, $boleto->lugar->LugaresNum);
             }
             $tabla .= "</table>";
             $texto = sprintf("\n\t\t\t\t\t\t\t\t<div style='background:#d35400;color:#FFF;width:500px;display:block;padding:5px;margin:auto'> \n\t\t\t\t\t\t\t\t<h2>Aviso de %s </h2>\n\t\t\t\t\t\t\t\t<div style='background:#fff;color:#2c3e50;padding:7px;'>\n\t\t\t\t\t\t\t\tEl usuario %s ha hecho una %s en el evento %s el día %s.<br/>\n\t\t\t\t\t\t\t\t<br /><p style='color:#95a5a6'>\n\t\t\t\t\t\t\t\t%s\t\n\t\t\t\t\t\t\t\tÉsta es una notificación automatica generada por el sistema, por favor no reponda a esta dirección.\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<pre>%s</pre>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t", $_GET['tipo'], $usuario->UsuariosNom, strtoupper($_GET['tipo']), $evento->EventoNom, date('d/m Y H:i:s'), $tabla, $out);
             echo $admin->notificar('Taquillacero/Punto de venta :: Se ha realizado una ' . $_GET['tipo'], $texto) ? 1 : 0;
             echo $admin1->notificar('Taquillacero/Punto de venta :: Se ha realizado una ' . $_GET['tipo'], $texto) ? 1 : 0;
         } else {
             echo -1;
         }
     } else {
         echo 0;
     }
 }
Пример #2
0
Файл: Filas.php Проект: cicb/tpc
 public function beforeDelete()
 {
     //Antes de eliminar la fila verifica que no tenga ventas y elimina tambien sus lugares
     $identificador = array('EventoId' => $this->EventoId, 'FuncionesId' => $this->FuncionesId, 'ZonasId' => $this->ZonasId, 'SubzonaId' => $this->SubzonaId, 'FilasId' => $this->FilasId);
     $ventas = Ventaslevel1::model()->countByAttributes(array('EventoId' => $this->EventoId));
     if ($ventas == 0) {
         //Si no hay ventas se procede a eliminar sus asientos
         Lugares::model()->deleteAllByAttributes($identificador);
         return parent::beforeDelete();
     } else {
         //Si existen ventas no se puede eliminar
         return false;
     }
 }
Пример #3
0
 public function actionInconsistencias()
 {
     $boletos = array('70182964699', '0103875289497', '1726565439985', '00185205198797', '203649164637', '228752538227', '2311341751208', '2406354565123', '2615212674826', '2693422095792', '2714584935648', '353121807382', '370874480886', '3921323231506', '4493003155697', '4804792079710', '482643791645', '6135458826682', '619313763942', '6880644607858', '701829646997', '7055957808097', '7828248747425', '8662124364912', '8773721912410', '9434049877971', '9462669052607', '9871131532699', '360099704808', '9906112730518', '5092522751947');
     $reportes = new Reportes();
     foreach ($boletos as $boleto) {
         // $this->renderPartial('inconsistencias',compact($boletos));
         $boleto = substr($boleto, 0, 12);
         $level1 = Ventaslevel1::model()->findByAttributes(array('LugaresNumBol' => $boleto));
         // if (is_object($level1)) {
         // 	echo "$boleto : OK <br>";
         // }
         // else
         // 	echo "$boleto no OK <br>";
         $this->renderPartial('/reportes/widgets/tablaHistorico', compact(array('boleto', 'reportes')));
     }
 }
Пример #4
0
 public function esEditable()
 {
     // Verifica que la distribucion solo este asignada a un evento que es el mismo que el evento del que se quiere editar
     $neventos = sizeof($this->eventos);
     if ($neventos > 1) {
         return false;
     } else {
         if ($neventos > 0) {
             $ventas = Ventaslevel1::model()->countByAttributes(array('EventoId' => $this->eventos[0]->EventoId));
             return $ventas == 0;
         }
     }
     return false;
 }
Пример #5
0
 public function buscarBoletos($referencia = false, $numerosBoletos = false)
 {
     if (!($referencia or $numerosBoletos)) {
         # Si ambos filtros estan desactivados regresa vacio
         return array();
     } else {
         $criteria = new CDbCriteria();
         $criteria->limit = 10;
         if ($numerosBoletos and is_array($numerosBoletos)) {
             # Si pasan un arr1eglo de numeros de boletos
             #Valida que todos los numero de referencia sean validos
             foreach ($numerosBoletos as $LugaresNumBol) {
                 # Si al menos uno no es valido se detiene la operacion
                 if (empty($LugaresNumBol) or !is_numeric($LugaresNumBol) or strlen($LugaresNumBol) != 12) {
                     return array();
                 }
             }
             $criteria->addInCondition('t.LugaresNumBol', $numerosBoletos);
         }
         if ($referencia and is_string($referencia)) {
             # Si le pasan una referencia
             $this->validarEntrada($referencia, 'referencia');
             $criteria->compare('venta.VentasNumRef', $referencia);
         }
         # Busca los boletos de la venta y los devuelve en el formato de impresion de boletos
         // $criteria=new CDbCriteria;
         // $criteria->limit=10;
         // $criteria->select='subzona.SubzonaAcc , zona.ZonasAli, fila.FilasAli, lugar.LugaresLug, VentasBolTip, precios.VentasCosBol, VentasCarSer, EventoDesBol, EventoNom, ForoNom, funcionesTexto, VentasCon, LugaresNumBol';
         $boletos = Ventaslevel1::model()->with(array('venta', 'evento', 'funcion', 'zona', 'subzona', 'fila', 'lugar', 'precios', 'foro'))->findAll($criteria);
         return $boletos;
     }
 }
Пример #6
0
Файл: Zonas.php Проект: cicb/tpc
 public function eliminarLugares()
 {
     // Elimina de la base de datos todos los lugares de esta zona dejando intacto las subzonas y las filas
     $identificador = array('EventoId' => $this->EventoId, 'FuncionesId' => $this->FuncionesId, 'ZonasId' => $this->ZonasId);
     $ventas = Ventaslevel1::model()->countByAttributes(array('EventoId' => $this->EventoId));
     if ($ventas == 0) {
         //Si no hay ventas elimina todos los lugares
         $ret = Lugares::model()->deleteAllByAttributes($identificador);
         return $ret;
     } else {
         return -1;
     }
 }