function reportes($header, $data) { $this->SetFillColor(100, 100, 100); $this->SetTextColor(255); $this->SetDrawColor(0, 0, 0); $this->SetLineWidth(0.3); $this->SetFont('', 'B'); $w = array(13, 40, 13, 13, 13, 13, 13, 13, 13, 28); for ($i = 0; $i < count($header); $i++) { $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true); } $this->Ln(); $this->SetFillColor(224, 235, 255); $this->SetTextColor(0); $this->SetFont(''); $fill = false; $gg = 1; foreach ($data as $row) { $this->Cell($w[0], 6, $gg++, 'LR', 0, 'L', $fill); $this->Cell($w[1], 6, Equipo::find($row->equipo)->nombre, 'LR', 0, 'L', $fill); $this->Cell($w[2], 6, $row->PJ, 'LR', 0, 'L', $fill); $this->Cell($w[3], 6, $row->PG, 'LR', 0, 'L', $fill); $this->Cell($w[4], 6, $row->PE, 'LR', 0, 'L', $fill); $this->Cell($w[5], 6, $row->PP, 'LR', 0, 'L', $fill); $this->Cell($w[5], 6, $row->GF, 'LR', 0, 'L', $fill); $this->Cell($w[6], 6, $row->GE, 'LR', 0, 'L', $fill); $this->Cell($w[7], 6, $row->DG, 'LR', 0, 'L', $fill); $this->Cell($w[8], 6, $row->puntaje, 'LR', 0, 'c', $fill); $this->Ln(); $fill = !$fill; } $this->Cell(array_sum($w), 0, '', 'T'); }
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); }
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); }
public function delete($id = 0) { $equipo = Equipo::find($id); $equipo->estado = 0; return $equipo->save(); }
<?php $price = DB::table('tcambio')->max('idcambio'); $cod = $partido->codpartido; //$cod=DB::select('SELECT max(`id`) FROM `treunion` WHERE 1').get(); $nuevo = (int) $price + 1; $conclusiones = DB::select('select * from tjugadorenjuego WHERE codpartido=?', array($cod)); $arr = array(); foreach ($conclusiones as $user) { $jugador = Jugador::find($user->idjugador); $equipo = Equipo::find($jugador->codequipo); $arr[$user->idjugadorenjuego] = $user->nrocamiseta . " " . $equipo->nombre; } /* $hora=localtime(); echo gettype($hora)."<br>"; echo $hora[0]."<br>"; echo $hora[1]."<br>"; echo $hora[2]."<br>"; echo $hora[3]."<br>"; */ $part = DB::select('select * from tpartido'); $cadena = ""; $arr2 = array(); foreach ($part as $user) { $idd = $user->codpartido; //echo $idd; $encuentros = DB::select('call encuentros(?)', array($idd)); foreach ($encuentros as $key) { $partido = $key->codpartido; $cadena = " vs " . $key->nombreEquipo . $cadena;