/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($name)
 {
     $deporte = new Deporte();
     $service = new Actividad();
     $id = Auth::user()->id;
     $empresa = Empresa::find($id);
     $deportes = $empresa->deportes;
     $servicios = $empresa->actividades;
     return View::make('dashboard.dashboard', array('empresaNombre' => $name, 'deport' => $deporte->comboDeporte(), 'service' => $service->comboServicios(), 'deportes' => $deportes, 'servicios' => $servicios));
 }
예제 #2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Deporte the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Deporte::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
    $respuesta .= "<option id='" . $act['id_actividad'] . "'><a href='#'>" . $act['profesor'] . " - " . $act['deporte'] . $hora . "</a></option>";
}
$respuesta .= "</select>";
echo $respuesta;
?>
                            <br>
                            <?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'actividad-form'));
?>
                            <div class="form-group">
                                <?php 
echo $form->labelEx($deporte, 'Deporte');
$form->labelEx($deporte, 'Deporte');
?>
                                <?php 
echo $form->dropDownList($actividad, 'id_deporte', CHtml::listData(Deporte::model()->findAll(), 'id_deporte', 'deporte'), array('empty' => 'Seleccione el deporte', 'class' => "form-control"));
?>
                            </div>
                            <div class="form-group">
                                <?php 
$criteria = new CDbCriteria();
$criteria->condition = 'id_usuario IN (select id_usuario from actividad where id_actividad IN ( select id_actividad from actividad where id_institucion = :institucion ))';
$criteria->params = array(':institucion' => Yii::app()->user->id);
$usuario = FichaUsuario::model()->findAll($criteria);
?>
                                <?php 
echo $form->labelEx($ficha_usuario, 'Profesor');
?>
                                <?php 
echo $form->dropDownList($actividad, 'id_usuario', CHtml::listData(FichaUsuario::model()->findAll($criteria), 'id_usuario', 'nombre', 'apellido'), array('prompt' => 'Seleccione el profesor', 'class' => "form-control"));
?>
<br>
<br>
<br>
<div class="container" style="z-index:300; width:300px; margin-left:13%;">
    <form class="form" method="post" action="ListaDeInscripcion" >
        <?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'actividad-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'clientOptions' => array('validateOnSubmit' => true)));
?>
        <div class="col-md-12">
            <?php 
echo CHtml::beginForm('InscripcionActividad', 'post');
?>
            <br>
            <div class="form-group">
                <?php 
echo $form->dropDownList($deportes, 'id_deporte', CHtml::listData(Deporte::model()->findAll(), 'id_deporte', 'deporte'), array('empty' => 'Seleccione el deporte', 'class' => "form-control", "onchange" => "BuscadorGimnasios();", "id" => "ListaDeporte", "name" => "deporte"));
?>
                <?php 
echo $form->error($deportes, 'deporte');
?>
            </div>
            <br>
            <div class="form-group">
                <?php 
echo $form->dropDownList($localidad, 'id_provincia', CHtml::listData(Provincia::model()->findAll(), 'id_provincia', 'provincia'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('Usuario/SeleccionarLocalidad'), 'update' => '#' . CHtml::activeId($localidad, 'id_localidad')), 'prompt' => 'Seleccione una Provincia', 'class' => "form-control", "onchange" => "BuscadorGimnasios();"));
?>
                <?php 
echo $form->error($localidad, 'id_provincia');
?>
            </div>
            <br>
예제 #5
0
        </nav>
    </div>
</header>
<div class="container">
    <div class='row'>
        <?php 
echo "<br>\n        <br>\n        <br>\n        <br>\n        <br>\n        <br>";
if ($actividades_alumno != null) {
    echo "<table id='veractividades' class='display' cellspacing='0' width='100%'>\n\t            <thead class='fuente'>\n\t\t          <tr><th>Deporte</th><th>Días y Horarios</th><th>Valor actividad</th><th>Desafectar actividad</th></tr>\n\t\t        </thead>\n\t\t        <tbody class='fuente'>";
    foreach ($actividades_alumno as $act_alum) {
        $act = Actividad::model()->findByAttributes(array('id_institucion' => $ins->id_institucion, 'id_actividad' => $act_alum->id_actividad));
        if ($act != null) {
            echo "<tr>";
            echo "<input type='hidden' value='{$act->id_actividad}' id='idactividad'></input>";
            echo "<input type='hidden' value='{$act_alum->id_usuario}' id='idalumno'></input>";
            $deporte = Deporte::model()->findByAttributes(array('id_deporte' => $act->id_deporte));
            echo "<td id='depo'>{$deporte->deporte}</td>";
            $acti_horarios = ActividadHorario::model()->findAllByAttributes(array('id_actividad' => $act->id_actividad));
            echo "<td id='diahor'>";
            foreach ($acti_horarios as $act_hor) {
                $dias = array('Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo');
                $id_dia = $act_hor->id_dia - 1;
                echo $dias[$id_dia] . "&nbsp;" . $act_hor->hora . ':' . ($act_hor->minutos == '0' ? '0' . $act_hor->minutos : $act_hor->minutos) . " - ";
            }
            echo "</td>";
            ?>
                    <td id='valor'><?php 
            echo $act->valor_actividad;
            ?>
</td>
                    <td id='elim'><a href="" data-toggle="modal" data-target="#myModal">Desafectar actividad</a></td>
예제 #6
0
<?php

$rango = 20;
if (isset($_POST["rango"]) and $_POST["rango"] != '') {
    $rango = $_POST["rango"];
}
require_once '../class/classDeporte.php';
$deporte = new Deporte($id, $nombre);
$deporte->listarDeporte();
//$sql="select first($rango) * from deportes";
//$result=mysql_query($sql, $conexion);
$cabecera = '<table class="table table-striped table-bordered bootstrap-datatable datatable" >
		<thead >
		<tr >
			<th>Deporte</th>
		</tr>
		</thead>   
		<tbody>';
$footer = "</tbody>\n\t\t\t</table>";
$tabladeporte = '';
while ($row = @mysql_fetch_array($deporte)) {
    $tabladeporte = $tabladeporte . ' <tr> <td style="width:300px;font-size:90%">' . $row->descripcion . '</td>
			</tr>';
}
$tabladeporte = $cabecera . $tabladeporte . $footer;
@mysql_close($conexion);
?>
 
	

예제 #7
0
 public function actionListarPagos()
 {
     if (isset($_POST['usuario']) && isset($_POST['anio'])) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'id_usuario = :id and anio = :anio and mes = :mes';
         $criteria->params = array(':id' => $_POST['usuario'], ':anio' => $_POST['anio'], ':mes' => $_POST['mes']);
         $pagos = Pago::model()->findAll($criteria);
         $result = array();
         foreach ($pagos as $p) {
             $horario = "";
             $dia = "";
             $mes = "";
             $actividad = Actividad::model()->findByPk($p->id_actividad);
             $deporte = Deporte::model()->findByPk($actividad->id_deporte);
             $actividad_horario = ActividadHorario::model()->findAll('id_actividad = :id', array(':id' => $p->id_actividad));
             foreach ($actividad_horario as $ah) {
                 if ($ah->id_dia == 1) {
                     $dia = "Lunes";
                 }
                 if ($ah->id_dia == 2) {
                     $dia = "Martes";
                 }
                 if ($ah->id_dia == 3) {
                     $dia = "Miercoles";
                 }
                 if ($ah->id_dia == 4) {
                     $dia = "Jueves";
                 }
                 if ($ah->id_dia == 5) {
                     $dia = "Viernes";
                 }
                 if ($ah->id_dia == 6) {
                     $dia = "Sabado";
                 }
                 if ($ah->id_dia == 7) {
                     $dia = "Domingo";
                 }
                 $horario = $horario . "Dia: " . $dia . " Horario: " . str_pad($ah->hora, 2, '0', STR_PAD_LEFT) . ":" . str_pad($ah->minutos, 2, '0', STR_PAD_LEFT);
             }
             if ($p->mes == 1) {
                 $mes = "Enero";
             }
             if ($p->mes == 2) {
                 $mes = "Febrero";
             }
             if ($p->mes == 3) {
                 $mes = "Marzo";
             }
             if ($p->mes == 4) {
                 $mes = "Abril";
             }
             if ($p->mes == 5) {
                 $mes = "Mayo";
             }
             if ($p->mes == 6) {
                 $mes = "Junio";
             }
             if ($p->mes == 7) {
                 $mes = "Julio";
             }
             if ($p->mes == 8) {
                 $mes = "Agosto";
             }
             if ($p->mes == 9) {
                 $mes = "Septiembre";
             }
             if ($p->mes == 10) {
                 $mes = "Octubre";
             }
             if ($p->mes == 11) {
                 $mes = "Noviembre";
             }
             if ($p->mes == 12) {
                 $mes = "Diciembre";
             }
             $result[] = array('usuario' => $p->id_usuario, 'actividad' => 'Deporte: ' . $deporte->deporte . ' ' . $horario, 'anio' => $p->anio, 'mes' => $mes, 'monto' => "\$" . $p->monto, 'id' => $p->id_actividad, 'm' => $p->mes);
         }
         echo CJSON::encode($result);
     }
 }
 public function actionConsultarActividadesInscripto()
 {
     $id_usuario = Yii::app()->user->id;
     $id_institucion = $_POST['idinstitucion'];
     $actividades = Actividad::model()->findAllByAttributes(array('id_usuario' => $id_usuario, 'id_institucion' => $id_institucion));
     if ($actividades != NULL) {
         echo "<table id='lisactividades' class='display' cellspacing='0' width='100%'>\n\t         <thead>\n                <th>Deporte</th><th>Días y Horarios</th><th>Alumnos Inscriptos</th>\n\t\t\t </thead>\n\t         <tbody>";
         foreach ($actividades as $act) {
             echo "<tr>";
             $deporte = Deporte::model()->findByAttributes(array('id_deporte' => $act->id_deporte));
             echo "<td id='deporte'>" . $deporte->deporte . "</td>";
             $diashorarios = ActividadHorario::model()->findAllByAttributes(array('id_actividad' => $act->id_actividad));
             echo "<td id='diahor'>";
             foreach ($diashorarios as $diashor) {
                 $dias = array('Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo');
                 $id_dia = $diashor->id_dia - 1;
                 echo $dias[$id_dia] . "&nbsp;" . $diashor->hora . ':' . ($diashor->minutos == '0' ? '0' . $diashor->minutos : $diashor->minutos) . "&nbsp&nbsp";
             }
             echo "</td>";
             echo "<td><input type='button' class='btn btn-primary' value='Ver alumnos Inscriptos' onclick='javascript:AlumnosInscriptos({$act->id_actividad})'></input></td>";
             echo "</tr>";
         }
         echo "</tbody>";
         echo "</table>";
         echo "<script type='text/javascript'>\n                \$('#lisactividades').DataTable( {\n\t\t            'language' : {\n\t\t\t            'sProcessing':     'Procesando...',\n\t\t\t            'sLengthMenu':     'Mostrar _MENU_ registros',\n\t\t\t            'sZeroRecords':    'No se encontraron resultados',\n\t\t\t            'sEmptyTable':     'Ningún dato disponible en esta tabla',\n\t\t\t            'sInfo':           'Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros',\n\t\t\t            'sInfoEmpty':      'Mostrando registros del 0 al 0 de un total de 0 registros',\n\t\t\t            'sInfoFiltered':   '(filtrado de un total de _MAX_ registros)',\n\t\t\t            'sInfoPostFix':    '',\n\t\t\t            'sSearch':         'Buscar:',\n\t\t\t            'sUrl':            '',\n\t\t\t            'sInfoThousands':  ',',\n\t\t\t            'sLoadingRecords': 'Cargando...',\n\n\t\t\t            'oPaginate': {\n\t\t\t\t            'sFirst':    'Primero',\n\t\t\t\t            'sLast':     'Ultimo',\n\t\t\t\t            'sNext':     'Siguiente',\n\t\t\t\t            'sPrevious': 'Anterior'\n\t\t\t            },\n\t\t\t                \n\t\t\t            'oAria': {\n\t\t\t\t            'sSortAscending':  ': Activar para ordenar la columna de manera ascendente',\n\t\t\t\t            'sSortDescending': ': Activar para ordenar la columna de manera descendente'\n\t\t\t            }\n\t\t            }\n\t            } );\n            </script>";
     } else {
         echo "error";
     }
 }
예제 #9
0
                <?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'Profesor', 'enableAjaxValidation' => true, 'enableClientValidation' => false, 'clientOptions' => array('validateOnSubmit' => true)));
?>
                <div class="col-md-8">
                    <?php 
echo CHtml::beginForm('EditarProfesor', 'post');
?>
                    <div class="form-group">
                        <div><h4> Actividades que dicta</h4></div>
                        <?php 
if ($actividad == NULL) {
    echo "<br/>";
    echo "No dicta ninguna actividad";
} else {
    foreach ($actividad as $act) {
        echo $form->dropDownList($act, 'id_deporte', CHtml::listData(Deporte::model()->findAll(), 'id_deporte', 'deporte'), array('class' => "form-control", 'name' => 'deporte[]'));
        echo "<br/>";
    }
}
?>
                    </div>
                    <div class="form-group">
                        <?php 
echo CHtml::submitButton('Modificar actividades', array('class' => 'btn btn-primary'));
?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php 
예제 #10
0
    echo "</table>";
} else {
    echo "<div class='row'>\n                        <div class='.col-md-6 .col-md-offset-3'>\n                            <h5 class='text-center'>No hay solicitud de profesores</h5>\n                        </div>\n                    </div>";
}
?>
<br>
<br>
<br>
<?php 
echo "<div><h2>Alumnos que se anotaron en actividades</h2></div>";
if ($actividades_pen != null) {
    echo "<table class='table table-hover'>\n                        <thead>\n                            <tr>\n                                <th>Nombre</th>\n                                <th>Apellido</th>\n                                <th>Actividad</th>\n                            </tr>\n                        </thead>";
    foreach ($actividades_pen as $a) {
        $fua = FichaUsuario::model()->findAll('id_usuario=:id_usuario', array(':id_usuario' => $a->id_usuario));
        $actividad = Actividad::model()->findByPk($a->id_actividad);
        $deporte = Deporte::model()->findByPk($actividad->id_deporte);
        $actividad_horario = ActividadHorario::model()->findAll('id_actividad = :id', array(':id' => $a->id_actividad));
        $var = $deporte->deporte . ' - ';
        foreach ($actividad_horario as $ah) {
            if ($ah->id_dia == 1) {
                $dia = "Lunes";
            }
            if ($ah->id_dia == 2) {
                $dia = "Martes";
            }
            if ($ah->id_dia == 3) {
                $dia = "Miercoles";
            }
            if ($ah->id_dia == 4) {
                $dia = "Jueves";
            }