Ejemplo n.º 1
0
 public function guardar()
 {
     $tipo = $_REQUEST['tipo'];
     $nombre = $_REQUEST['nombre'];
     $descripcion = $_REQUEST['descripcion'] ?: null;
     $fecha = Escritorio::getFechaEcuador();
     $estado = 15;
     //En construccion
     $evento_nuevo = \App\Evento::firstOrCreate(['nombre' => $nombre, 'descripcion' => $descripcion, 'fecha' => $fecha, 'cantidad_participantes' => $_REQUEST['cantidad'], 'TIPO_id' => $tipo, 'ESTADO_id' => $estado]);
     if ($evento_nuevo != null) {
         header('Content-Type: application/json');
         echo json_encode(['status' => true, 'evento_nuevo_id' => $evento_nuevo->id]);
     } else {
         header('Content-Type: application/json');
         echo json_encode(['status' => false]);
     }
 }
Ejemplo n.º 2
0
 public function barrerTicket()
 {
     $quince_minutos_antes = date('H:i:s', time() - 60 * 60 * 5 - 15 * 60);
     $tickets = \App\Ticket::where('fecha', '<=', Escritorio::getFechaEcuador())->where('hora_creacion', '<', $quince_minutos_antes)->whereNotIn('ESTADO_id', [11, 12, 13])->get();
     //dd($tickets,$quince_minutos_antes);
     $i = 0;
     if (count($tickets) > 0) {
         foreach ($tickets as $ticket) {
             $i++;
             $this->cambiarEstado($ticket->id, 'anulada');
             $this->cambiarEstadoBicicleta($ticket->id, 'buena');
         }
     }
     $mensaje = '<i class="fa fa-check"></i> Se han anulado ' . $i . ' tickets por expiraci&oacute;n';
     header('Content-Type: application/json');
     echo json_encode(['status' => true, 'mensaje' => $mensaje]);
 }
Ejemplo n.º 3
0
</option>
                                <?php 
}
?>
                            </select>
                        </div>

                        <!--fecha-->
                        <div class="form-group espacio">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input type="text" class="form-control" id="filtro_fecha"
                                       readonly value="<?php 
echo Escritorio::getFechaEcuador();
?>
">
                            </div>
                        </div>
                        <script>
                            $('#filtro_fecha').datepicker({
                                format: "yyyy-mm-dd",
                                autoclose: true,
                                todayBtn: "linked",
                                language: "es",
                                orientation: "top right",
                                todayHighlight: true
                            });
                        </script>