public function usuarios_por_profesor($inicio = false, $fin = false, $grafica = 'usuarios_por_clases')
 {
     if (!$fin) {
         $fin = current_time('timestamp');
     }
     if (!$inicio) {
         $inicio = current_time('timestamp') - dias(14);
     }
     $unix_time_inicio = strtotime($inicio);
     $unix_time_fin = strtotime($fin);
     $dias = ($unix_time_fin - $unix_time_inicio) / 60 / 60 / 24;
     $html = '';
     $profesores = get_posts(array('post_type' => 'instructor', 'posts_per_page' => -1, 'fields' => 'ids'));
     if (!$profesores) {
         return;
     }
     $html .= $this->js_css();
     foreach ($profesores as $profe_id) {
         $data = array('fechas' => array());
         $profe = new Instructor($profe_id);
         $clases_por_fecha = $profe->get_clases($inicio, $fin, true, true);
         $maximo_bicis_dia = 0;
         if ($clases_por_fecha) {
             foreach ($clases_por_fecha as $fecha => $clase_array) {
                 if (!count($clase_array)) {
                     continue;
                 }
                 /*SETEAMOS EL DIA EN EL QUE TRABAJAMOS*/
                 if (!isset($data['fechas'][$fecha])) {
                     $data['fechas'][$fecha] = array();
                 }
                 /*RECORREMOS LAS CLASES*/
                 foreach ($clase_array as $clase_objeto) {
                     $clase = new Clase($clase_objeto->ID);
                     $bicis_totales = $clase->cantidad_bicis(2);
                     $bicis_disponibles = $clase->cantidad_bicis(1);
                     $bicis_tomadas = $bicis_totales - $bicis_disponibles;
                     if ($maximo_bicis_dia < $bicis_tomadas) {
                         $maximo_bicis_dia = $bicis_tomadas;
                     }
                     $data['fechas'][$fecha][] = array('hora' => date_i18n('H:i', $clase->fecha), 'asistencia' => $bicis_tomadas, 'totales' => $bicis_totales, 'id_clase' => $clase->ID, 'instructor' => get_the_title($clase->instructor));
                 }
             }
             $data['maximo'] = $maximo_bicis_dia;
             $data['instructor'] = $profe->nombre;
             $data['instructor_foto'] = $profe->foto;
             /*UNA VEZ SETEADA LA INFORMACIÓN LA IMPRIMIMOS*/
             $html .= $this->crear_grafica('usuarios_por_clases', $data);
             $html .= $this->crear_grafica('porcentaje_por_clases', $data);
         }
     }
     return $html;
 }
Example #2
0
 static function clases()
 {
     //METODO ESTATICO QUE DEVUELVE TODAS LAS CLASES DE LA BASE
     $cs = array();
     $conn = new Conexion();
     $sql = 'SELECT id_clase FROM clase';
     $consulta = $conn->prepare($sql);
     $consulta->setFetchMode(PDO::FETCH_ASSOC);
     try {
         $consulta->execute();
         $results = $consulta->fetchall();
         foreach ($results as $r) {
             $c = Clase::clase($r['id_clase']);
             array_push($cs, $c);
         }
     } catch (PDOException $e) {
     }
     return $cs;
 }
Example #3
0
<?php

global $post;
$clase = new Clase($post->ID);
?>
<!doctype html>
<html lang="es">
<head>
    <title>Siclo.com</title>
    <meta charset="utf-8" /> 
    <meta property="og:title" content="Siclo.com" />
    <meta property="og:type" content="website" />
    <meta property="og:image" content="<?php 
plantilla();
?>
/images/share/share_facebook.jpg" />
    <meta name="twitter:image:src" content="<?php 
plantilla();
?>
/images/share/share_facebook.jpg">
    <meta property="og:description" content="Acabo de reservar con <?php 
echo get_the_title($clase->instructor);
?>
 en Síclo. ¡A mi nadie me pedalea la bici!" />
</head>
<body>
<?php 
if (!isset($_GET['imprimir_reserva'])) {
    ?>
	<script type="text/javascript">document.location.href="<?php 
    echo get_home_url();
Example #4
0
require_once '../wp-load.php';
global $admin;
class Admin
{
    function permisos()
    {
        return true;
    }
}
$admin = new Admin();
$clases = get_posts(array('post_type' => 'clase', 'posts_per_page' => -1, 'fields' => 'ids', 'meta_query' => array(array('key' => 'instructor', 'value' => 504, 'compare' => '='))));
$html = '';
if ($clases) {
    foreach ($clases as $id) {
        $clase = new Clase($id);
        $html .= $clase->imprimir_reservaciones();
    }
}
function imagenes()
{
    return '';
}
?>
<html>
<head>
<title>Hola</title>
<style type="text/css">
.bookings_bottom {
	display: none;
}
 public function print_dia($dia = 0, $clases_format = array(), $imprimir = true, $defecto = false, $front = false)
 {
     $dia = $this->fecha_inicio + dias($dia);
     $numero_dia = date('d', $dia);
     $titulo = '<strong>' . $numero_dia . '</strong>' . date_i18n(' l', $dia);
     $html = '';
     $html .= '<section class="dia col text-center">';
     $html .= $this->print_horas_guia();
     $html .= '<div class="contenedor_dia contcal gris4">';
     $html .= '<h2 class="titlecal text-center gris3 color_gris2">' . $titulo . '<small class="repetir_semana color_v_oscuro" style="display:none;" data-dia_repetir="' . $dia . '">Repetir anterior</small></h2>';
     for ($h = $this->hora_min; $h < $this->hora_max; $h++) {
         /*HORAS*/
         $html .= '<section class="hora" data-hora="' . $h . '" data-dia="' . $dia . '">';
         $html .= '<h2>' . $h . ':00hs</h2>';
         if (isset($clases_format[$h . '_' . $numero_dia])) {
             $cantidad = count($clases_format[$h . '_' . $numero_dia]);
             foreach ($clases_format[$h . '_' . $numero_dia] as $clase) {
                 $c = new Clase($clase->ID);
                 $this->instructores[$c->instructor] = true;
                 $data_link = 'data-link="' . get_permalink($c->ID) . '"';
                 if ($c->is_completa() || !$imprimir) {
                     $data_link = '';
                 }
                 $css = $defecto && $defecto == $c->ID ? 'clase_calendario centrado_vertical reserva_usando' : 'clase_calendario centrado_vertical';
                 if (!$front) {
                     $html .= '<article ' . $data_link . ' data-clase_calendario="' . $c->ID . '" class="' . $css . ' text blanco" ><div class="elemento_centrado" data-instructor="' . $c->instructor . '">';
                     $html .= get_the_title($c->instructor) . '<time>' . date_i18n('g:i A', $c->fecha) . '</time><small>' . $c->tipo . '</small>';
                     $html .= '</div></article>';
                 } else {
                     $data_cc = $data_link !== 'data-selclase="' . get_permalink($c->ID) . '"' ? '' : '';
                     $tipo = $c->tipo ? $c->tipo : '<br/>';
                     $small = "";
                     $status = get_post_field('post_status', $c->ID);
                     $pasada = $c->fecha < current_time('timestamp');
                     if ($pasada) {
                         $css .= ' clase_pasada';
                     }
                     if ($tipo !== '<br/>') {
                         $small .= '<small>' . $tipo . '</small>';
                     }
                     $html .= '<div ' . $data_cc . ' class="' . $css . ' text blanco" data-clase_calendario="' . $c->ID . '" data-instructor="' . $c->instructor . '">' . "<div class='large'>" . get_the_title($c->instructor) . "</div>" . "<small class='superSmall'>" . $small . "</small>" . "<div class='medium'><strong>" . date_i18n('g:i A', $c->fecha) . "</strong></div>" . "</div>";
                 }
             }
         }
         $html .= '</section>';
     }
     $html .= '</div>';
     $html .= '</section>';
     if ($imprimir) {
         echo $html;
     } else {
         return $html;
     }
 }
Example #6
0
 public function imprimir_historial_back($pendientes = true)
 {
     $clase = new Clase($this->clase);
     $numero_dia = date('d', $clase->fecha);
     $titulo = date_i18n('l ', $clase->fecha) . $numero_dia;
     $comprador = get_user_by('id', $this->comprador);
     if (!$comprador) {
         return;
     }
     $userTitle = '<span class="upcoming_reservations_date">' . $titulo . '</span><span class="upcoming_reservations_span upcoming_reservation_address">' . get_the_title($clase->get_ubicacion()) . '</span><span class="upcoming_reservation_separator">/</span><span class="upcoming_reservation_user">' . $comprador->display_name . '</span><span class="upcoming_reservation_separator">/</span><span class="upcoming_reservations_span upcoming_reservation_time">' . date_i18n('g:i A', $clase->fecha) . '</span>';
     if ($pendientes) {
         return print_single_option($this->ID, array('titulo' => $userTitle, 'extra' => editar_opcion(false, false, false, 'eliminar_reserva basic_bookings symbols', '<img src="' . imagenes(false) . '/trash_bookings.png" />', $this->ID) . editar_opcion($this->ID, 'editar_reserva', false, 'basic_bookings symbols', '<img src="' . imagenes(false) . '/editar.png" />'), 'class' => 'bookings_bottom_single'), false);
     } else {
         return print_single_option($this->ID, array('titulo' => $userTitle, 'class' => 'bookings_bottom_single bookings_bottom_single_pastReservations'), false);
     }
 }
Example #7
0
echo $form->labelEx($model, 'um');
?>
		<?php 
echo $form->textField($model, 'um', array('size' => 3, 'maxlength' => 3));
?>
		<?php 
echo $form->error($model, 'um');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'codclase');
?>
	       <?php 
$datos1 = CHtml::listData(Clase::model()->findAll(array('order' => 'nomclase')), 'codclasema', 'nomclase');
echo $form->DropDownList($model, 'codclase', $datos1, array('empty' => '--Seleccione una clase--'));
?>
		<?php 
echo $form->error($model, 'codclase');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'codgrupo');
?>
	     <?php 
$datos1 = CHtml::listData(Maestrogrup::model()->findAll(array('order' => 'descri2')), 'codgrupo', 'descri2');
echo $form->DropDownList($model, 'codgrupo', $datos1, array('empty' => '--Seleccione un grupo--'));
?>
Example #8
0
 public function eliminar()
 {
     /*AÑADIR ELIMINACION DE SALONES*/
     $clases = $this->get_clases(false);
     if ($clases) {
         foreach ($clases as $clase) {
             $c = new Clase($clase);
             $c->eliminar();
         }
     }
     eliminar($this->ID);
 }
 function reservaciones_salon($id_salon = false)
 {
     if (!$id_salon) {
         return;
     }
     $salon = new Salon($id_salon);
     $html = '<div class="instructor_incoming_calendar">';
     /*SETEAMOS LOS CALENDARIOS*/
     $calendario = new Calendario(array('tipo' => 'back_end', 'data_tipo' => $salon->ID, 'ID' => 'semana_1'));
     $calendario2 = new Calendario(array('tipo' => 'back_end', 'data_tipo' => $salon->ID, 'ID' => 'semana_2', 'fecha_inicio' => strtotime(date_i18n('Y-m-d')) + dias(7)));
     $html .= '<div class="nueva_cabe_fer">';
     $html .= '<span class="titulo_fer_n">Reservaciones</span>';
     $html .= $calendario->imprimir_cabecera_back('semana_1', true);
     $html .= $calendario2->imprimir_cabecera_back('semana_1', true);
     $html .= '</div>';
     /*CABECERA DIAS-----*/
     $html .= $calendario->print_dias_reserva();
     $html .= '</div>';
     /*SEMANA 1*/
     $html .= '<div id="semana_1" class="calendario_back_end">';
     foreach ($salon->get_clases(true, strtotime(date_i18n('Y-m-d')), strtotime(date_i18n('Y-m-d')) + dias(7), true) as $clase) {
         $c = new Clase($clase->ID);
         $html .= $c->imprimir_reservaciones();
     }
     $html .= '</div>';
     /*SEMANA 2*/
     $html .= '<div id="semana_2" class="calendario_back_end escondido">';
     foreach ($salon->get_clases(true, strtotime(date_i18n('Y-m-d')) + dias(8), strtotime(date_i18n('Y-m-d')) + dias(15), true) as $clase) {
         $c = new Clase($clase->ID);
         $html .= $c->imprimir_reservaciones();
     }
     $html .= '</div>';
     return $html;
 }
Example #10
0
            include '../vista/modulos/form-asistencia.php';
            break;
        case 'seleccionarClase':
            $tituloModulo = 'Bedel&iacute;a | Seleccionar una clase';
            include_once '../modelo/clase.class.php';
            $cs = Clase::clases();
            include '../vista/modulos/seleccionarClase.php';
            break;
        case 'registrar':
            $tituloModulo = 'Bedel&iacute;a | Registro de asistencias';
            if (!isset($_GET['clase'])) {
                header("Location: ../index.php");
            }
            include_once '../modelo/alumno.class.php';
            include_once '../modelo/clase.class.php';
            $c = Clase::clase($_GET['clase']);
            $as = $c->getAlumnos();
            include '../vista/modulos/registrarAsistencias.php';
            break;
        case 'editar':
            // Corregir con la vista correcta
            include '../vista/modulos/form-asistencia.php';
            break;
        default:
            header('Location: ../index.php');
    }
    die;
}
if (!isset($_POST['action'])) {
    header("Location: ../index.php");
}
Example #11
0
require_once '../../../../wp-load.php';
$id_class = isset($_POST['id_calendario']) ? $_POST['id_calendario'] : false;
?>
<div class="row columna_cabecera">
    <div class="col-xs-5"><small class="rounded azul back">Volver al calendario</small></div>
    <div class="col-xs-7 text-right">
        <span class="color_gris2 medium">Selecciona tu bici y entra en el <span class="color_azul">Si</span>clo.</span>
        <big class="color_negro">¡Ponte a <span class="color_azul">rodar</span>!</big>
    </div>
</div>
<hr>
<div class="row">
    <div class="col-md-7">
        <div class="clase_salon center-block">
            <?php 
$clase = new Clase($id_class);
$clase->imprimir_forma();
?>
        </div>
    </div>
    <div class="col-md-5 brr">
        <div class="paquetes gris4" id="info">
            <?php 
if (is_user_logged_in()) {
    global $current_user;
    $c = numero_clases_user($current_user->ID);
    if ($c === 0) {
        tarjeta();
    } else {
        usuarioinfo(false, false, true, $clase);
    }
Example #12
0
 function repetir_semana_anterior($dia = false)
 {
     global $admin;
     if (!$dia) {
         return;
     }
     if (!$admin->permisos('Administrador')) {
         return;
     }
     $anterior = $dia - dias(7);
     $entradas = get_posts(array('post_type' => 'clase', 'posts_per_page' => -1, 'fields' => 'ids', 'post_status' => array('future', 'publish'), 'date_query' => array(array('year' => date_i18n('Y', $anterior), 'month' => date_i18n('m', $anterior), 'day' => date_i18n('d', $anterior)))));
     if (!$entradas) {
         return '<script>alert("No hay clases asignadas en la semana anterior")</script>';
     }
     foreach ($entradas as $id) {
         $c = new Clase($id);
         $fecha = $c->fecha + dias(7);
         $fecha = date_i18n('Y-m-d', $fecha) . ' ' . date_i18n('H', $fecha) . ':' . date_i18n('i', $fecha) . ':00';
         $c->duplicar($fecha);
     }
 }