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); }
if ($exite != "") { 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">