public function editpartido_post($codcampeonato, $codtorneo, $codfixture)
 {
     $codEscenario = Input::get('escenario');
     $fixture = Fixture::find($codfixture);
     $equipo1 = $fixture->codEquipo1;
     $nombre1 = Equipo::find($equipo1)->nombre;
     $nombre1 = substr($nombre1, 0, 3);
     $equipo2 = $fixture->codEquipo2;
     $nombre2 = Equipo::find($equipo2)->nombre;
     $nombre2 = substr($nombre2, 0, 3);
     $nrofecha = $fixture->nroFecha;
     $horaincio = $fixture->hora;
     $hora = substr($horaincio, 0, 2);
     $min = substr($horaincio, 3, 2);
     $horaI = (int) $hora;
     $minI = (int) $min;
     $horaI = $horaI + 1;
     $siguiente = $horaI . ":" . $minI;
     $fecha = DB::table('tfecha')->where('nroFecha', '=', $nrofecha)->where('codRueda', '=', $codtorneo)->first();
     $nro = DB::table('tprogramacion')->count();
     $idfecha = $fecha->idFecha;
     $cop = "PRO" . $idfecha . ($nro + 1);
     $programacion = new Programacion();
     $programacion->codProgramacion = $cop;
     $programacion->idFecha = $idfecha;
     $programacion->diaPartido = $fecha->diaFecha;
     $programacion->nroPartido = $fixture->nroPartido;
     $programacion->codEscenario = $codEscenario;
     $programacion->save();
     $partido = new Partido();
     $cP = "PA" . $nombre1 . $nombre2;
     $partido->codPartido = $cP;
     $partido->codProgramacion = $cop;
     $partido->horaInicio = $horaincio;
     $partido->horaFin = $siguiente;
     $partido->tipoPartido = "normal";
     $partido->save();
     return Redirect::to('/fecha/edit/' . $codcampeonato . '/' . $codtorneo . '/' . $fecha->nroFecha);
 }
Exemple #2
0
                        <th>partido</th>
                        <th>hora</th>
                        <th class="text-center">{{$fecha->diaFecha}}</th>
                        <th>Accion</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($fixture as $val)
                        <tr>
                            <td>{{$val->nroPartido}}</td>
                            <td>{{$val->hora}}</td>
                            <td class="text-center">{{Equipo::find($val->codEquipo1)->nombre.' <----> '.Equipo::find($val->codEquipo2)->nombre}}</td>
                            <td>
                                <!--- encontrar cod de partido   -->
                                <?php 
$programacion = Programacion::where('idFecha', '=', $fecha->idFecha)->where('nroPartido', '=', $val->nroPartido)->first();
$partido = Partido::where('codProgramacion', '=', $programacion->codProgramacion)->first();
$fixture = Fixture::where('codRueda', '=', $torneo->codRueda)->where('nroFecha', '=', $fecha->nroFecha)->where('nroPartido', '=', $val->nroPartido)->first();
?>

                                <br>
                                <a class="label label-primary" href="{{$partido->codPartido}}/partido.html" >
                                    <span class="glyphicon glyphicon-list"></span> &nbsp;Partido
                                </a><br>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
            <div class="panel-footer">
Exemple #3
0
 public function getProgramas()
 {
     $c = Programacion::model()->getCurrent();
     $n = Programacion::model()->getNext();
     return array('actual' => $c, 'siguiente' => $n);
 }
    }
    //fin esp
    ?>
 
			<tr>
				<td align="left" ><?php 
    echo $r[codigo_objetivo_estrategico] . "." . $obj_esp . "." . $row_t[nro_asignacion] . ".";
    ?>
</td>
				<td align="left" ><?php 
    echo $row_t[nombre_tarea];
    ?>
</td>
				<td align="right">
					<?php 
    $programado = Programacion::ProgramacionProgramado('', $row_t[id_asignacion_anp_objetivos], '');
    echo num_format($programado, '.0');
    ?>
</td>
			</tr>
		<?php 
}
?>
	
  </table></td>
</tr>
<tr>
  <td><strong>Localizacion</strong></td>
  <td><?php 
echo $row_anp[nombre_departamento];
?>
 /**
  * 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 Url the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Programacion::model()->with('micrositio')->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #6
0
 public function partido($codcampeonato, $codrueda, $idfecha, $codpartido)
 {
     //$todoConclusion = Cambio::all();
     //elementos
     $fecha = Fechas::find($idfecha);
     $partido = Partido::find($codpartido);
     $programacion = Programacion::find($partido->codProgramacion);
     $torneo = Torneo::where('codRueda', '=', $codrueda)->first();
     $arbitros = Arbitro::all();
     $arbixPart = ArbitroPorPartido::where('codPartido', '=', $codpartido)->count();
     $todosArbitros = ArbitroPorPartido::where('codPartido', '=', $codpartido)->get();
     //end elementos
     $nroPartido = $programacion->nroPartido;
     $fixture = Fixture::where('codRueda', '=', $torneo->codRueda)->where('nroFecha', '=', $fecha->nroFecha)->where('nroPartido', '=', $nroPartido)->first();
     //elementos
     $equipo1 = Equipo::find($fixture->codEquipo1);
     $equipo2 = Equipo::find($fixture->codEquipo2);
     $activarPlanilla = Planilla::where('codPartido', '=', $codpartido)->first();
     $fechaactual = DB::select("select curdate() as fecha");
     $fechasiguiente = DB::select("select  adddate(curdate(),1) as fecha");
     $fechaAnterior = DB::select("select  subdate(curdate(),1) as fecha");
     $hora = DB::select("select  curtime() as hora");
     $horaAsistencia = DB::select("select  subtime(?,3000) as fecha", array($partido->horaInicio));
     foreach ($fechaactual as $value) {
         $Factual = $value->fecha;
     }
     foreach ($fechasiguiente as $value) {
         $Fsiguiente = $value->fecha;
     }
     foreach ($hora as $value) {
         $horaA = $value->hora;
     }
     foreach ($fechaAnterior as $value) {
         $Fantes = $value->fecha;
     }
     foreach ($horaAsistencia as $value) {
         $HrAistencia = $value->fecha;
     }
     ///===== es la dia de programacion
     $HH = DB::select("select  if(?=?,1,0) as fecha", array($fecha->diaFecha, $Factual));
     foreach ($HH as $value) {
         $esdiaProgramacion = $value->fecha;
     }
     //end fechaf
     // mañena es dia de programacion
     $HH = DB::select("select  if(?<?,1,0) as fecha", array($fecha->diaFecha, $Fsiguiente));
     foreach ($HH as $value) {
         $manenaProgramacion = $value->fecha;
     }
     // ayer fue dia de programacion
     $HH = DB::select("select  if(?=?,1,0) as fecha", array($fecha->diaFecha, $Fantes));
     foreach ($HH as $value) {
         $ayerFProgramacion = $value->fecha;
     }
     // si la  hora es mayor 23:50
     $HH = DB::select("select  if(?=?,1,0) as fecha", array(substr($horaA, 0, 5), "23:50"));
     foreach ($HH as $value) {
         $esHora = $value->fecha;
     }
     // es hora de inicio
     $HH = DB::select("select  if(curtime()>=? and curtime()<?,1,0) as fecha", array($partido->horaInicio, "23:50:00"));
     foreach ($HH as $value) {
         $HoraI = $value->fecha;
     }
     //hora de tomo asistencia 30 min
     $HH = DB::select("select  if(curtime()>=? and curtime()<=?,1,0) as fecha", array($HrAistencia, $partido->horaInicio));
     foreach ($HH as $value) {
         $AH = $value->fecha;
     }
     $jugadoresequipo1 = "";
     $jugadoresequipo2 = "";
     $activarPlanilla = Planilla::where('codPartido', '=', $codpartido)->first();
     if ($activarPlanilla != "") {
         $Planilla1 = Planilla::where('codPartido', '=', $codpartido)->where('nroPlantilla', '=', 1)->first();
         $Planilla2 = Planilla::where('codPartido', '=', $codpartido)->where('nroPlantilla', '=', 2)->first();
         //$fixture->codEquipo1
         //$Jequipo1 = Jugador::where('codequipo', '=', $fixture->equipo1)->get();
         //$Jequipo2 = Jugador::where('codequipo', '=', $fixture->equipo2)->get();
         //$arbitros = Arbitro::all();
         //todos los jugadores de este partido  $torneo $idtorneo,$idfecha,$idfixture)
     }
     /*
          $Delanteros1 = '';
          $Mediocampistas1 = '';
          $Defensas1 = '';
          $Guardameta1 = '';
          $suplentes1 = '';
          $jugadoresdeunpartido2 = '';
          //recuperamos los arbitros del partido
          $arbitrosdelpartido = '';
          //verificamos si el partido ya se jugó
              //recuperar los datos del partido jugado
              $arbitrosdelpartido = ArbitroPorPartido::where('codPartido','=',$partido->codPartido)->first();
     
              //resuperamos todos los jugadores de este partido  ... un rato
     /*
              $Delanteros1 = DB::table('tjugadorenjuego')
                  ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
                  ->join('tdocente','tdocente.coddocente','=','tjugador.coddocente')
                  ->join('tequipo','tequipo.codequipo','=','tjugador.codequipo')
                  ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
                  ->where('tjugador.codequipo','=',$fixture->equipo1)
                  ->where('tjugadorenjuego.condicionenpartido','=','delantero')
                  ->get();
              $Mediocampistas1 = DB::table('tjugadorenjuego')
                  ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
                  ->join('tdocente','tdocente.coddocente','=','tjugador.coddocente')
                  ->join('tequipo','tequipo.codequipo','=','tjugador.codequipo')
                  ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
                  ->where('tjugador.codequipo','=',$fixture->equipo1)
                  ->where('tjugadorenjuego.condicionenpartido','=','mediocampista')
                  ->get();
              $Defensas1 = DB::table('tjugadorenjuego')
                  ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
                  ->join('tdocente','tdocente.coddocente','=','tjugador.coddocente')
                  ->join('tequipo','tequipo.codequipo','=','tjugador.codequipo')
                  ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
                  ->where('tjugador.codequipo','=',$fixture->equipo1)
                  ->where('tjugadorenjuego.condicionenpartido','=','defensa')
                  ->get();
              $Guardameta1 = DB::table('tjugadorenjuego')
              ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
              ->join('tdocente','tdocente.coddocente','=','tjugador.coddocente')
              ->join('tequipo','tequipo.codequipo','=','tjugador.codequipo')
              ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
              ->where('tjugador.codequipo','=',$fixture->equipo1)
              ->where('tjugadorenjuego.condicionenpartido','=','guardameta')
              ->get();
              $suplentes1 = DB::table('tjugadorenjuego')
                  ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
                  ->join('tdocente','tdocente.coddocente','=','tjugador.coddocente')
                  ->join('tequipo','tequipo.codequipo','=','tjugador.codequipo')
                  ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
                  ->where('tjugador.codequipo','=',$fixture->equipo1)
                  ->where('tjugadorenjuego.condicionenpartido','=','suplente')
                  ->get();
              $jugadoresdeunpartido2 = DB::table('tjugadorenjuego')
                  ->join('tjugador','tjugadorenjuego.idjugador','=','tjugador.idjugador')
                  ->where('tjugadorenjuego.codpartido','=',$partido->codpartido)
                  ->where('tjugador.codequipo','=',$fixture->equipo2)
                  ->get();
     */
     $activarPlanilla = Planilla::where('codPartido', '=', $codpartido)->first();
     return View::make('user_com_organizing.fecha.partido.index', compact('fixture'))->with('idfecha', $idfecha)->with('torneo', $torneo)->with('programacion', $programacion)->with('codcampeonato', $codcampeonato)->with('arbitros', $arbitros)->with('partido', $partido)->with('arbixPart', $arbixPart)->with('todosArbitros', $todosArbitros)->with('equipo1', $equipo1)->with('equipo2', $equipo2)->with('activarPlanilla', $activarPlanilla)->with('esdiaProgramacion', $esdiaProgramacion)->with('manenaProgramacion', $manenaProgramacion)->with('ayerFProgramacion', $ayerFProgramacion)->with('esHora', $esHora)->with('HoraI', $HoraI)->with('AH', $AH);
     //->with('todoConclusion', $todoConclusion);
 }
Exemple #7
0
                    <?php 
    $fecha = $i + 1;
    ?>

                    <div class="panel-info">
                        <div class="panel-heading">
                            FECHA {{$fecha}}
                            <div class="pull-right">

                                <?php 
    $fechaexiste = Fechas::where('nroFecha', '=', $fecha)->where('codRueda', '=', $torneo->codRueda)->first();
    ?>
                                @if($fechaexiste != '')
                                        <?php 
    $programacionexiste = Programacion::where('idFecha', '=', $fechaexiste->idFecha)->first();
    $programacionro = Programacion::where('idFecha', '=', $fechaexiste->idFecha)->count();
    ?>
                                    @if($programacionexiste != '' && $programacionro==$nroPartido)


                                                <a class="btn btn-success" href="{{URL::to( 'fechas/'.$codcampeonato.'/'.$torneo->codRueda.'/'.$fechaexiste->idFecha.'/detail.html');}}">detalle</a>

                                            @else
                                                <a class="btn btn-warning" href="{{ URL::to('fecha/edit/'.$codcampeonato.'/'.$torneo->codRueda.'/'.$fecha);}}">programacion</a>
                                            @endif
                                @else

                                    <a class="btn btn-success" href="{{ URL::to('fecha/edit/'.$codcampeonato.'/'.$torneo->codRueda.'/'.$fecha);}}">Programar dia y hora de la Fecha</a>
                                @endif

Exemple #8
0
        foreach ($partidoActual as $value) {
            $codEquipo1 = $value->id_equipo1;
            $codEquipo2 = $value->id_equipo2;
            $idfixture = $value->id_fixture;
        }
        $nroPlantilla = 0;
        $nro1 = strcmp($codEquipo1, $equipo->codEquipo);
        $nro2 = strcmp($codEquipo2, $equipo->codEquipo);
        if ($nro1 == 0) {
            $nroPlantilla = 1;
        }
        if ($nro2 == 0) {
            $nroPlantilla = 2;
        }
        $nroPartido = Fixture::find($idfixture)->nroPartido;
        $programacion = Programacion::where('idFecha', '=', $idfecha)->where('nroPartido', '=', $nroPartido)->first();
        $partidoA = Partido::where('codProgramacion', '=', $programacion->codProgramacion)->first();
        $Plantilla = Planilla::where('codPartido', '=', $partidoA->codPartido)->where('nroPlantilla', '=', $nroPlantilla)->first();
        $codPla = $Plantilla->codPantilla;
        echo "<br>" . $partidoA->codPartido . "<br>" . $nroPlantilla . " " . $codPla;
    } else {
        $descansa = 1;
    }
}
?>
    <!-- BEGIN PAR MANEJO DE ERRORES -->
    @include('alerts.allsuccess')
    @include('alerts.success')
    <!-- END PARA MANEJO DE ERRORES -->
    <div class="container">
        <div class="row-margin-top ">
 /**
  * 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.
  */
 public function loadModel()
 {
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = Programacion::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }
 public function run($args)
 {
     $horarios = Horario::model()->with('pgPrograma')->findAll(array('order' => 'dia_semana ASC, hora_inicio ASC', 'condition' => 'pgPrograma.estado = 2'));
     foreach ($horarios as $horario) {
         $pagina = Pagina::model()->findByPk($horario->pgPrograma->pagina_id);
         $micrositio_id = $pagina->micrositio_id;
         $tipo_emision_id = $horario->tipo_emision_id;
         $dia_semana = $horario->dia_semana;
         $hora_inicio = $horario->hora_inicio;
         $hora_fin = $horario->hora_fin;
         $estado = 1;
         date_default_timezone_set('America/Bogota');
         setlocale(LC_ALL, 'es_ES.UTF-8');
         $sts = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         // set current date
         // parse about any English textual datetime description into a Unix timestamp
         $ts = $sts;
         // calculate the number of days since Monday
         $dow = date('w', $ts);
         $offset = $dow - 1;
         if ($offset < 0) {
             $offset = 6;
         }
         // calculate timestamp for the Monday
         $ts = $ts - $offset * 86400;
         $semana = array();
         // loop from Monday till Sunday
         for ($i = 0; $i < 7; $i++, $ts += 86400) {
             $semana[] = $ts;
         }
         $hora_inicio = $semana[$dia_semana - 1] + Horarios::hora_a_timestamp($hora_inicio);
         $hora_fin = $semana[$dia_semana - 1] + Horarios::hora_a_timestamp($hora_fin);
         /* PILAS AQUÍ, FESTIVO /**/
         $tts = mktime(0, 0, 0, date('m', $hora_inicio), date('d', $hora_inicio), date('Y', $hora_inicio));
         if ($tts == mktime(0, 0, 0, 3, 23, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 4, 2, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 4, 3, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 5, 1, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 5, 18, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 8, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 15, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 29, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 7, 20, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 8, 7, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 8, 17, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 10, 12, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 11, 2, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 11, 16, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 12, 8, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 12, 25, date('Y'))) {
             continue;
         }
         $p = new Programacion();
         if (!$p->exists(array('condition' => 'hora_inicio=' . $hora_inicio . ' AND hora_fin=' . $hora_fin . ' AND estado=1'))) {
             $p->micrositio_id = $micrositio_id;
             $p->hora_inicio = $hora_inicio;
             $p->hora_fin = $hora_fin;
             $p->tipo_emision_id = $tipo_emision_id;
             $p->estado = $estado;
             $p->save();
             if ($p) {
                 echo '+ Guardado ' . $pagina->nombre . ' ' . $hora_inicio . '<br />' . "\r\n";
             }
         } else {
             echo '- Existía ' . $pagina->nombre . '<br />' . "\r\n";
         }
     }
     return 0;
 }
Exemple #11
0
 protected function beforeDelete()
 {
     $this->transaccion = $this->dbConnection->getCurrentTransaction();
     if ($this->transaccion === null) {
         $this->transaccion = $this->dbConnection->beginTransaction();
     }
     try {
         $this->pagina_id = NULL;
         $this->save(NULL);
         foreach ($this->paginas as $pagina) {
             $p = Pagina::model()->findByPk($pagina->id);
             $p->delete();
         }
         foreach ($this->albumFotos as $albumFoto) {
             $af = AlbumFoto::model()->findByPk($albumFoto->id);
             $af->delete();
         }
         foreach ($this->albumVideos as $albumVideo) {
             $av = AlbumVideo::model()->findByPk($albumVideo->id);
             $av->delete();
         }
         foreach ($this->programacions as $programacion) {
             $pr = Programacion::model()->findByPk($programacion->id);
             $pr->delete();
         }
         foreach ($this->redSocials as $redSocial) {
             $r = RedSocial::model()->findByPk($redSocial->id);
             $r->delete();
         }
         return parent::beforeDelete();
     } catch (Exception $e) {
         $this->transaccion->rollback();
         return false;
     }
 }